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