@best-bundles/bundle-ui 0.0.21 → 0.0.23
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/components/BundleBuilderDrawer.d.ts.map +1 -1
- package/dist/context/BundleProvider.d.ts +6 -1
- package/dist/context/BundleProvider.d.ts.map +1 -1
- package/dist/index.js +749 -706
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.css +1 -1
- package/dist/liquid/bundle-ui.iife.js +17 -17
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.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_vl21a_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 9999);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_vl21a_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_vl21a_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:#0b1b44;background:linear-gradient(180deg,#fff,#bae6fd);border:2px solid 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_vl21a_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_vl21a_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_vl21a_74{opacity:1}._backdropClosed_vl21a_78{opacity:0}._panel_vl21a_82{width:440px;max-width:100%;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_vl21a_102{animation:_bbSlideInFromRight_vl21a_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_vl21a_106{animation:_bbSlideOutToRight_vl21a_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_vl21a_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_vl21a_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_vl21a_1{transition:none}._celebrationChip_vl21a_23,._panelOpen_vl21a_102,._panelClosed_vl21a_106{animation:none}}._header_vl21a_145{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_vl21a_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_vl21a_162{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_vl21a_171{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}._searchIconButton_vl21a_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_vl21a_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_vl21a_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_vl21a_197{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_vl21a_209 ._headerTitleWrap_vl21a_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_vl21a_209 ._headerSearchWrap_vl21a_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_vl21a_221{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_vl21a_233{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_vl21a_233::-webkit-search-cancel-button,._searchInput_vl21a_233::-webkit-search-decoration,._searchInput_vl21a_233::-webkit-search-results-button,._searchInput_vl21a_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_vl21a_254{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_vl21a_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_vl21a_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_vl21a_276{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}._closeButton_vl21a_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_vl21a_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_vl21a_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_vl21a_193,._headerSearchWrap_vl21a_197{transition:none}}._body_vl21a_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_vl21a_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_vl21a_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_vl21a_324{margin-top:4px}._variantList_vl21a_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_vl21a_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantLeft_vl21a_344{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_vl21a_351{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_vl21a_351:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_vl21a_351:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_vl21a_351:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._variantThumb_vl21a_379{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_vl21a_389{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_vl21a_396{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_vl21a_406{min-width:0}._variantName_vl21a_410{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_vl21a_419{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_vl21a_427{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_vl21a_434{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_vl21a_427{font-size:13px;font-weight:800}._qtyControls_vl21a_445{display:inline-flex;align-items:center;gap:6px}._qtyButton_vl21a_451{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_vl21a_451:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_vl21a_451:disabled{opacity:.6;cursor:not-allowed}._qtyButton_vl21a_451:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_vl21a_476{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_vl21a_483{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}._poweredBy_vl21a_490{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_vl21a_490 a{color:inherit;text-decoration:none}._boxSummaryWindow_vl21a_502{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_vl21a_502::-webkit-scrollbar{display:none}._boxSummaryRow_vl21a_519{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_vl21a_527{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_vl21a_535{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_vl21a_547{cursor:pointer}._boxItemClickable_vl21a_547:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_vl21a_556{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:nowrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_vl21a_567{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_vl21a_573{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_vl21a_579{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:linear-gradient(180deg,#2563eb1a,#2563eb08);color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemDiscountText_vl21a_587{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_vl21a_595{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_vl21a_602{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_vl21a_609{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_vl21a_620{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_vl21a_627{gap:0}._cta_vl21a_620{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_vl21a_643{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_vl21a_655{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_vl21a_673{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_vl21a_673>span{opacity:0}._ctaDualRight_vl21a_686{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_vl21a_702{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_vl21a_702>span{opacity:0}._ctaTotals_vl21a_713{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_vl21a_721{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:linear-gradient(180deg,#2563eb24,#2563eb0f);border:1px solid rgba(37,99,235,.3);color:#1d4ed8f2;white-space:nowrap}._ctaTotalsWrap_vl21a_735{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_vl21a_748{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_vl21a_755{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_vl21a_762{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_vl21a_735{transition:none}}._cta_vl21a_620:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_vl21a_620:disabled{opacity:.6;cursor:not-allowed}._cta_vl21a_620:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_vl21a_643:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_vl21a_643:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_vl21a_643:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_vl21a_655:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_vl21a_655:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_vl21a_655:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_vl21a_686:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_vl21a_686:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_vl21a_686:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_vl21a_831{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_vl21a_1{padding:0;justify-content:stretch}._panel_vl21a_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { jsx as h, jsxs as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.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_227w4_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 9999);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_227w4_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_227w4_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_227w4_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_227w4_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_227w4_74{opacity:1}._backdropClosed_227w4_78{opacity:0}._panel_227w4_82{width:440px;max-width:100%;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_227w4_102{animation:_bbSlideInFromRight_227w4_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_227w4_106{animation:_bbSlideOutToRight_227w4_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_227w4_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_227w4_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_227w4_1{transition:none}._celebrationChip_227w4_23,._panelOpen_227w4_102,._panelClosed_227w4_106{animation:none}}._header_227w4_145{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_227w4_154{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_227w4_162{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_227w4_171{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}._searchIconButton_227w4_171:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_227w4_171:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_227w4_193{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_227w4_197{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_227w4_209 ._headerTitleWrap_227w4_193{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_227w4_209 ._headerSearchWrap_227w4_197{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_227w4_221{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_227w4_233{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_227w4_233::-webkit-search-cancel-button,._searchInput_227w4_233::-webkit-search-decoration,._searchInput_227w4_233::-webkit-search-results-button,._searchInput_227w4_233::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_227w4_254{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_227w4_254:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_227w4_254:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_227w4_276{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}._closeButton_227w4_276:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_227w4_276:disabled{opacity:.6;cursor:not-allowed}._closeButton_227w4_276:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_227w4_193,._headerSearchWrap_227w4_197{transition:none}}._body_227w4_309{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_227w4_314{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_227w4_319{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_227w4_324{margin-top:4px}._variantList_227w4_328{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_227w4_336{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantLeft_227w4_344{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_227w4_351{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_227w4_351:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_227w4_351:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_227w4_351:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._variantThumb_227w4_379{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_227w4_389{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_227w4_396{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_227w4_406{min-width:0}._variantName_227w4_410{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_227w4_419{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_227w4_427{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_227w4_434{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_227w4_427{font-size:13px;font-weight:800}._qtyControls_227w4_445{display:inline-flex;align-items:center;gap:6px}._qtyButton_227w4_451{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_227w4_451:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_227w4_451:disabled{opacity:.6;cursor:not-allowed}._qtyButton_227w4_451:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_227w4_476{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_227w4_483{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}._poweredBy_227w4_490{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_227w4_490 a{color:inherit;text-decoration:none}._boxSummaryWindow_227w4_502{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_227w4_502::-webkit-scrollbar{display:none}._boxSummaryRow_227w4_519{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_227w4_527{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_227w4_535{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_227w4_547{cursor:pointer}._boxItemClickable_227w4_547:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_227w4_556{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:nowrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_227w4_567{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_227w4_573{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_227w4_579{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_227w4_587{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_227w4_595{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_227w4_602{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_227w4_609{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_227w4_620{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_227w4_627{gap:0}._cta_227w4_620{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_227w4_643{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_227w4_655{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_227w4_673{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_227w4_673>span{opacity:0}._ctaDualRight_227w4_686{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_227w4_702{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_227w4_702>span{opacity:0}._ctaTotals_227w4_713{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_227w4_721{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:linear-gradient(180deg,#2563eb24,#2563eb0f);border:1px solid rgba(37,99,235,.3);color:#1d4ed8f2;white-space:nowrap}._ctaTotalsWrap_227w4_735{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_227w4_748{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_227w4_755{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_227w4_762{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_227w4_735{transition:none}}._cta_227w4_620:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_227w4_620:disabled{opacity:.6;cursor:not-allowed}._cta_227w4_620:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_227w4_643:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_227w4_643:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_227w4_643:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_227w4_655:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_227w4_655:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_227w4_655:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_227w4_686:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_227w4_686:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_227w4_686:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_227w4_831{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_227w4_1{padding:0;justify-content:stretch}._panel_227w4_82{width:100%;height:100%;border-radius:0}}')),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { jsx as h, jsxs as M, Fragment as _e } from "react/jsx-runtime";
|
|
3
|
+
import Lt, { useState as N, useRef as z, useEffect as E, useCallback as ut, useMemo as B, createContext as ge, useContext as ve, forwardRef as fe, createElement as Qt } from "react";
|
|
4
|
+
const Rt = {
|
|
5
5
|
bundleId: "_bundle_id",
|
|
6
6
|
bundleConfig: "_bundle_config",
|
|
7
7
|
bundleSource: "_bundle_source",
|
|
8
8
|
bundleTitle: "_bundle_title"
|
|
9
9
|
};
|
|
10
|
-
async function
|
|
10
|
+
async function xe(i) {
|
|
11
11
|
const t = new URL("/api/public/bundle-config", i.apiBaseUrl);
|
|
12
12
|
t.searchParams.set("shop", i.shop);
|
|
13
|
-
const
|
|
13
|
+
const o = await (await fetch(t, {
|
|
14
14
|
method: "GET",
|
|
15
15
|
signal: i.signal,
|
|
16
16
|
headers: { "Content-Type": "application/json" }
|
|
17
17
|
})).json().catch(() => null);
|
|
18
|
-
return !
|
|
18
|
+
return !o || typeof o != "object" ? { ok: !1, error: "Invalid response." } : o;
|
|
19
19
|
}
|
|
20
20
|
const ae = "bb_anonymous_user_id";
|
|
21
21
|
function Ft() {
|
|
@@ -40,12 +40,12 @@ function Ft() {
|
|
|
40
40
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
async function
|
|
43
|
+
async function Dt(i, t, e) {
|
|
44
44
|
if (!(typeof window > "u"))
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const r = await fetch(
|
|
46
|
+
const o = new URL(i, window.location.origin);
|
|
47
|
+
o.searchParams.set("shop", t);
|
|
48
|
+
const r = await fetch(o, {
|
|
49
49
|
method: "POST",
|
|
50
50
|
headers: {
|
|
51
51
|
"Content-Type": "application/json"
|
|
@@ -58,12 +58,45 @@ async function Rt(i, t, e) {
|
|
|
58
58
|
`[Bundle Analytics] Event tracking failed with status ${r.status}:`,
|
|
59
59
|
await r.text().catch(() => "Unable to read response")
|
|
60
60
|
);
|
|
61
|
-
} catch (
|
|
62
|
-
console.warn("[Bundle Analytics] Failed to track event:",
|
|
61
|
+
} catch (o) {
|
|
62
|
+
console.warn("[Bundle Analytics] Failed to track event:", o);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const me = ge(null), Ce = {
|
|
66
|
+
primaryColor: "--bb-cta-bg",
|
|
67
|
+
primaryHoverColor: "--bb-cta-bg-hover",
|
|
68
|
+
primaryTextColor: "--bb-cta-text",
|
|
69
|
+
backgroundColor: "--bb-surface-bg",
|
|
70
|
+
backdropColor: "--bb-backdrop-bg",
|
|
71
|
+
textColor: "--bb-text-color",
|
|
72
|
+
titleColor: "--bb-title-color",
|
|
73
|
+
mutedTextColor: "--bb-muted-color",
|
|
74
|
+
borderRadius: "--bb-panel-radius",
|
|
75
|
+
borderColor: "--bb-border-color",
|
|
76
|
+
borderStrongColor: "--bb-border-strong-color",
|
|
77
|
+
focusRingColor: "--bb-focus-ring",
|
|
78
|
+
tierBorderColor: "--bb-tier-border",
|
|
79
|
+
tierTextColor: "--bb-tier-text",
|
|
80
|
+
tierBackgroundColor: "--bb-tier-bg",
|
|
81
|
+
celebrationTextColor: "--bb-celebration-text",
|
|
82
|
+
celebrationBgTop: "--bb-celebration-bg-top",
|
|
83
|
+
celebrationBgBottom: "--bb-celebration-bg-bottom",
|
|
84
|
+
celebrationBorderColor: "--bb-celebration-border"
|
|
85
|
+
};
|
|
86
|
+
function se(i) {
|
|
87
|
+
if (!i) return;
|
|
88
|
+
const t = document.documentElement;
|
|
89
|
+
Object.entries(Ce).forEach(([e, o]) => {
|
|
90
|
+
const r = i[e];
|
|
91
|
+
r && t.style.setProperty(o, r);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function ce(i) {
|
|
95
|
+
if (typeof window > "u") return i;
|
|
96
|
+
const t = window.__BUNDLE_PREVIEW_STYLES__;
|
|
97
|
+
return t && typeof t == "object" ? t : i;
|
|
98
|
+
}
|
|
99
|
+
function Ie() {
|
|
67
100
|
try {
|
|
68
101
|
const i = globalThis.crypto;
|
|
69
102
|
if (i != null && i.randomUUID) return i.randomUUID();
|
|
@@ -71,459 +104,469 @@ function _e() {
|
|
|
71
104
|
}
|
|
72
105
|
return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
73
106
|
}
|
|
74
|
-
function
|
|
107
|
+
function le(i) {
|
|
75
108
|
return Number.isFinite(i) ? Math.max(0, Math.floor(i)) : 0;
|
|
76
109
|
}
|
|
77
|
-
function
|
|
110
|
+
function lr(i) {
|
|
78
111
|
const {
|
|
79
112
|
apiBaseUrl: t,
|
|
80
113
|
shop: e,
|
|
81
|
-
cartAdapter:
|
|
114
|
+
cartAdapter: o,
|
|
82
115
|
configHandle: r = "default",
|
|
83
116
|
initialData: n,
|
|
84
117
|
configFetcher: l,
|
|
85
|
-
analyticsEndpoint:
|
|
86
|
-
children:
|
|
87
|
-
} = i,
|
|
118
|
+
analyticsEndpoint: s,
|
|
119
|
+
children: p
|
|
120
|
+
} = i, v = s ?? `${t}/api/public/bundle-analytics`, [O, P] = N(!1), [C, Z] = N(!n), [L, Y] = N(!1), [q, T] = N(null), [R, j] = N((n == null ? void 0 : n.currencyCode) ?? null), [y, ht] = N((n == null ? void 0 : n.config) ?? null), [it, _t] = N(
|
|
88
121
|
(n == null ? void 0 : n.eligibleVariants) ?? []
|
|
89
|
-
), [
|
|
122
|
+
), [ft, kt] = N(
|
|
90
123
|
() => ({ selections: {}, order: [] })
|
|
91
|
-
),
|
|
92
|
-
|
|
93
|
-
var
|
|
124
|
+
), Mt = z(null);
|
|
125
|
+
E(() => {
|
|
126
|
+
var $;
|
|
94
127
|
if (n) return;
|
|
95
|
-
(
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
return Z(!0),
|
|
128
|
+
($ = Mt.current) == null || $.abort();
|
|
129
|
+
const f = new AbortController();
|
|
130
|
+
Mt.current = f;
|
|
131
|
+
const x = l ?? xe;
|
|
132
|
+
return Z(!0), T(null), x({ apiBaseUrl: t, shop: e, signal: f.signal }).then((_) => {
|
|
100
133
|
if (!_.ok) {
|
|
101
|
-
|
|
134
|
+
T(_.error || "Failed to load bundle config."), ht(null), _t([]), j(null);
|
|
102
135
|
return;
|
|
103
136
|
}
|
|
104
|
-
j(_.currencyCode ?? null), ht(_.config),
|
|
137
|
+
j(_.currencyCode ?? null), ht(_.config), _t(_.eligibleVariants ?? []);
|
|
105
138
|
}).catch((_) => {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
}).finally(() => Z(!1)), () =>
|
|
109
|
-
}, [t, e, n, l])
|
|
110
|
-
|
|
111
|
-
|
|
139
|
+
const H = _ instanceof Error ? _.message : "Failed to load bundle config.";
|
|
140
|
+
T(H), ht(null), _t([]), j(null);
|
|
141
|
+
}).finally(() => Z(!1)), () => f.abort();
|
|
142
|
+
}, [t, e, n, l]), E(() => {
|
|
143
|
+
const f = ce(y == null ? void 0 : y.styleSettings);
|
|
144
|
+
f && se(f);
|
|
145
|
+
}, [y == null ? void 0 : y.styleSettings]), E(() => {
|
|
146
|
+
if (typeof window > "u") return;
|
|
147
|
+
const f = () => {
|
|
148
|
+
const x = ce(void 0);
|
|
149
|
+
x && se(x);
|
|
150
|
+
};
|
|
151
|
+
return window.addEventListener("bundle-preview-styles-updated", f), () => window.removeEventListener("bundle-preview-styles-updated", f);
|
|
152
|
+
}, []);
|
|
153
|
+
const Ot = ut(() => {
|
|
154
|
+
if (P(!0), v)
|
|
112
155
|
try {
|
|
113
|
-
const
|
|
114
|
-
|
|
156
|
+
const f = Ft();
|
|
157
|
+
Dt(v, e, {
|
|
115
158
|
eventType: "DRAWER_OPENED",
|
|
116
159
|
shop: e,
|
|
117
|
-
anonymousUserId:
|
|
160
|
+
anonymousUserId: f,
|
|
118
161
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
119
|
-
}).catch((
|
|
120
|
-
console.warn("[Bundle Analytics] Failed to track drawer opened:",
|
|
162
|
+
}).catch((x) => {
|
|
163
|
+
console.warn("[Bundle Analytics] Failed to track drawer opened:", x);
|
|
121
164
|
});
|
|
122
|
-
} catch (
|
|
123
|
-
console.warn("[Bundle Analytics] Error in open() callback:",
|
|
165
|
+
} catch (f) {
|
|
166
|
+
console.warn("[Bundle Analytics] Error in open() callback:", f);
|
|
124
167
|
}
|
|
125
|
-
}, [
|
|
126
|
-
|
|
127
|
-
if (!
|
|
168
|
+
}, [v, e]), mt = ut(() => P(!1), []), Pt = ut(() => {
|
|
169
|
+
P((f) => {
|
|
170
|
+
if (!f && v)
|
|
128
171
|
try {
|
|
129
|
-
const
|
|
130
|
-
|
|
172
|
+
const x = Ft();
|
|
173
|
+
Dt(v, e, {
|
|
131
174
|
eventType: "DRAWER_OPENED",
|
|
132
175
|
shop: e,
|
|
133
|
-
anonymousUserId:
|
|
176
|
+
anonymousUserId: x,
|
|
134
177
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
135
|
-
}).catch((
|
|
136
|
-
console.warn("[Bundle Analytics] Failed to track drawer opened:",
|
|
178
|
+
}).catch(($) => {
|
|
179
|
+
console.warn("[Bundle Analytics] Failed to track drawer opened:", $);
|
|
137
180
|
});
|
|
138
|
-
} catch (
|
|
139
|
-
console.warn("[Bundle Analytics] Error in toggle() callback:",
|
|
181
|
+
} catch (x) {
|
|
182
|
+
console.warn("[Bundle Analytics] Error in toggle() callback:", x);
|
|
140
183
|
}
|
|
141
|
-
return !
|
|
184
|
+
return !f;
|
|
142
185
|
});
|
|
143
|
-
}, [
|
|
144
|
-
const
|
|
145
|
-
return Math.max(2, Math.min(100,
|
|
146
|
-
}, [
|
|
147
|
-
if (!pt.has(
|
|
186
|
+
}, [v, e]), At = B(() => {
|
|
187
|
+
const f = Number((y == null ? void 0 : y.maxBundleSize) ?? NaN), x = Number.isFinite(f) ? Math.floor(f) : 100;
|
|
188
|
+
return Math.max(2, Math.min(100, x));
|
|
189
|
+
}, [y == null ? void 0 : y.maxBundleSize]), pt = B(() => new Set(it.map((f) => f.id)), [it]), J = ut((f, x) => {
|
|
190
|
+
if (!pt.has(f))
|
|
148
191
|
return;
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
154
|
-
const { [
|
|
155
|
-
|
|
156
|
-
} else
|
|
157
|
-
let
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
else if (
|
|
161
|
-
let
|
|
162
|
-
const
|
|
163
|
-
for (let
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
|
|
192
|
+
const $ = le(x);
|
|
193
|
+
kt((_) => {
|
|
194
|
+
const H = _.selections[f] ?? 0, U = $ - H, It = Object.values(_.selections).reduce((Q, V) => Q + (V || 0), 0), k = U > 0 ? Math.min(U, Math.max(0, At - It)) : U, F = H + k;
|
|
195
|
+
let D;
|
|
196
|
+
if (F <= 0) {
|
|
197
|
+
const { [f]: Q, ...V } = _.selections;
|
|
198
|
+
D = V;
|
|
199
|
+
} else H === F ? D = _.selections : D = { ..._.selections, [f]: F };
|
|
200
|
+
let ct = _.order;
|
|
201
|
+
if (k > 0)
|
|
202
|
+
ct = [..._.order, ...Array.from({ length: k }, () => f)];
|
|
203
|
+
else if (k < 0) {
|
|
204
|
+
let Q = -k;
|
|
205
|
+
const V = [];
|
|
206
|
+
for (let nt = _.order.length - 1; nt >= 0; nt--) {
|
|
207
|
+
const wt = _.order[nt];
|
|
208
|
+
if (wt === f && Q > 0) {
|
|
209
|
+
Q--;
|
|
167
210
|
continue;
|
|
168
211
|
}
|
|
169
|
-
|
|
212
|
+
V.push(wt);
|
|
170
213
|
}
|
|
171
|
-
|
|
214
|
+
V.reverse(), ct = V;
|
|
172
215
|
}
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
216
|
+
if (D === _.selections && ct === _.order) return _;
|
|
217
|
+
if (v)
|
|
175
218
|
try {
|
|
176
|
-
const
|
|
177
|
-
|
|
219
|
+
const Q = Ft();
|
|
220
|
+
Dt(v, e, {
|
|
178
221
|
eventType: "VARIANT_SELECTION_CHANGED",
|
|
179
222
|
shop: e,
|
|
180
|
-
anonymousUserId:
|
|
223
|
+
anonymousUserId: Q,
|
|
181
224
|
before: { ..._.selections },
|
|
182
|
-
after: { ...
|
|
225
|
+
after: { ...D },
|
|
183
226
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
184
227
|
});
|
|
185
228
|
} catch {
|
|
186
229
|
}
|
|
187
|
-
return { selections:
|
|
230
|
+
return { selections: D, order: ct };
|
|
188
231
|
});
|
|
189
|
-
}, [
|
|
190
|
-
const
|
|
191
|
-
return Number.isFinite(
|
|
192
|
-
}, [
|
|
193
|
-
var
|
|
194
|
-
if (!
|
|
195
|
-
const
|
|
196
|
-
merchandiseId:
|
|
197
|
-
quantity:
|
|
232
|
+
}, [At, pt, v, e]), bt = ut(() => kt({ selections: {}, order: [] }), []), K = ft.selections, xt = ft.order, at = B(() => Object.values(K).reduce((f, x) => f + (x || 0), 0), [K]), tt = B(() => {
|
|
233
|
+
const f = (y == null ? void 0 : y.rules) ?? [], x = f.length ? Math.min(...f.map(($) => $.minBundleSize)) : 2;
|
|
234
|
+
return Number.isFinite(x) && x > 0 ? x : 2;
|
|
235
|
+
}, [y]), gt = B(() => !(C || L || q || !(y != null && y.isActive) || at < tt), [at, y == null ? void 0 : y.isActive, q, C, tt, L]), st = ut(async (f) => {
|
|
236
|
+
var wt, A;
|
|
237
|
+
if (!gt || !y) return;
|
|
238
|
+
const x = Ie(), $ = (y.title ?? "").trim().slice(0, 255), _ = Object.entries(K).map(([m, rt]) => ({ merchandiseId: m, quantity: le(rt) })).filter((m) => m.quantity > 0).filter((m) => pt.has(m.merchandiseId)).map((m) => ({
|
|
239
|
+
merchandiseId: m.merchandiseId,
|
|
240
|
+
quantity: m.quantity,
|
|
198
241
|
attributes: [
|
|
199
|
-
{ key:
|
|
200
|
-
{ key:
|
|
201
|
-
{ key:
|
|
202
|
-
|
|
242
|
+
{ key: Rt.bundleId, value: x },
|
|
243
|
+
{ key: Rt.bundleConfig, value: r },
|
|
244
|
+
{ key: Rt.bundleSource, value: "bundle_builder" },
|
|
245
|
+
...$ ? [{ key: Rt.bundleTitle, value: $ }] : []
|
|
203
246
|
]
|
|
204
247
|
}));
|
|
205
248
|
if (!_.length) return;
|
|
206
|
-
const
|
|
207
|
-
let
|
|
208
|
-
for (const [
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
Number.isFinite(
|
|
249
|
+
const H = new Map(it.map((m) => [m.id, m]));
|
|
250
|
+
let U = 0;
|
|
251
|
+
for (const [m, rt] of Object.entries(K)) {
|
|
252
|
+
const lt = rt ?? 0;
|
|
253
|
+
if (lt <= 0) continue;
|
|
254
|
+
const St = H.get(m), vt = Number(St == null ? void 0 : St.price);
|
|
255
|
+
Number.isFinite(vt) && (U += vt * lt);
|
|
213
256
|
}
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
let
|
|
217
|
-
for (const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
return Number.isFinite(
|
|
222
|
-
})() : null,
|
|
223
|
-
|
|
257
|
+
U = Math.round(U * 100) / 100;
|
|
258
|
+
const It = [...y.rules ?? []].sort((m, rt) => m.minBundleSize - rt.minBundleSize);
|
|
259
|
+
let k = null;
|
|
260
|
+
for (const m of It)
|
|
261
|
+
at >= m.minBundleSize && (k = m);
|
|
262
|
+
const F = k ? (() => {
|
|
263
|
+
const m = Number.parseFloat(k.discountPercent);
|
|
264
|
+
return Number.isFinite(m) && m > 0 ? m : null;
|
|
265
|
+
})() : null, D = F ? Math.round(U * (1 - F / 100) * 100) / 100 : U, ct = U - D, Q = _.map((m) => m.merchandiseId), V = (k == null ? void 0 : k.handle) ?? "", nt = ((wt = k == null ? void 0 : k.label) == null ? void 0 : wt.trim()) || "";
|
|
266
|
+
Y(!0);
|
|
224
267
|
try {
|
|
225
|
-
if (
|
|
268
|
+
if (f != null && f.checkout ? await o.linesAddForCheckout(_) : await o.linesAdd(_), v)
|
|
226
269
|
try {
|
|
227
|
-
const
|
|
228
|
-
|
|
270
|
+
const m = Ft();
|
|
271
|
+
Dt(v, e, {
|
|
229
272
|
eventType: "BUNDLE_ADDED_TO_BASKET",
|
|
230
273
|
shop: e,
|
|
231
|
-
anonymousUserId:
|
|
232
|
-
bundleId:
|
|
233
|
-
productVariantIds:
|
|
234
|
-
grossPrice:
|
|
235
|
-
discountedPrice:
|
|
274
|
+
anonymousUserId: m,
|
|
275
|
+
bundleId: x,
|
|
276
|
+
productVariantIds: Q,
|
|
277
|
+
grossPrice: U,
|
|
278
|
+
discountedPrice: D,
|
|
236
279
|
currency: R ?? void 0,
|
|
237
|
-
discountThresholdIdentifier:
|
|
238
|
-
discountLabel:
|
|
239
|
-
discountPercentage:
|
|
240
|
-
discountedAmount:
|
|
280
|
+
discountThresholdIdentifier: V,
|
|
281
|
+
discountLabel: nt,
|
|
282
|
+
discountPercentage: F,
|
|
283
|
+
discountedAmount: ct,
|
|
241
284
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
242
285
|
});
|
|
243
286
|
} catch {
|
|
244
287
|
}
|
|
245
|
-
bt(),
|
|
288
|
+
bt(), mt(), (A = f == null ? void 0 : f.onComplete) == null || A.call(f);
|
|
246
289
|
} finally {
|
|
247
|
-
|
|
290
|
+
Y(!1);
|
|
248
291
|
}
|
|
249
292
|
}, [
|
|
250
|
-
|
|
251
|
-
|
|
293
|
+
gt,
|
|
294
|
+
o,
|
|
252
295
|
bt,
|
|
253
|
-
|
|
254
|
-
|
|
296
|
+
mt,
|
|
297
|
+
y,
|
|
255
298
|
r,
|
|
256
299
|
R,
|
|
257
|
-
|
|
300
|
+
K,
|
|
258
301
|
pt,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
302
|
+
it,
|
|
303
|
+
at,
|
|
304
|
+
v,
|
|
262
305
|
e
|
|
263
|
-
]),
|
|
264
|
-
await
|
|
306
|
+
]), Ct = ut(async () => {
|
|
307
|
+
await st(
|
|
265
308
|
{
|
|
266
309
|
onComplete: () => {
|
|
267
|
-
var
|
|
268
|
-
(
|
|
310
|
+
var f;
|
|
311
|
+
(f = o.openCartUI) == null || f.call(o);
|
|
269
312
|
}
|
|
270
313
|
}
|
|
271
314
|
);
|
|
272
|
-
}, [
|
|
273
|
-
await
|
|
315
|
+
}, [st, o]), et = ut(async () => {
|
|
316
|
+
await st(
|
|
274
317
|
{
|
|
275
318
|
checkout: !0,
|
|
276
319
|
onComplete: () => {
|
|
277
|
-
var
|
|
278
|
-
(
|
|
320
|
+
var f;
|
|
321
|
+
(f = o.navigateToCheckout) == null || f.call(o);
|
|
279
322
|
}
|
|
280
323
|
}
|
|
281
324
|
);
|
|
282
|
-
}, [
|
|
325
|
+
}, [st, o]), qt = B(
|
|
283
326
|
() => ({
|
|
284
|
-
isOpen:
|
|
285
|
-
open:
|
|
286
|
-
close:
|
|
287
|
-
toggle:
|
|
288
|
-
loading:
|
|
289
|
-
submitting:
|
|
290
|
-
error:
|
|
327
|
+
isOpen: O,
|
|
328
|
+
open: Ot,
|
|
329
|
+
close: mt,
|
|
330
|
+
toggle: Pt,
|
|
331
|
+
loading: C,
|
|
332
|
+
submitting: L,
|
|
333
|
+
error: q,
|
|
291
334
|
currencyCode: R,
|
|
292
|
-
config:
|
|
293
|
-
eligibleVariants:
|
|
294
|
-
selections:
|
|
295
|
-
selectionOrder:
|
|
335
|
+
config: y,
|
|
336
|
+
eligibleVariants: it,
|
|
337
|
+
selections: K,
|
|
338
|
+
selectionOrder: xt,
|
|
296
339
|
setQuantity: J,
|
|
297
340
|
clearSelections: bt,
|
|
298
|
-
bundleSize:
|
|
341
|
+
bundleSize: at,
|
|
299
342
|
minRequired: tt,
|
|
300
|
-
canSubmit:
|
|
301
|
-
submit:
|
|
343
|
+
canSubmit: gt,
|
|
344
|
+
submit: Ct,
|
|
302
345
|
submitAndCheckout: et
|
|
303
346
|
}),
|
|
304
347
|
[
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
E,
|
|
348
|
+
O,
|
|
349
|
+
Ot,
|
|
350
|
+
mt,
|
|
351
|
+
Pt,
|
|
352
|
+
C,
|
|
311
353
|
L,
|
|
354
|
+
q,
|
|
312
355
|
R,
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
356
|
+
y,
|
|
357
|
+
it,
|
|
358
|
+
K,
|
|
359
|
+
xt,
|
|
317
360
|
J,
|
|
318
361
|
bt,
|
|
319
|
-
|
|
362
|
+
at,
|
|
320
363
|
tt,
|
|
321
|
-
|
|
322
|
-
|
|
364
|
+
gt,
|
|
365
|
+
Ct,
|
|
323
366
|
et
|
|
324
367
|
]
|
|
325
368
|
);
|
|
326
|
-
return /* @__PURE__ */ h(
|
|
369
|
+
return /* @__PURE__ */ h(me.Provider, { value: qt, children: p });
|
|
327
370
|
}
|
|
328
|
-
function
|
|
329
|
-
const i =
|
|
371
|
+
function Yt() {
|
|
372
|
+
const i = ve(me);
|
|
330
373
|
if (!i)
|
|
331
374
|
throw new Error("useBundleBuilder must be used within <BundleProvider />");
|
|
332
375
|
return i;
|
|
333
376
|
}
|
|
334
|
-
function
|
|
335
|
-
const { isOpen: i, open: t, close: e, toggle:
|
|
336
|
-
return { isOpen: i, open: t, close: e, toggle:
|
|
377
|
+
function ur() {
|
|
378
|
+
const { isOpen: i, open: t, close: e, toggle: o } = Yt();
|
|
379
|
+
return { isOpen: i, open: t, close: e, toggle: o };
|
|
337
380
|
}
|
|
338
|
-
const
|
|
339
|
-
button:
|
|
381
|
+
const Se = "_button_18rtl_1", Be = {
|
|
382
|
+
button: Se
|
|
340
383
|
};
|
|
341
|
-
function
|
|
342
|
-
const { toggle: t } =
|
|
384
|
+
function dr(i) {
|
|
385
|
+
const { toggle: t } = Yt();
|
|
343
386
|
return /* @__PURE__ */ h(
|
|
344
387
|
"button",
|
|
345
388
|
{
|
|
346
389
|
type: "button",
|
|
347
390
|
onClick: t,
|
|
348
|
-
className: [
|
|
391
|
+
className: [Be.button, i.className].filter(Boolean).join(" "),
|
|
349
392
|
children: i.children ?? "Build a bundle"
|
|
350
393
|
}
|
|
351
394
|
);
|
|
352
395
|
}
|
|
353
|
-
var
|
|
354
|
-
function
|
|
355
|
-
if (
|
|
356
|
-
|
|
396
|
+
var jt, ue;
|
|
397
|
+
function Te() {
|
|
398
|
+
if (ue) return jt;
|
|
399
|
+
ue = 1;
|
|
357
400
|
var i = {
|
|
358
|
-
linear: function(t, e,
|
|
359
|
-
var n =
|
|
401
|
+
linear: function(t, e, o, r) {
|
|
402
|
+
var n = o - e;
|
|
360
403
|
return n * t / r + e;
|
|
361
404
|
},
|
|
362
|
-
easeInQuad: function(t, e,
|
|
363
|
-
var n =
|
|
405
|
+
easeInQuad: function(t, e, o, r) {
|
|
406
|
+
var n = o - e;
|
|
364
407
|
return n * (t /= r) * t + e;
|
|
365
408
|
},
|
|
366
|
-
easeOutQuad: function(t, e,
|
|
367
|
-
var n =
|
|
409
|
+
easeOutQuad: function(t, e, o, r) {
|
|
410
|
+
var n = o - e;
|
|
368
411
|
return -n * (t /= r) * (t - 2) + e;
|
|
369
412
|
},
|
|
370
|
-
easeInOutQuad: function(t, e,
|
|
371
|
-
var n =
|
|
413
|
+
easeInOutQuad: function(t, e, o, r) {
|
|
414
|
+
var n = o - e;
|
|
372
415
|
return (t /= r / 2) < 1 ? n / 2 * t * t + e : -n / 2 * (--t * (t - 2) - 1) + e;
|
|
373
416
|
},
|
|
374
|
-
easeInCubic: function(t, e,
|
|
375
|
-
var n =
|
|
417
|
+
easeInCubic: function(t, e, o, r) {
|
|
418
|
+
var n = o - e;
|
|
376
419
|
return n * (t /= r) * t * t + e;
|
|
377
420
|
},
|
|
378
|
-
easeOutCubic: function(t, e,
|
|
379
|
-
var n =
|
|
421
|
+
easeOutCubic: function(t, e, o, r) {
|
|
422
|
+
var n = o - e;
|
|
380
423
|
return n * ((t = t / r - 1) * t * t + 1) + e;
|
|
381
424
|
},
|
|
382
|
-
easeInOutCubic: function(t, e,
|
|
383
|
-
var n =
|
|
425
|
+
easeInOutCubic: function(t, e, o, r) {
|
|
426
|
+
var n = o - e;
|
|
384
427
|
return (t /= r / 2) < 1 ? n / 2 * t * t * t + e : n / 2 * ((t -= 2) * t * t + 2) + e;
|
|
385
428
|
},
|
|
386
|
-
easeInQuart: function(t, e,
|
|
387
|
-
var n =
|
|
429
|
+
easeInQuart: function(t, e, o, r) {
|
|
430
|
+
var n = o - e;
|
|
388
431
|
return n * (t /= r) * t * t * t + e;
|
|
389
432
|
},
|
|
390
|
-
easeOutQuart: function(t, e,
|
|
391
|
-
var n =
|
|
433
|
+
easeOutQuart: function(t, e, o, r) {
|
|
434
|
+
var n = o - e;
|
|
392
435
|
return -n * ((t = t / r - 1) * t * t * t - 1) + e;
|
|
393
436
|
},
|
|
394
|
-
easeInOutQuart: function(t, e,
|
|
395
|
-
var n =
|
|
437
|
+
easeInOutQuart: function(t, e, o, r) {
|
|
438
|
+
var n = o - e;
|
|
396
439
|
return (t /= r / 2) < 1 ? n / 2 * t * t * t * t + e : -n / 2 * ((t -= 2) * t * t * t - 2) + e;
|
|
397
440
|
},
|
|
398
|
-
easeInQuint: function(t, e,
|
|
399
|
-
var n =
|
|
441
|
+
easeInQuint: function(t, e, o, r) {
|
|
442
|
+
var n = o - e;
|
|
400
443
|
return n * (t /= r) * t * t * t * t + e;
|
|
401
444
|
},
|
|
402
|
-
easeOutQuint: function(t, e,
|
|
403
|
-
var n =
|
|
445
|
+
easeOutQuint: function(t, e, o, r) {
|
|
446
|
+
var n = o - e;
|
|
404
447
|
return n * ((t = t / r - 1) * t * t * t * t + 1) + e;
|
|
405
448
|
},
|
|
406
|
-
easeInOutQuint: function(t, e,
|
|
407
|
-
var n =
|
|
449
|
+
easeInOutQuint: function(t, e, o, r) {
|
|
450
|
+
var n = o - e;
|
|
408
451
|
return (t /= r / 2) < 1 ? n / 2 * t * t * t * t * t + e : n / 2 * ((t -= 2) * t * t * t * t + 2) + e;
|
|
409
452
|
},
|
|
410
|
-
easeInSine: function(t, e,
|
|
411
|
-
var n =
|
|
453
|
+
easeInSine: function(t, e, o, r) {
|
|
454
|
+
var n = o - e;
|
|
412
455
|
return -n * Math.cos(t / r * (Math.PI / 2)) + n + e;
|
|
413
456
|
},
|
|
414
|
-
easeOutSine: function(t, e,
|
|
415
|
-
var n =
|
|
457
|
+
easeOutSine: function(t, e, o, r) {
|
|
458
|
+
var n = o - e;
|
|
416
459
|
return n * Math.sin(t / r * (Math.PI / 2)) + e;
|
|
417
460
|
},
|
|
418
|
-
easeInOutSine: function(t, e,
|
|
419
|
-
var n =
|
|
461
|
+
easeInOutSine: function(t, e, o, r) {
|
|
462
|
+
var n = o - e;
|
|
420
463
|
return -n / 2 * (Math.cos(Math.PI * t / r) - 1) + e;
|
|
421
464
|
},
|
|
422
|
-
easeInExpo: function(t, e,
|
|
423
|
-
var n =
|
|
465
|
+
easeInExpo: function(t, e, o, r) {
|
|
466
|
+
var n = o - e;
|
|
424
467
|
return t == 0 ? e : n * Math.pow(2, 10 * (t / r - 1)) + e;
|
|
425
468
|
},
|
|
426
|
-
easeOutExpo: function(t, e,
|
|
427
|
-
var n =
|
|
469
|
+
easeOutExpo: function(t, e, o, r) {
|
|
470
|
+
var n = o - e;
|
|
428
471
|
return t == r ? e + n : n * (-Math.pow(2, -10 * t / r) + 1) + e;
|
|
429
472
|
},
|
|
430
|
-
easeInOutExpo: function(t, e,
|
|
431
|
-
var n =
|
|
473
|
+
easeInOutExpo: function(t, e, o, r) {
|
|
474
|
+
var n = o - e;
|
|
432
475
|
return t === 0 ? e : t === r ? e + n : (t /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (t - 1)) + e : n / 2 * (-Math.pow(2, -10 * --t) + 2) + e;
|
|
433
476
|
},
|
|
434
|
-
easeInCirc: function(t, e,
|
|
435
|
-
var n =
|
|
477
|
+
easeInCirc: function(t, e, o, r) {
|
|
478
|
+
var n = o - e;
|
|
436
479
|
return -n * (Math.sqrt(1 - (t /= r) * t) - 1) + e;
|
|
437
480
|
},
|
|
438
|
-
easeOutCirc: function(t, e,
|
|
439
|
-
var n =
|
|
481
|
+
easeOutCirc: function(t, e, o, r) {
|
|
482
|
+
var n = o - e;
|
|
440
483
|
return n * Math.sqrt(1 - (t = t / r - 1) * t) + e;
|
|
441
484
|
},
|
|
442
|
-
easeInOutCirc: function(t, e,
|
|
443
|
-
var n =
|
|
485
|
+
easeInOutCirc: function(t, e, o, r) {
|
|
486
|
+
var n = o - e;
|
|
444
487
|
return (t /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - t * t) - 1) + e : n / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + e;
|
|
445
488
|
},
|
|
446
|
-
easeInElastic: function(t, e,
|
|
447
|
-
var n =
|
|
448
|
-
return
|
|
489
|
+
easeInElastic: function(t, e, o, r) {
|
|
490
|
+
var n = o - e, l, s, p;
|
|
491
|
+
return p = 1.70158, s = 0, l = n, t === 0 ? e : (t /= r) === 1 ? e + n : (s || (s = r * 0.3), l < Math.abs(n) ? (l = n, p = s / 4) : p = s / (2 * Math.PI) * Math.asin(n / l), -(l * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * r - p) * (2 * Math.PI) / s)) + e);
|
|
449
492
|
},
|
|
450
|
-
easeOutElastic: function(t, e,
|
|
451
|
-
var n =
|
|
452
|
-
return
|
|
493
|
+
easeOutElastic: function(t, e, o, r) {
|
|
494
|
+
var n = o - e, l, s, p;
|
|
495
|
+
return p = 1.70158, s = 0, l = n, t === 0 ? e : (t /= r) === 1 ? e + n : (s || (s = r * 0.3), l < Math.abs(n) ? (l = n, p = s / 4) : p = s / (2 * Math.PI) * Math.asin(n / l), l * Math.pow(2, -10 * t) * Math.sin((t * r - p) * (2 * Math.PI) / s) + n + e);
|
|
453
496
|
},
|
|
454
|
-
easeInOutElastic: function(t, e,
|
|
455
|
-
var n =
|
|
456
|
-
return
|
|
497
|
+
easeInOutElastic: function(t, e, o, r) {
|
|
498
|
+
var n = o - e, l, s, p;
|
|
499
|
+
return p = 1.70158, s = 0, l = n, t === 0 ? e : (t /= r / 2) === 2 ? e + n : (s || (s = r * (0.3 * 1.5)), l < Math.abs(n) ? (l = n, p = s / 4) : p = s / (2 * Math.PI) * Math.asin(n / l), t < 1 ? -0.5 * (l * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * r - p) * (2 * Math.PI) / s)) + e : l * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * r - p) * (2 * Math.PI) / s) * 0.5 + n + e);
|
|
457
500
|
},
|
|
458
|
-
easeInBack: function(t, e,
|
|
459
|
-
var l =
|
|
501
|
+
easeInBack: function(t, e, o, r, n) {
|
|
502
|
+
var l = o - e;
|
|
460
503
|
return n === void 0 && (n = 1.70158), l * (t /= r) * t * ((n + 1) * t - n) + e;
|
|
461
504
|
},
|
|
462
|
-
easeOutBack: function(t, e,
|
|
463
|
-
var l =
|
|
505
|
+
easeOutBack: function(t, e, o, r, n) {
|
|
506
|
+
var l = o - e;
|
|
464
507
|
return n === void 0 && (n = 1.70158), l * ((t = t / r - 1) * t * ((n + 1) * t + n) + 1) + e;
|
|
465
508
|
},
|
|
466
|
-
easeInOutBack: function(t, e,
|
|
467
|
-
var l =
|
|
509
|
+
easeInOutBack: function(t, e, o, r, n) {
|
|
510
|
+
var l = o - e;
|
|
468
511
|
return n === void 0 && (n = 1.70158), (t /= r / 2) < 1 ? l / 2 * (t * t * (((n *= 1.525) + 1) * t - n)) + e : l / 2 * ((t -= 2) * t * (((n *= 1.525) + 1) * t + n) + 2) + e;
|
|
469
512
|
},
|
|
470
|
-
easeInBounce: function(t, e,
|
|
471
|
-
var n =
|
|
513
|
+
easeInBounce: function(t, e, o, r) {
|
|
514
|
+
var n = o - e, l;
|
|
472
515
|
return l = i.easeOutBounce(r - t, 0, n, r), n - l + e;
|
|
473
516
|
},
|
|
474
|
-
easeOutBounce: function(t, e,
|
|
475
|
-
var n =
|
|
517
|
+
easeOutBounce: function(t, e, o, r) {
|
|
518
|
+
var n = o - e;
|
|
476
519
|
return (t /= r) < 1 / 2.75 ? n * (7.5625 * t * t) + e : t < 2 / 2.75 ? n * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e : t < 2.5 / 2.75 ? n * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e : n * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
|
|
477
520
|
},
|
|
478
|
-
easeInOutBounce: function(t, e,
|
|
479
|
-
var n =
|
|
521
|
+
easeInOutBounce: function(t, e, o, r) {
|
|
522
|
+
var n = o - e, l;
|
|
480
523
|
return t < r / 2 ? (l = i.easeInBounce(t * 2, 0, n, r), l * 0.5 + e) : (l = i.easeOutBounce(t * 2 - r, 0, n, r), l * 0.5 + n * 0.5 + e);
|
|
481
524
|
}
|
|
482
525
|
};
|
|
483
|
-
return
|
|
526
|
+
return jt = i, jt;
|
|
484
527
|
}
|
|
485
|
-
var
|
|
486
|
-
function
|
|
528
|
+
var Ne = Te();
|
|
529
|
+
function ke(i) {
|
|
487
530
|
return i * Math.PI / 180;
|
|
488
531
|
}
|
|
489
532
|
function W(i, t) {
|
|
490
533
|
return i + Math.random() * (t - i);
|
|
491
534
|
}
|
|
492
|
-
function
|
|
535
|
+
function Me(i, t) {
|
|
493
536
|
return Math.floor(i + Math.random() * (t - i + 1));
|
|
494
537
|
}
|
|
495
|
-
var
|
|
538
|
+
var Nt;
|
|
496
539
|
(function(i) {
|
|
497
540
|
i[i.Circle = 0] = "Circle", i[i.Square = 1] = "Square", i[i.Strip = 2] = "Strip";
|
|
498
|
-
})(
|
|
541
|
+
})(Nt || (Nt = {}));
|
|
499
542
|
var dt;
|
|
500
543
|
(function(i) {
|
|
501
544
|
i[i.Positive = 1] = "Positive", i[i.Negative = -1] = "Negative";
|
|
502
545
|
})(dt || (dt = {}));
|
|
503
|
-
const
|
|
504
|
-
class
|
|
505
|
-
constructor(t, e,
|
|
546
|
+
const Oe = 1e3 / 60;
|
|
547
|
+
class Pe {
|
|
548
|
+
constructor(t, e, o, r) {
|
|
506
549
|
this.getOptions = e;
|
|
507
|
-
const { colors: n, initialVelocityX: l, initialVelocityY:
|
|
508
|
-
this.context = t, this.x =
|
|
550
|
+
const { colors: n, initialVelocityX: l, initialVelocityY: s } = this.getOptions();
|
|
551
|
+
this.context = t, this.x = o, this.y = r, this.w = W(5, 20), this.h = W(5, 20), this.radius = W(5, 10), this.vx = typeof l == "number" ? W(-l, l) : W(l.min, l.max), this.vy = typeof s == "number" ? W(-s, 0) : W(s.min, s.max), this.shape = Me(0, 2), this.angle = ke(W(0, 360)), this.angularSpin = W(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = W(0, 1), this.rotationDirection = W(0, 1) ? dt.Positive : dt.Negative;
|
|
509
552
|
}
|
|
510
553
|
update(t) {
|
|
511
|
-
const { gravity: e, wind:
|
|
512
|
-
this.x += this.vx *
|
|
513
|
-
const
|
|
514
|
-
if (this.rotateY +=
|
|
554
|
+
const { gravity: e, wind: o, friction: r, opacity: n, drawShape: l } = this.getOptions(), s = t / Oe;
|
|
555
|
+
this.x += this.vx * s, this.y += this.vy * s, this.vy += e * s, this.vx += o * s, this.vx *= r ** s, this.vy *= r ** s, this.rotateY >= 1 && this.rotationDirection === dt.Positive ? this.rotationDirection = dt.Negative : this.rotateY <= -1 && this.rotationDirection === dt.Negative && (this.rotationDirection = dt.Positive);
|
|
556
|
+
const p = 0.1 * this.rotationDirection * s;
|
|
557
|
+
if (this.rotateY += p, this.angle += this.angularSpin, this.context.save(), this.context.translate(this.x, this.y), this.context.rotate(this.angle), this.context.scale(1, this.rotateY), this.context.rotate(this.angle), this.context.beginPath(), this.context.fillStyle = this.color, this.context.strokeStyle = this.color, this.context.globalAlpha = n, this.context.lineCap = "round", this.context.lineWidth = 2, l && typeof l == "function")
|
|
515
558
|
l.call(this, this.context);
|
|
516
559
|
else
|
|
517
560
|
switch (this.shape) {
|
|
518
|
-
case
|
|
561
|
+
case Nt.Circle: {
|
|
519
562
|
this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
|
|
520
563
|
break;
|
|
521
564
|
}
|
|
522
|
-
case
|
|
565
|
+
case Nt.Square: {
|
|
523
566
|
this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
|
|
524
567
|
break;
|
|
525
568
|
}
|
|
526
|
-
case
|
|
569
|
+
case Nt.Strip: {
|
|
527
570
|
this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
|
|
528
571
|
break;
|
|
529
572
|
}
|
|
@@ -531,39 +574,39 @@ class Se {
|
|
|
531
574
|
this.context.closePath(), this.context.restore();
|
|
532
575
|
}
|
|
533
576
|
}
|
|
534
|
-
class
|
|
577
|
+
class Ae {
|
|
535
578
|
constructor(t, e) {
|
|
536
579
|
this.x = 0, this.y = 0, this.w = 0, this.h = 0, this.lastNumberOfPieces = 0, this.tweenProgress = 0, this.tweenFrom = 0, this.particles = [], this.particlesGenerated = 0, this.removeParticleAt = (r) => {
|
|
537
580
|
this.particles.splice(r, 1);
|
|
538
581
|
}, this.getParticle = () => {
|
|
539
582
|
const r = W(this.x, this.w + this.x), n = W(this.y, this.h + this.y);
|
|
540
|
-
return new
|
|
583
|
+
return new Pe(this.context, this.getOptions, r, n);
|
|
541
584
|
}, this.animate = (r) => {
|
|
542
|
-
const { canvas: n, context: l, particlesGenerated:
|
|
543
|
-
if (!
|
|
585
|
+
const { canvas: n, context: l, particlesGenerated: s, lastNumberOfPieces: p } = this, { run: v, recycle: O, numberOfPieces: P, debug: C, tweenFunction: Z, tweenDuration: L } = this.getOptions();
|
|
586
|
+
if (!v)
|
|
544
587
|
return !1;
|
|
545
|
-
const
|
|
546
|
-
if (
|
|
547
|
-
|
|
548
|
-
const
|
|
588
|
+
const Y = this.particles.length, q = O ? Y : s;
|
|
589
|
+
if (q < P) {
|
|
590
|
+
p !== P && (this.tweenProgress = 0, this.tweenFrom = q, this.lastNumberOfPieces = P), this.tweenProgress = Math.min(L, Math.max(0, this.tweenProgress + r));
|
|
591
|
+
const T = Z(this.tweenProgress, this.tweenFrom, P, L), R = Math.round(T - q);
|
|
549
592
|
for (let j = 0; j < R; j++)
|
|
550
593
|
this.particles.push(this.getParticle());
|
|
551
594
|
this.particlesGenerated += R;
|
|
552
595
|
}
|
|
553
|
-
|
|
554
|
-
for (let
|
|
555
|
-
const R = this.particles[
|
|
556
|
-
R.update(r), (R.y > n.height || R.y < -100 || R.x > n.width + 100 || R.x < -100) && (
|
|
596
|
+
C && (l.font = "12px sans-serif", l.fillStyle = "#333", l.textAlign = "right", l.fillText(`Particles: ${Y}`, n.width - 10, n.height - 20));
|
|
597
|
+
for (let T = this.particles.length - 1; T >= 0; T--) {
|
|
598
|
+
const R = this.particles[T];
|
|
599
|
+
R.update(r), (R.y > n.height || R.y < -100 || R.x > n.width + 100 || R.x < -100) && (O && q <= P ? this.particles[T] = this.getParticle() : this.removeParticleAt(T));
|
|
557
600
|
}
|
|
558
|
-
return
|
|
601
|
+
return Y > 0 || q < P;
|
|
559
602
|
}, this.canvas = t;
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
603
|
+
const o = this.canvas.getContext("2d");
|
|
604
|
+
if (!o)
|
|
562
605
|
throw new Error("Could not get canvas context");
|
|
563
|
-
this.context =
|
|
606
|
+
this.context = o, this.getOptions = e;
|
|
564
607
|
}
|
|
565
608
|
}
|
|
566
|
-
const
|
|
609
|
+
const Kt = {
|
|
567
610
|
width: typeof window < "u" ? window.innerWidth : 300,
|
|
568
611
|
height: typeof window < "u" ? window.innerHeight : 200,
|
|
569
612
|
numberOfPieces: 200,
|
|
@@ -593,12 +636,12 @@ const Yt = {
|
|
|
593
636
|
],
|
|
594
637
|
opacity: 1,
|
|
595
638
|
debug: !1,
|
|
596
|
-
tweenFunction:
|
|
639
|
+
tweenFunction: Ne.easeInOutQuad,
|
|
597
640
|
tweenDuration: 5e3,
|
|
598
641
|
recycle: !0,
|
|
599
642
|
run: !0
|
|
600
643
|
};
|
|
601
|
-
class
|
|
644
|
+
class Re {
|
|
602
645
|
constructor(t, e) {
|
|
603
646
|
this.lastFrameTime = 0, this.setOptionsWithDefaults = (r) => {
|
|
604
647
|
const n = {
|
|
@@ -611,55 +654,55 @@ class Te {
|
|
|
611
654
|
};
|
|
612
655
|
this._options = {
|
|
613
656
|
...n,
|
|
614
|
-
...
|
|
657
|
+
...Kt,
|
|
615
658
|
...r
|
|
616
659
|
}, Object.assign(this, r.confettiSource);
|
|
617
660
|
}, this.update = (r = 0) => {
|
|
618
|
-
const { options: { run: n, onConfettiComplete: l, frameRate:
|
|
619
|
-
if (
|
|
661
|
+
const { options: { run: n, onConfettiComplete: l, frameRate: s }, canvas: p, context: v } = this, O = Math.min(r - this.lastFrameTime, 50);
|
|
662
|
+
if (s && O < 1e3 / s) {
|
|
620
663
|
this.rafId = requestAnimationFrame(this.update);
|
|
621
664
|
return;
|
|
622
665
|
}
|
|
623
|
-
this.lastFrameTime = r - (
|
|
666
|
+
this.lastFrameTime = r - (s ? O % s : 0), n && (v.fillStyle = "white", v.clearRect(0, 0, p.width, p.height)), this.generator.animate(O) ? this.rafId = requestAnimationFrame(this.update) : (l && typeof l == "function" && this.generator.particlesGenerated > 0 && l.call(this, this), this._options.run = !1);
|
|
624
667
|
}, this.reset = () => {
|
|
625
668
|
this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
|
|
626
669
|
}, this.stop = () => {
|
|
627
670
|
this.options = { run: !1 }, this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = void 0);
|
|
628
671
|
}, this.canvas = t;
|
|
629
|
-
const
|
|
630
|
-
if (!
|
|
672
|
+
const o = this.canvas.getContext("2d");
|
|
673
|
+
if (!o)
|
|
631
674
|
throw new Error("Could not get canvas context");
|
|
632
|
-
this.context =
|
|
675
|
+
this.context = o, this.generator = new Ae(this.canvas, () => this.options), this.options = e, this.update();
|
|
633
676
|
}
|
|
634
677
|
get options() {
|
|
635
678
|
return this._options;
|
|
636
679
|
}
|
|
637
680
|
set options(t) {
|
|
638
681
|
var r, n;
|
|
639
|
-
const e = (r = this._options) == null ? void 0 : r.run,
|
|
640
|
-
this.setOptionsWithDefaults(t), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof t.recycle == "boolean" && t.recycle &&
|
|
682
|
+
const e = (r = this._options) == null ? void 0 : r.run, o = (n = this._options) == null ? void 0 : n.recycle;
|
|
683
|
+
this.setOptionsWithDefaults(t), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof t.recycle == "boolean" && t.recycle && o === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof t.run == "boolean" && t.run && e === !1 && this.update();
|
|
641
684
|
}
|
|
642
685
|
}
|
|
643
|
-
const
|
|
644
|
-
class
|
|
686
|
+
const Fe = Lt.createRef();
|
|
687
|
+
class Ht extends Lt.Component {
|
|
645
688
|
constructor(t) {
|
|
646
|
-
super(t), this.canvas =
|
|
689
|
+
super(t), this.canvas = Lt.createRef(), this.canvas = t.canvasRef || Fe;
|
|
647
690
|
}
|
|
648
691
|
componentDidMount() {
|
|
649
692
|
if (this.canvas.current) {
|
|
650
|
-
const t =
|
|
651
|
-
this.confetti = new
|
|
693
|
+
const t = Vt(this.props)[0];
|
|
694
|
+
this.confetti = new Re(this.canvas.current, t);
|
|
652
695
|
}
|
|
653
696
|
}
|
|
654
697
|
componentDidUpdate() {
|
|
655
|
-
const t =
|
|
698
|
+
const t = Vt(this.props)[0];
|
|
656
699
|
this.confetti && (this.confetti.options = t);
|
|
657
700
|
}
|
|
658
701
|
componentWillUnmount() {
|
|
659
702
|
this.confetti && this.confetti.stop(), this.confetti = void 0;
|
|
660
703
|
}
|
|
661
704
|
render() {
|
|
662
|
-
const [t, e] =
|
|
705
|
+
const [t, e] = Vt(this.props), o = {
|
|
663
706
|
zIndex: 2,
|
|
664
707
|
position: "absolute",
|
|
665
708
|
pointerEvents: "none",
|
|
@@ -669,41 +712,41 @@ class Kt extends qt.Component {
|
|
|
669
712
|
right: 0,
|
|
670
713
|
...e.style
|
|
671
714
|
};
|
|
672
|
-
return h("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style:
|
|
715
|
+
return h("canvas", { width: t.width, height: t.height, ref: this.canvas, ...e, style: o });
|
|
673
716
|
}
|
|
674
717
|
}
|
|
675
|
-
|
|
676
|
-
...
|
|
718
|
+
Ht.defaultProps = {
|
|
719
|
+
...Kt
|
|
677
720
|
};
|
|
678
|
-
|
|
679
|
-
function
|
|
680
|
-
const t = {}, e = {},
|
|
681
|
-
...Object.keys(
|
|
721
|
+
Ht.displayName = "ReactConfetti";
|
|
722
|
+
function Vt(i) {
|
|
723
|
+
const t = {}, e = {}, o = {}, r = [
|
|
724
|
+
...Object.keys(Kt),
|
|
682
725
|
"confettiSource",
|
|
683
726
|
"drawShape",
|
|
684
727
|
"onConfettiComplete",
|
|
685
728
|
"frameRate"
|
|
686
729
|
], n = ["canvasRef"];
|
|
687
730
|
for (const l in i) {
|
|
688
|
-
const
|
|
689
|
-
r.includes(l) ? t[l] =
|
|
731
|
+
const s = i[l];
|
|
732
|
+
r.includes(l) ? t[l] = s : n.includes(l) ? n[l] = s : o[l] = s;
|
|
690
733
|
}
|
|
691
|
-
return [t,
|
|
734
|
+
return [t, o, e];
|
|
692
735
|
}
|
|
693
|
-
const
|
|
736
|
+
const De = Lt.forwardRef((i, t) => h(Ht, { canvasRef: t, ...i }));
|
|
694
737
|
/**
|
|
695
738
|
* @license lucide-react v0.515.0 - ISC
|
|
696
739
|
*
|
|
697
740
|
* This source code is licensed under the ISC license.
|
|
698
741
|
* See the LICENSE file in the root directory of this source tree.
|
|
699
742
|
*/
|
|
700
|
-
const
|
|
743
|
+
const Ee = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Le = (i) => i.replace(
|
|
701
744
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
702
|
-
(t, e,
|
|
703
|
-
),
|
|
704
|
-
const t =
|
|
745
|
+
(t, e, o) => o ? o.toUpperCase() : e.toLowerCase()
|
|
746
|
+
), de = (i) => {
|
|
747
|
+
const t = Le(i);
|
|
705
748
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
706
|
-
},
|
|
749
|
+
}, pe = (...i) => i.filter((t, e, o) => !!t && t.trim() !== "" && o.indexOf(t) === e).join(" ").trim(), qe = (i) => {
|
|
707
750
|
for (const t in i)
|
|
708
751
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
709
752
|
return !0;
|
|
@@ -714,7 +757,7 @@ const Pe = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Oe = (
|
|
|
714
757
|
* This source code is licensed under the ISC license.
|
|
715
758
|
* See the LICENSE file in the root directory of this source tree.
|
|
716
759
|
*/
|
|
717
|
-
var
|
|
760
|
+
var $e = {
|
|
718
761
|
xmlns: "http://www.w3.org/2000/svg",
|
|
719
762
|
width: 24,
|
|
720
763
|
height: 24,
|
|
@@ -731,31 +774,31 @@ var Fe = {
|
|
|
731
774
|
* This source code is licensed under the ISC license.
|
|
732
775
|
* See the LICENSE file in the root directory of this source tree.
|
|
733
776
|
*/
|
|
734
|
-
const
|
|
777
|
+
const Ue = fe(
|
|
735
778
|
({
|
|
736
779
|
color: i = "currentColor",
|
|
737
780
|
size: t = 24,
|
|
738
781
|
strokeWidth: e = 2,
|
|
739
|
-
absoluteStrokeWidth:
|
|
782
|
+
absoluteStrokeWidth: o,
|
|
740
783
|
className: r = "",
|
|
741
784
|
children: n,
|
|
742
785
|
iconNode: l,
|
|
743
|
-
...
|
|
744
|
-
},
|
|
786
|
+
...s
|
|
787
|
+
}, p) => Qt(
|
|
745
788
|
"svg",
|
|
746
789
|
{
|
|
747
|
-
ref:
|
|
748
|
-
|
|
790
|
+
ref: p,
|
|
791
|
+
...$e,
|
|
749
792
|
width: t,
|
|
750
793
|
height: t,
|
|
751
794
|
stroke: i,
|
|
752
|
-
strokeWidth:
|
|
753
|
-
className:
|
|
754
|
-
...!n && !
|
|
755
|
-
...
|
|
795
|
+
strokeWidth: o ? Number(e) * 24 / Number(t) : e,
|
|
796
|
+
className: pe("lucide", r),
|
|
797
|
+
...!n && !qe(s) && { "aria-hidden": "true" },
|
|
798
|
+
...s
|
|
756
799
|
},
|
|
757
800
|
[
|
|
758
|
-
...l.map(([
|
|
801
|
+
...l.map(([v, O]) => Qt(v, O)),
|
|
759
802
|
...Array.isArray(n) ? n : [n]
|
|
760
803
|
]
|
|
761
804
|
)
|
|
@@ -766,20 +809,20 @@ const Re = le(
|
|
|
766
809
|
* This source code is licensed under the ISC license.
|
|
767
810
|
* See the LICENSE file in the root directory of this source tree.
|
|
768
811
|
*/
|
|
769
|
-
const
|
|
770
|
-
const e =
|
|
771
|
-
({ className:
|
|
812
|
+
const ze = (i, t) => {
|
|
813
|
+
const e = fe(
|
|
814
|
+
({ className: o, ...r }, n) => Qt(Ue, {
|
|
772
815
|
ref: n,
|
|
773
816
|
iconNode: t,
|
|
774
|
-
className:
|
|
775
|
-
`lucide-${
|
|
817
|
+
className: pe(
|
|
818
|
+
`lucide-${Ee(de(i))}`,
|
|
776
819
|
`lucide-${i}`,
|
|
777
|
-
|
|
820
|
+
o
|
|
778
821
|
),
|
|
779
822
|
...r
|
|
780
823
|
})
|
|
781
824
|
);
|
|
782
|
-
return e.displayName =
|
|
825
|
+
return e.displayName = de(i), e;
|
|
783
826
|
};
|
|
784
827
|
/**
|
|
785
828
|
* @license lucide-react v0.515.0 - ISC
|
|
@@ -787,303 +830,303 @@ const De = (i, t) => {
|
|
|
787
830
|
* This source code is licensed under the ISC license.
|
|
788
831
|
* See the LICENSE file in the root directory of this source tree.
|
|
789
832
|
*/
|
|
790
|
-
const
|
|
833
|
+
const We = [
|
|
791
834
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
792
835
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
793
|
-
],
|
|
794
|
-
backdrop:
|
|
795
|
-
celebrationOverlay:
|
|
796
|
-
celebrationChip:
|
|
797
|
-
backdropOpen:
|
|
798
|
-
backdropClosed:
|
|
799
|
-
panel:
|
|
800
|
-
panelOpen:
|
|
801
|
-
panelClosed:
|
|
802
|
-
header:
|
|
803
|
-
headerCenter:
|
|
804
|
-
title:
|
|
805
|
-
searchIconButton:
|
|
806
|
-
headerTitleWrap:
|
|
807
|
-
headerSearchWrap:
|
|
808
|
-
headerSearchOpen:
|
|
809
|
-
searchBar:
|
|
810
|
-
searchInput:
|
|
811
|
-
searchClearButton:
|
|
812
|
-
closeButton:
|
|
813
|
-
body:
|
|
814
|
-
muted:
|
|
815
|
-
error:
|
|
816
|
-
variants:
|
|
817
|
-
variantList:
|
|
818
|
-
variantRow:
|
|
819
|
-
variantLeft:
|
|
820
|
-
addToBundleButton:
|
|
821
|
-
variantThumb:
|
|
822
|
-
variantThumbImg:
|
|
823
|
-
variantThumbFallback:
|
|
824
|
-
variantInfo:
|
|
825
|
-
variantName:
|
|
826
|
-
variantMeta:
|
|
827
|
-
variantPriceRow:
|
|
828
|
-
variantCompareAt:
|
|
829
|
-
variantPrice:
|
|
830
|
-
qtyControls:
|
|
831
|
-
qtyButton:
|
|
832
|
-
qtyValue:
|
|
833
|
-
footer:
|
|
834
|
-
poweredBy:
|
|
835
|
-
boxSummaryWindow:
|
|
836
|
-
boxSummaryRow:
|
|
837
|
-
boxSlot:
|
|
838
|
-
boxItem:
|
|
839
|
-
boxItemClickable:
|
|
840
|
-
boxThresholdLabel:
|
|
841
|
-
boxItemPlaceholder:
|
|
842
|
-
boxItemFilled:
|
|
843
|
-
boxItemThreshold:
|
|
844
|
-
boxItemDiscountText:
|
|
845
|
-
boxItemPlus:
|
|
846
|
-
boxItemImage:
|
|
847
|
-
boxItemFallback:
|
|
848
|
-
ctaButtonGroup:
|
|
849
|
-
ctaButtonGroupAnimating:
|
|
850
|
-
cta:
|
|
851
|
-
ctaDualLeft:
|
|
852
|
-
ctaDualLeftAnimating:
|
|
853
|
-
ctaDualRight:
|
|
854
|
-
ctaDualRightAnimating:
|
|
855
|
-
ctaTotals:
|
|
856
|
-
ctaDiscountBadge:
|
|
857
|
-
ctaTotalsWrap:
|
|
858
|
-
ctaTotalsWrapVisible:
|
|
859
|
-
ctaTotalsStrike:
|
|
860
|
-
ctaTotalsPrice:
|
|
836
|
+
], je = ze("search", We), Ve = "_backdrop_227w4_1", Ge = "_celebrationOverlay_227w4_14", Qe = "_celebrationChip_227w4_23", Ye = "_backdropOpen_227w4_74", Ke = "_backdropClosed_227w4_78", He = "_panel_227w4_82", Xe = "_panelOpen_227w4_102", Ze = "_panelClosed_227w4_106", Je = "_header_227w4_145", tn = "_headerCenter_227w4_154", en = "_title_227w4_162", nn = "_searchIconButton_227w4_171", rn = "_headerTitleWrap_227w4_193", on = "_headerSearchWrap_227w4_197", an = "_headerSearchOpen_227w4_209", sn = "_searchBar_227w4_221", cn = "_searchInput_227w4_233", ln = "_searchClearButton_227w4_254", un = "_closeButton_227w4_276", dn = "_body_227w4_309", hn = "_muted_227w4_314", fn = "_error_227w4_319", mn = "_variants_227w4_324", pn = "_variantList_227w4_328", bn = "_variantRow_227w4_336", wn = "_variantLeft_227w4_344", yn = "_addToBundleButton_227w4_351", _n = "_variantThumb_227w4_379", gn = "_variantThumbImg_227w4_389", vn = "_variantThumbFallback_227w4_396", xn = "_variantInfo_227w4_406", Cn = "_variantName_227w4_410", In = "_variantMeta_227w4_419", Sn = "_variantPriceRow_227w4_427", Bn = "_variantCompareAt_227w4_434", Tn = "_variantPrice_227w4_427", Nn = "_qtyControls_227w4_445", kn = "_qtyButton_227w4_451", Mn = "_qtyValue_227w4_476", On = "_footer_227w4_483", Pn = "_poweredBy_227w4_490", An = "_boxSummaryWindow_227w4_502", Rn = "_boxSummaryRow_227w4_519", Fn = "_boxSlot_227w4_527", Dn = "_boxItem_227w4_535", En = "_boxItemClickable_227w4_547", Ln = "_boxThresholdLabel_227w4_556", qn = "_boxItemPlaceholder_227w4_567", $n = "_boxItemFilled_227w4_573", Un = "_boxItemThreshold_227w4_579", zn = "_boxItemDiscountText_227w4_587", Wn = "_boxItemPlus_227w4_595", jn = "_boxItemImage_227w4_602", Vn = "_boxItemFallback_227w4_609", Gn = "_ctaButtonGroup_227w4_620", Qn = "_ctaButtonGroupAnimating_227w4_627", Yn = "_cta_227w4_620", Kn = "_ctaDualLeft_227w4_655", Hn = "_ctaDualLeftAnimating_227w4_673", Xn = "_ctaDualRight_227w4_686", Zn = "_ctaDualRightAnimating_227w4_702", Jn = "_ctaTotals_227w4_713", tr = "_ctaDiscountBadge_227w4_721", er = "_ctaTotalsWrap_227w4_735", nr = "_ctaTotalsWrapVisible_227w4_748", rr = "_ctaTotalsStrike_227w4_755", or = "_ctaTotalsPrice_227w4_762", u = {
|
|
837
|
+
backdrop: Ve,
|
|
838
|
+
celebrationOverlay: Ge,
|
|
839
|
+
celebrationChip: Qe,
|
|
840
|
+
backdropOpen: Ye,
|
|
841
|
+
backdropClosed: Ke,
|
|
842
|
+
panel: He,
|
|
843
|
+
panelOpen: Xe,
|
|
844
|
+
panelClosed: Ze,
|
|
845
|
+
header: Je,
|
|
846
|
+
headerCenter: tn,
|
|
847
|
+
title: en,
|
|
848
|
+
searchIconButton: nn,
|
|
849
|
+
headerTitleWrap: rn,
|
|
850
|
+
headerSearchWrap: on,
|
|
851
|
+
headerSearchOpen: an,
|
|
852
|
+
searchBar: sn,
|
|
853
|
+
searchInput: cn,
|
|
854
|
+
searchClearButton: ln,
|
|
855
|
+
closeButton: un,
|
|
856
|
+
body: dn,
|
|
857
|
+
muted: hn,
|
|
858
|
+
error: fn,
|
|
859
|
+
variants: mn,
|
|
860
|
+
variantList: pn,
|
|
861
|
+
variantRow: bn,
|
|
862
|
+
variantLeft: wn,
|
|
863
|
+
addToBundleButton: yn,
|
|
864
|
+
variantThumb: _n,
|
|
865
|
+
variantThumbImg: gn,
|
|
866
|
+
variantThumbFallback: vn,
|
|
867
|
+
variantInfo: xn,
|
|
868
|
+
variantName: Cn,
|
|
869
|
+
variantMeta: In,
|
|
870
|
+
variantPriceRow: Sn,
|
|
871
|
+
variantCompareAt: Bn,
|
|
872
|
+
variantPrice: Tn,
|
|
873
|
+
qtyControls: Nn,
|
|
874
|
+
qtyButton: kn,
|
|
875
|
+
qtyValue: Mn,
|
|
876
|
+
footer: On,
|
|
877
|
+
poweredBy: Pn,
|
|
878
|
+
boxSummaryWindow: An,
|
|
879
|
+
boxSummaryRow: Rn,
|
|
880
|
+
boxSlot: Fn,
|
|
881
|
+
boxItem: Dn,
|
|
882
|
+
boxItemClickable: En,
|
|
883
|
+
boxThresholdLabel: Ln,
|
|
884
|
+
boxItemPlaceholder: qn,
|
|
885
|
+
boxItemFilled: $n,
|
|
886
|
+
boxItemThreshold: Un,
|
|
887
|
+
boxItemDiscountText: zn,
|
|
888
|
+
boxItemPlus: Wn,
|
|
889
|
+
boxItemImage: jn,
|
|
890
|
+
boxItemFallback: Vn,
|
|
891
|
+
ctaButtonGroup: Gn,
|
|
892
|
+
ctaButtonGroupAnimating: Qn,
|
|
893
|
+
cta: Yn,
|
|
894
|
+
ctaDualLeft: Kn,
|
|
895
|
+
ctaDualLeftAnimating: Hn,
|
|
896
|
+
ctaDualRight: Xn,
|
|
897
|
+
ctaDualRightAnimating: Zn,
|
|
898
|
+
ctaTotals: Jn,
|
|
899
|
+
ctaDiscountBadge: tr,
|
|
900
|
+
ctaTotalsWrap: er,
|
|
901
|
+
ctaTotalsWrapVisible: nr,
|
|
902
|
+
ctaTotalsStrike: rr,
|
|
903
|
+
ctaTotalsPrice: or
|
|
861
904
|
};
|
|
862
|
-
function
|
|
863
|
-
var
|
|
905
|
+
function hr(i) {
|
|
906
|
+
var oe, ie;
|
|
864
907
|
const {
|
|
865
908
|
isOpen: t,
|
|
866
909
|
close: e,
|
|
867
|
-
loading:
|
|
910
|
+
loading: o,
|
|
868
911
|
submitting: r,
|
|
869
912
|
error: n,
|
|
870
913
|
currencyCode: l,
|
|
871
|
-
config:
|
|
872
|
-
eligibleVariants:
|
|
873
|
-
selections:
|
|
874
|
-
selectionOrder:
|
|
875
|
-
setQuantity:
|
|
876
|
-
bundleSize:
|
|
914
|
+
config: s,
|
|
915
|
+
eligibleVariants: p,
|
|
916
|
+
selections: v,
|
|
917
|
+
selectionOrder: O,
|
|
918
|
+
setQuantity: P,
|
|
919
|
+
bundleSize: C,
|
|
877
920
|
minRequired: Z,
|
|
878
|
-
canSubmit:
|
|
879
|
-
submit:
|
|
880
|
-
submitAndCheckout:
|
|
881
|
-
} =
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
921
|
+
canSubmit: L,
|
|
922
|
+
submit: Y,
|
|
923
|
+
submitAndCheckout: q
|
|
924
|
+
} = Yt(), [T, R] = N(!1), [j, y] = N(""), ht = z(null), it = z(null), _t = z(null), [ft, kt] = N(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Mt, Ot] = N(0), [mt, Pt] = N(null), [At, pt] = N(!1), J = z(null), bt = z(C), K = 7e3, [xt, at] = N(0), [tt, gt] = N(null), [st, Ct] = N(!1), et = z(null), qt = 2800, f = [
|
|
925
|
+
"#2563eb",
|
|
926
|
+
"#3b82f6",
|
|
927
|
+
"#60a5fa",
|
|
928
|
+
"#93c5fd",
|
|
929
|
+
"#bae6fd",
|
|
930
|
+
"#e0f2fe"
|
|
931
|
+
], x = B(() => {
|
|
932
|
+
var c;
|
|
933
|
+
const a = (c = s == null ? void 0 : s.styleSettings) == null ? void 0 : c.confettiColors;
|
|
934
|
+
return Array.isArray(a) && a.length >= 6 ? a.slice(0, 6).map(
|
|
935
|
+
(d, b) => typeof d == "string" && d.trim() ? d : f[b]
|
|
936
|
+
) : [...f];
|
|
937
|
+
}, [(oe = s == null ? void 0 : s.styleSettings) == null ? void 0 : oe.confettiColors]), $ = (a) => {
|
|
938
|
+
const c = Number.parseFloat(a);
|
|
939
|
+
return Number.isFinite(c) ? String(Math.round(c)) : a;
|
|
940
|
+
}, _ = (a) => {
|
|
941
|
+
const c = (a ?? []).filter((d) => {
|
|
942
|
+
var I, g;
|
|
943
|
+
const b = (I = d == null ? void 0 : d.name) == null ? void 0 : I.trim(), w = (g = d == null ? void 0 : d.value) == null ? void 0 : g.trim();
|
|
944
|
+
return !(!b || !w || b.toLowerCase() === "title");
|
|
889
945
|
});
|
|
890
|
-
return
|
|
891
|
-
},
|
|
892
|
-
var
|
|
893
|
-
return ((
|
|
894
|
-
},
|
|
895
|
-
const
|
|
896
|
-
return [
|
|
897
|
-
}, [
|
|
898
|
-
const
|
|
899
|
-
if (!Number.isFinite(
|
|
946
|
+
return c.length ? c.map((d) => `${d.name}: ${d.value}`).join(" · ") : null;
|
|
947
|
+
}, H = (a) => {
|
|
948
|
+
var c;
|
|
949
|
+
return ((c = a.product) == null ? void 0 : c.title) ?? a.displayName ?? a.title;
|
|
950
|
+
}, U = (a) => {
|
|
951
|
+
const c = H(a), d = _(a.selectedOptions);
|
|
952
|
+
return [c, d].filter(Boolean).join(" — ");
|
|
953
|
+
}, [It, k] = N(t), F = z(null), D = (a) => {
|
|
954
|
+
const c = Number(a);
|
|
955
|
+
if (!Number.isFinite(c)) return a;
|
|
900
956
|
if (l)
|
|
901
957
|
try {
|
|
902
|
-
return new Intl.NumberFormat(void 0, { style: "currency", currency: l }).format(
|
|
958
|
+
return new Intl.NumberFormat(void 0, { style: "currency", currency: l }).format(c);
|
|
903
959
|
} catch {
|
|
904
960
|
}
|
|
905
|
-
return `$${
|
|
906
|
-
},
|
|
907
|
-
const
|
|
908
|
-
return Math.max(2, Math.min(100,
|
|
909
|
-
}, [
|
|
910
|
-
const
|
|
911
|
-
if (!
|
|
912
|
-
const
|
|
913
|
-
var
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
for (const
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
return
|
|
961
|
+
return `$${c.toFixed(2)}`;
|
|
962
|
+
}, ct = ((ie = s == null ? void 0 : s.title) == null ? void 0 : ie.trim()) || "Build your bundle", Q = B(() => {
|
|
963
|
+
const a = Number((s == null ? void 0 : s.maxBundleSize) ?? NaN), c = Number.isFinite(a) ? Math.floor(a) : 100;
|
|
964
|
+
return Math.max(2, Math.min(100, c));
|
|
965
|
+
}, [s == null ? void 0 : s.maxBundleSize]), V = C >= Q, nt = B(() => [...p].sort((a, c) => a.displayName.localeCompare(c.displayName)), [p]), wt = B(() => {
|
|
966
|
+
const a = j.trim().toLowerCase();
|
|
967
|
+
if (!a) return nt;
|
|
968
|
+
const c = a.split(/\s+/).filter(Boolean), d = (b) => {
|
|
969
|
+
var g;
|
|
970
|
+
const w = [];
|
|
971
|
+
w.push(b.displayName), (g = b.product) != null && g.title && w.push(b.product.title);
|
|
972
|
+
for (const S of b.selectedOptions ?? [])
|
|
973
|
+
w.push(S.name), w.push(S.value);
|
|
974
|
+
const I = w.join(" ").toLowerCase();
|
|
975
|
+
return c.every((S) => I.includes(S));
|
|
920
976
|
};
|
|
921
|
-
return
|
|
922
|
-
}, [j,
|
|
923
|
-
let
|
|
924
|
-
for (const
|
|
925
|
-
|
|
926
|
-
return
|
|
927
|
-
}, [
|
|
928
|
-
if (!
|
|
929
|
-
const
|
|
930
|
-
return !Number.isFinite(
|
|
931
|
-
}, [
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
934
|
-
const
|
|
935
|
-
return !Number.isFinite(
|
|
936
|
-
}, [
|
|
937
|
-
const
|
|
938
|
-
let
|
|
939
|
-
for (const [d, b] of Object.entries(
|
|
940
|
-
const
|
|
941
|
-
if (
|
|
942
|
-
const
|
|
943
|
-
Number.isFinite(
|
|
977
|
+
return nt.filter(d);
|
|
978
|
+
}, [j, nt]), A = B(() => [...(s == null ? void 0 : s.rules) ?? []].sort((a, c) => a.minBundleSize - c.minBundleSize), [s == null ? void 0 : s.rules]), m = B(() => Math.max(0, Z - C), [C, Z]), rt = B(() => {
|
|
979
|
+
let a = null;
|
|
980
|
+
for (const c of A)
|
|
981
|
+
C >= c.minBundleSize && (a = c);
|
|
982
|
+
return a;
|
|
983
|
+
}, [C, A]), lt = B(() => {
|
|
984
|
+
if (!rt) return null;
|
|
985
|
+
const a = Number.parseFloat(rt.discountPercent);
|
|
986
|
+
return !Number.isFinite(a) || a <= 0 ? null : a;
|
|
987
|
+
}, [rt]), St = B(() => {
|
|
988
|
+
const a = A[0];
|
|
989
|
+
if (!a) return null;
|
|
990
|
+
const c = Number.parseFloat(a.discountPercent);
|
|
991
|
+
return !Number.isFinite(c) || c <= 0 ? null : c;
|
|
992
|
+
}, [A]), vt = lt ?? St, Bt = B(() => {
|
|
993
|
+
const a = new Map(p.map((d) => [d.id, d]));
|
|
994
|
+
let c = 0;
|
|
995
|
+
for (const [d, b] of Object.entries(v)) {
|
|
996
|
+
const w = b ?? 0;
|
|
997
|
+
if (w <= 0) continue;
|
|
998
|
+
const I = a.get(d), g = Number(I == null ? void 0 : I.price);
|
|
999
|
+
Number.isFinite(g) && (c += g * w);
|
|
944
1000
|
}
|
|
945
|
-
return Math.round(
|
|
946
|
-
}, [
|
|
947
|
-
if (!
|
|
948
|
-
const
|
|
949
|
-
return Math.round(
|
|
950
|
-
}, [
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
}, [
|
|
954
|
-
var
|
|
955
|
-
const
|
|
956
|
-
for (const d of
|
|
1001
|
+
return Math.round(c * 100) / 100;
|
|
1002
|
+
}, [p, v]), be = B(() => {
|
|
1003
|
+
if (!lt) return Bt;
|
|
1004
|
+
const a = Bt * (1 - lt / 100);
|
|
1005
|
+
return Math.round(a * 100) / 100;
|
|
1006
|
+
}, [lt, Bt]), Xt = B(() => A.length ? Math.max(...A.map((a) => a.minBundleSize)) : 0, [A]), $t = B(() => {
|
|
1007
|
+
const a = new Map(p.map((c) => [c.id, c]));
|
|
1008
|
+
return O.map((c) => a.get(c)).filter((c) => !!c);
|
|
1009
|
+
}, [p, O]), we = B(() => {
|
|
1010
|
+
var c;
|
|
1011
|
+
const a = /* @__PURE__ */ new Map();
|
|
1012
|
+
for (const d of A) {
|
|
957
1013
|
const b = Math.max(0, d.minBundleSize - 1);
|
|
958
|
-
|
|
1014
|
+
a.set(b, {
|
|
959
1015
|
discountPercent: d.discountPercent,
|
|
960
1016
|
minBundleSize: d.minBundleSize,
|
|
961
|
-
label: ((
|
|
1017
|
+
label: ((c = d.label) == null ? void 0 : c.trim()) || `Buy ${d.minBundleSize}+`
|
|
962
1018
|
});
|
|
963
1019
|
}
|
|
964
|
-
return
|
|
965
|
-
}, [
|
|
966
|
-
|
|
967
|
-
if (((
|
|
968
|
-
const
|
|
969
|
-
|
|
1020
|
+
return a;
|
|
1021
|
+
}, [A]), ye = B(() => Math.max(Xt || Z, $t.length), [$t.length, Xt, Z]), [Ut, Zt] = N(!0), Jt = z(m);
|
|
1022
|
+
E(() => {
|
|
1023
|
+
if (((s == null ? void 0 : s.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
|
|
1024
|
+
const c = Jt.current > 0;
|
|
1025
|
+
Zt(!(c && m === 0));
|
|
970
1026
|
}
|
|
971
|
-
|
|
972
|
-
}, [
|
|
973
|
-
const
|
|
974
|
-
const
|
|
975
|
-
if (!
|
|
976
|
-
const d =
|
|
1027
|
+
Jt.current = m;
|
|
1028
|
+
}, [m, s == null ? void 0 : s.ctaButtonMode]);
|
|
1029
|
+
const zt = z(null), te = z(null), ee = z(null), ne = z(C), re = (a) => {
|
|
1030
|
+
const c = te.current;
|
|
1031
|
+
if (!c) return;
|
|
1032
|
+
const d = c.querySelector(`[data-variant-row="${a}"]`);
|
|
977
1033
|
if (!d) return;
|
|
978
|
-
const b =
|
|
979
|
-
if (
|
|
980
|
-
const
|
|
981
|
-
|
|
1034
|
+
const b = c.getBoundingClientRect(), w = d.getBoundingClientRect(), I = 8;
|
|
1035
|
+
if (w.top >= b.top + I && w.bottom <= b.bottom - I) return;
|
|
1036
|
+
const S = Math.max(0, c.scrollHeight - c.clientHeight), G = w.top - b.top + w.height / 2, X = c.scrollTop + G - c.clientHeight / 2, ot = Math.min(S, Math.max(0, X));
|
|
1037
|
+
c.scrollTo({ top: ot, behavior: "smooth" });
|
|
982
1038
|
};
|
|
983
|
-
return
|
|
1039
|
+
return E(() => {
|
|
984
1040
|
if (!t) return;
|
|
985
|
-
const
|
|
986
|
-
|
|
1041
|
+
const a = (c) => {
|
|
1042
|
+
c.key === "Escape" && e();
|
|
987
1043
|
};
|
|
988
|
-
return window.addEventListener("keydown",
|
|
989
|
-
}, [e, t]),
|
|
1044
|
+
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
1045
|
+
}, [e, t]), E(() => {
|
|
990
1046
|
if (typeof window > "u") return;
|
|
991
|
-
const
|
|
992
|
-
return
|
|
993
|
-
}, []),
|
|
994
|
-
if (
|
|
995
|
-
|
|
1047
|
+
const a = () => kt({ width: window.innerWidth, height: window.innerHeight });
|
|
1048
|
+
return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
|
|
1049
|
+
}, []), E(() => {
|
|
1050
|
+
if (F.current != null && (window.clearTimeout(F.current), F.current = null), t) {
|
|
1051
|
+
k(!0);
|
|
996
1052
|
return;
|
|
997
1053
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1054
|
+
F.current = window.setTimeout(() => {
|
|
1055
|
+
k(!1), F.current = null;
|
|
1000
1056
|
}, 220);
|
|
1001
|
-
}, [t]),
|
|
1002
|
-
|
|
1003
|
-
}, []),
|
|
1057
|
+
}, [t]), E(() => () => {
|
|
1058
|
+
F.current != null && window.clearTimeout(F.current);
|
|
1059
|
+
}, []), E(() => () => {
|
|
1004
1060
|
J.current != null && window.clearTimeout(J.current);
|
|
1005
|
-
}, []),
|
|
1061
|
+
}, []), E(() => () => {
|
|
1006
1062
|
et.current != null && window.clearTimeout(et.current);
|
|
1007
|
-
}, []),
|
|
1008
|
-
if (!t || !
|
|
1009
|
-
const
|
|
1010
|
-
var
|
|
1011
|
-
return (
|
|
1063
|
+
}, []), E(() => {
|
|
1064
|
+
if (!t || !T) return;
|
|
1065
|
+
const a = requestAnimationFrame(() => {
|
|
1066
|
+
var c;
|
|
1067
|
+
return (c = ht.current) == null ? void 0 : c.focus();
|
|
1012
1068
|
});
|
|
1013
|
-
return () => cancelAnimationFrame(
|
|
1014
|
-
}, [t,
|
|
1015
|
-
const
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1018
|
-
if (!
|
|
1019
|
-
const d =
|
|
1020
|
-
if (
|
|
1021
|
-
const
|
|
1022
|
-
const
|
|
1023
|
-
if (!
|
|
1024
|
-
const
|
|
1069
|
+
return () => cancelAnimationFrame(a);
|
|
1070
|
+
}, [t, T]), E(() => {
|
|
1071
|
+
const a = ne.current;
|
|
1072
|
+
if (ne.current = C, C <= a) return;
|
|
1073
|
+
const c = ee.current;
|
|
1074
|
+
if (!c) return;
|
|
1075
|
+
const d = A.some((g) => g.minBundleSize === C), b = A.find((g) => g.minBundleSize > C), w = b && d ? b.minBundleSize - 1 : b ? null : C - 1;
|
|
1076
|
+
if (w == null || w < 0) return;
|
|
1077
|
+
const I = requestAnimationFrame(() => {
|
|
1078
|
+
const g = c.querySelector(`[data-box-slot="${w}"]`);
|
|
1079
|
+
if (!g) return;
|
|
1080
|
+
const S = c.getBoundingClientRect(), X = g.getBoundingClientRect().right - S.right;
|
|
1025
1081
|
if (X <= 1) return;
|
|
1026
|
-
const ot = Math.max(0,
|
|
1027
|
-
|
|
1082
|
+
const ot = Math.max(0, c.scrollWidth - c.clientWidth), yt = Math.min(ot, Math.max(0, c.scrollLeft + X));
|
|
1083
|
+
c.scrollTo({ left: yt, behavior: "smooth" });
|
|
1028
1084
|
});
|
|
1029
|
-
return () => cancelAnimationFrame(
|
|
1030
|
-
}, [
|
|
1085
|
+
return () => cancelAnimationFrame(I);
|
|
1086
|
+
}, [C, A]), E(() => {
|
|
1031
1087
|
if (!t) return;
|
|
1032
|
-
const
|
|
1033
|
-
if (bt.current =
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
},
|
|
1038
|
-
}, [
|
|
1039
|
-
if (!t || !
|
|
1040
|
-
const
|
|
1041
|
-
var
|
|
1042
|
-
const
|
|
1043
|
-
x:
|
|
1044
|
-
y:
|
|
1088
|
+
const a = bt.current;
|
|
1089
|
+
if (bt.current = C, C <= a) return;
|
|
1090
|
+
const c = A.find((d) => d.minBundleSize === C);
|
|
1091
|
+
c && (gt(`You received a ${$(c.discountPercent)}% discount!`), at((d) => d + 1), Ct(!0), et.current != null && window.clearTimeout(et.current), et.current = window.setTimeout(() => {
|
|
1092
|
+
Ct(!1), et.current = null;
|
|
1093
|
+
}, qt));
|
|
1094
|
+
}, [C, t, A]), E(() => {
|
|
1095
|
+
if (!t || !st || !tt) return;
|
|
1096
|
+
const a = requestAnimationFrame(() => {
|
|
1097
|
+
var S;
|
|
1098
|
+
const c = _t.current, d = c == null ? void 0 : c.getBoundingClientRect(), b = (S = zt.current) == null ? void 0 : S.getBoundingClientRect(), w = d ? d.left + d.width / 2 : b ? b.left + b.width / 2 : window.innerWidth / 2, I = d ? d.top + d.height / 2 : b ? b.top + b.height / 2 : window.innerHeight / 2, g = {
|
|
1099
|
+
x: w - 2,
|
|
1100
|
+
y: I - 2,
|
|
1045
1101
|
w: 4,
|
|
1046
1102
|
h: 4
|
|
1047
1103
|
};
|
|
1048
|
-
|
|
1104
|
+
Pt(g), Ot((G) => G + 1), pt(!0), J.current != null && window.clearTimeout(J.current), J.current = window.setTimeout(() => {
|
|
1049
1105
|
pt(!1), J.current = null;
|
|
1050
|
-
},
|
|
1106
|
+
}, K);
|
|
1051
1107
|
});
|
|
1052
|
-
return () => cancelAnimationFrame(
|
|
1053
|
-
}, [
|
|
1054
|
-
var
|
|
1055
|
-
t && ((
|
|
1056
|
-
}, [t]),
|
|
1108
|
+
return () => cancelAnimationFrame(a);
|
|
1109
|
+
}, [xt, tt, K, st, t]), E(() => {
|
|
1110
|
+
var a;
|
|
1111
|
+
t && ((a = zt.current) == null || a.focus());
|
|
1112
|
+
}, [t]), It ? /* @__PURE__ */ M(
|
|
1057
1113
|
"div",
|
|
1058
1114
|
{
|
|
1059
1115
|
role: "dialog",
|
|
1060
1116
|
"aria-modal": "true",
|
|
1061
1117
|
"aria-label": "Bundle builder",
|
|
1062
1118
|
className: [u.backdrop, t ? u.backdropOpen : u.backdropClosed, i.className].filter(Boolean).join(" "),
|
|
1063
|
-
onMouseDown: (
|
|
1064
|
-
|
|
1119
|
+
onMouseDown: (a) => {
|
|
1120
|
+
a.target === a.currentTarget && e();
|
|
1065
1121
|
},
|
|
1066
1122
|
children: [
|
|
1067
|
-
|
|
1068
|
-
|
|
1123
|
+
At && mt && ft.width > 0 && ft.height > 0 ? /* @__PURE__ */ h(
|
|
1124
|
+
De,
|
|
1069
1125
|
{
|
|
1070
|
-
width:
|
|
1071
|
-
height:
|
|
1072
|
-
confettiSource:
|
|
1073
|
-
colors:
|
|
1074
|
-
"#2563eb",
|
|
1075
|
-
// blue-600
|
|
1076
|
-
"#3b82f6",
|
|
1077
|
-
// blue-500
|
|
1078
|
-
"#60a5fa",
|
|
1079
|
-
// blue-400
|
|
1080
|
-
"#93c5fd",
|
|
1081
|
-
// blue-300
|
|
1082
|
-
"#bae6fd",
|
|
1083
|
-
// blue-200
|
|
1084
|
-
"#e0f2fe"
|
|
1085
|
-
// blue-100
|
|
1086
|
-
],
|
|
1126
|
+
width: ft.width,
|
|
1127
|
+
height: ft.height,
|
|
1128
|
+
confettiSource: mt,
|
|
1129
|
+
colors: x,
|
|
1087
1130
|
recycle: !1,
|
|
1088
1131
|
numberOfPieces: 70,
|
|
1089
1132
|
tweenDuration: 100,
|
|
@@ -1092,27 +1135,27 @@ function or(i) {
|
|
|
1092
1135
|
initialVelocityX: { min: -6, max: 6 },
|
|
1093
1136
|
style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
|
|
1094
1137
|
},
|
|
1095
|
-
|
|
1138
|
+
Mt
|
|
1096
1139
|
) : null,
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
|
|
1099
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ M("aside", { ref: zt, className: [u.panel, t ? u.panelOpen : u.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
|
|
1141
|
+
st && tt ? /* @__PURE__ */ h("div", { className: u.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ h("div", { ref: _t, className: u.celebrationChip, children: tt }, xt) }) : null,
|
|
1142
|
+
/* @__PURE__ */ M("header", { className: [u.header, T ? u.headerSearchOpen : null].filter(Boolean).join(" "), children: [
|
|
1100
1143
|
/* @__PURE__ */ h(
|
|
1101
1144
|
"button",
|
|
1102
1145
|
{
|
|
1103
1146
|
type: "button",
|
|
1104
1147
|
className: u.searchIconButton,
|
|
1105
|
-
"aria-label":
|
|
1106
|
-
"aria-expanded":
|
|
1148
|
+
"aria-label": T ? "Search (expanded)" : "Search",
|
|
1149
|
+
"aria-expanded": T,
|
|
1107
1150
|
onClick: () => {
|
|
1108
1151
|
R(!0);
|
|
1109
1152
|
},
|
|
1110
|
-
children: /* @__PURE__ */ h(
|
|
1153
|
+
children: /* @__PURE__ */ h(je, { size: 18, "aria-hidden": "true" })
|
|
1111
1154
|
}
|
|
1112
1155
|
),
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */ h("div", { className: u.headerTitleWrap, "aria-hidden":
|
|
1115
|
-
/* @__PURE__ */ h("div", { className: u.headerSearchWrap, "aria-hidden": !
|
|
1156
|
+
/* @__PURE__ */ M("div", { className: u.headerCenter, children: [
|
|
1157
|
+
/* @__PURE__ */ h("div", { className: u.headerTitleWrap, "aria-hidden": T, children: /* @__PURE__ */ h("h2", { className: u.title, children: ct }) }),
|
|
1158
|
+
/* @__PURE__ */ h("div", { className: u.headerSearchWrap, "aria-hidden": !T, children: /* @__PURE__ */ M("div", { className: u.searchBar, children: [
|
|
1116
1159
|
/* @__PURE__ */ h(
|
|
1117
1160
|
"input",
|
|
1118
1161
|
{
|
|
@@ -1121,7 +1164,7 @@ function or(i) {
|
|
|
1121
1164
|
type: "search",
|
|
1122
1165
|
value: j,
|
|
1123
1166
|
placeholder: "Search",
|
|
1124
|
-
onChange: (
|
|
1167
|
+
onChange: (a) => y(a.target.value),
|
|
1125
1168
|
onBlur: () => {
|
|
1126
1169
|
j.trim() === "" && R(!1);
|
|
1127
1170
|
}
|
|
@@ -1132,12 +1175,12 @@ function or(i) {
|
|
|
1132
1175
|
{
|
|
1133
1176
|
type: "button",
|
|
1134
1177
|
className: u.searchClearButton,
|
|
1135
|
-
onMouseDown: (
|
|
1136
|
-
|
|
1178
|
+
onMouseDown: (a) => {
|
|
1179
|
+
a.preventDefault();
|
|
1137
1180
|
},
|
|
1138
1181
|
onClick: () => {
|
|
1139
|
-
var
|
|
1140
|
-
|
|
1182
|
+
var a;
|
|
1183
|
+
y(""), (a = ht.current) == null || a.focus();
|
|
1141
1184
|
},
|
|
1142
1185
|
"aria-label": "Clear search",
|
|
1143
1186
|
children: "Clear"
|
|
@@ -1147,96 +1190,96 @@ function or(i) {
|
|
|
1147
1190
|
] }),
|
|
1148
1191
|
/* @__PURE__ */ h("button", { type: "button", onClick: e, disabled: r, className: u.closeButton, "aria-label": "Close", children: "×" })
|
|
1149
1192
|
] }),
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
|
|
1193
|
+
/* @__PURE__ */ M("div", { className: u.body, ref: te, children: [
|
|
1194
|
+
o ? /* @__PURE__ */ h("p", { className: u.muted, children: "Loading…" }) : null,
|
|
1152
1195
|
n ? /* @__PURE__ */ h("p", { className: u.error, children: n }) : null,
|
|
1153
|
-
!
|
|
1154
|
-
/* @__PURE__ */ h("div", { className: u.variants, children: /* @__PURE__ */ h("ul", { className: u.variantList, children:
|
|
1155
|
-
var X, ot,
|
|
1156
|
-
const
|
|
1157
|
-
return /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */ h("div", { className: u.variantThumb, "aria-hidden": "true", children: (X =
|
|
1196
|
+
!o && s && !s.isActive ? /* @__PURE__ */ h("p", { className: u.error, children: "Bundles are not active." }) : null,
|
|
1197
|
+
/* @__PURE__ */ h("div", { className: u.variants, children: /* @__PURE__ */ h("ul", { className: u.variantList, children: wt.map((a) => {
|
|
1198
|
+
var X, ot, yt, Tt;
|
|
1199
|
+
const c = v[a.id] ?? 0, d = H(a), b = _(a.selectedOptions), w = U(a), I = vt, g = Number(a.price), S = I != null && Number.isFinite(I) && I > 0 && Number.isFinite(g), G = S ? Math.round(g * (1 - I / 100) * 100) / 100 : null;
|
|
1200
|
+
return /* @__PURE__ */ M("li", { className: u.variantRow, "data-variant-row": a.id, children: [
|
|
1201
|
+
/* @__PURE__ */ M("div", { className: u.variantLeft, children: [
|
|
1202
|
+
/* @__PURE__ */ h("div", { className: u.variantThumb, "aria-hidden": "true", children: (X = a.image) != null && X.url ? /* @__PURE__ */ h(
|
|
1160
1203
|
"img",
|
|
1161
1204
|
{
|
|
1162
1205
|
className: u.variantThumbImg,
|
|
1163
|
-
src:
|
|
1164
|
-
alt:
|
|
1206
|
+
src: a.image.url,
|
|
1207
|
+
alt: a.image.altText ?? w,
|
|
1165
1208
|
loading: "lazy"
|
|
1166
1209
|
}
|
|
1167
|
-
) : /* @__PURE__ */ h("div", { className: u.variantThumbFallback, children: ((
|
|
1168
|
-
/* @__PURE__ */
|
|
1210
|
+
) : /* @__PURE__ */ h("div", { className: u.variantThumbFallback, children: ((Tt = (yt = (ot = a.product) == null ? void 0 : ot.title) == null ? void 0 : yt.slice(0, 1)) == null ? void 0 : Tt.toUpperCase()) ?? "•" }) }),
|
|
1211
|
+
/* @__PURE__ */ M("div", { className: u.variantInfo, children: [
|
|
1169
1212
|
/* @__PURE__ */ h("div", { className: u.variantName, children: d }),
|
|
1170
1213
|
b ? /* @__PURE__ */ h("div", { className: u.variantMeta, children: b }) : null,
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
-
|
|
1173
|
-
/* @__PURE__ */ h("span", { className: u.variantPrice, children:
|
|
1174
|
-
|
|
1214
|
+
/* @__PURE__ */ M("div", { className: u.variantPriceRow, children: [
|
|
1215
|
+
S ? /* @__PURE__ */ h("span", { className: u.variantCompareAt, children: D(Number.isFinite(g) ? g.toFixed(2) : a.price) }) : null,
|
|
1216
|
+
/* @__PURE__ */ h("span", { className: u.variantPrice, children: D(
|
|
1217
|
+
G != null ? G.toFixed(2) : Number.isFinite(g) ? g.toFixed(2) : a.price
|
|
1175
1218
|
) })
|
|
1176
1219
|
] })
|
|
1177
1220
|
] })
|
|
1178
1221
|
] }),
|
|
1179
|
-
|
|
1222
|
+
c <= 0 ? /* @__PURE__ */ h(
|
|
1180
1223
|
"button",
|
|
1181
1224
|
{
|
|
1182
1225
|
type: "button",
|
|
1183
|
-
onClick: () =>
|
|
1184
|
-
disabled: r ||
|
|
1226
|
+
onClick: () => P(a.id, 1),
|
|
1227
|
+
disabled: r || V,
|
|
1185
1228
|
className: u.addToBundleButton,
|
|
1186
|
-
"aria-label": `Add ${
|
|
1229
|
+
"aria-label": `Add ${w} to bundle`,
|
|
1187
1230
|
children: "Add"
|
|
1188
1231
|
}
|
|
1189
|
-
) : /* @__PURE__ */
|
|
1232
|
+
) : /* @__PURE__ */ M("div", { className: u.qtyControls, children: [
|
|
1190
1233
|
/* @__PURE__ */ h(
|
|
1191
1234
|
"button",
|
|
1192
1235
|
{
|
|
1193
1236
|
type: "button",
|
|
1194
|
-
onClick: () =>
|
|
1195
|
-
disabled: r ||
|
|
1237
|
+
onClick: () => P(a.id, c - 1),
|
|
1238
|
+
disabled: r || c <= 0,
|
|
1196
1239
|
className: u.qtyButton,
|
|
1197
|
-
"aria-label": `Decrease ${
|
|
1240
|
+
"aria-label": `Decrease ${w}`,
|
|
1198
1241
|
children: "−"
|
|
1199
1242
|
}
|
|
1200
1243
|
),
|
|
1201
|
-
/* @__PURE__ */ h("span", { className: u.qtyValue, "aria-label": `Quantity ${
|
|
1244
|
+
/* @__PURE__ */ h("span", { className: u.qtyValue, "aria-label": `Quantity ${c}`, children: c }),
|
|
1202
1245
|
/* @__PURE__ */ h(
|
|
1203
1246
|
"button",
|
|
1204
1247
|
{
|
|
1205
1248
|
type: "button",
|
|
1206
|
-
onClick: () =>
|
|
1207
|
-
disabled: r ||
|
|
1249
|
+
onClick: () => P(a.id, c + 1),
|
|
1250
|
+
disabled: r || V,
|
|
1208
1251
|
className: u.qtyButton,
|
|
1209
|
-
"aria-label": `Increase ${
|
|
1252
|
+
"aria-label": `Increase ${w}`,
|
|
1210
1253
|
children: "+"
|
|
1211
1254
|
}
|
|
1212
1255
|
)
|
|
1213
1256
|
] })
|
|
1214
|
-
] },
|
|
1257
|
+
] }, a.id);
|
|
1215
1258
|
}) }) })
|
|
1216
1259
|
] }),
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */ h("div", { className: u.boxSummaryWindow, ref:
|
|
1219
|
-
var X, ot,
|
|
1220
|
-
const d =
|
|
1221
|
-
return /* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ M("footer", { className: u.footer, ref: it, children: [
|
|
1261
|
+
/* @__PURE__ */ h("div", { className: u.boxSummaryWindow, ref: ee, children: /* @__PURE__ */ h("div", { className: u.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ye }).map((a, c) => {
|
|
1262
|
+
var X, ot, yt, Tt;
|
|
1263
|
+
const d = $t[c], b = we.get(c), w = !!d, I = !!b, g = I && !w, S = b ? `${b.discountPercent}% off` : null, G = w ? d.displayName : `Slot ${c + 1}`;
|
|
1264
|
+
return /* @__PURE__ */ M("div", { "data-box-slot": c, className: u.boxSlot, children: [
|
|
1222
1265
|
/* @__PURE__ */ h(
|
|
1223
1266
|
"div",
|
|
1224
1267
|
{
|
|
1225
1268
|
className: [
|
|
1226
1269
|
u.boxItem,
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1270
|
+
w ? u.boxItemFilled : u.boxItemPlaceholder,
|
|
1271
|
+
I ? u.boxItemThreshold : null,
|
|
1272
|
+
w ? u.boxItemClickable : null
|
|
1230
1273
|
].filter(Boolean).join(" "),
|
|
1231
|
-
role:
|
|
1232
|
-
tabIndex:
|
|
1233
|
-
onClick:
|
|
1234
|
-
onKeyDown:
|
|
1235
|
-
(
|
|
1274
|
+
role: w ? "button" : void 0,
|
|
1275
|
+
tabIndex: w ? 0 : void 0,
|
|
1276
|
+
onClick: w ? () => re(d.id) : void 0,
|
|
1277
|
+
onKeyDown: w ? (Wt) => {
|
|
1278
|
+
(Wt.key === "Enter" || Wt.key === " ") && (Wt.preventDefault(), re(d.id));
|
|
1236
1279
|
} : void 0,
|
|
1237
|
-
"aria-label":
|
|
1238
|
-
title:
|
|
1239
|
-
children:
|
|
1280
|
+
"aria-label": g && S ? `${G}. Unlocks ${S}.` : G,
|
|
1281
|
+
title: g && S ? `${G} • Unlocks ${S}` : G,
|
|
1282
|
+
children: w ? (X = d.image) != null && X.url ? /* @__PURE__ */ h(
|
|
1240
1283
|
"img",
|
|
1241
1284
|
{
|
|
1242
1285
|
className: u.boxItemImage,
|
|
@@ -1244,40 +1287,40 @@ function or(i) {
|
|
|
1244
1287
|
alt: d.image.altText ?? d.displayName,
|
|
1245
1288
|
loading: "lazy"
|
|
1246
1289
|
}
|
|
1247
|
-
) : /* @__PURE__ */ h("div", { className: u.boxItemFallback, "aria-hidden": "true", children: ((
|
|
1290
|
+
) : /* @__PURE__ */ h("div", { className: u.boxItemFallback, "aria-hidden": "true", children: ((Tt = (yt = (ot = d.product) == null ? void 0 : ot.title) == null ? void 0 : yt.slice(0, 1)) == null ? void 0 : Tt.toUpperCase()) ?? "•" }) : g && S ? /* @__PURE__ */ h("div", { className: u.boxItemDiscountText, children: S }) : /* @__PURE__ */ h("div", { className: u.boxItemPlus, "aria-hidden": "true", children: "+" })
|
|
1248
1291
|
}
|
|
1249
1292
|
),
|
|
1250
|
-
|
|
1251
|
-
] },
|
|
1293
|
+
I ? /* @__PURE__ */ h("div", { className: u.boxThresholdLabel, children: b.label }) : null
|
|
1294
|
+
] }, c);
|
|
1252
1295
|
}) }) }),
|
|
1253
1296
|
/* @__PURE__ */ h(
|
|
1254
1297
|
"div",
|
|
1255
1298
|
{
|
|
1256
|
-
className: [u.ctaTotalsWrap,
|
|
1257
|
-
"aria-hidden":
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1259
|
-
|
|
1260
|
-
|
|
1299
|
+
className: [u.ctaTotalsWrap, m <= 0 ? u.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
|
|
1300
|
+
"aria-hidden": m > 0,
|
|
1301
|
+
children: /* @__PURE__ */ M("div", { className: u.ctaTotals, "aria-label": "Totals", children: [
|
|
1302
|
+
vt ? /* @__PURE__ */ M("span", { className: u.ctaDiscountBadge, children: [
|
|
1303
|
+
vt,
|
|
1261
1304
|
"% Discount"
|
|
1262
1305
|
] }) : /* @__PURE__ */ h("span", {}),
|
|
1263
|
-
/* @__PURE__ */ h("span", { children:
|
|
1264
|
-
/* @__PURE__ */ h("span", { className: u.ctaTotalsStrike, children:
|
|
1306
|
+
/* @__PURE__ */ h("span", { children: lt ? /* @__PURE__ */ M(_e, { children: [
|
|
1307
|
+
/* @__PURE__ */ h("span", { className: u.ctaTotalsStrike, children: D(Bt.toFixed(2)) }),
|
|
1265
1308
|
" ",
|
|
1266
|
-
/* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children:
|
|
1267
|
-
] }) : /* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children:
|
|
1309
|
+
/* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children: D(be.toFixed(2)) })
|
|
1310
|
+
] }) : /* @__PURE__ */ h("span", { className: u.ctaTotalsPrice, children: D(Bt.toFixed(2)) }) })
|
|
1268
1311
|
] })
|
|
1269
1312
|
}
|
|
1270
1313
|
),
|
|
1271
1314
|
(() => {
|
|
1272
|
-
const
|
|
1273
|
-
return
|
|
1315
|
+
const a = (s == null ? void 0 : s.ctaButtonMode) || "add_to_cart";
|
|
1316
|
+
return a === "add_to_cart_checkout" ? m > 0 ? /* @__PURE__ */ h("button", { type: "button", onClick: Y, disabled: !L, className: u.cta, children: r ? "Adding…" : `Add ${m} more product${m === 1 ? "" : "s"}` }) : /* @__PURE__ */ M("div", { className: `${u.ctaButtonGroup} ${Ut ? u.ctaButtonGroupAnimating : ""}`, children: [
|
|
1274
1317
|
/* @__PURE__ */ h(
|
|
1275
1318
|
"button",
|
|
1276
1319
|
{
|
|
1277
1320
|
type: "button",
|
|
1278
|
-
onClick:
|
|
1279
|
-
disabled: !
|
|
1280
|
-
className: `${u.ctaDualLeft} ${
|
|
1321
|
+
onClick: Y,
|
|
1322
|
+
disabled: !L,
|
|
1323
|
+
className: `${u.ctaDualLeft} ${Ut ? u.ctaDualLeftAnimating : ""}`,
|
|
1281
1324
|
children: /* @__PURE__ */ h("span", { children: r ? "Adding…" : "Add to Basket" })
|
|
1282
1325
|
}
|
|
1283
1326
|
),
|
|
@@ -1285,15 +1328,15 @@ function or(i) {
|
|
|
1285
1328
|
"button",
|
|
1286
1329
|
{
|
|
1287
1330
|
type: "button",
|
|
1288
|
-
onClick:
|
|
1289
|
-
disabled: !
|
|
1290
|
-
className: `${u.ctaDualRight} ${
|
|
1331
|
+
onClick: q,
|
|
1332
|
+
disabled: !L,
|
|
1333
|
+
className: `${u.ctaDualRight} ${Ut ? u.ctaDualRightAnimating : ""}`,
|
|
1291
1334
|
children: /* @__PURE__ */ h("span", { children: r ? "Processing…" : "Checkout" })
|
|
1292
1335
|
}
|
|
1293
1336
|
)
|
|
1294
|
-
] }) :
|
|
1337
|
+
] }) : a === "checkout" ? /* @__PURE__ */ h("button", { type: "button", onClick: q, disabled: !L, className: u.cta, children: r ? "Processing…" : m > 0 ? `Add ${m} more product${m === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ h("button", { type: "button", onClick: Y, disabled: !L, className: u.cta, children: r ? "Adding…" : m > 0 ? `Add ${m} more product${m === 1 ? "" : "s"}` : "Add to Basket" });
|
|
1295
1338
|
})(),
|
|
1296
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ M("div", { className: u.poweredBy, children: [
|
|
1297
1340
|
"powered by ",
|
|
1298
1341
|
/* @__PURE__ */ h("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
|
|
1299
1342
|
] })
|
|
@@ -1303,30 +1346,30 @@ function or(i) {
|
|
|
1303
1346
|
}
|
|
1304
1347
|
) : null;
|
|
1305
1348
|
}
|
|
1306
|
-
function
|
|
1349
|
+
function Gt(i) {
|
|
1307
1350
|
if (i != null && i.length)
|
|
1308
1351
|
return i.reduce((t, e) => (e != null && e.key && (t[e.key] = e.value ?? ""), t), {});
|
|
1309
1352
|
}
|
|
1310
|
-
function
|
|
1353
|
+
function he(i) {
|
|
1311
1354
|
const t = /\/(\d+)$/.exec(i);
|
|
1312
1355
|
return t ? t[1] : i;
|
|
1313
1356
|
}
|
|
1314
|
-
function
|
|
1357
|
+
function ir() {
|
|
1315
1358
|
var i;
|
|
1316
1359
|
return ((i = window == null ? void 0 : window.routes) == null ? void 0 : i.cart_url) || "/cart";
|
|
1317
1360
|
}
|
|
1318
|
-
async function
|
|
1361
|
+
async function ar() {
|
|
1319
1362
|
try {
|
|
1320
|
-
const i =
|
|
1363
|
+
const i = ir(), t = encodeURIComponent("cart-drawer,cart-icon-bubble,cart-live-region-text"), e = await fetch(`${i}?sections=${t}`, { method: "GET" });
|
|
1321
1364
|
if (!e.ok) return;
|
|
1322
|
-
const
|
|
1323
|
-
if (!
|
|
1365
|
+
const o = await e.json().catch(() => null);
|
|
1366
|
+
if (!o) return;
|
|
1324
1367
|
const r = ["cart-drawer", "cart-icon-bubble", "cart-live-region-text"];
|
|
1325
|
-
for (const
|
|
1326
|
-
const
|
|
1327
|
-
if (!
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1368
|
+
for (const s of r) {
|
|
1369
|
+
const p = o[s];
|
|
1370
|
+
if (!p) continue;
|
|
1371
|
+
const v = new DOMParser().parseFromString(p, "text/html"), O = v.getElementById(s) || v.querySelector(s), P = document.getElementById(s) || document.querySelector(s);
|
|
1372
|
+
P && O && P.replaceWith(O);
|
|
1330
1373
|
}
|
|
1331
1374
|
const n = document.querySelector("cart-drawer");
|
|
1332
1375
|
if (n && typeof n.open == "function") {
|
|
@@ -1339,7 +1382,7 @@ async function tr() {
|
|
|
1339
1382
|
} catch {
|
|
1340
1383
|
}
|
|
1341
1384
|
}
|
|
1342
|
-
async function
|
|
1385
|
+
async function Et(i, t) {
|
|
1343
1386
|
const e = await fetch(i, {
|
|
1344
1387
|
method: "POST",
|
|
1345
1388
|
headers: {
|
|
@@ -1349,44 +1392,44 @@ async function Dt(i, t) {
|
|
|
1349
1392
|
body: JSON.stringify(t)
|
|
1350
1393
|
});
|
|
1351
1394
|
if (!e.ok) {
|
|
1352
|
-
const
|
|
1353
|
-
throw new Error(
|
|
1395
|
+
const o = await e.text().catch(() => "");
|
|
1396
|
+
throw new Error(o || `Cart request failed: ${e.status}`);
|
|
1354
1397
|
}
|
|
1355
1398
|
return e.json().catch(() => null);
|
|
1356
1399
|
}
|
|
1357
|
-
function
|
|
1400
|
+
function fr() {
|
|
1358
1401
|
return {
|
|
1359
1402
|
async linesAdd(i) {
|
|
1360
1403
|
const t = i.map((e) => ({
|
|
1361
|
-
id:
|
|
1404
|
+
id: he(e.merchandiseId),
|
|
1362
1405
|
quantity: e.quantity,
|
|
1363
|
-
properties:
|
|
1406
|
+
properties: Gt(e.attributes)
|
|
1364
1407
|
}));
|
|
1365
|
-
await
|
|
1408
|
+
await Et("/cart/add.js", { items: t });
|
|
1366
1409
|
},
|
|
1367
1410
|
async linesAddForCheckout(i) {
|
|
1368
1411
|
const t = i.map((e) => ({
|
|
1369
|
-
id:
|
|
1412
|
+
id: he(e.merchandiseId),
|
|
1370
1413
|
quantity: e.quantity,
|
|
1371
|
-
properties:
|
|
1414
|
+
properties: Gt(e.attributes)
|
|
1372
1415
|
}));
|
|
1373
|
-
await
|
|
1416
|
+
await Et("/cart/add.js", { items: t });
|
|
1374
1417
|
},
|
|
1375
1418
|
async linesUpdate(i) {
|
|
1376
1419
|
for (const t of i)
|
|
1377
|
-
await
|
|
1420
|
+
await Et("/cart/change.js", {
|
|
1378
1421
|
id: t.id,
|
|
1379
1422
|
quantity: t.quantity,
|
|
1380
|
-
properties:
|
|
1423
|
+
properties: Gt(t.attributes)
|
|
1381
1424
|
});
|
|
1382
1425
|
},
|
|
1383
1426
|
async linesRemove(i) {
|
|
1384
1427
|
for (const t of i)
|
|
1385
|
-
await
|
|
1428
|
+
await Et("/cart/change.js", { id: t, quantity: 0 });
|
|
1386
1429
|
},
|
|
1387
1430
|
openCartUI() {
|
|
1388
1431
|
window.setTimeout(() => {
|
|
1389
|
-
|
|
1432
|
+
ar();
|
|
1390
1433
|
}, 0);
|
|
1391
1434
|
},
|
|
1392
1435
|
navigateToCheckout() {
|
|
@@ -1395,12 +1438,12 @@ function sr() {
|
|
|
1395
1438
|
};
|
|
1396
1439
|
}
|
|
1397
1440
|
export {
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1441
|
+
hr as BundleBuilderDrawer,
|
|
1442
|
+
dr as BundleButton,
|
|
1443
|
+
Rt as BundleLineAttributeKeys,
|
|
1444
|
+
lr as BundleProvider,
|
|
1445
|
+
fr as createLiquidCartAdapter,
|
|
1446
|
+
Yt as useBundleBuilder,
|
|
1447
|
+
ur as useBundleBuilderDrawer
|
|
1405
1448
|
};
|
|
1406
1449
|
//# sourceMappingURL=index.js.map
|