@best-bundles/bundle-ui 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,30 +1,50 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._button_18rtl_1{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--bb-font-family, inherit);border:1px solid var(--bb-button-border, rgba(0, 0, 0, .12));background:var(--bb-button-bg, #111827);color:var(--bb-button-text, #ffffff);font:inherit;line-height:1;padding:10px 14px;border-radius:var(--bb-button-radius, 10px);cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease,opacity .12s ease}._button_18rtl_1:hover{background:var(--bb-button-bg-hover, #0b1220)}._button_18rtl_1:active{transform:translateY(1px)}._button_18rtl_1:disabled{opacity:.6;cursor:not-allowed}._button_18rtl_1:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._backdrop_18x6y_1{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--bb-backdrop-z-index, 2147483647);display:flex;justify-content:flex-end;background:var(--bb-backdrop-bg, rgba(0, 0, 0, .5));-webkit-backdrop-filter:blur(var(--bb-backdrop-blur, 2px));backdrop-filter:blur(var(--bb-backdrop-blur, 2px));padding:var(--bb-backdrop-padding, 12px);opacity:0;transition:opacity var(--bb-drawer-transition-duration, .22s) ease}._celebrationOverlay_18x6y_14{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:none;z-index:50}._celebrationChip_18x6y_23{font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.03em;font-size:18px;line-height:1;padding:12px 16px;border-radius:999px;color:var(--bb-celebration-text, #0b1b44);background:linear-gradient(180deg,var(--bb-celebration-bg-top, #ffffff),var(--bb-celebration-bg-bottom, #bae6fd));border:2px solid var(--bb-celebration-border, rgba(37, 99, 235, .28));box-shadow:0 18px 55px #0006,0 10px 28px #2563eb33,inset 0 1px #ffffffbf;transform-origin:50% 60%;will-change:transform,opacity,filter;animation:_bbCelebrationPop_18x6y_1 2.8s cubic-bezier(.16,1,.3,1) forwards;filter:saturate(1.05)}@keyframes _bbCelebrationPop_18x6y_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_18x6y_74{opacity:1}._backdropClosed_18x6y_78{opacity:0}._panel_18x6y_82{width:440px;max-width:100%;min-width:0;height:100%;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border-radius:var(--bb-panel-radius, 16px);box-shadow:0 20px 60px #00000059;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;outline:none;position:relative;top:unset;right:unset;bottom:unset;left:unset}._panelOpen_18x6y_103{animation:_bbSlideInFromRight_18x6y_1 var(--bb-drawer-transition-duration, .22s) ease forwards}._panelClosed_18x6y_107{animation:_bbSlideOutToRight_18x6y_1 var(--bb-drawer-transition-duration, .22s) ease forwards}@keyframes _bbSlideInFromRight_18x6y_1{0%{transform:translate(110%)}to{transform:translate(0)}}@keyframes _bbSlideOutToRight_18x6y_1{0%{transform:translate(0)}to{transform:translate(110%)}}@media(prefers-reduced-motion:reduce){._backdrop_18x6y_1{transition:none}._celebrationChip_18x6y_23,._panelOpen_18x6y_103,._panelClosed_18x6y_107{animation:none}}._header_18x6y_146{display:grid;grid-template-columns:36px 1fr 36px;align-items:center;column-gap:12px;padding:var(--bb-header-padding, 16px 16px 12px 16px);border-bottom:1px solid var(--bb-border-color, rgba(17, 24, 39, .08))}._headerCenter_18x6y_155{position:relative;min-width:0;display:flex;justify-content:center;align-items:center}._title_18x6y_163{font-size:24px;margin:0;line-height:1.2;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._searchIconButton_18x6y_172{width:36px;height:36px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0}._searchIconButton_18x6y_172:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchIconButton_18x6y_172:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._headerTitleWrap_18x6y_195{transition:opacity .18s ease,transform .22s ease}._headerSearchWrap_18x6y_199{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:0;transform:translateY(-2px);transition:opacity .18s ease,transform .22s ease}._headerSearchOpen_18x6y_211 ._headerTitleWrap_18x6y_195{opacity:0;transform:translateY(2px);pointer-events:none}._headerSearchOpen_18x6y_211 ._headerSearchWrap_18x6y_199{opacity:1;transform:translateY(0);pointer-events:auto}._searchBar_18x6y_223{width:min(320px,100%);height:36px;display:flex;align-items:center;gap:8px;background:var(--bb-surface-bg, #ffffff);border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));border-radius:10px;padding:0 8px}._searchInput_18x6y_235{width:100%;border:none;outline:none;background:transparent;font:inherit;font-size:14px;min-width:0;height:100%;line-height:36px;padding:0}._searchInput_18x6y_235::-webkit-search-cancel-button,._searchInput_18x6y_235::-webkit-search-decoration,._searchInput_18x6y_235::-webkit-search-results-button,._searchInput_18x6y_235::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}._searchClearButton_18x6y_256{border:none;background:transparent;color:var(--bb-text-color, #111827);font:inherit;font-size:13px;font-weight:700;cursor:pointer;padding:6px;border-radius:10px;line-height:1}._searchClearButton_18x6y_256:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._searchClearButton_18x6y_256:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._closeButton_18x6y_278{border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);width:36px;height:36px;border-radius:10px;cursor:pointer;flex:0 0 auto;padding:0}._closeButton_18x6y_278:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._closeButton_18x6y_278:disabled{opacity:.6;cursor:not-allowed}._closeButton_18x6y_278:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}@media(prefers-reduced-motion:reduce){._headerTitleWrap_18x6y_195,._headerSearchWrap_18x6y_199{transition:none}}._body_18x6y_312{padding:var(--bb-body-padding, 8px 16px);overflow:auto}._muted_18x6y_317{color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));margin:0 0 12px}._error_18x6y_322{color:var(--bb-error-color, #b91c1c);margin:0 0 12px}._variants_18x6y_327{margin-top:4px}._variantList_18x6y_331{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_18x6y_339{display:grid;grid-template-columns:1fr auto;gap:0px;align-items:stretch;padding:5px}._variantRowSoldOut_18x6y_347{opacity:.65}._variantLeft_18x6y_351{min-width:0;display:flex;gap:12px;align-items:center}._addToBundleButton_18x6y_358{height:100%;align-self:stretch;border-radius:12px;border:none;background:var(--bb-cta-bg, #91aae5);color:var(--bb-cta-text, #ffffff);font:inherit;font-weight:800;padding:0 16px;cursor:pointer;white-space:nowrap}._addToBundleButton_18x6y_358:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._addToBundleButton_18x6y_358:disabled{opacity:.6;cursor:not-allowed}._addToBundleButton_18x6y_358:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._soldOutContainer_18x6y_386{display:flex;align-items:center;justify-content:center;height:100%;padding:0 16px}._soldOut_18x6y_386{align-self:center;text-align:center;color:var(--bb-muted-color, rgba(17, 24, 39));font-size:.9em;font-weight:600;pointer-events:none}._variantThumb_18x6y_403{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_18x6y_413{width:100%;height:100%;object-fit:cover;display:block}._variantThumbFallback_18x6y_420{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--bb-text-color, #111827)}._variantInfo_18x6y_430{min-width:0}._variantName_18x6y_434{font-size:14px;font-weight:600;margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantMeta_18x6y_443{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantPriceRow_18x6y_451{display:flex;align-items:baseline;gap:8px;margin-top:4px}._variantCompareAt_18x6y_458{font-size:12px;color:var(--bb-muted-color, rgba(17, 24, 39, .6));text-decoration:line-through}._variantPrice_18x6y_451{font-size:13px;font-weight:800}._qtyControls_18x6y_469{display:inline-flex;align-items:center;gap:6px}._qtyButton_18x6y_475{padding:0;width:34px;height:34px;border-radius:10px;border:1px solid var(--bb-border-strong-color, rgba(17, 24, 39, .12));background:var(--bb-surface-bg, #ffffff);cursor:pointer;line-height:1;font-size:16px}._qtyButton_18x6y_475:hover{background:var(--bb-control-bg-hover, rgba(17, 24, 39, .04))}._qtyButton_18x6y_475:disabled{opacity:.6;cursor:not-allowed}._qtyButton_18x6y_475:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_18x6y_501{min-width:18px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700}._footer_18x6y_508{padding:var(--bb-footer-padding, 12px 16px 16px 16px);border-top:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);position:relative;min-width:0}._poweredBy_18x6y_516{font-size:10px;color:var(rgba(17, 24, 39, .6));text-align:center;margin-top:10px}._poweredBy_18x6y_516 a{color:inherit;text-decoration:none}._boxSummaryWindow_18x6y_528{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;min-width:0;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_18x6y_528::-webkit-scrollbar{display:none}._boxSummaryRow_18x6y_546{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_18x6y_554{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_18x6y_563{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_18x6y_575{cursor:pointer}._boxItemClickable_18x6y_575:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxThresholdLabel_18x6y_584{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._boxItemPlaceholder_18x6y_595{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_18x6y_601{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemThreshold_18x6y_607{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_18x6y_615{font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxItemPlus_18x6y_623{font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemImage_18x6y_630{width:100%;height:100%;object-fit:cover;display:block}._boxItemFallback_18x6y_637{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_18x6y_648{display:flex;gap:8px;width:100%;transition:gap .3s cubic-bezier(.4,0,.2,1)}._ctaButtonGroupAnimating_18x6y_655{gap:0}._cta_18x6y_648{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_18x6y_671{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_18x6y_683{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_18x6y_701{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_18x6y_701>span{opacity:0}._ctaDualRight_18x6y_714{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_18x6y_730{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;opacity:.6}._ctaDualRightAnimating_18x6y_730>span{opacity:0}._ctaTotals_18x6y_741{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-variant-numeric:tabular-nums}._ctaDiscountBadge_18x6y_749{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:800;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));color:var(--bb-tier-text, rgba(29, 78, 216, .95));white-space:nowrap}._ctaTotalsWrap_18x6y_763{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_18x6y_776{max-height:40px;opacity:1;transform:translateY(0);margin-bottom:8px}._ctaTotalsStrike_18x6y_783{opacity:.85;text-decoration:line-through;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._ctaTotalsPrice_18x6y_790{font-weight:900;color:var(--bb-text-color, #111827)}@media(prefers-reduced-motion:reduce){._ctaTotalsWrap_18x6y_763{transition:none}}._cta_18x6y_648:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._cta_18x6y_648:disabled{opacity:.6;cursor:not-allowed}._cta_18x6y_648:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaSecondary_18x6y_671:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaSecondary_18x6y_671:disabled{opacity:.6;cursor:not-allowed}._ctaSecondary_18x6y_671:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualLeft_18x6y_683:hover{background:var(--bb-cta-bg, #2563eb);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_18x6y_683:disabled{opacity:.6;cursor:not-allowed}._ctaDualLeft_18x6y_683:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._ctaDualRight_18x6y_714:hover{background:var(--bb-cta-bg-hover, #1d4ed8)}._ctaDualRight_18x6y_714:disabled{opacity:.6;cursor:not-allowed}._ctaDualRight_18x6y_714:focus-visible{outline:2px solid var(--bb-cta-focus-ring, var(--bb-text-color, #111827));outline-offset:2px}._helperText_18x6y_859{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_18x6y_1{padding:0;justify-content:stretch}._panel_18x6y_82{width:100%;height:100%;border-radius:0}}._panel_1n9m6_2 button,._panel_1n9m6_2 input,._panel_1n9m6_2 [role=button]{box-sizing:border-box;margin:0}._panel_1n9m6_2{background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-family:var(--bb-font-family-body, "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));border-radius:var(--bb-panel-radius, 16px);padding:20px;display:grid;gap:14px}._header_1n9m6_20{text-align:start}._title_1n9m6_24{font-size:22px;margin:0;font-family:var(--bb-font-family-title, "Bebas Neue", "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);letter-spacing:.02em;color:var(--bb-title-color, var(--bb-text-color, #111827))}._status_1n9m6_32{font-size:13px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._error_1n9m6_37{font-size:13px;color:#b91c1c;font-weight:600}._inactive_1n9m6_43{font-size:13px;color:#b45309;font-weight:600}._section_1n9m6_49{display:grid;gap:6px}._sectionTitle_1n9m6_54{text-align:left;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._rules_1n9m6_63{display:flex;justify-content:center;gap:6px}._rulesList_1n9m6_69{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}._ruleItem_1n9m6_80{display:flex;flex-direction:column;align-items:center;gap:6px;padding:6px 10px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .25));background:var(--bb-tier-bg, rgba(37, 99, 235, .06));color:var(--bb-tier-text, #1f2937)}._ruleMin_1n9m6_92{font-weight:600;font-size:13px}._ruleDiscount_1n9m6_97{font-weight:700;font-size:13px}._ruleLabel_1n9m6_102{font-size:12px;opacity:.7}._rulesVisual_1n9m6_107{display:flex;flex-direction:column;gap:4px;width:100%}._rulesLabelsRow_1n9m6_114,._rulesLinesRow_1n9m6_121{display:flex;flex-direction:row;gap:4px;width:100%}._rulesLineLabelCell_1n9m6_128{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center}._rulesLineLabelCell_1n9m6_128:empty{display:flex!important}._rulesLineLabel_1n9m6_128{font-size:11px;font-weight:600;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65))}._rulesLineLabelSpacer_1n9m6_145{height:1em}._rulesLine_1n9m6_121{display:block;width:100%;height:4px;border-radius:999px;background-color:var(--bb-tier-background, rgba(148, 163, 184, .22));transition:background-color .2s ease}._rulesLine_1n9m6_121:empty{display:block!important}._rulesLineEmpty_1n9m6_162{background-color:var(--bb-tier-background, rgba(148, 163, 184, .22))}._rulesLineFilled_1n9m6_166{background-color:var(--bb-tier-border, rgba(37, 99, 235, .8))}._variants_1n9m6_170{display:grid;gap:12px;max-height:400px;overflow-y:auto;padding-right:6px}._variantList_1n9m6_178{list-style:none;padding:0;margin:0;display:grid;gap:10px}._variantRow_1n9m6_186{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;align-items:start;padding:8px;border-radius:var(--bb-border-radius, 12px);border:1px solid var(--bb-border-color, rgba(15, 23, 42, .08));background:#fff;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}._variantRowInteractive_1n9m6_198{cursor:pointer}._variantRowSelected_1n9m6_202{border-color:#2563eb40;box-shadow:0 0 0 1px #2563eb14}._variantRowSoldOut_1n9m6_207{opacity:.65}._variantMedia_1n9m6_211{display:grid;align-items:start;justify-items:center;width:76px;aspect-ratio:1 / 1}._variantContent_1n9m6_219{display:flex;flex-direction:column;justify-content:space-between;gap:4px;height:100%}._variantHeader_1n9m6_227{display:flex;flex-direction:column;gap:4px}._variantTitle_1n9m6_233{font-weight:700;font-size:14px;color:var(--bb-text-color, #111827)}._variantDetailsRow_1n9m6_239{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px;align-items:start}._variantImage_1n9m6_247{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);object-fit:cover;background:#94a3b833}._variantImageFallback_1n9m6_255{width:100%;height:100%;border-radius:var(--bb-border-radius, 12px);background:linear-gradient(135deg,#94a3b84d,#94a3b80d);display:grid;place-items:center;color:#94a3b8cc;font-size:10px;text-transform:uppercase;letter-spacing:.08em}._variantMeta_1n9m6_268{font-size:12px;color:var(--bb-muted-color, rgba(15, 23, 42, .6))}._variantPrice_1n9m6_273{font-size:13px;font-weight:600;color:#0f172a}._variantFooterRow_1n9m6_279{display:flex;align-items:center;justify-content:space-between;width:100%}._variantActions_1n9m6_286{display:grid;align-items:end;justify-items:end}._qtyActions_1n9m6_292{display:inline-flex;align-items:center;gap:6px}._variantUnavailable_1n9m6_298{display:none}._qtyControls_1n9m6_302{display:inline-flex;align-items:center;gap:6px;padding:4px;border-radius:999px;border:1px solid var(--bb-border-strong-color, rgba(15, 23, 42, .12));background:#0f172a0a}._qtyButton_1n9m6_312{width:30px;height:30px;padding:0;border-radius:999px;border:0;background:var(--bb-surface-bg, #ffffff);color:var(--bb-text-color, #111827);font-size:16px;cursor:pointer;display:grid;place-items:center}._qtyButton_1n9m6_312:disabled{cursor:not-allowed;opacity:.4}._qtyButton_1n9m6_312:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._qtyValue_1n9m6_336{min-width:22px;text-align:center;font-weight:600;font-size:13px}._soldOut_1n9m6_343{color:var(--bb-muted-color, rgba(17, 24, 39));font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}._qtyChip_1n9m6_351{min-width:44px;height:30px;padding:0 2px;border-radius:var(--bb-border-radius, 12px);background:#0f172a14;color:#0f172a;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:3px}._qtyChipInteractive_1n9m6_366{cursor:pointer}._qtyChipValue_1n9m6_370{min-width:14px;padding-left:3px;text-align:center}._qtyChipPlus_1n9m6_376{margin-bottom:-3px;font-weight:500}._qtyChipClear_1n9m6_381{width:22px;height:22px;border-radius:999px;border:1px solid rgba(15,23,42,.12);background:#fff;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0;transition:background .16s ease,color .16s ease}._qtyChip_1n9m6_351:hover ._qtyChipClear_1n9m6_381{background:#0f172a;color:#fff}._qtyTrash_1n9m6_400{width:22px;height:22px;border:0;background:transparent;color:#0f172a;display:grid;place-items:center;cursor:pointer;padding:0}._footer_1n9m6_412{display:grid;padding-top:6px}._boxSummaryWindow_1n9m6_417{margin-bottom:6px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px;scrollbar-width:none;-ms-overflow-style:none}._boxSummaryWindow_1n9m6_417::-webkit-scrollbar{display:none}._boxSummaryRow_1n9m6_431{--bb-box-gap: 10px;display:flex;align-items:flex-start;gap:var(--bb-box-gap);width:100%}._boxSlot_1n9m6_439{flex:0 0 calc((100% - (4 * var(--bb-box-gap))) / 5);max-width:calc((100% - (4 * var(--bb-box-gap))) / 5);display:flex;flex-direction:column;align-items:stretch;gap:6px}._boxItem_1n9m6_448{width:100%;border-radius:var(--bb-border-radius, 12px);position:relative;display:block;-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden}._boxItem_1n9m6_448:before{content:"";display:block;padding-bottom:100%}._boxItemFilled_1n9m6_465{border:1px solid var(--bb-border-color, rgba(17, 24, 39, .08));background:var(--bb-surface-bg, #ffffff);overflow:hidden}._boxItemPlaceholder_1n9m6_471{border:1px dashed var(--bb-border-strong-color, rgba(17, 24, 39, .18));background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .02));color:var(--bb-muted-color, rgba(17, 24, 39, .6))}._boxItemThreshold_1n9m6_477{border-style:solid;border-width:2px;border-color:var(--bb-tier-border, rgba(37, 99, 235, .55));background:var(--bb-tier-bg, rgba(37, 99, 235, .08));color:var(--bb-tier-text, rgba(29, 78, 216, .95))}._boxItemClickable_1n9m6_485{cursor:pointer}._boxItemClickable_1n9m6_485:focus-visible{outline:2px solid var(--bb-focus-ring, #2563eb);outline-offset:2px}._boxItemImage_1n9m6_494{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block}._boxItemFallback_1n9m6_505{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:var(--bb-surface-subtle-bg, rgba(17, 24, 39, .04));color:var(--bb-text-color, #111827);font-weight:800}._boxItemPlus_1n9m6_518{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;opacity:.5;line-height:1}._boxItemDiscountText_1n9m6_530{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;text-align:center;line-height:1.1;padding:6px}._boxThresholdLabel_1n9m6_543{font-size:11px;line-height:1.15;font-weight:700;color:var(--bb-muted-strong-color, rgba(17, 24, 39, .65));text-align:center;white-space:wrap;overflow:hidden;text-overflow:ellipsis}._totalsReveal_1n9m6_554{max-height:0;padding-bottom:12px;opacity:0;overflow:hidden;transition:max-height .26s ease,opacity .2s ease}._totalsRevealOpen_1n9m6_562{max-height:80px;opacity:1}._ctaTotalsWrap_1n9m6_567{opacity:0;transition:opacity .18s ease .12s}._ctaTotalsWrapVisible_1n9m6_572{opacity:1}._ctaTotals_1n9m6_567{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-radius:14px;background:#0f172a0a;font-size:13px;font-weight:600}._ctaDiscountBadge_1n9m6_587{padding:4px 8px;border-radius:999px;background:var(--bb-tier-bg, rgba(37, 99, 235, .12));color:var(--bb-tier-text, rgba(30, 64, 175, .9));border:1px solid var(--bb-tier-border, rgba(37, 99, 235, .3));font-size:11px;text-transform:uppercase;letter-spacing:.08em}._ctaTotalsStrike_1n9m6_598{text-decoration:line-through;color:#64748bcc;margin-right:6px}._ctaTotalsPrice_1n9m6_604{font-weight:700;color:#0f172a}._cta_1n9m6_567{border:0;border-radius:var(--bb-border-radius, 12px);padding:14px 18px;min-height:44px;font-weight:700;font-size:14px;background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff);cursor:pointer;letter-spacing:.02em;transition:transform .14s ease,box-shadow .14s ease,background .14s ease;box-shadow:0 10px 24px #0f172a40}._cta_1n9m6_567:hover{transform:translateY(-1px);background:var(--bb-cta-bg-hover, #0f172a)}._cta_1n9m6_567:disabled{cursor:not-allowed;transform:none;box-shadow:none;opacity:.6}._ctaButtonGroup_1n9m6_636{display:grid;grid-template-columns:1fr 1fr;gap:10px}._ctaDualLeft_1n9m6_642,._ctaDualRight_1n9m6_643{border:0;border-radius:var(--bb-border-radius, 12px);padding:12px 16px;min-height:44px;font-weight:700;font-size:13px;cursor:pointer}._ctaDualLeft_1n9m6_642{background:#fff;color:#0f172a;border:1px solid rgba(15,23,42,.15)}._ctaDualRight_1n9m6_643{background:var(--bb-cta-bg, #111827);color:var(--bb-cta-text, #ffffff)}._ctaDualLeft_1n9m6_642:disabled,._ctaDualRight_1n9m6_643:disabled{cursor:not-allowed;opacity:.6}._poweredBy_1n9m6_670{padding-top:12px;font-size:11px;color:#64748bcc;text-align:center}._poweredBy_1n9m6_670 a{color:inherit;text-decoration:none;font-weight:700}@media(max-width:640px){._panel_1n9m6_2{padding:16px}._variantRow_1n9m6_186{grid-template-columns:64px minmax(0,1fr);gap:10px}._qtyControls_1n9m6_302{justify-self:start}._variantDetailsRow_1n9m6_239{grid-template-columns:1fr}}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { jsx as s, jsxs as S, Fragment as Xe } from "react/jsx-runtime";
3
- import Ve, { useState as j, useRef as J, useEffect as V, useCallback as Te, useMemo as k, createContext as St, useContext as Bt, forwardRef as wt, createElement as Ze } from "react";
4
- const $e = {
2
+ import { jsx as s, jsxs as R, Fragment as ut } from "react/jsx-runtime";
3
+ import at, { useState as G, useRef as U, useEffect as $, useCallback as me, useMemo as A, createContext as Tt, useContext as kt, forwardRef as St, createElement as dt } from "react";
4
+ const et = {
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 Tt(o) {
11
- const e = new URL("/api/public/bundle-config", o.apiBaseUrl);
12
- e.searchParams.set("shop", o.shop), o.configHandle && e.searchParams.set("handle", o.configHandle);
10
+ async function Rt(a) {
11
+ const e = new URL("/api/public/bundle-configs-active", a.apiBaseUrl);
12
+ e.searchParams.set("shop", a.shop);
13
13
  const i = await (await fetch(e, {
14
14
  method: "GET",
15
- signal: o.signal,
15
+ signal: a.signal,
16
16
  headers: { "Content-Type": "application/json" }
17
17
  })).json().catch(() => null);
18
18
  return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
19
19
  }
20
- const dt = "bb_anonymous_user_id";
21
- function Le() {
20
+ async function Pt(a) {
21
+ const e = new URL("/api/public/bundle-config", a.apiBaseUrl);
22
+ e.searchParams.set("shop", a.shop), a.configHandle && e.searchParams.set("handle", a.configHandle), a.fresh && e.searchParams.set("fresh", "1");
23
+ const i = await (await fetch(e, {
24
+ method: "GET",
25
+ signal: a.signal,
26
+ headers: { "Content-Type": "application/json" }
27
+ })).json().catch(() => null);
28
+ return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
29
+ }
30
+ async function Ot(a) {
31
+ const e = new URL("/api/public/bundle-config-status", a.apiBaseUrl);
32
+ e.searchParams.set("shop", a.shop), a.configHandle && e.searchParams.set("handle", a.configHandle);
33
+ const i = await (await fetch(e, {
34
+ method: "GET",
35
+ signal: a.signal,
36
+ headers: { "Content-Type": "application/json" }
37
+ })).json().catch(() => null);
38
+ return !i || typeof i != "object" ? { ok: !1, error: "Invalid response." } : i;
39
+ }
40
+ const bt = "bb_anonymous_user_id";
41
+ function tt() {
22
42
  if (typeof window > "u" || typeof localStorage > "u")
23
43
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
24
44
  try {
25
- const o = localStorage.getItem(dt);
26
- if (o && typeof o == "string" && o.length > 0)
27
- return o;
45
+ const a = localStorage.getItem(bt);
46
+ if (a && typeof a == "string" && a.length > 0)
47
+ return a;
28
48
  let e;
29
49
  try {
30
50
  const t = globalThis.crypto;
@@ -35,17 +55,17 @@ function Le() {
35
55
  } catch {
36
56
  e = `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
37
57
  }
38
- return localStorage.setItem(dt, e), e;
58
+ return localStorage.setItem(bt, e), e;
39
59
  } catch {
40
60
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
41
61
  }
42
62
  }
43
- async function Oe(o, e, t) {
63
+ async function He(a, e, t) {
44
64
  if (!(typeof window > "u"))
45
65
  try {
46
- const i = new URL(o, window.location.origin);
66
+ const i = new URL(a, window.location.origin);
47
67
  i.searchParams.set("shop", e);
48
- const a = await fetch(i, {
68
+ const r = await fetch(i, {
49
69
  method: "POST",
50
70
  headers: {
51
71
  "Content-Type": "application/json"
@@ -54,25 +74,27 @@ async function Oe(o, e, t) {
54
74
  // Don't wait for response - fire and forget
55
75
  keepalive: !0
56
76
  });
57
- a.ok || console.warn(
58
- `[Bundle Analytics] Event tracking failed with status ${a.status}:`,
59
- await a.text().catch(() => "Unable to read response")
77
+ r.ok || console.warn(
78
+ `[Bundle Analytics] Event tracking failed with status ${r.status}:`,
79
+ await r.text().catch(() => "Unable to read response")
60
80
  );
61
81
  } catch (i) {
62
82
  console.warn("[Bundle Analytics] Failed to track event:", i);
63
83
  }
64
84
  }
65
- const xt = St(null), qe = "#best-bundles";
66
- function Rt(o) {
67
- const e = String(o ?? "").trim().toLowerCase();
68
- if (!e.startsWith(qe)) return null;
69
- if (e === qe) return "default";
70
- const t = `${qe}:`;
71
- if (!e.startsWith(t)) return null;
72
- const i = e.slice(t.length).trim();
73
- return i && i.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
85
+ const Nt = Tt(null), Ke = "#best-bundles", Ft = [];
86
+ function $e(a) {
87
+ const e = String(a ?? "").trim().toLowerCase();
88
+ return e && e.replace(/[^a-z0-9-]+/g, "-").replace(/^-+/, "").replace(/-+$/, "").replace(/-{2,}/g, "-") || "default";
74
89
  }
75
- const kt = {
90
+ function pt(a) {
91
+ const e = String(a ?? "").trim().toLowerCase();
92
+ if (!e.startsWith(Ke)) return null;
93
+ if (e === Ke) return "default";
94
+ const t = `${Ke}:`;
95
+ return e.startsWith(t) ? $e(e.slice(t.length)) : null;
96
+ }
97
+ const Mt = {
76
98
  primaryColor: "--bb-cta-bg",
77
99
  primaryHoverColor: "--bb-cta-bg-hover",
78
100
  primaryTextColor: "--bb-cta-text",
@@ -94,605 +116,685 @@ const kt = {
94
116
  celebrationBorderColor: "--bb-celebration-border",
95
117
  fontFamilyBody: "--bb-font-family-body",
96
118
  fontFamilyTitle: "--bb-font-family-title"
97
- }, He = "bb-google-fonts";
98
- function ht(o) {
99
- const e = (o ?? "").trim().replace(/^["']|["']$/g, "");
119
+ }, ot = "bb-google-fonts";
120
+ function _t(a) {
121
+ const e = (a ?? "").trim().replace(/^["']|["']$/g, "");
100
122
  return e ? encodeURIComponent(e).replace(/%20/g, "+") : "";
101
123
  }
102
- function Pt(o) {
124
+ function At(a) {
103
125
  var c;
104
126
  if (typeof document > "u" || !document.head) return;
105
- if (!o) {
106
- (c = document.getElementById(He)) == null || c.remove();
127
+ if (!a) {
128
+ (c = document.getElementById(ot)) == null || c.remove();
107
129
  return;
108
130
  }
109
- const e = (o.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (o.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), i = [];
110
- e && i.push("family=" + ht(e)), t && t !== e && i.push("family=" + ht(t));
111
- const a = document.getElementById(He);
131
+ const e = (a.fontFamilyBody ?? "").trim().replace(/^["']|["']$/g, ""), t = (a.fontFamilyTitle ?? "").trim().replace(/^["']|["']$/g, ""), i = [];
132
+ e && i.push("family=" + _t(e)), t && t !== e && i.push("family=" + _t(t));
133
+ const r = document.getElementById(ot);
112
134
  if (i.length === 0) {
113
- a == null || a.remove();
135
+ r == null || r.remove();
114
136
  return;
115
137
  }
116
138
  const n = `https://fonts.googleapis.com/css2?${i.join("&")}&display=swap`;
117
- if (a) {
118
- a.getAttribute("href") !== n && a.setAttribute("href", n);
139
+ if (r) {
140
+ r.getAttribute("href") !== n && r.setAttribute("href", n);
119
141
  return;
120
142
  }
121
143
  const d = document.createElement("link");
122
- d.id = He, d.rel = "stylesheet", d.href = n, document.head.appendChild(d);
144
+ d.id = ot, d.rel = "stylesheet", d.href = n, document.head.appendChild(d);
123
145
  }
124
- function mt(o) {
125
- if (!o) return;
126
- Pt(o);
146
+ function yt(a) {
147
+ if (!a) return;
148
+ At(a);
127
149
  const e = document.documentElement;
128
- Object.entries(kt).forEach(([t, i]) => {
129
- let a = o[t];
130
- a && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(a) && !/^["']/.test(a.trim()) && (a = `"${a.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(i, a));
150
+ Object.entries(Mt).forEach(([t, i]) => {
151
+ let r = a[t];
152
+ r && ((t === "fontFamilyBody" || t === "fontFamilyTitle") && /^\s*\S+\s+\S/.test(r) && !/^["']/.test(r.trim()) && (r = `"${r.trim().replace(/^["']|["']$/g, "")}"`), e.style.setProperty(i, r));
131
153
  });
132
154
  }
133
- function ft(o) {
134
- if (typeof window > "u") return o;
155
+ function wt(a) {
156
+ if (typeof window > "u") return a;
135
157
  const e = window.__BUNDLE_PREVIEW_STYLES__;
136
- return e && typeof e == "object" ? e : o;
158
+ return e && typeof e == "object" ? e : a;
137
159
  }
138
- function Ot() {
160
+ function Lt() {
139
161
  try {
140
- const o = globalThis.crypto;
141
- if (o != null && o.randomUUID) return o.randomUUID();
162
+ const a = globalThis.crypto;
163
+ if (a != null && a.randomUUID) return a.randomUUID();
142
164
  } catch {
143
165
  }
144
166
  return `bb_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
145
167
  }
146
- function pt(o) {
147
- return Number.isFinite(o) ? Math.max(0, Math.floor(o)) : 0;
168
+ function vt(a) {
169
+ return Number.isFinite(a) ? Math.max(0, Math.floor(a)) : 0;
170
+ }
171
+ function Dt(a, e) {
172
+ return !a && !e;
148
173
  }
149
- function Fi(o) {
174
+ function jr(a) {
150
175
  const {
151
176
  apiBaseUrl: e,
152
177
  shop: t,
153
178
  cartAdapter: i,
154
- configHandle: a = "default",
179
+ configHandle: r = "default",
155
180
  initialData: n,
156
181
  configFetcher: d,
157
- analyticsEndpoint: c,
158
- allowDrawerWhenInactive: I = !1,
159
- children: G
160
- } = o, g = c ?? `${e}/api/public/bundle-analytics`, [A, P] = j(!1), [z, H] = j(!n), [te, ne] = j(!1), [L, Q] = j(null), [ee, ue] = j((n == null ? void 0 : n.currencyCode) ?? null), [w, D] = j((n == null ? void 0 : n.config) ?? null), [W, Y] = j(
161
- (n == null ? void 0 : n.eligibleVariants) ?? []
162
- ), [de, Ce] = j(
182
+ activeConfigsFetcher: c,
183
+ configStatusFetcher: k,
184
+ analyticsEndpoint: Y,
185
+ allowDrawerWhenInactive: P = !1,
186
+ children: Z
187
+ } = a, O = $e(r), E = Y ?? `${e}/api/public/bundle-analytics`, X = Dt(P, n), [le, ce] = G(!1), [j, te] = G(!1), [re, ie] = G(null), [J, H] = G(O), [ee, fe] = G(() => n ? { [O]: n } : {}), [ue, Fe] = G(X), [Me, be] = G(
188
+ !X && !n ? O : null
189
+ ), [Ge, Ne] = G(null), [ve, ge] = G(null), [qe, ke] = G(
163
190
  () => ({ selections: {}, order: [] })
164
- ), Ne = J(null);
165
- V(() => {
166
- var x;
167
- if (n) return;
168
- (x = Ne.current) == null || x.abort();
169
- const r = new AbortController();
170
- Ne.current = r;
171
- const _ = d ?? Tt;
172
- return H(!0), Q(null), _({ apiBaseUrl: e, shop: t, configHandle: a, signal: r.signal }).then((b) => {
173
- if (!b.ok) {
174
- Q(b.error || "Failed to load bundle config."), D(null), Y([]), ue(null);
175
- return;
176
- }
177
- ue(b.currencyCode ?? null);
178
- const y = typeof window < "u" ? window : null, R = y == null ? void 0 : y.__BUNDLE_PREVIEW_CONFIG__;
179
- if (R) {
180
- D(R);
181
- const U = y.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__;
182
- if (U !== void 0)
183
- Y(U);
184
- else {
185
- const B = new Set(R.eligibleVariantIds ?? []);
186
- Y(
187
- B.size === 0 ? b.eligibleVariants ?? [] : (b.eligibleVariants ?? []).filter((E) => B.has(E.id))
188
- );
189
- }
190
- H(y.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0);
191
- } else
192
- D(b.config), Y(b.eligibleVariants ?? []), H(!1);
193
- }).catch((b) => {
194
- const y = b instanceof Error ? b.message : "Failed to load bundle config.";
195
- Q(y), D(null), Y([]), ue(null);
196
- }).finally(() => {
197
- const b = typeof window < "u" ? window : null;
198
- b != null && b.__BUNDLE_PREVIEW_CONFIG__ || H(!1);
199
- }), () => r.abort();
200
- }, [e, t, a, n, d]), V(() => {
201
- const r = ft(w == null ? void 0 : w.styleSettings);
202
- r && mt(r);
203
- }, [w == null ? void 0 : w.styleSettings]), V(() => {
204
- if (typeof window > "u") return;
205
- const r = () => {
206
- const _ = ft(void 0);
207
- _ && mt(_);
208
- };
209
- return window.addEventListener("bundle-preview-styles-updated", r), () => window.removeEventListener("bundle-preview-styles-updated", r);
210
- }, []), V(() => {
211
- if (typeof window > "u") return;
212
- const r = window, _ = () => {
213
- const x = r.__BUNDLE_PREVIEW_CONFIG__;
214
- if (!x) return;
215
- const b = r.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0;
216
- H(b), D(x);
217
- const y = r.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__;
218
- y ? Y(y) : b || Y((R) => {
219
- const U = new Set(x.eligibleVariantIds ?? []);
220
- return U.size === 0 || R.length === 0 ? R : R.filter((B) => U.has(B.id));
221
- });
222
- };
223
- return r.__BUNDLE_PREVIEW_CONFIG__ && _(), window.addEventListener("bundle-preview-config-updated", _), () => window.removeEventListener("bundle-preview-config-updated", _);
224
- }, []);
225
- const ae = Te(() => {
226
- if (!(!I && w != null && !w.isActive) && (P(!0), g))
191
+ ), ze = U(null), je = U(null), Be = U(null), oe = U(J), xe = U(ee), Re = U(ue), de = U(null), m = d ?? Pt, b = c ?? Rt, w = k ?? Ot;
192
+ $(() => {
193
+ oe.current = J;
194
+ }, [J]), $(() => {
195
+ xe.current = ee;
196
+ }, [ee]), $(() => {
197
+ Re.current = ue;
198
+ }, [ue]);
199
+ const L = me((u) => {
200
+ H($e(u));
201
+ }, []), B = me(() => {
202
+ if (E)
227
203
  try {
228
- const r = Le();
229
- Oe(g, t, {
230
- eventType: "DRAWER_OPENED",
231
- shop: t,
232
- anonymousUserId: r,
233
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
234
- mixpanelEvent: "bundle_opened"
235
- }).catch((_) => {
236
- console.warn("[Bundle Analytics] Failed to track drawer opened:", _);
237
- });
238
- } catch (r) {
239
- console.warn("[Bundle Analytics] Error in open() callback:", r);
240
- }
241
- }, [g, t, w, I]), oe = Te(() => {
242
- if (g)
243
- try {
244
- const r = Le();
245
- Oe(g, t, {
204
+ const u = tt();
205
+ He(E, t, {
246
206
  eventType: "DRAWER_CLOSED",
247
207
  shop: t,
248
- anonymousUserId: r,
208
+ anonymousUserId: u,
249
209
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
250
210
  mixpanelEvent: "bundle_closed"
251
211
  }).catch((_) => {
252
212
  console.warn("[Bundle Analytics] Failed to track drawer closed:", _);
253
213
  });
254
- } catch (r) {
255
- console.warn("[Bundle Analytics] Error in close() callback:", r);
214
+ } catch (u) {
215
+ console.warn("[Bundle Analytics] Error in close() callback:", u);
256
216
  }
257
- P(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(qe) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
258
- }, [g, t]);
259
- V(() => {
260
- if (typeof window > "u") return;
261
- const r = () => {
262
- const _ = Rt(window.location.hash);
263
- _ && (_ === "default" || _ === a) && ae();
264
- };
265
- return r(), window.addEventListener("hashchange", r), () => window.removeEventListener("hashchange", r);
266
- }, [ae, a]);
267
- const we = Te(() => {
268
- !I && !A && w != null && !w.isActive || P((r) => {
269
- if (r)
270
- oe();
271
- else if (g)
217
+ ce(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(Ke) && window.history.replaceState(null, "", window.location.pathname + window.location.search);
218
+ }, [E, t]), q = me(() => {
219
+ ce((u) => {
220
+ if (u) return u;
221
+ if (E)
272
222
  try {
273
- const _ = Le();
274
- Oe(g, t, {
223
+ const _ = tt();
224
+ He(E, t, {
275
225
  eventType: "DRAWER_OPENED",
276
226
  shop: t,
277
227
  anonymousUserId: _,
278
228
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
279
229
  mixpanelEvent: "bundle_opened"
280
- }).catch((x) => {
281
- console.warn("[Bundle Analytics] Failed to track drawer opened:", x);
230
+ }).catch((y) => {
231
+ console.warn("[Bundle Analytics] Failed to track drawer opened:", y);
282
232
  });
283
233
  } catch (_) {
284
- console.warn("[Bundle Analytics] Error in toggle() callback:", _);
234
+ console.warn("[Bundle Analytics] Error in open() callback:", _);
235
+ }
236
+ return !0;
237
+ });
238
+ }, [E, t]), T = me((u, _) => !_.ok || _.config.isActive === !1 ? (fe((y) => {
239
+ if (!y[u]) return y;
240
+ const v = { ...y };
241
+ return delete v[u], v;
242
+ }), !P && oe.current === u && (ie(_.ok ? "Bundle is inactive." : _.error || "Failed to load bundle config."), ce(!1), typeof window < "u" && window.location.hash.toLowerCase().startsWith(Ke) && window.history.replaceState(null, "", window.location.pathname + window.location.search)), !1) : (fe((y) => ({
243
+ ...y,
244
+ [u]: {
245
+ currencyCode: _.currencyCode ?? null,
246
+ config: _.config,
247
+ eligibleVariants: _.eligibleVariants ?? []
248
+ }
249
+ })), oe.current === u && ie(null), !0), [P]), Q = me((u, _) => {
250
+ var F;
251
+ const y = $e(u);
252
+ (F = je.current) == null || F.abort();
253
+ const v = new AbortController();
254
+ je.current = v, _ != null && _.blocking && be(y), ie(null), m({
255
+ apiBaseUrl: e,
256
+ shop: t,
257
+ configHandle: y,
258
+ fresh: (_ == null ? void 0 : _.blocking) === !0 && !xe.current[y],
259
+ signal: v.signal
260
+ }).then((M) => {
261
+ v.signal.aborted || T(y, M);
262
+ }).catch((M) => {
263
+ if (v.signal.aborted) return;
264
+ const ae = M instanceof Error ? M.message : "Failed to load bundle config.";
265
+ oe.current === y && ie(ae);
266
+ }).finally(() => {
267
+ v.signal.aborted || be((M) => M === y ? null : M);
268
+ });
269
+ }, [e, T, m, t]), Ce = me((u) => {
270
+ const _ = $e(u), y = xe.current[_];
271
+ H(_), ie(null), Q(_, { blocking: !y });
272
+ }, [Q]), z = me((u, _ = "api") => {
273
+ var M, ae;
274
+ const y = $e(u), v = xe.current[y];
275
+ if (X && Re.current && !v) {
276
+ ge({ handle: y, source: _ });
277
+ return;
278
+ }
279
+ if (H(y), P) {
280
+ q(), Q(y, { blocking: !v });
281
+ return;
282
+ }
283
+ if ((M = v == null ? void 0 : v.config) != null && M.isActive) {
284
+ ie(null), q(), Q(y, { blocking: !1 });
285
+ return;
286
+ }
287
+ Ne(y), (ae = Be.current) == null || ae.abort();
288
+ const F = new AbortController();
289
+ Be.current = F, w({
290
+ apiBaseUrl: e,
291
+ shop: t,
292
+ configHandle: y,
293
+ signal: F.signal
294
+ }).then((V) => {
295
+ if (!F.signal.aborted) {
296
+ if (Ne((o) => o === y ? null : o), !V.ok || V.isActive !== !0) {
297
+ _ === "hash" && typeof window < "u" && pt(window.location.hash) === y && window.history.replaceState(null, "", window.location.pathname + window.location.search);
298
+ return;
285
299
  }
286
- return !r;
300
+ ie(null), H(y), q(), Q(y, { blocking: !0 });
301
+ }
302
+ }).catch(() => {
303
+ F.signal.aborted || Ne((V) => V === y ? null : V);
287
304
  });
288
- }, [g, t, oe, w, A, I]);
289
- V(() => {
290
- !I && (w == null ? void 0 : w.isActive) === !1 && A && oe();
291
- }, [I, w == null ? void 0 : w.isActive, A, oe]);
292
- const xe = k(() => {
293
- const r = Number((w == null ? void 0 : w.maxBundleSize) ?? NaN), _ = Number.isFinite(r) ? Math.floor(r) : 100;
305
+ }, [
306
+ P,
307
+ e,
308
+ q,
309
+ Q,
310
+ t,
311
+ w,
312
+ X
313
+ ]), pe = me(() => {
314
+ z(oe.current, "api");
315
+ }, [z]);
316
+ $(() => {
317
+ de.current = z;
318
+ }, [z]);
319
+ const Pe = me(() => {
320
+ if (le) {
321
+ B();
322
+ return;
323
+ }
324
+ z(oe.current, "api");
325
+ }, [B, le, z]);
326
+ $(() => {
327
+ H($e(r));
328
+ }, [r]), $(() => {
329
+ var _;
330
+ if (!X) {
331
+ Fe(!1), n || Q(O, { blocking: !0 });
332
+ return;
333
+ }
334
+ (_ = ze.current) == null || _.abort();
335
+ const u = new AbortController();
336
+ return ze.current = u, Fe(!0), b({ apiBaseUrl: e, shop: t, signal: u.signal }).then((y) => {
337
+ u.signal.aborted || y.ok && fe((v) => {
338
+ const F = { ...v };
339
+ for (const [M, ae] of Object.entries(y.configs ?? {}))
340
+ F[$e(M)] = {
341
+ currencyCode: ae.currencyCode ?? null,
342
+ config: ae.config,
343
+ eligibleVariants: ae.eligibleVariants ?? []
344
+ };
345
+ return F;
346
+ });
347
+ }).catch(() => {
348
+ }).finally(() => {
349
+ u.signal.aborted || Fe(!1);
350
+ }), () => u.abort();
351
+ }, [b, e, n, O, Q, t, X]), $(() => {
352
+ ue || !ve || (z(ve.handle, ve.source), ge(null));
353
+ }, [ue, z, ve]), $(() => {
354
+ if (typeof window > "u") return;
355
+ const u = () => {
356
+ var y;
357
+ const _ = pt(window.location.hash);
358
+ _ && ((y = de.current) == null || y.call(de, _, "hash"));
359
+ };
360
+ return u(), window.addEventListener("hashchange", u), () => window.removeEventListener("hashchange", u);
361
+ }, []);
362
+ const he = ee[J] ?? null, g = (he == null ? void 0 : he.config) ?? null, Te = (he == null ? void 0 : he.eligibleVariants) ?? Ft, Ae = (he == null ? void 0 : he.currencyCode) ?? null, W = !g && (Me === J || Ge === J) || P && !g && Me != null;
363
+ $(() => {
364
+ const u = wt(g == null ? void 0 : g.styleSettings);
365
+ u && yt(u);
366
+ }, [g == null ? void 0 : g.styleSettings]), $(() => {
367
+ if (typeof window > "u") return;
368
+ const u = () => {
369
+ const _ = wt(void 0);
370
+ _ && yt(_);
371
+ };
372
+ return window.addEventListener("bundle-preview-styles-updated", u), () => window.removeEventListener("bundle-preview-styles-updated", u);
373
+ }, []), $(() => {
374
+ if (typeof window > "u") return;
375
+ const u = window, _ = () => {
376
+ const y = u.__BUNDLE_PREVIEW_CONFIG__;
377
+ if (!y) return;
378
+ const v = u.__BUNDLE_PREVIEW_ELIGIBLE_VARIANTS__ ?? [];
379
+ fe((F) => {
380
+ var M;
381
+ return {
382
+ ...F,
383
+ [oe.current]: {
384
+ currencyCode: Ae ?? null,
385
+ config: y,
386
+ eligibleVariants: v.length ? v : ((M = F[oe.current]) == null ? void 0 : M.eligibleVariants) ?? []
387
+ }
388
+ };
389
+ }), u.__BUNDLE_PREVIEW_VARIANTS_LOADING__ === !0 ? be(oe.current) : be((F) => F === oe.current ? null : F);
390
+ };
391
+ return u.__BUNDLE_PREVIEW_CONFIG__ && _(), window.addEventListener("bundle-preview-config-updated", _), () => window.removeEventListener("bundle-preview-config-updated", _);
392
+ }, [Ae]);
393
+ const ne = A(() => {
394
+ const u = Number((g == null ? void 0 : g.maxBundleSize) ?? Number.NaN), _ = Number.isFinite(u) ? Math.floor(u) : 100;
294
395
  return Math.max(2, Math.min(100, _));
295
- }, [w == null ? void 0 : w.maxBundleSize]), X = k(() => new Set(
296
- W.filter((r) => r.availableForSale !== !1).map((r) => r.id)
297
- ), [W]), se = k(() => {
298
- const r = (w == null ? void 0 : w.rules) ?? [], _ = r.length ? Math.min(...r.map((R) => R.minBundleSize)) : 2, x = Number.isFinite(_) && _ > 0 ? _ : 2, b = Number((w == null ? void 0 : w.minBundleSize) ?? NaN), y = Number.isFinite(b) && Number.isInteger(b) ? Math.max(2, Math.min(100, b)) : null;
299
- return y == null ? x : Math.min(x, y);
300
- }, [w == null ? void 0 : w.minBundleSize, w == null ? void 0 : w.rules]), ke = Te((r, _) => {
301
- if (!X.has(r) && !z)
396
+ }, [g == null ? void 0 : g.maxBundleSize]), Ie = A(() => new Set(
397
+ Te.filter((u) => u.availableForSale !== !1).map((u) => u.id)
398
+ ), [Te]), se = A(() => {
399
+ const u = (g == null ? void 0 : g.rules) ?? [], _ = u.length ? Math.min(...u.map((M) => M.minBundleSize)) : 2, y = Number.isFinite(_) && _ > 0 ? _ : 2, v = Number((g == null ? void 0 : g.minBundleSize) ?? Number.NaN), F = Number.isFinite(v) && Number.isInteger(v) ? Math.max(2, Math.min(100, v)) : null;
400
+ return F == null ? y : Math.min(y, F);
401
+ }, [g == null ? void 0 : g.minBundleSize, g == null ? void 0 : g.rules]), Qe = me((u, _) => {
402
+ if (!Ie.has(u) && !W)
302
403
  return;
303
- const x = pt(_);
304
- Ce((b) => {
305
- const y = b.selections[r] ?? 0, R = x - y, U = Object.values(b.selections).reduce((ie, O) => ie + (O || 0), 0), B = R > 0 ? Math.min(R, Math.max(0, xe - U)) : R, E = y + B;
306
- let K;
307
- if (E <= 0) {
308
- const { [r]: ie, ...O } = b.selections;
309
- K = O;
310
- } else y === E ? K = b.selections : K = { ...b.selections, [r]: E };
311
- let _e = b.order;
312
- if (B > 0)
313
- _e = [...b.order, ...Array.from({ length: B }, () => r)];
314
- else if (B < 0) {
315
- let ie = -B;
316
- const O = [];
317
- for (let q = b.order.length - 1; q >= 0; q--) {
318
- const T = b.order[q];
319
- if (T === r && ie > 0) {
320
- ie--;
404
+ const y = vt(_);
405
+ ke((v) => {
406
+ const F = v.selections[u] ?? 0, M = y - F, ae = Object.values(v.selections).reduce((N, x) => N + (x || 0), 0), V = M > 0 ? Math.min(M, Math.max(0, ne - ae)) : M, o = F + V;
407
+ let l;
408
+ if (o <= 0) {
409
+ const N = { ...v.selections };
410
+ delete N[u], l = N;
411
+ } else F === o ? l = v.selections : l = { ...v.selections, [u]: o };
412
+ let p = v.order;
413
+ if (V > 0)
414
+ p = [...v.order, ...Array.from({ length: V }, () => u)];
415
+ else if (V < 0) {
416
+ let N = -V;
417
+ const x = [];
418
+ for (let D = v.order.length - 1; D >= 0; D--) {
419
+ const I = v.order[D];
420
+ if (I === u && N > 0) {
421
+ N--;
321
422
  continue;
322
423
  }
323
- O.push(T);
424
+ x.push(I);
324
425
  }
325
- O.reverse(), _e = O;
426
+ x.reverse(), p = x;
326
427
  }
327
- if (K === b.selections && _e === b.order) return b;
328
- const be = U, Se = Object.values(K).reduce((ie, O) => ie + (O || 0), 0);
329
- if (g)
428
+ if (l === v.selections && p === v.order) return v;
429
+ const S = ae, C = Object.values(l).reduce((N, x) => N + (x || 0), 0);
430
+ if (E)
330
431
  try {
331
- const ie = Le(), O = {
432
+ const N = tt(), x = {
332
433
  eventType: "VARIANT_SELECTION_CHANGED",
333
434
  shop: t,
334
- anonymousUserId: ie,
335
- before: { ...b.selections },
336
- after: { ...K },
435
+ anonymousUserId: N,
436
+ before: { ...v.selections },
437
+ after: { ...l },
337
438
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
338
439
  };
339
- Oe(g, t, O), be === 0 && Se >= 1 && Oe(g, t, {
340
- ...O,
440
+ He(E, t, x), S === 0 && C >= 1 && He(E, t, {
441
+ ...x,
341
442
  mixpanelEvent: "bundle_started"
342
- }), be < se && Se >= se && Oe(g, t, {
343
- ...O,
443
+ }), S < se && C >= se && He(E, t, {
444
+ ...x,
344
445
  mixpanelEvent: "bundle_completed"
345
446
  });
346
447
  } catch {
347
448
  }
348
- return { selections: K, order: _e };
449
+ return { selections: l, order: p };
349
450
  });
350
- }, [xe, se, X, g, t, z]);
351
- V(() => {
352
- z || Ce((r) => {
353
- const _ = Object.entries(r.selections).filter(
354
- ([y]) => X.has(y)
355
- ), x = Object.fromEntries(_), b = r.order.filter((y) => X.has(y));
356
- return b.length === r.order.length && _.length === Object.keys(r.selections).length ? r : { selections: x, order: b };
451
+ }, [E, Ie, W, ne, se, t]);
452
+ $(() => {
453
+ W || ke((u) => {
454
+ const _ = Object.entries(u.selections).filter(([F]) => Ie.has(F)), y = Object.fromEntries(_), v = u.order.filter((F) => Ie.has(F));
455
+ return v.length === u.order.length && _.length === Object.keys(u.selections).length ? u : { selections: y, order: v };
357
456
  });
358
- }, [z, X]);
359
- const ge = Te(() => Ce({ selections: {}, order: [] }), []), he = de.selections, ye = de.order, me = k(() => Object.values(he).reduce((r, _) => r + (_ || 0), 0), [he]), fe = k(() => !(z || te || L || !(w != null && w.isActive) || me < se), [me, w == null ? void 0 : w.isActive, L, z, se, te]), pe = Te(async (r) => {
360
- var O, q;
361
- if (!fe || !w) return;
362
- const _ = Ot(), x = (w.title ?? "").trim().slice(0, 255), b = Object.entries(he).map(([T, Z]) => ({ merchandiseId: T, quantity: pt(Z) })).filter((T) => T.quantity > 0).filter((T) => X.has(T.merchandiseId)).map((T) => ({
363
- merchandiseId: T.merchandiseId,
364
- quantity: T.quantity,
457
+ }, [Ie, W]), $(() => {
458
+ ke({ selections: {}, order: [] });
459
+ }, [J]);
460
+ const Ve = me(() => ke({ selections: {}, order: [] }), []), _e = qe.selections, Xe = qe.order, Oe = A(() => Object.values(_e).reduce((u, _) => u + (_ || 0), 0), [_e]), Le = A(() => !(W || j || re || !(g != null && g.isActive) || Oe < se), [Oe, g == null ? void 0 : g.isActive, re, W, se, j]), We = me(async (u) => {
461
+ var x, D;
462
+ if (!Le || !g) return;
463
+ const _ = Lt(), y = (g.title ?? "").trim().slice(0, 255), v = Object.entries(_e).map(([I, K]) => ({ merchandiseId: I, quantity: vt(K) })).filter((I) => I.quantity > 0).filter((I) => Ie.has(I.merchandiseId)).map((I) => ({
464
+ merchandiseId: I.merchandiseId,
465
+ quantity: I.quantity,
365
466
  attributes: [
366
- { key: $e.bundleId, value: _ },
367
- { key: $e.bundleConfig, value: a },
368
- { key: $e.bundleSource, value: "bundle_builder" },
369
- ...x ? [{ key: $e.bundleTitle, value: x }] : []
467
+ { key: et.bundleId, value: _ },
468
+ { key: et.bundleConfig, value: J },
469
+ { key: et.bundleSource, value: "bundle_builder" },
470
+ ...y ? [{ key: et.bundleTitle, value: y }] : []
370
471
  ]
371
472
  }));
372
- if (!b.length) return;
373
- const y = new Map(W.map((T) => [T.id, T]));
374
- let R = 0;
375
- for (const [T, Z] of Object.entries(he)) {
376
- const Fe = Z ?? 0;
377
- if (Fe <= 0) continue;
378
- const Me = y.get(T), Be = Number(Me == null ? void 0 : Me.price);
379
- Number.isFinite(Be) && (R += Be * Fe);
473
+ if (!v.length) return;
474
+ const F = new Map(Te.map((I) => [I.id, I]));
475
+ let M = 0;
476
+ for (const [I, K] of Object.entries(_e)) {
477
+ const we = K ?? 0;
478
+ if (we <= 0) continue;
479
+ const Se = F.get(I), De = Number(Se == null ? void 0 : Se.price);
480
+ Number.isFinite(De) && (M += De * we);
380
481
  }
381
- R = Math.round(R * 100) / 100;
382
- const U = [...w.rules ?? []].sort((T, Z) => T.minBundleSize - Z.minBundleSize);
383
- let B = null;
384
- for (const T of U)
385
- me >= T.minBundleSize && (B = T);
386
- const E = B ? (() => {
387
- const T = Number.parseFloat(B.discountPercent);
388
- return Number.isFinite(T) && T > 0 ? T : null;
389
- })() : null, K = E ? Math.round(R * (1 - E / 100) * 100) / 100 : R, _e = R - K, be = b.map((T) => T.merchandiseId), Se = (B == null ? void 0 : B.handle) ?? "", ie = ((O = B == null ? void 0 : B.label) == null ? void 0 : O.trim()) || "";
390
- ne(!0);
482
+ M = Math.round(M * 100) / 100;
483
+ const ae = [...g.rules ?? []].sort((I, K) => I.minBundleSize - K.minBundleSize);
484
+ let V = null;
485
+ for (const I of ae)
486
+ Oe >= I.minBundleSize && (V = I);
487
+ const o = V ? (() => {
488
+ const I = Number.parseFloat(V.discountPercent);
489
+ return Number.isFinite(I) && I > 0 ? I : null;
490
+ })() : null, l = o ? Math.round(M * (1 - o / 100) * 100) / 100 : M, p = M - l, S = v.map((I) => I.merchandiseId), C = (V == null ? void 0 : V.handle) ?? "", N = ((x = V == null ? void 0 : V.label) == null ? void 0 : x.trim()) || "";
491
+ te(!0);
391
492
  try {
392
- if (r != null && r.checkout ? await i.linesAddForCheckout(b) : await i.linesAdd(b), g)
493
+ if (u != null && u.checkout ? await i.linesAddForCheckout(v) : await i.linesAdd(v), E)
393
494
  try {
394
- const T = Le(), Z = !!(r != null && r.checkout);
395
- Oe(g, t, {
495
+ const I = tt(), K = !!(u != null && u.checkout);
496
+ He(E, t, {
396
497
  eventType: "BUNDLE_ADDED_TO_BASKET",
397
498
  shop: t,
398
- anonymousUserId: T,
499
+ anonymousUserId: I,
399
500
  bundleId: _,
400
- productVariantIds: be,
401
- grossPrice: R,
402
- discountedPrice: K,
403
- currency: ee ?? void 0,
404
- discountThresholdIdentifier: Se,
405
- discountLabel: ie,
406
- discountPercentage: E,
407
- discountedAmount: _e,
501
+ productVariantIds: S,
502
+ grossPrice: M,
503
+ discountedPrice: l,
504
+ currency: Ae ?? void 0,
505
+ discountThresholdIdentifier: C,
506
+ discountLabel: N,
507
+ discountPercentage: o,
508
+ discountedAmount: p,
408
509
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
409
- checkout: Z,
410
- mixpanelEvent: Z ? "checkout_started_with_bundle" : "bundle_added_to_cart"
510
+ checkout: K,
511
+ mixpanelEvent: K ? "checkout_started_with_bundle" : "bundle_added_to_cart"
411
512
  });
412
513
  } catch {
413
514
  }
414
- ge(), oe(), (q = r == null ? void 0 : r.onComplete) == null || q.call(r);
515
+ Ve(), B(), (D = u == null ? void 0 : u.onComplete) == null || D.call(u);
415
516
  } finally {
416
- ne(!1);
517
+ te(!1);
417
518
  }
418
519
  }, [
419
- fe,
520
+ E,
521
+ Oe,
522
+ Le,
420
523
  i,
421
- ge,
422
- oe,
423
- w,
424
- a,
425
- ee,
426
- he,
427
- X,
428
- W,
429
- me,
524
+ Ve,
525
+ B,
430
526
  g,
527
+ Ae,
528
+ J,
529
+ Ie,
530
+ Te,
531
+ _e,
431
532
  t
432
- ]), le = Te(async () => {
433
- await pe(
434
- {
435
- onComplete: () => {
436
- var r;
437
- (r = i.openCartUI) == null || r.call(i);
438
- }
533
+ ]), Ze = me(async () => {
534
+ await We({
535
+ onComplete: () => {
536
+ var u;
537
+ (u = i.openCartUI) == null || u.call(i);
439
538
  }
440
- );
441
- }, [pe, i]), m = Te(async () => {
442
- await pe(
443
- {
444
- checkout: !0,
445
- onComplete: () => {
446
- var r;
447
- (r = i.navigateToCheckout) == null || r.call(i);
448
- }
539
+ });
540
+ }, [i, We]), Ue = me(async () => {
541
+ await We({
542
+ checkout: !0,
543
+ onComplete: () => {
544
+ var u;
545
+ (u = i.navigateToCheckout) == null || u.call(i);
449
546
  }
450
- );
451
- }, [pe, i]), p = k(
452
- () => ({
453
- isOpen: A,
454
- open: ae,
455
- close: oe,
456
- toggle: we,
457
- loading: z,
458
- submitting: te,
459
- error: L,
460
- currencyCode: ee,
461
- config: w,
462
- eligibleVariants: W,
463
- selections: he,
464
- selectionOrder: ye,
465
- setQuantity: ke,
466
- clearSelections: ge,
467
- bundleSize: me,
468
- minRequired: se,
469
- canSubmit: fe,
470
- submit: le,
471
- submitAndCheckout: m
472
- }),
473
- [
474
- A,
475
- ae,
476
- oe,
477
- we,
478
- z,
479
- te,
480
- L,
481
- ee,
482
- w,
483
- W,
484
- he,
485
- ye,
486
- ke,
487
- ge,
488
- me,
489
- se,
490
- fe,
491
- le,
492
- m
493
- ]
494
- );
495
- return /* @__PURE__ */ s(xt.Provider, { value: p, children: G });
547
+ });
548
+ }, [i, We]), Je = A(() => ({
549
+ isOpen: le,
550
+ open: pe,
551
+ openForHandle: z,
552
+ close: B,
553
+ toggle: Pe,
554
+ currentHandle: J,
555
+ setConfigHandle: L,
556
+ loadHandle: Ce,
557
+ loading: W,
558
+ submitting: j,
559
+ error: re,
560
+ currencyCode: Ae,
561
+ config: g,
562
+ eligibleVariants: Te,
563
+ selections: _e,
564
+ selectionOrder: Xe,
565
+ setQuantity: Qe,
566
+ clearSelections: Ve,
567
+ bundleSize: Oe,
568
+ minRequired: se,
569
+ canSubmit: Le,
570
+ submit: Ze,
571
+ submitAndCheckout: Ue
572
+ }), [
573
+ Oe,
574
+ Le,
575
+ Ve,
576
+ B,
577
+ g,
578
+ Ae,
579
+ J,
580
+ Te,
581
+ re,
582
+ le,
583
+ W,
584
+ se,
585
+ pe,
586
+ z,
587
+ Xe,
588
+ _e,
589
+ L,
590
+ Ce,
591
+ Qe,
592
+ Ze,
593
+ Ue,
594
+ j,
595
+ Pe
596
+ ]);
597
+ return /* @__PURE__ */ s(Nt.Provider, { value: Je, children: Z });
496
598
  }
497
- function ze() {
498
- const o = Bt(xt);
499
- if (!o)
599
+ function rt() {
600
+ const a = kt(Nt);
601
+ if (!a)
500
602
  throw new Error("useBundleBuilder must be used within <BundleProvider />");
501
- return o;
603
+ return a;
502
604
  }
503
- function Ai() {
504
- const { isOpen: o, open: e, close: t, toggle: i } = ze();
505
- return { isOpen: o, open: e, close: t, toggle: i };
605
+ function Wr() {
606
+ const { isOpen: a, open: e, close: t, toggle: i } = rt();
607
+ return { isOpen: a, open: e, close: t, toggle: i };
506
608
  }
507
- const Mt = "_button_18rtl_1", Ft = {
508
- button: Mt
609
+ const $t = "_button_18rtl_1", Et = {
610
+ button: $t
509
611
  };
510
- function Li(o) {
511
- const { toggle: e } = ze();
612
+ function Ur(a) {
613
+ const { toggle: e } = rt();
512
614
  return /* @__PURE__ */ s(
513
615
  "button",
514
616
  {
515
617
  type: "button",
516
618
  onClick: e,
517
- className: [Ft.button, o.className].filter(Boolean).join(" "),
518
- children: o.children ?? "Build a bundle"
619
+ className: [Et.button, a.className].filter(Boolean).join(" "),
620
+ children: a.children ?? "Build a bundle"
519
621
  }
520
622
  );
521
623
  }
522
- var Qe, _t;
523
- function At() {
524
- if (_t) return Qe;
525
- _t = 1;
526
- var o = {
527
- linear: function(e, t, i, a) {
624
+ var st, gt;
625
+ function qt() {
626
+ if (gt) return st;
627
+ gt = 1;
628
+ var a = {
629
+ linear: function(e, t, i, r) {
528
630
  var n = i - t;
529
- return n * e / a + t;
631
+ return n * e / r + t;
530
632
  },
531
- easeInQuad: function(e, t, i, a) {
633
+ easeInQuad: function(e, t, i, r) {
532
634
  var n = i - t;
533
- return n * (e /= a) * e + t;
635
+ return n * (e /= r) * e + t;
534
636
  },
535
- easeOutQuad: function(e, t, i, a) {
637
+ easeOutQuad: function(e, t, i, r) {
536
638
  var n = i - t;
537
- return -n * (e /= a) * (e - 2) + t;
639
+ return -n * (e /= r) * (e - 2) + t;
538
640
  },
539
- easeInOutQuad: function(e, t, i, a) {
641
+ easeInOutQuad: function(e, t, i, r) {
540
642
  var n = i - t;
541
- return (e /= a / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
643
+ return (e /= r / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
542
644
  },
543
- easeInCubic: function(e, t, i, a) {
645
+ easeInCubic: function(e, t, i, r) {
544
646
  var n = i - t;
545
- return n * (e /= a) * e * e + t;
647
+ return n * (e /= r) * e * e + t;
546
648
  },
547
- easeOutCubic: function(e, t, i, a) {
649
+ easeOutCubic: function(e, t, i, r) {
548
650
  var n = i - t;
549
- return n * ((e = e / a - 1) * e * e + 1) + t;
651
+ return n * ((e = e / r - 1) * e * e + 1) + t;
550
652
  },
551
- easeInOutCubic: function(e, t, i, a) {
653
+ easeInOutCubic: function(e, t, i, r) {
552
654
  var n = i - t;
553
- return (e /= a / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
655
+ return (e /= r / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
554
656
  },
555
- easeInQuart: function(e, t, i, a) {
657
+ easeInQuart: function(e, t, i, r) {
556
658
  var n = i - t;
557
- return n * (e /= a) * e * e * e + t;
659
+ return n * (e /= r) * e * e * e + t;
558
660
  },
559
- easeOutQuart: function(e, t, i, a) {
661
+ easeOutQuart: function(e, t, i, r) {
560
662
  var n = i - t;
561
- return -n * ((e = e / a - 1) * e * e * e - 1) + t;
663
+ return -n * ((e = e / r - 1) * e * e * e - 1) + t;
562
664
  },
563
- easeInOutQuart: function(e, t, i, a) {
665
+ easeInOutQuart: function(e, t, i, r) {
564
666
  var n = i - t;
565
- return (e /= a / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
667
+ return (e /= r / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
566
668
  },
567
- easeInQuint: function(e, t, i, a) {
669
+ easeInQuint: function(e, t, i, r) {
568
670
  var n = i - t;
569
- return n * (e /= a) * e * e * e * e + t;
671
+ return n * (e /= r) * e * e * e * e + t;
570
672
  },
571
- easeOutQuint: function(e, t, i, a) {
673
+ easeOutQuint: function(e, t, i, r) {
572
674
  var n = i - t;
573
- return n * ((e = e / a - 1) * e * e * e * e + 1) + t;
675
+ return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
574
676
  },
575
- easeInOutQuint: function(e, t, i, a) {
677
+ easeInOutQuint: function(e, t, i, r) {
576
678
  var n = i - t;
577
- return (e /= a / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
679
+ return (e /= r / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
578
680
  },
579
- easeInSine: function(e, t, i, a) {
681
+ easeInSine: function(e, t, i, r) {
580
682
  var n = i - t;
581
- return -n * Math.cos(e / a * (Math.PI / 2)) + n + t;
683
+ return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
582
684
  },
583
- easeOutSine: function(e, t, i, a) {
685
+ easeOutSine: function(e, t, i, r) {
584
686
  var n = i - t;
585
- return n * Math.sin(e / a * (Math.PI / 2)) + t;
687
+ return n * Math.sin(e / r * (Math.PI / 2)) + t;
586
688
  },
587
- easeInOutSine: function(e, t, i, a) {
689
+ easeInOutSine: function(e, t, i, r) {
588
690
  var n = i - t;
589
- return -n / 2 * (Math.cos(Math.PI * e / a) - 1) + t;
691
+ return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
590
692
  },
591
- easeInExpo: function(e, t, i, a) {
693
+ easeInExpo: function(e, t, i, r) {
592
694
  var n = i - t;
593
- return e == 0 ? t : n * Math.pow(2, 10 * (e / a - 1)) + t;
695
+ return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t;
594
696
  },
595
- easeOutExpo: function(e, t, i, a) {
697
+ easeOutExpo: function(e, t, i, r) {
596
698
  var n = i - t;
597
- return e == a ? t + n : n * (-Math.pow(2, -10 * e / a) + 1) + t;
699
+ return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t;
598
700
  },
599
- easeInOutExpo: function(e, t, i, a) {
701
+ easeInOutExpo: function(e, t, i, r) {
600
702
  var n = i - t;
601
- return e === 0 ? t : e === a ? t + n : (e /= a / 2) < 1 ? n / 2 * Math.pow(2, 10 * (e - 1)) + t : n / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
703
+ return e === 0 ? t : e === r ? t + n : (e /= r / 2) < 1 ? n / 2 * Math.pow(2, 10 * (e - 1)) + t : n / 2 * (-Math.pow(2, -10 * --e) + 2) + t;
602
704
  },
603
- easeInCirc: function(e, t, i, a) {
705
+ easeInCirc: function(e, t, i, r) {
604
706
  var n = i - t;
605
- return -n * (Math.sqrt(1 - (e /= a) * e) - 1) + t;
707
+ return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
606
708
  },
607
- easeOutCirc: function(e, t, i, a) {
709
+ easeOutCirc: function(e, t, i, r) {
608
710
  var n = i - t;
609
- return n * Math.sqrt(1 - (e = e / a - 1) * e) + t;
711
+ return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
610
712
  },
611
- easeInOutCirc: function(e, t, i, a) {
713
+ easeInOutCirc: function(e, t, i, r) {
612
714
  var n = i - t;
613
- return (e /= a / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
715
+ return (e /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
614
716
  },
615
- easeInElastic: function(e, t, i, a) {
616
- var n = i - t, d, c, I;
617
- return I = 1.70158, c = 0, d = n, e === 0 ? t : (e /= a) === 1 ? t + n : (c || (c = a * 0.3), d < Math.abs(n) ? (d = n, I = c / 4) : I = c / (2 * Math.PI) * Math.asin(n / d), -(d * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * a - I) * (2 * Math.PI) / c)) + t);
717
+ easeInElastic: function(e, t, i, r) {
718
+ var n = i - t, d, c, k;
719
+ return k = 1.70158, c = 0, d = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), d < Math.abs(n) ? (d = n, k = c / 4) : k = c / (2 * Math.PI) * Math.asin(n / d), -(d * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - k) * (2 * Math.PI) / c)) + t);
618
720
  },
619
- easeOutElastic: function(e, t, i, a) {
620
- var n = i - t, d, c, I;
621
- return I = 1.70158, c = 0, d = n, e === 0 ? t : (e /= a) === 1 ? t + n : (c || (c = a * 0.3), d < Math.abs(n) ? (d = n, I = c / 4) : I = c / (2 * Math.PI) * Math.asin(n / d), d * Math.pow(2, -10 * e) * Math.sin((e * a - I) * (2 * Math.PI) / c) + n + t);
721
+ easeOutElastic: function(e, t, i, r) {
722
+ var n = i - t, d, c, k;
723
+ return k = 1.70158, c = 0, d = n, e === 0 ? t : (e /= r) === 1 ? t + n : (c || (c = r * 0.3), d < Math.abs(n) ? (d = n, k = c / 4) : k = c / (2 * Math.PI) * Math.asin(n / d), d * Math.pow(2, -10 * e) * Math.sin((e * r - k) * (2 * Math.PI) / c) + n + t);
622
724
  },
623
- easeInOutElastic: function(e, t, i, a) {
624
- var n = i - t, d, c, I;
625
- return I = 1.70158, c = 0, d = n, e === 0 ? t : (e /= a / 2) === 2 ? t + n : (c || (c = a * (0.3 * 1.5)), d < Math.abs(n) ? (d = n, I = c / 4) : I = c / (2 * Math.PI) * Math.asin(n / d), e < 1 ? -0.5 * (d * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * a - I) * (2 * Math.PI) / c)) + t : d * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * a - I) * (2 * Math.PI) / c) * 0.5 + n + t);
725
+ easeInOutElastic: function(e, t, i, r) {
726
+ var n = i - t, d, c, k;
727
+ return k = 1.70158, c = 0, d = n, e === 0 ? t : (e /= r / 2) === 2 ? t + n : (c || (c = r * (0.3 * 1.5)), d < Math.abs(n) ? (d = n, k = c / 4) : k = c / (2 * Math.PI) * Math.asin(n / d), e < 1 ? -0.5 * (d * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - k) * (2 * Math.PI) / c)) + t : d * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - k) * (2 * Math.PI) / c) * 0.5 + n + t);
626
728
  },
627
- easeInBack: function(e, t, i, a, n) {
729
+ easeInBack: function(e, t, i, r, n) {
628
730
  var d = i - t;
629
- return n === void 0 && (n = 1.70158), d * (e /= a) * e * ((n + 1) * e - n) + t;
731
+ return n === void 0 && (n = 1.70158), d * (e /= r) * e * ((n + 1) * e - n) + t;
630
732
  },
631
- easeOutBack: function(e, t, i, a, n) {
733
+ easeOutBack: function(e, t, i, r, n) {
632
734
  var d = i - t;
633
- return n === void 0 && (n = 1.70158), d * ((e = e / a - 1) * e * ((n + 1) * e + n) + 1) + t;
735
+ return n === void 0 && (n = 1.70158), d * ((e = e / r - 1) * e * ((n + 1) * e + n) + 1) + t;
634
736
  },
635
- easeInOutBack: function(e, t, i, a, n) {
737
+ easeInOutBack: function(e, t, i, r, n) {
636
738
  var d = i - t;
637
- return n === void 0 && (n = 1.70158), (e /= a / 2) < 1 ? d / 2 * (e * e * (((n *= 1.525) + 1) * e - n)) + t : d / 2 * ((e -= 2) * e * (((n *= 1.525) + 1) * e + n) + 2) + t;
739
+ return n === void 0 && (n = 1.70158), (e /= r / 2) < 1 ? d / 2 * (e * e * (((n *= 1.525) + 1) * e - n)) + t : d / 2 * ((e -= 2) * e * (((n *= 1.525) + 1) * e + n) + 2) + t;
638
740
  },
639
- easeInBounce: function(e, t, i, a) {
741
+ easeInBounce: function(e, t, i, r) {
640
742
  var n = i - t, d;
641
- return d = o.easeOutBounce(a - e, 0, n, a), n - d + t;
743
+ return d = a.easeOutBounce(r - e, 0, n, r), n - d + t;
642
744
  },
643
- easeOutBounce: function(e, t, i, a) {
745
+ easeOutBounce: function(e, t, i, r) {
644
746
  var n = i - t;
645
- return (e /= a) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
747
+ return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
646
748
  },
647
- easeInOutBounce: function(e, t, i, a) {
749
+ easeInOutBounce: function(e, t, i, r) {
648
750
  var n = i - t, d;
649
- return e < a / 2 ? (d = o.easeInBounce(e * 2, 0, n, a), d * 0.5 + t) : (d = o.easeOutBounce(e * 2 - a, 0, n, a), d * 0.5 + n * 0.5 + t);
751
+ return e < r / 2 ? (d = a.easeInBounce(e * 2, 0, n, r), d * 0.5 + t) : (d = a.easeOutBounce(e * 2 - r, 0, n, r), d * 0.5 + n * 0.5 + t);
650
752
  }
651
753
  };
652
- return Qe = o, Qe;
754
+ return st = a, st;
653
755
  }
654
- var Lt = At();
655
- function Dt(o) {
656
- return o * Math.PI / 180;
756
+ var zt = qt();
757
+ function Vt(a) {
758
+ return a * Math.PI / 180;
657
759
  }
658
- function re(o, e) {
659
- return o + Math.random() * (e - o);
760
+ function ye(a, e) {
761
+ return a + Math.random() * (e - a);
660
762
  }
661
- function $t(o, e) {
662
- return Math.floor(o + Math.random() * (e - o + 1));
763
+ function jt(a, e) {
764
+ return Math.floor(a + Math.random() * (e - a + 1));
663
765
  }
664
- var De;
665
- (function(o) {
666
- o[o.Circle = 0] = "Circle", o[o.Square = 1] = "Square", o[o.Strip = 2] = "Strip";
667
- })(De || (De = {}));
668
- var Re;
669
- (function(o) {
670
- o[o.Positive = 1] = "Positive", o[o.Negative = -1] = "Negative";
671
- })(Re || (Re = {}));
672
- const Et = 1e3 / 60;
673
- class qt {
674
- constructor(e, t, i, a) {
766
+ var Ye;
767
+ (function(a) {
768
+ a[a.Circle = 0] = "Circle", a[a.Square = 1] = "Square", a[a.Strip = 2] = "Strip";
769
+ })(Ye || (Ye = {}));
770
+ var Ee;
771
+ (function(a) {
772
+ a[a.Positive = 1] = "Positive", a[a.Negative = -1] = "Negative";
773
+ })(Ee || (Ee = {}));
774
+ const Wt = 1e3 / 60;
775
+ class Ut {
776
+ constructor(e, t, i, r) {
675
777
  this.getOptions = t;
676
778
  const { colors: n, initialVelocityX: d, initialVelocityY: c } = this.getOptions();
677
- this.context = e, this.x = i, this.y = a, this.w = re(5, 20), this.h = re(5, 20), this.radius = re(5, 10), this.vx = typeof d == "number" ? re(-d, d) : re(d.min, d.max), this.vy = typeof c == "number" ? re(-c, 0) : re(c.min, c.max), this.shape = $t(0, 2), this.angle = Dt(re(0, 360)), this.angularSpin = re(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = re(0, 1), this.rotationDirection = re(0, 1) ? Re.Positive : Re.Negative;
779
+ this.context = e, this.x = i, this.y = r, this.w = ye(5, 20), this.h = ye(5, 20), this.radius = ye(5, 10), this.vx = typeof d == "number" ? ye(-d, d) : ye(d.min, d.max), this.vy = typeof c == "number" ? ye(-c, 0) : ye(c.min, c.max), this.shape = jt(0, 2), this.angle = Vt(ye(0, 360)), this.angularSpin = ye(-0.2, 0.2), this.color = n[Math.floor(Math.random() * n.length)], this.rotateY = ye(0, 1), this.rotationDirection = ye(0, 1) ? Ee.Positive : Ee.Negative;
678
780
  }
679
781
  update(e) {
680
- const { gravity: t, wind: i, friction: a, opacity: n, drawShape: d } = this.getOptions(), c = e / Et;
681
- this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += i * c, this.vx *= a ** c, this.vy *= a ** c, this.rotateY >= 1 && this.rotationDirection === Re.Positive ? this.rotationDirection = Re.Negative : this.rotateY <= -1 && this.rotationDirection === Re.Negative && (this.rotationDirection = Re.Positive);
682
- const I = 0.1 * this.rotationDirection * c;
683
- if (this.rotateY += I, 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, d && typeof d == "function")
782
+ const { gravity: t, wind: i, friction: r, opacity: n, drawShape: d } = this.getOptions(), c = e / Wt;
783
+ this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += i * c, this.vx *= r ** c, this.vy *= r ** c, this.rotateY >= 1 && this.rotationDirection === Ee.Positive ? this.rotationDirection = Ee.Negative : this.rotateY <= -1 && this.rotationDirection === Ee.Negative && (this.rotationDirection = Ee.Positive);
784
+ const k = 0.1 * this.rotationDirection * c;
785
+ if (this.rotateY += k, 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, d && typeof d == "function")
684
786
  d.call(this, this.context);
685
787
  else
686
788
  switch (this.shape) {
687
- case De.Circle: {
789
+ case Ye.Circle: {
688
790
  this.context.beginPath(), this.context.arc(0, 0, this.radius, 0, 2 * Math.PI), this.context.fill();
689
791
  break;
690
792
  }
691
- case De.Square: {
793
+ case Ye.Square: {
692
794
  this.context.fillRect(-this.w / 2, -this.h / 2, this.w, this.h);
693
795
  break;
694
796
  }
695
- case De.Strip: {
797
+ case Ye.Strip: {
696
798
  this.context.fillRect(-this.w / 6, -this.h / 2, this.w / 3, this.h);
697
799
  break;
698
800
  }
@@ -700,31 +802,31 @@ class qt {
700
802
  this.context.closePath(), this.context.restore();
701
803
  }
702
804
  }
703
- class Vt {
805
+ class Ht {
704
806
  constructor(e, t) {
705
- 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 = (a) => {
706
- this.particles.splice(a, 1);
807
+ 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) => {
808
+ this.particles.splice(r, 1);
707
809
  }, this.getParticle = () => {
708
- const a = re(this.x, this.w + this.x), n = re(this.y, this.h + this.y);
709
- return new qt(this.context, this.getOptions, a, n);
710
- }, this.animate = (a) => {
711
- const { canvas: n, context: d, particlesGenerated: c, lastNumberOfPieces: I } = this, { run: G, recycle: g, numberOfPieces: A, debug: P, tweenFunction: z, tweenDuration: H } = this.getOptions();
712
- if (!G)
810
+ const r = ye(this.x, this.w + this.x), n = ye(this.y, this.h + this.y);
811
+ return new Ut(this.context, this.getOptions, r, n);
812
+ }, this.animate = (r) => {
813
+ const { canvas: n, context: d, particlesGenerated: c, lastNumberOfPieces: k } = this, { run: Y, recycle: P, numberOfPieces: Z, debug: O, tweenFunction: E, tweenDuration: X } = this.getOptions();
814
+ if (!Y)
713
815
  return !1;
714
- const te = this.particles.length, ne = g ? te : c;
715
- if (ne < A) {
716
- I !== A && (this.tweenProgress = 0, this.tweenFrom = ne, this.lastNumberOfPieces = A), this.tweenProgress = Math.min(H, Math.max(0, this.tweenProgress + a));
717
- const L = z(this.tweenProgress, this.tweenFrom, A, H), Q = Math.round(L - ne);
718
- for (let ee = 0; ee < Q; ee++)
816
+ const le = this.particles.length, ce = P ? le : c;
817
+ if (ce < Z) {
818
+ k !== Z && (this.tweenProgress = 0, this.tweenFrom = ce, this.lastNumberOfPieces = Z), this.tweenProgress = Math.min(X, Math.max(0, this.tweenProgress + r));
819
+ const j = E(this.tweenProgress, this.tweenFrom, Z, X), te = Math.round(j - ce);
820
+ for (let re = 0; re < te; re++)
719
821
  this.particles.push(this.getParticle());
720
- this.particlesGenerated += Q;
822
+ this.particlesGenerated += te;
721
823
  }
722
- P && (d.font = "12px sans-serif", d.fillStyle = "#333", d.textAlign = "right", d.fillText(`Particles: ${te}`, n.width - 10, n.height - 20));
723
- for (let L = this.particles.length - 1; L >= 0; L--) {
724
- const Q = this.particles[L];
725
- Q.update(a), (Q.y > n.height || Q.y < -100 || Q.x > n.width + 100 || Q.x < -100) && (g && ne <= A ? this.particles[L] = this.getParticle() : this.removeParticleAt(L));
824
+ O && (d.font = "12px sans-serif", d.fillStyle = "#333", d.textAlign = "right", d.fillText(`Particles: ${le}`, n.width - 10, n.height - 20));
825
+ for (let j = this.particles.length - 1; j >= 0; j--) {
826
+ const te = this.particles[j];
827
+ te.update(r), (te.y > n.height || te.y < -100 || te.x > n.width + 100 || te.x < -100) && (P && ce <= Z ? this.particles[j] = this.getParticle() : this.removeParticleAt(j));
726
828
  }
727
- return te > 0 || ne < A;
829
+ return le > 0 || ce < Z;
728
830
  }, this.canvas = e;
729
831
  const i = this.canvas.getContext("2d");
730
832
  if (!i)
@@ -732,7 +834,7 @@ class Vt {
732
834
  this.context = i, this.getOptions = t;
733
835
  }
734
836
  }
735
- const Je = {
837
+ const ht = {
736
838
  width: typeof window < "u" ? window.innerWidth : 300,
737
839
  height: typeof window < "u" ? window.innerHeight : 200,
738
840
  numberOfPieces: 200,
@@ -762,14 +864,14 @@ const Je = {
762
864
  ],
763
865
  opacity: 1,
764
866
  debug: !1,
765
- tweenFunction: Lt.easeInOutQuad,
867
+ tweenFunction: zt.easeInOutQuad,
766
868
  tweenDuration: 5e3,
767
869
  recycle: !0,
768
870
  run: !0
769
871
  };
770
- class zt {
872
+ class Gt {
771
873
  constructor(e, t) {
772
- this.lastFrameTime = 0, this.setOptionsWithDefaults = (a) => {
874
+ this.lastFrameTime = 0, this.setOptionsWithDefaults = (r) => {
773
875
  const n = {
774
876
  confettiSource: {
775
877
  x: 0,
@@ -780,16 +882,16 @@ class zt {
780
882
  };
781
883
  this._options = {
782
884
  ...n,
783
- ...Je,
784
- ...a
785
- }, Object.assign(this, a.confettiSource);
786
- }, this.update = (a = 0) => {
787
- const { options: { run: n, onConfettiComplete: d, frameRate: c }, canvas: I, context: G } = this, g = Math.min(a - this.lastFrameTime, 50);
788
- if (c && g < 1e3 / c) {
885
+ ...ht,
886
+ ...r
887
+ }, Object.assign(this, r.confettiSource);
888
+ }, this.update = (r = 0) => {
889
+ const { options: { run: n, onConfettiComplete: d, frameRate: c }, canvas: k, context: Y } = this, P = Math.min(r - this.lastFrameTime, 50);
890
+ if (c && P < 1e3 / c) {
789
891
  this.rafId = requestAnimationFrame(this.update);
790
892
  return;
791
893
  }
792
- this.lastFrameTime = a - (c ? g % c : 0), n && (G.fillStyle = "white", G.clearRect(0, 0, I.width, I.height)), this.generator.animate(g) ? this.rafId = requestAnimationFrame(this.update) : (d && typeof d == "function" && this.generator.particlesGenerated > 0 && d.call(this, this), this._options.run = !1);
894
+ this.lastFrameTime = r - (c ? P % c : 0), n && (Y.fillStyle = "white", Y.clearRect(0, 0, k.width, k.height)), this.generator.animate(P) ? this.rafId = requestAnimationFrame(this.update) : (d && typeof d == "function" && this.generator.particlesGenerated > 0 && d.call(this, this), this._options.run = !1);
793
895
  }, this.reset = () => {
794
896
  this.generator && this.generator.particlesGenerated > 0 && (this.generator.particlesGenerated = 0, this.generator.particles = [], this.generator.lastNumberOfPieces = 0);
795
897
  }, this.stop = () => {
@@ -798,37 +900,37 @@ class zt {
798
900
  const i = this.canvas.getContext("2d");
799
901
  if (!i)
800
902
  throw new Error("Could not get canvas context");
801
- this.context = i, this.generator = new Vt(this.canvas, () => this.options), this.options = t, this.update();
903
+ this.context = i, this.generator = new Ht(this.canvas, () => this.options), this.options = t, this.update();
802
904
  }
803
905
  get options() {
804
906
  return this._options;
805
907
  }
806
908
  set options(e) {
807
- var a, n;
808
- const t = (a = this._options) == null ? void 0 : a.run, i = (n = this._options) == null ? void 0 : n.recycle;
909
+ var r, n;
910
+ const t = (r = this._options) == null ? void 0 : r.run, i = (n = this._options) == null ? void 0 : n.recycle;
809
911
  this.setOptionsWithDefaults(e), this.generator && (Object.assign(this.generator, this.options.confettiSource), typeof e.recycle == "boolean" && e.recycle && i === !1 && (this.generator.lastNumberOfPieces = this.generator.particles.length)), typeof e.run == "boolean" && e.run && t === !1 && this.update();
810
912
  }
811
913
  }
812
- const Wt = Ve.createRef();
813
- class et extends Ve.Component {
914
+ const Qt = at.createRef();
915
+ class mt extends at.Component {
814
916
  constructor(e) {
815
- super(e), this.canvas = Ve.createRef(), this.canvas = e.canvasRef || Wt;
917
+ super(e), this.canvas = at.createRef(), this.canvas = e.canvasRef || Qt;
816
918
  }
817
919
  componentDidMount() {
818
920
  if (this.canvas.current) {
819
- const e = Ke(this.props)[0];
820
- this.confetti = new zt(this.canvas.current, e);
921
+ const e = lt(this.props)[0];
922
+ this.confetti = new Gt(this.canvas.current, e);
821
923
  }
822
924
  }
823
925
  componentDidUpdate() {
824
- const e = Ke(this.props)[0];
926
+ const e = lt(this.props)[0];
825
927
  this.confetti && (this.confetti.options = e);
826
928
  }
827
929
  componentWillUnmount() {
828
930
  this.confetti && this.confetti.stop(), this.confetti = void 0;
829
931
  }
830
932
  render() {
831
- const [e, t] = Ke(this.props), i = {
933
+ const [e, t] = lt(this.props), i = {
832
934
  zIndex: 2,
833
935
  position: "absolute",
834
936
  pointerEvents: "none",
@@ -841,39 +943,39 @@ class et extends Ve.Component {
841
943
  return s("canvas", { width: e.width, height: e.height, ref: this.canvas, ...t, style: i });
842
944
  }
843
945
  }
844
- et.defaultProps = {
845
- ...Je
946
+ mt.defaultProps = {
947
+ ...ht
846
948
  };
847
- et.displayName = "ReactConfetti";
848
- function Ke(o) {
849
- const e = {}, t = {}, i = {}, a = [
850
- ...Object.keys(Je),
949
+ mt.displayName = "ReactConfetti";
950
+ function lt(a) {
951
+ const e = {}, t = {}, i = {}, r = [
952
+ ...Object.keys(ht),
851
953
  "confettiSource",
852
954
  "drawShape",
853
955
  "onConfettiComplete",
854
956
  "frameRate"
855
957
  ], n = ["canvasRef"];
856
- for (const d in o) {
857
- const c = o[d];
858
- a.includes(d) ? e[d] = c : n.includes(d) ? n[d] = c : i[d] = c;
958
+ for (const d in a) {
959
+ const c = a[d];
960
+ r.includes(d) ? e[d] = c : n.includes(d) ? n[d] = c : i[d] = c;
859
961
  }
860
962
  return [e, i, t];
861
963
  }
862
- const Ut = Ve.forwardRef((o, e) => s(et, { canvasRef: e, ...o }));
964
+ const Kt = at.forwardRef((a, e) => s(mt, { canvasRef: e, ...a }));
863
965
  /**
864
966
  * @license lucide-react v0.515.0 - ISC
865
967
  *
866
968
  * This source code is licensed under the ISC license.
867
969
  * See the LICENSE file in the root directory of this source tree.
868
970
  */
869
- const jt = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Gt = (o) => o.replace(
971
+ const Yt = (a) => a.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xt = (a) => a.replace(
870
972
  /^([A-Z])|[\s-_]+(\w)/g,
871
973
  (e, t, i) => i ? i.toUpperCase() : t.toLowerCase()
872
- ), bt = (o) => {
873
- const e = Gt(o);
974
+ ), xt = (a) => {
975
+ const e = Xt(a);
874
976
  return e.charAt(0).toUpperCase() + e.slice(1);
875
- }, gt = (...o) => o.filter((e, t, i) => !!e && e.trim() !== "" && i.indexOf(e) === t).join(" ").trim(), Ht = (o) => {
876
- for (const e in o)
977
+ }, Bt = (...a) => a.filter((e, t, i) => !!e && e.trim() !== "" && i.indexOf(e) === t).join(" ").trim(), Zt = (a) => {
978
+ for (const e in a)
877
979
  if (e.startsWith("aria-") || e === "role" || e === "title")
878
980
  return !0;
879
981
  };
@@ -883,7 +985,7 @@ const jt = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Gt = (
883
985
  * This source code is licensed under the ISC license.
884
986
  * See the LICENSE file in the root directory of this source tree.
885
987
  */
886
- var Qt = {
988
+ var Jt = {
887
989
  xmlns: "http://www.w3.org/2000/svg",
888
990
  width: 24,
889
991
  height: 24,
@@ -900,31 +1002,31 @@ var Qt = {
900
1002
  * This source code is licensed under the ISC license.
901
1003
  * See the LICENSE file in the root directory of this source tree.
902
1004
  */
903
- const Kt = wt(
1005
+ const en = St(
904
1006
  ({
905
- color: o = "currentColor",
1007
+ color: a = "currentColor",
906
1008
  size: e = 24,
907
1009
  strokeWidth: t = 2,
908
1010
  absoluteStrokeWidth: i,
909
- className: a = "",
1011
+ className: r = "",
910
1012
  children: n,
911
1013
  iconNode: d,
912
1014
  ...c
913
- }, I) => Ze(
1015
+ }, k) => dt(
914
1016
  "svg",
915
1017
  {
916
- ref: I,
917
- ...Qt,
1018
+ ref: k,
1019
+ ...Jt,
918
1020
  width: e,
919
1021
  height: e,
920
- stroke: o,
1022
+ stroke: a,
921
1023
  strokeWidth: i ? Number(t) * 24 / Number(e) : t,
922
- className: gt("lucide", a),
923
- ...!n && !Ht(c) && { "aria-hidden": "true" },
1024
+ className: Bt("lucide", r),
1025
+ ...!n && !Zt(c) && { "aria-hidden": "true" },
924
1026
  ...c
925
1027
  },
926
1028
  [
927
- ...d.map(([G, g]) => Ze(G, g)),
1029
+ ...d.map(([Y, P]) => dt(Y, P)),
928
1030
  ...Array.isArray(n) ? n : [n]
929
1031
  ]
930
1032
  )
@@ -935,20 +1037,20 @@ const Kt = wt(
935
1037
  * This source code is licensed under the ISC license.
936
1038
  * See the LICENSE file in the root directory of this source tree.
937
1039
  */
938
- const tt = (o, e) => {
939
- const t = wt(
940
- ({ className: i, ...a }, n) => Ze(Kt, {
1040
+ const ft = (a, e) => {
1041
+ const t = St(
1042
+ ({ className: i, ...r }, n) => dt(en, {
941
1043
  ref: n,
942
1044
  iconNode: e,
943
- className: gt(
944
- `lucide-${jt(bt(o))}`,
945
- `lucide-${o}`,
1045
+ className: Bt(
1046
+ `lucide-${Yt(xt(a))}`,
1047
+ `lucide-${a}`,
946
1048
  i
947
1049
  ),
948
- ...a
1050
+ ...r
949
1051
  })
950
1052
  );
951
- return t.displayName = bt(o), t;
1053
+ return t.displayName = xt(a), t;
952
1054
  };
953
1055
  /**
954
1056
  * @license lucide-react v0.515.0 - ISC
@@ -956,324 +1058,324 @@ const tt = (o, e) => {
956
1058
  * This source code is licensed under the ISC license.
957
1059
  * See the LICENSE file in the root directory of this source tree.
958
1060
  */
959
- const Yt = [
1061
+ const tn = [
960
1062
  ["path", { d: "M5 12h14", key: "1ays0h" }],
961
1063
  ["path", { d: "M12 5v14", key: "s699le" }]
962
- ], yt = tt("plus", Yt);
1064
+ ], Ct = ft("plus", tn);
963
1065
  /**
964
1066
  * @license lucide-react v0.515.0 - ISC
965
1067
  *
966
1068
  * This source code is licensed under the ISC license.
967
1069
  * See the LICENSE file in the root directory of this source tree.
968
1070
  */
969
- const Xt = [
1071
+ const nn = [
970
1072
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
971
1073
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
972
- ], Zt = tt("search", Xt);
1074
+ ], an = ft("search", nn);
973
1075
  /**
974
1076
  * @license lucide-react v0.515.0 - ISC
975
1077
  *
976
1078
  * This source code is licensed under the ISC license.
977
1079
  * See the LICENSE file in the root directory of this source tree.
978
1080
  */
979
- const Jt = [
1081
+ const rn = [
980
1082
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
981
1083
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
982
1084
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
983
1085
  ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
984
1086
  ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
985
- ], en = tt("trash-2", Jt), tn = "_backdrop_18x6y_1", nn = "_celebrationOverlay_18x6y_14", an = "_celebrationChip_18x6y_23", rn = "_backdropOpen_18x6y_74", on = "_backdropClosed_18x6y_78", sn = "_panel_18x6y_82", ln = "_panelOpen_18x6y_103", cn = "_panelClosed_18x6y_107", un = "_header_18x6y_146", dn = "_headerCenter_18x6y_155", hn = "_title_18x6y_163", mn = "_searchIconButton_18x6y_172", fn = "_headerTitleWrap_18x6y_195", pn = "_headerSearchWrap_18x6y_199", _n = "_headerSearchOpen_18x6y_211", bn = "_searchBar_18x6y_223", yn = "_searchInput_18x6y_235", vn = "_searchClearButton_18x6y_256", wn = "_closeButton_18x6y_278", xn = "_body_18x6y_312", gn = "_muted_18x6y_317", In = "_error_18x6y_322", Cn = "_variants_18x6y_327", Nn = "_variantList_18x6y_331", Sn = "_variantRow_18x6y_339", Bn = "_variantRowSoldOut_18x6y_347", Tn = "_variantLeft_18x6y_351", Rn = "_addToBundleButton_18x6y_358", kn = "_soldOutContainer_18x6y_386", Pn = "_soldOut_18x6y_386", On = "_variantThumb_18x6y_403", Mn = "_variantThumbImg_18x6y_413", Fn = "_variantThumbFallback_18x6y_420", An = "_variantInfo_18x6y_430", Ln = "_variantName_18x6y_434", Dn = "_variantMeta_18x6y_443", $n = "_variantPriceRow_18x6y_451", En = "_variantCompareAt_18x6y_458", qn = "_variantPrice_18x6y_451", Vn = "_qtyControls_18x6y_469", zn = "_qtyButton_18x6y_475", Wn = "_qtyValue_18x6y_501", Un = "_footer_18x6y_508", jn = "_poweredBy_18x6y_516", Gn = "_boxSummaryWindow_18x6y_528", Hn = "_boxSummaryRow_18x6y_546", Qn = "_boxSlot_18x6y_554", Kn = "_boxItem_18x6y_563", Yn = "_boxItemClickable_18x6y_575", Xn = "_boxThresholdLabel_18x6y_584", Zn = "_boxItemPlaceholder_18x6y_595", Jn = "_boxItemFilled_18x6y_601", ea = "_boxItemThreshold_18x6y_607", ta = "_boxItemDiscountText_18x6y_615", na = "_boxItemPlus_18x6y_623", aa = "_boxItemImage_18x6y_630", ia = "_boxItemFallback_18x6y_637", ra = "_ctaButtonGroup_18x6y_648", oa = "_ctaButtonGroupAnimating_18x6y_655", sa = "_cta_18x6y_648", la = "_ctaDualLeft_18x6y_683", ca = "_ctaDualLeftAnimating_18x6y_701", ua = "_ctaDualRight_18x6y_714", da = "_ctaDualRightAnimating_18x6y_730", ha = "_ctaTotals_18x6y_741", ma = "_ctaDiscountBadge_18x6y_749", fa = "_ctaTotalsWrap_18x6y_763", pa = "_ctaTotalsWrapVisible_18x6y_776", _a = "_ctaTotalsStrike_18x6y_783", ba = "_ctaTotalsPrice_18x6y_790", h = {
986
- backdrop: tn,
987
- celebrationOverlay: nn,
988
- celebrationChip: an,
989
- backdropOpen: rn,
990
- backdropClosed: on,
991
- panel: sn,
992
- panelOpen: ln,
993
- panelClosed: cn,
994
- header: un,
995
- headerCenter: dn,
996
- title: hn,
997
- searchIconButton: mn,
998
- headerTitleWrap: fn,
999
- headerSearchWrap: pn,
1000
- headerSearchOpen: _n,
1001
- searchBar: bn,
1002
- searchInput: yn,
1003
- searchClearButton: vn,
1004
- closeButton: wn,
1005
- body: xn,
1006
- muted: gn,
1007
- error: In,
1008
- variants: Cn,
1009
- variantList: Nn,
1010
- variantRow: Sn,
1011
- variantRowSoldOut: Bn,
1012
- variantLeft: Tn,
1013
- addToBundleButton: Rn,
1014
- soldOutContainer: kn,
1015
- soldOut: Pn,
1016
- variantThumb: On,
1017
- variantThumbImg: Mn,
1018
- variantThumbFallback: Fn,
1019
- variantInfo: An,
1020
- variantName: Ln,
1021
- variantMeta: Dn,
1022
- variantPriceRow: $n,
1023
- variantCompareAt: En,
1024
- variantPrice: qn,
1025
- qtyControls: Vn,
1026
- qtyButton: zn,
1027
- qtyValue: Wn,
1028
- footer: Un,
1029
- poweredBy: jn,
1030
- boxSummaryWindow: Gn,
1031
- boxSummaryRow: Hn,
1032
- boxSlot: Qn,
1033
- boxItem: Kn,
1034
- boxItemClickable: Yn,
1035
- boxThresholdLabel: Xn,
1036
- boxItemPlaceholder: Zn,
1037
- boxItemFilled: Jn,
1038
- boxItemThreshold: ea,
1039
- boxItemDiscountText: ta,
1040
- boxItemPlus: na,
1041
- boxItemImage: aa,
1042
- boxItemFallback: ia,
1043
- ctaButtonGroup: ra,
1044
- ctaButtonGroupAnimating: oa,
1045
- cta: sa,
1046
- ctaDualLeft: la,
1047
- ctaDualLeftAnimating: ca,
1048
- ctaDualRight: ua,
1049
- ctaDualRightAnimating: da,
1050
- ctaTotals: ha,
1051
- ctaDiscountBadge: ma,
1052
- ctaTotalsWrap: fa,
1053
- ctaTotalsWrapVisible: pa,
1054
- ctaTotalsStrike: _a,
1055
- ctaTotalsPrice: ba
1087
+ ], on = ft("trash-2", rn), sn = "_backdrop_18x6y_1", ln = "_celebrationOverlay_18x6y_14", cn = "_celebrationChip_18x6y_23", un = "_backdropOpen_18x6y_74", dn = "_backdropClosed_18x6y_78", hn = "_panel_18x6y_82", mn = "_panelOpen_18x6y_103", fn = "_panelClosed_18x6y_107", bn = "_header_18x6y_146", pn = "_headerCenter_18x6y_155", _n = "_title_18x6y_163", yn = "_searchIconButton_18x6y_172", wn = "_headerTitleWrap_18x6y_195", vn = "_headerSearchWrap_18x6y_199", gn = "_headerSearchOpen_18x6y_211", xn = "_searchBar_18x6y_223", Cn = "_searchInput_18x6y_235", In = "_searchClearButton_18x6y_256", Sn = "_closeButton_18x6y_278", Nn = "_body_18x6y_312", Bn = "_muted_18x6y_317", Tn = "_error_18x6y_322", kn = "_variants_18x6y_327", Rn = "_variantList_18x6y_331", Pn = "_variantRow_18x6y_339", On = "_variantRowSoldOut_18x6y_347", Fn = "_variantLeft_18x6y_351", Mn = "_addToBundleButton_18x6y_358", An = "_soldOutContainer_18x6y_386", Ln = "_soldOut_18x6y_386", Dn = "_variantThumb_18x6y_403", $n = "_variantThumbImg_18x6y_413", En = "_variantThumbFallback_18x6y_420", qn = "_variantInfo_18x6y_430", zn = "_variantName_18x6y_434", Vn = "_variantMeta_18x6y_443", jn = "_variantPriceRow_18x6y_451", Wn = "_variantCompareAt_18x6y_458", Un = "_variantPrice_18x6y_451", Hn = "_qtyControls_18x6y_469", Gn = "_qtyButton_18x6y_475", Qn = "_qtyValue_18x6y_501", Kn = "_footer_18x6y_508", Yn = "_poweredBy_18x6y_516", Xn = "_boxSummaryWindow_18x6y_528", Zn = "_boxSummaryRow_18x6y_546", Jn = "_boxSlot_18x6y_554", ea = "_boxItem_18x6y_563", ta = "_boxItemClickable_18x6y_575", na = "_boxThresholdLabel_18x6y_584", aa = "_boxItemPlaceholder_18x6y_595", ra = "_boxItemFilled_18x6y_601", ia = "_boxItemThreshold_18x6y_607", oa = "_boxItemDiscountText_18x6y_615", sa = "_boxItemPlus_18x6y_623", la = "_boxItemImage_18x6y_630", ca = "_boxItemFallback_18x6y_637", ua = "_ctaButtonGroup_18x6y_648", da = "_ctaButtonGroupAnimating_18x6y_655", ha = "_cta_18x6y_648", ma = "_ctaDualLeft_18x6y_683", fa = "_ctaDualLeftAnimating_18x6y_701", ba = "_ctaDualRight_18x6y_714", pa = "_ctaDualRightAnimating_18x6y_730", _a = "_ctaTotals_18x6y_741", ya = "_ctaDiscountBadge_18x6y_749", wa = "_ctaTotalsWrap_18x6y_763", va = "_ctaTotalsWrapVisible_18x6y_776", ga = "_ctaTotalsStrike_18x6y_783", xa = "_ctaTotalsPrice_18x6y_790", h = {
1088
+ backdrop: sn,
1089
+ celebrationOverlay: ln,
1090
+ celebrationChip: cn,
1091
+ backdropOpen: un,
1092
+ backdropClosed: dn,
1093
+ panel: hn,
1094
+ panelOpen: mn,
1095
+ panelClosed: fn,
1096
+ header: bn,
1097
+ headerCenter: pn,
1098
+ title: _n,
1099
+ searchIconButton: yn,
1100
+ headerTitleWrap: wn,
1101
+ headerSearchWrap: vn,
1102
+ headerSearchOpen: gn,
1103
+ searchBar: xn,
1104
+ searchInput: Cn,
1105
+ searchClearButton: In,
1106
+ closeButton: Sn,
1107
+ body: Nn,
1108
+ muted: Bn,
1109
+ error: Tn,
1110
+ variants: kn,
1111
+ variantList: Rn,
1112
+ variantRow: Pn,
1113
+ variantRowSoldOut: On,
1114
+ variantLeft: Fn,
1115
+ addToBundleButton: Mn,
1116
+ soldOutContainer: An,
1117
+ soldOut: Ln,
1118
+ variantThumb: Dn,
1119
+ variantThumbImg: $n,
1120
+ variantThumbFallback: En,
1121
+ variantInfo: qn,
1122
+ variantName: zn,
1123
+ variantMeta: Vn,
1124
+ variantPriceRow: jn,
1125
+ variantCompareAt: Wn,
1126
+ variantPrice: Un,
1127
+ qtyControls: Hn,
1128
+ qtyButton: Gn,
1129
+ qtyValue: Qn,
1130
+ footer: Kn,
1131
+ poweredBy: Yn,
1132
+ boxSummaryWindow: Xn,
1133
+ boxSummaryRow: Zn,
1134
+ boxSlot: Jn,
1135
+ boxItem: ea,
1136
+ boxItemClickable: ta,
1137
+ boxThresholdLabel: na,
1138
+ boxItemPlaceholder: aa,
1139
+ boxItemFilled: ra,
1140
+ boxItemThreshold: ia,
1141
+ boxItemDiscountText: oa,
1142
+ boxItemPlus: sa,
1143
+ boxItemImage: la,
1144
+ boxItemFallback: ca,
1145
+ ctaButtonGroup: ua,
1146
+ ctaButtonGroupAnimating: da,
1147
+ cta: ha,
1148
+ ctaDualLeft: ma,
1149
+ ctaDualLeftAnimating: fa,
1150
+ ctaDualRight: ba,
1151
+ ctaDualRightAnimating: pa,
1152
+ ctaTotals: _a,
1153
+ ctaDiscountBadge: ya,
1154
+ ctaTotalsWrap: wa,
1155
+ ctaTotalsWrapVisible: va,
1156
+ ctaTotalsStrike: ga,
1157
+ ctaTotalsPrice: xa
1056
1158
  };
1057
- function Di(o) {
1058
- var ct, ut;
1159
+ function Hr(a) {
1160
+ var ae, V;
1059
1161
  const {
1060
1162
  isOpen: e,
1061
1163
  close: t,
1062
1164
  loading: i,
1063
- submitting: a,
1165
+ submitting: r,
1064
1166
  error: n,
1065
1167
  currencyCode: d,
1066
1168
  config: c,
1067
- eligibleVariants: I,
1068
- selections: G,
1069
- selectionOrder: g,
1070
- setQuantity: A,
1071
- bundleSize: P,
1072
- minRequired: z,
1073
- canSubmit: H,
1074
- submit: te,
1075
- submitAndCheckout: ne
1076
- } = ze(), [L, Q] = j(!1), [ee, ue] = j(""), w = J(null), D = J(null), W = J(null), [Y, de] = j(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Ce, Ne] = j(0), [ae, oe] = j(null), [we, xe] = j(!1), X = J(null), se = J(P), ke = 7e3, [ge, he] = j(0), [ye, me] = j(null), [fe, pe] = j(!1), le = J(null), m = 2800, p = [
1169
+ eligibleVariants: k,
1170
+ selections: Y,
1171
+ selectionOrder: P,
1172
+ setQuantity: Z,
1173
+ bundleSize: O,
1174
+ minRequired: E,
1175
+ canSubmit: X,
1176
+ submit: le,
1177
+ submitAndCheckout: ce
1178
+ } = rt(), [j, te] = G(!1), [re, ie] = G(""), J = U(null), H = U(null), ee = U(null), [fe, ue] = G(() => typeof window > "u" ? { width: 0, height: 0 } : { width: window.innerWidth, height: window.innerHeight }), [Fe, Me] = G(0), [be, Ge] = G(null), [Ne, ve] = G(!1), ge = U(null), qe = U(O), ke = 7e3, [ze, je] = G(0), [Be, oe] = G(null), [xe, Re] = G(!1), de = U(null), m = 2800, b = [
1077
1179
  "#2563eb",
1078
1180
  "#3b82f6",
1079
1181
  "#60a5fa",
1080
1182
  "#93c5fd",
1081
1183
  "#bae6fd",
1082
1184
  "#e0f2fe"
1083
- ], r = k(() => {
1084
- var u;
1085
- const l = (u = c == null ? void 0 : c.styleSettings) == null ? void 0 : u.confettiColors;
1086
- return Array.isArray(l) && l.length >= 6 ? l.slice(0, 6).map(
1087
- (v, N) => typeof v == "string" && v.trim() ? v : p[N]
1088
- ) : [...p];
1089
- }, [(ct = c == null ? void 0 : c.styleSettings) == null ? void 0 : ct.confettiColors]), _ = (l) => {
1090
- const u = Number.parseFloat(l);
1091
- return Number.isFinite(u) ? String(Math.round(u)) : l;
1092
- }, x = (l) => {
1093
- const u = (l ?? []).filter((v) => {
1094
- var F, M;
1095
- const N = (F = v == null ? void 0 : v.name) == null ? void 0 : F.trim(), C = (M = v == null ? void 0 : v.value) == null ? void 0 : M.trim();
1096
- return !(!N || !C || N.toLowerCase() === "title");
1185
+ ], w = A(() => {
1186
+ var l;
1187
+ const o = (l = c == null ? void 0 : c.styleSettings) == null ? void 0 : l.confettiColors;
1188
+ return Array.isArray(o) && o.length >= 6 ? o.slice(0, 6).map(
1189
+ (p, S) => typeof p == "string" && p.trim() ? p : b[S]
1190
+ ) : [...b];
1191
+ }, [(ae = c == null ? void 0 : c.styleSettings) == null ? void 0 : ae.confettiColors]), L = (o) => {
1192
+ const l = Number.parseFloat(o);
1193
+ return Number.isFinite(l) ? String(Math.round(l)) : o;
1194
+ }, B = (o) => {
1195
+ const l = (o ?? []).filter((p) => {
1196
+ var N, x;
1197
+ const S = (N = p == null ? void 0 : p.name) == null ? void 0 : N.trim(), C = (x = p == null ? void 0 : p.value) == null ? void 0 : x.trim();
1198
+ return !(!S || !C || S.toLowerCase() === "title");
1097
1199
  });
1098
- return u.length ? u.map((v) => `${v.name}: ${v.value}`).join(" · ") : null;
1099
- }, b = (l) => {
1100
- var u;
1101
- return ((u = l.product) == null ? void 0 : u.title) ?? l.displayName ?? l.title;
1102
- }, y = (l) => {
1103
- const u = b(l), v = x(l.selectedOptions);
1104
- return [u, v].filter(Boolean).join(" — ");
1105
- }, [R, U] = j(e), B = J(null), E = (l) => {
1106
- const u = Number(l);
1107
- if (!Number.isFinite(u)) return l;
1200
+ return l.length ? l.map((p) => `${p.name}: ${p.value}`).join(" · ") : null;
1201
+ }, q = (o) => {
1202
+ var l;
1203
+ return ((l = o.product) == null ? void 0 : l.title) ?? o.displayName ?? o.title;
1204
+ }, T = (o) => {
1205
+ const l = q(o), p = B(o.selectedOptions);
1206
+ return [l, p].filter(Boolean).join(" — ");
1207
+ }, [Q, Ce] = G(e), z = U(null), pe = (o) => {
1208
+ const l = Number(o);
1209
+ if (!Number.isFinite(l)) return o;
1108
1210
  if (d)
1109
1211
  try {
1110
- return new Intl.NumberFormat(void 0, { style: "currency", currency: d }).format(u);
1212
+ return new Intl.NumberFormat(void 0, { style: "currency", currency: d }).format(l);
1111
1213
  } catch {
1112
1214
  }
1113
- return `$${u.toFixed(2)}`;
1114
- }, K = ((ut = c == null ? void 0 : c.title) == null ? void 0 : ut.trim()) || "Build your bundle", _e = k(() => {
1115
- const l = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), u = Number.isFinite(l) ? Math.floor(l) : 100;
1116
- return Math.max(2, Math.min(100, u));
1117
- }, [c == null ? void 0 : c.maxBundleSize]), be = P >= _e, Se = k(() => [...I].sort((l, u) => l.displayName.localeCompare(u.displayName)), [I]), ie = k(() => {
1118
- const l = ee.trim().toLowerCase();
1119
- if (!l) return Se;
1120
- const u = l.split(/\s+/).filter(Boolean), v = (N) => {
1121
- var M;
1215
+ return `$${l.toFixed(2)}`;
1216
+ }, Pe = ((V = c == null ? void 0 : c.title) == null ? void 0 : V.trim()) || "Build your bundle", he = A(() => {
1217
+ const o = Number((c == null ? void 0 : c.maxBundleSize) ?? NaN), l = Number.isFinite(o) ? Math.floor(o) : 100;
1218
+ return Math.max(2, Math.min(100, l));
1219
+ }, [c == null ? void 0 : c.maxBundleSize]), g = O >= he, Te = A(() => [...k].sort((o, l) => o.displayName.localeCompare(l.displayName)), [k]), Ae = A(() => {
1220
+ const o = re.trim().toLowerCase();
1221
+ if (!o) return Te;
1222
+ const l = o.split(/\s+/).filter(Boolean), p = (S) => {
1223
+ var x;
1122
1224
  const C = [];
1123
- C.push(N.displayName), (M = N.product) != null && M.title && C.push(N.product.title);
1124
- for (const $ of N.selectedOptions ?? [])
1125
- C.push($.name), C.push($.value);
1126
- const F = C.join(" ").toLowerCase();
1127
- return u.every(($) => F.includes($));
1225
+ C.push(S.displayName), (x = S.product) != null && x.title && C.push(S.product.title);
1226
+ for (const D of S.selectedOptions ?? [])
1227
+ C.push(D.name), C.push(D.value);
1228
+ const N = C.join(" ").toLowerCase();
1229
+ return l.every((D) => N.includes(D));
1128
1230
  };
1129
- return Se.filter(v);
1130
- }, [ee, Se]), O = k(() => [...(c == null ? void 0 : c.rules) ?? []].sort((l, u) => l.minBundleSize - u.minBundleSize), [c == null ? void 0 : c.rules]), q = k(() => Math.max(0, z - P), [P, z]), T = k(() => {
1131
- let l = null;
1132
- for (const u of O)
1133
- P >= u.minBundleSize && (l = u);
1134
- return l;
1135
- }, [P, O]), Z = k(() => {
1136
- if (!T) return null;
1137
- const l = Number.parseFloat(T.discountPercent);
1138
- return !Number.isFinite(l) || l <= 0 ? null : l;
1139
- }, [T]), Fe = O[0], Me = !!(Fe && P >= Fe.minBundleSize), Be = k(() => {
1140
- const l = new Map(I.map((v) => [v.id, v]));
1141
- let u = 0;
1142
- for (const [v, N] of Object.entries(G)) {
1143
- const C = N ?? 0;
1231
+ return Te.filter(p);
1232
+ }, [re, Te]), W = A(() => [...(c == null ? void 0 : c.rules) ?? []].sort((o, l) => o.minBundleSize - l.minBundleSize), [c == null ? void 0 : c.rules]), ne = A(() => Math.max(0, E - O), [O, E]), Ie = A(() => {
1233
+ let o = null;
1234
+ for (const l of W)
1235
+ O >= l.minBundleSize && (o = l);
1236
+ return o;
1237
+ }, [O, W]), se = A(() => {
1238
+ if (!Ie) return null;
1239
+ const o = Number.parseFloat(Ie.discountPercent);
1240
+ return !Number.isFinite(o) || o <= 0 ? null : o;
1241
+ }, [Ie]), Qe = W[0], Ve = !!(Qe && O >= Qe.minBundleSize), _e = A(() => {
1242
+ const o = new Map(k.map((p) => [p.id, p]));
1243
+ let l = 0;
1244
+ for (const [p, S] of Object.entries(Y)) {
1245
+ const C = S ?? 0;
1144
1246
  if (C <= 0) continue;
1145
- const F = l.get(v), M = Number(F == null ? void 0 : F.price);
1146
- Number.isFinite(M) && (u += M * C);
1247
+ const N = o.get(p), x = Number(N == null ? void 0 : N.price);
1248
+ Number.isFinite(x) && (l += x * C);
1147
1249
  }
1148
- return Math.round(u * 100) / 100;
1149
- }, [I, G]), It = k(() => {
1150
- if (!Z) return Be;
1151
- const l = Be * (1 - Z / 100);
1152
1250
  return Math.round(l * 100) / 100;
1153
- }, [Z, Be]), nt = k(() => O.length ? Math.max(...O.map((l) => l.minBundleSize)) : 0, [O]), We = k(() => {
1154
- const l = new Map(I.map((u) => [u.id, u]));
1155
- return g.map((u) => l.get(u)).filter((u) => !!u);
1156
- }, [I, g]), Ct = k(() => {
1157
- var u;
1158
- const l = /* @__PURE__ */ new Map();
1159
- for (const v of O) {
1160
- const N = Math.max(0, v.minBundleSize - 1);
1161
- l.set(N, {
1162
- discountPercent: v.discountPercent,
1163
- minBundleSize: v.minBundleSize,
1164
- label: ((u = v.label) == null ? void 0 : u.trim()) || `Buy ${v.minBundleSize}+`
1251
+ }, [k, Y]), Xe = A(() => {
1252
+ if (!se) return _e;
1253
+ const o = _e * (1 - se / 100);
1254
+ return Math.round(o * 100) / 100;
1255
+ }, [se, _e]), Oe = A(() => W.length ? Math.max(...W.map((o) => o.minBundleSize)) : 0, [W]), Le = A(() => {
1256
+ const o = new Map(k.map((l) => [l.id, l]));
1257
+ return P.map((l) => o.get(l)).filter((l) => !!l);
1258
+ }, [k, P]), We = A(() => {
1259
+ var l;
1260
+ const o = /* @__PURE__ */ new Map();
1261
+ for (const p of W) {
1262
+ const S = Math.max(0, p.minBundleSize - 1);
1263
+ o.set(S, {
1264
+ discountPercent: p.discountPercent,
1265
+ minBundleSize: p.minBundleSize,
1266
+ label: ((l = p.label) == null ? void 0 : l.trim()) || `Buy ${p.minBundleSize}+`
1165
1267
  });
1166
1268
  }
1167
- return l;
1168
- }, [O]), Nt = k(() => Math.max(nt || z, We.length), [We.length, nt, z]), [Ue, at] = j(!0), it = J(q);
1169
- V(() => {
1269
+ return o;
1270
+ }, [W]), Ze = A(() => Math.max(Oe || E, Le.length), [Le.length, Oe, E]), [Ue, Je] = G(!0), u = U(ne);
1271
+ $(() => {
1170
1272
  if (((c == null ? void 0 : c.ctaButtonMode) || "add_to_cart") === "add_to_cart_checkout") {
1171
- const u = it.current > 0;
1172
- at(!(u && q === 0));
1273
+ const l = u.current > 0;
1274
+ Je(!(l && ne === 0));
1173
1275
  }
1174
- it.current = q;
1175
- }, [q, c == null ? void 0 : c.ctaButtonMode]);
1176
- const je = J(null), rt = J(null), ot = J(null), st = J(P), lt = (l) => {
1177
- const u = rt.current;
1178
- if (!u) return;
1179
- const v = u.querySelector(`[data-variant-row="${l}"]`);
1180
- if (!v) return;
1181
- const N = u.getBoundingClientRect(), C = v.getBoundingClientRect(), F = 8;
1182
- if (C.top >= N.top + F && C.bottom <= N.bottom - F) return;
1183
- const $ = Math.max(0, u.scrollHeight - u.clientHeight), ce = C.top - N.top + C.height / 2, ve = u.scrollTop + ce - u.clientHeight / 2, Ie = Math.min($, Math.max(0, ve));
1184
- u.scrollTo({ top: Ie, behavior: "smooth" });
1276
+ u.current = ne;
1277
+ }, [ne, c == null ? void 0 : c.ctaButtonMode]);
1278
+ const _ = U(null), y = U(null), v = U(null), F = U(O), M = (o) => {
1279
+ const l = y.current;
1280
+ if (!l) return;
1281
+ const p = l.querySelector(`[data-variant-row="${o}"]`);
1282
+ if (!p) return;
1283
+ const S = l.getBoundingClientRect(), C = p.getBoundingClientRect(), N = 8;
1284
+ if (C.top >= S.top + N && C.bottom <= S.bottom - N) return;
1285
+ const D = Math.max(0, l.scrollHeight - l.clientHeight), I = C.top - S.top + C.height / 2, K = l.scrollTop + I - l.clientHeight / 2, we = Math.min(D, Math.max(0, K));
1286
+ l.scrollTo({ top: we, behavior: "smooth" });
1185
1287
  };
1186
- return V(() => {
1288
+ return $(() => {
1187
1289
  if (!e) return;
1188
- const l = (u) => {
1189
- u.key === "Escape" && t();
1290
+ const o = (l) => {
1291
+ l.key === "Escape" && t();
1190
1292
  };
1191
- return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
1192
- }, [t, e]), V(() => {
1293
+ return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
1294
+ }, [t, e]), $(() => {
1193
1295
  if (typeof window > "u") return;
1194
- const l = () => de({ width: window.innerWidth, height: window.innerHeight });
1195
- return l(), window.addEventListener("resize", l), () => window.removeEventListener("resize", l);
1196
- }, []), V(() => {
1197
- if (B.current != null && (window.clearTimeout(B.current), B.current = null), e) {
1198
- U(!0);
1296
+ const o = () => ue({ width: window.innerWidth, height: window.innerHeight });
1297
+ return o(), window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
1298
+ }, []), $(() => {
1299
+ if (z.current != null && (window.clearTimeout(z.current), z.current = null), e) {
1300
+ Ce(!0);
1199
1301
  return;
1200
1302
  }
1201
- B.current = window.setTimeout(() => {
1202
- U(!1), B.current = null;
1303
+ z.current = window.setTimeout(() => {
1304
+ Ce(!1), z.current = null;
1203
1305
  }, 220);
1204
- }, [e]), V(() => () => {
1205
- B.current != null && window.clearTimeout(B.current);
1206
- }, []), V(() => () => {
1207
- X.current != null && window.clearTimeout(X.current);
1208
- }, []), V(() => () => {
1209
- le.current != null && window.clearTimeout(le.current);
1210
- }, []), V(() => {
1211
- if (!e || !L) return;
1212
- const l = requestAnimationFrame(() => {
1213
- var u;
1214
- return (u = w.current) == null ? void 0 : u.focus();
1306
+ }, [e]), $(() => () => {
1307
+ z.current != null && window.clearTimeout(z.current);
1308
+ }, []), $(() => () => {
1309
+ ge.current != null && window.clearTimeout(ge.current);
1310
+ }, []), $(() => () => {
1311
+ de.current != null && window.clearTimeout(de.current);
1312
+ }, []), $(() => {
1313
+ if (!e || !j) return;
1314
+ const o = requestAnimationFrame(() => {
1315
+ var l;
1316
+ return (l = J.current) == null ? void 0 : l.focus();
1215
1317
  });
1216
- return () => cancelAnimationFrame(l);
1217
- }, [e, L]), V(() => {
1218
- const l = st.current;
1219
- if (st.current = P, P <= l) return;
1220
- const u = ot.current;
1221
- if (!u) return;
1222
- const v = O.some((M) => M.minBundleSize === P), N = O.find((M) => M.minBundleSize > P), C = N && v ? N.minBundleSize - 1 : N ? null : P - 1;
1318
+ return () => cancelAnimationFrame(o);
1319
+ }, [e, j]), $(() => {
1320
+ const o = F.current;
1321
+ if (F.current = O, O <= o) return;
1322
+ const l = v.current;
1323
+ if (!l) return;
1324
+ const p = W.some((x) => x.minBundleSize === O), S = W.find((x) => x.minBundleSize > O), C = S && p ? S.minBundleSize - 1 : S ? null : O - 1;
1223
1325
  if (C == null || C < 0) return;
1224
- const F = requestAnimationFrame(() => {
1225
- const M = u.querySelector(`[data-box-slot="${C}"]`);
1226
- if (!M) return;
1227
- const $ = u.getBoundingClientRect(), ve = M.getBoundingClientRect().right - $.right;
1228
- if (ve <= 1) return;
1229
- const Ie = Math.max(0, u.scrollWidth - u.clientWidth), Pe = Math.min(Ie, Math.max(0, u.scrollLeft + ve));
1230
- u.scrollTo({ left: Pe, behavior: "smooth" });
1326
+ const N = requestAnimationFrame(() => {
1327
+ const x = l.querySelector(`[data-box-slot="${C}"]`);
1328
+ if (!x) return;
1329
+ const D = l.getBoundingClientRect(), K = x.getBoundingClientRect().right - D.right;
1330
+ if (K <= 1) return;
1331
+ const we = Math.max(0, l.scrollWidth - l.clientWidth), Se = Math.min(we, Math.max(0, l.scrollLeft + K));
1332
+ l.scrollTo({ left: Se, behavior: "smooth" });
1231
1333
  });
1232
- return () => cancelAnimationFrame(F);
1233
- }, [P, O]), V(() => {
1334
+ return () => cancelAnimationFrame(N);
1335
+ }, [O, W]), $(() => {
1234
1336
  if (!e) return;
1235
- const l = se.current;
1236
- if (se.current = P, P <= l) return;
1237
- const u = O.find((v) => v.minBundleSize === P);
1238
- u && (me(`You received a ${_(u.discountPercent)}% discount!`), he((v) => v + 1), pe(!0), le.current != null && window.clearTimeout(le.current), le.current = window.setTimeout(() => {
1239
- pe(!1), le.current = null;
1337
+ const o = qe.current;
1338
+ if (qe.current = O, O <= o) return;
1339
+ const l = W.find((p) => p.minBundleSize === O);
1340
+ l && (oe(`You received a ${L(l.discountPercent)}% discount!`), je((p) => p + 1), Re(!0), de.current != null && window.clearTimeout(de.current), de.current = window.setTimeout(() => {
1341
+ Re(!1), de.current = null;
1240
1342
  }, m));
1241
- }, [P, e, O]), V(() => {
1242
- if (!e || !fe || !ye) return;
1243
- const l = requestAnimationFrame(() => {
1244
- var $;
1245
- const u = W.current, v = u == null ? void 0 : u.getBoundingClientRect(), N = ($ = je.current) == null ? void 0 : $.getBoundingClientRect(), C = v ? v.left + v.width / 2 : N ? N.left + N.width / 2 : window.innerWidth / 2, F = v ? v.top + v.height / 2 : N ? N.top + N.height / 2 : window.innerHeight / 2, M = {
1343
+ }, [O, e, W]), $(() => {
1344
+ if (!e || !xe || !Be) return;
1345
+ const o = requestAnimationFrame(() => {
1346
+ var D;
1347
+ const l = ee.current, p = l == null ? void 0 : l.getBoundingClientRect(), S = (D = _.current) == null ? void 0 : D.getBoundingClientRect(), C = p ? p.left + p.width / 2 : S ? S.left + S.width / 2 : window.innerWidth / 2, N = p ? p.top + p.height / 2 : S ? S.top + S.height / 2 : window.innerHeight / 2, x = {
1246
1348
  x: C - 2,
1247
- y: F - 2,
1349
+ y: N - 2,
1248
1350
  w: 4,
1249
1351
  h: 4
1250
1352
  };
1251
- oe(M), Ne((ce) => ce + 1), xe(!0), X.current != null && window.clearTimeout(X.current), X.current = window.setTimeout(() => {
1252
- xe(!1), X.current = null;
1353
+ Ge(x), Me((I) => I + 1), ve(!0), ge.current != null && window.clearTimeout(ge.current), ge.current = window.setTimeout(() => {
1354
+ ve(!1), ge.current = null;
1253
1355
  }, ke);
1254
1356
  });
1255
- return () => cancelAnimationFrame(l);
1256
- }, [ge, ye, ke, fe, e]), V(() => {
1257
- var l;
1258
- e && ((l = je.current) == null || l.focus());
1259
- }, [e]), R ? /* @__PURE__ */ S(
1357
+ return () => cancelAnimationFrame(o);
1358
+ }, [ze, Be, ke, xe, e]), $(() => {
1359
+ var o;
1360
+ e && ((o = _.current) == null || o.focus());
1361
+ }, [e]), Q ? /* @__PURE__ */ R(
1260
1362
  "div",
1261
1363
  {
1262
1364
  role: "dialog",
1263
1365
  "aria-modal": "true",
1264
1366
  "aria-label": "Bundle builder",
1265
- className: [h.backdrop, e ? h.backdropOpen : h.backdropClosed, o.className].filter(Boolean).join(" "),
1266
- onMouseDown: (l) => {
1267
- l.target === l.currentTarget && t();
1367
+ className: [h.backdrop, e ? h.backdropOpen : h.backdropClosed, a.className].filter(Boolean).join(" "),
1368
+ onMouseDown: (o) => {
1369
+ o.target === o.currentTarget && t();
1268
1370
  },
1269
1371
  children: [
1270
- we && ae && Y.width > 0 && Y.height > 0 ? /* @__PURE__ */ s(
1271
- Ut,
1372
+ Ne && be && fe.width > 0 && fe.height > 0 ? /* @__PURE__ */ s(
1373
+ Kt,
1272
1374
  {
1273
- width: Y.width,
1274
- height: Y.height,
1275
- confettiSource: ae,
1276
- colors: r,
1375
+ width: fe.width,
1376
+ height: fe.height,
1377
+ confettiSource: be,
1378
+ colors: w,
1277
1379
  recycle: !1,
1278
1380
  numberOfPieces: 70,
1279
1381
  tweenDuration: 100,
@@ -1282,52 +1384,52 @@ function Di(o) {
1282
1384
  initialVelocityX: { min: -6, max: 6 },
1283
1385
  style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 2147483646 }
1284
1386
  },
1285
- Ce
1387
+ Fe
1286
1388
  ) : null,
1287
- /* @__PURE__ */ S("aside", { ref: je, className: [h.panel, e ? h.panelOpen : h.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1288
- fe && ye ? /* @__PURE__ */ s("div", { className: h.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ s("div", { ref: W, className: h.celebrationChip, children: ye }, ge) }) : null,
1289
- /* @__PURE__ */ S("header", { className: [h.header, L ? h.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1389
+ /* @__PURE__ */ R("aside", { ref: _, className: [h.panel, e ? h.panelOpen : h.panelClosed].filter(Boolean).join(" "), tabIndex: -1, children: [
1390
+ xe && Be ? /* @__PURE__ */ s("div", { className: h.celebrationOverlay, "aria-hidden": "true", children: /* @__PURE__ */ s("div", { ref: ee, className: h.celebrationChip, children: Be }, ze) }) : null,
1391
+ /* @__PURE__ */ R("header", { className: [h.header, j ? h.headerSearchOpen : null].filter(Boolean).join(" "), children: [
1290
1392
  /* @__PURE__ */ s(
1291
1393
  "button",
1292
1394
  {
1293
1395
  type: "button",
1294
1396
  className: h.searchIconButton,
1295
- "aria-label": L ? "Search (expanded)" : "Search",
1296
- "aria-expanded": L,
1397
+ "aria-label": j ? "Search (expanded)" : "Search",
1398
+ "aria-expanded": j,
1297
1399
  onClick: () => {
1298
- Q(!0);
1400
+ te(!0);
1299
1401
  },
1300
- children: /* @__PURE__ */ s(Zt, { size: 18, "aria-hidden": "true" })
1402
+ children: /* @__PURE__ */ s(an, { size: 18, "aria-hidden": "true" })
1301
1403
  }
1302
1404
  ),
1303
- /* @__PURE__ */ S("div", { className: h.headerCenter, children: [
1304
- /* @__PURE__ */ s("div", { className: h.headerTitleWrap, "aria-hidden": L, children: /* @__PURE__ */ s("h2", { className: h.title, children: K }) }),
1305
- /* @__PURE__ */ s("div", { className: h.headerSearchWrap, "aria-hidden": !L, children: /* @__PURE__ */ S("div", { className: h.searchBar, children: [
1405
+ /* @__PURE__ */ R("div", { className: h.headerCenter, children: [
1406
+ /* @__PURE__ */ s("div", { className: h.headerTitleWrap, "aria-hidden": j, children: /* @__PURE__ */ s("h2", { className: h.title, children: Pe }) }),
1407
+ /* @__PURE__ */ s("div", { className: h.headerSearchWrap, "aria-hidden": !j, children: /* @__PURE__ */ R("div", { className: h.searchBar, children: [
1306
1408
  /* @__PURE__ */ s(
1307
1409
  "input",
1308
1410
  {
1309
- ref: w,
1411
+ ref: J,
1310
1412
  className: h.searchInput,
1311
1413
  type: "search",
1312
- value: ee,
1414
+ value: re,
1313
1415
  placeholder: "Search",
1314
- onChange: (l) => ue(l.target.value),
1416
+ onChange: (o) => ie(o.target.value),
1315
1417
  onBlur: () => {
1316
- ee.trim() === "" && Q(!1);
1418
+ re.trim() === "" && te(!1);
1317
1419
  }
1318
1420
  }
1319
1421
  ),
1320
- ee.trim() ? /* @__PURE__ */ s(
1422
+ re.trim() ? /* @__PURE__ */ s(
1321
1423
  "button",
1322
1424
  {
1323
1425
  type: "button",
1324
1426
  className: h.searchClearButton,
1325
- onMouseDown: (l) => {
1326
- l.preventDefault();
1427
+ onMouseDown: (o) => {
1428
+ o.preventDefault();
1327
1429
  },
1328
1430
  onClick: () => {
1329
- var l;
1330
- ue(""), (l = w.current) == null || l.focus();
1431
+ var o;
1432
+ ie(""), (o = J.current) == null || o.focus();
1331
1433
  },
1332
1434
  "aria-label": "Clear search",
1333
1435
  children: "Clear"
@@ -1335,74 +1437,74 @@ function Di(o) {
1335
1437
  ) : null
1336
1438
  ] }) })
1337
1439
  ] }),
1338
- /* @__PURE__ */ s("button", { type: "button", onClick: t, disabled: a, className: h.closeButton, "aria-label": "Close", children: "×" })
1440
+ /* @__PURE__ */ s("button", { type: "button", onClick: t, disabled: r, className: h.closeButton, "aria-label": "Close", children: "×" })
1339
1441
  ] }),
1340
- /* @__PURE__ */ S("div", { className: h.body, ref: rt, children: [
1442
+ /* @__PURE__ */ R("div", { className: h.body, ref: y, children: [
1341
1443
  i ? /* @__PURE__ */ s("p", { className: h.muted, children: "Loading…" }) : null,
1342
1444
  n ? /* @__PURE__ */ s("p", { className: h.error, children: n }) : null,
1343
- /* @__PURE__ */ s("div", { className: h.variants, children: /* @__PURE__ */ s("ul", { className: h.variantList, children: ie.map((l) => {
1344
- var ve, Ie, Pe, Ae;
1345
- const u = G[l.id] ?? 0, v = b(l), N = x(l.selectedOptions), C = y(l), F = Z, M = Number(l.price), $ = F != null && Number.isFinite(F) && F > 0 && Number.isFinite(M), ce = $ ? Math.round(M * (1 - F / 100) * 100) / 100 : null;
1346
- return /* @__PURE__ */ S(
1445
+ /* @__PURE__ */ s("div", { className: h.variants, children: /* @__PURE__ */ s("ul", { className: h.variantList, children: Ae.map((o) => {
1446
+ var K, we, Se, De;
1447
+ const l = Y[o.id] ?? 0, p = q(o), S = B(o.selectedOptions), C = T(o), N = se, x = Number(o.price), D = N != null && Number.isFinite(N) && N > 0 && Number.isFinite(x), I = D ? Math.round(x * (1 - N / 100) * 100) / 100 : null;
1448
+ return /* @__PURE__ */ R(
1347
1449
  "li",
1348
1450
  {
1349
- className: [h.variantRow, l.availableForSale === !1 && h.variantRowSoldOut].filter(Boolean).join(" "),
1350
- "data-variant-row": l.id,
1451
+ className: [h.variantRow, o.availableForSale === !1 && h.variantRowSoldOut].filter(Boolean).join(" "),
1452
+ "data-variant-row": o.id,
1351
1453
  children: [
1352
- /* @__PURE__ */ S("div", { className: h.variantLeft, children: [
1353
- /* @__PURE__ */ s("div", { className: h.variantThumb, "aria-hidden": "true", children: (ve = l.image) != null && ve.url ? /* @__PURE__ */ s(
1454
+ /* @__PURE__ */ R("div", { className: h.variantLeft, children: [
1455
+ /* @__PURE__ */ s("div", { className: h.variantThumb, "aria-hidden": "true", children: (K = o.image) != null && K.url ? /* @__PURE__ */ s(
1354
1456
  "img",
1355
1457
  {
1356
1458
  className: h.variantThumbImg,
1357
- src: l.image.url,
1358
- alt: l.image.altText ?? C,
1459
+ src: o.image.url,
1460
+ alt: o.image.altText ?? C,
1359
1461
  loading: "lazy"
1360
1462
  }
1361
- ) : /* @__PURE__ */ s("div", { className: h.variantThumbFallback, children: ((Ae = (Pe = (Ie = l.product) == null ? void 0 : Ie.title) == null ? void 0 : Pe.slice(0, 1)) == null ? void 0 : Ae.toUpperCase()) ?? "•" }) }),
1362
- /* @__PURE__ */ S("div", { className: h.variantInfo, children: [
1363
- /* @__PURE__ */ s("div", { className: h.variantName, children: v }),
1364
- N ? /* @__PURE__ */ s("div", { className: h.variantMeta, children: N }) : null,
1365
- /* @__PURE__ */ S("div", { className: h.variantPriceRow, children: [
1366
- $ ? /* @__PURE__ */ s("span", { className: h.variantCompareAt, children: E(Number.isFinite(M) ? M.toFixed(2) : l.price) }) : null,
1367
- /* @__PURE__ */ s("span", { className: h.variantPrice, children: E(
1368
- ce != null ? ce.toFixed(2) : Number.isFinite(M) ? M.toFixed(2) : l.price
1463
+ ) : /* @__PURE__ */ s("div", { className: h.variantThumbFallback, children: ((De = (Se = (we = o.product) == null ? void 0 : we.title) == null ? void 0 : Se.slice(0, 1)) == null ? void 0 : De.toUpperCase()) ?? "•" }) }),
1464
+ /* @__PURE__ */ R("div", { className: h.variantInfo, children: [
1465
+ /* @__PURE__ */ s("div", { className: h.variantName, children: p }),
1466
+ S ? /* @__PURE__ */ s("div", { className: h.variantMeta, children: S }) : null,
1467
+ /* @__PURE__ */ R("div", { className: h.variantPriceRow, children: [
1468
+ D ? /* @__PURE__ */ s("span", { className: h.variantCompareAt, children: pe(Number.isFinite(x) ? x.toFixed(2) : o.price) }) : null,
1469
+ /* @__PURE__ */ s("span", { className: h.variantPrice, children: pe(
1470
+ I != null ? I.toFixed(2) : Number.isFinite(x) ? x.toFixed(2) : o.price
1369
1471
  ) })
1370
1472
  ] })
1371
1473
  ] })
1372
1474
  ] }),
1373
- l.availableForSale === !1 ? /* @__PURE__ */ s("div", { className: h.soldOutContainer, children: /* @__PURE__ */ S("span", { className: h.soldOut, "aria-label": `${C} is sold out`, children: [
1475
+ o.availableForSale === !1 ? /* @__PURE__ */ s("div", { className: h.soldOutContainer, children: /* @__PURE__ */ R("span", { className: h.soldOut, "aria-label": `${C} is sold out`, children: [
1374
1476
  "Sold",
1375
1477
  /* @__PURE__ */ s("br", {}),
1376
1478
  "Out"
1377
- ] }) }) : u <= 0 ? /* @__PURE__ */ s(
1479
+ ] }) }) : l <= 0 ? /* @__PURE__ */ s(
1378
1480
  "button",
1379
1481
  {
1380
1482
  type: "button",
1381
- onClick: () => A(l.id, 1),
1382
- disabled: a || be,
1483
+ onClick: () => Z(o.id, 1),
1484
+ disabled: r || g,
1383
1485
  className: h.addToBundleButton,
1384
1486
  "aria-label": `Add ${C} to bundle`,
1385
1487
  children: "Add"
1386
1488
  }
1387
- ) : /* @__PURE__ */ S("div", { className: h.qtyControls, children: [
1489
+ ) : /* @__PURE__ */ R("div", { className: h.qtyControls, children: [
1388
1490
  /* @__PURE__ */ s(
1389
1491
  "button",
1390
1492
  {
1391
1493
  type: "button",
1392
- onClick: () => A(l.id, u - 1),
1393
- disabled: a || u <= 0,
1494
+ onClick: () => Z(o.id, l - 1),
1495
+ disabled: r || l <= 0,
1394
1496
  className: h.qtyButton,
1395
1497
  "aria-label": `Decrease ${C}`,
1396
1498
  children: "−"
1397
1499
  }
1398
1500
  ),
1399
- /* @__PURE__ */ s("span", { className: h.qtyValue, "aria-label": `Quantity ${u}`, children: u }),
1501
+ /* @__PURE__ */ s("span", { className: h.qtyValue, "aria-label": `Quantity ${l}`, children: l }),
1400
1502
  /* @__PURE__ */ s(
1401
1503
  "button",
1402
1504
  {
1403
1505
  type: "button",
1404
- onClick: () => A(l.id, u + 1),
1405
- disabled: a || be,
1506
+ onClick: () => Z(o.id, l + 1),
1507
+ disabled: r || g,
1406
1508
  className: h.qtyButton,
1407
1509
  "aria-label": `Increase ${C}`,
1408
1510
  children: "+"
@@ -1411,90 +1513,90 @@ function Di(o) {
1411
1513
  ] })
1412
1514
  ]
1413
1515
  },
1414
- l.id
1516
+ o.id
1415
1517
  );
1416
1518
  }) }) })
1417
1519
  ] }),
1418
- /* @__PURE__ */ S("footer", { className: h.footer, ref: D, children: [
1419
- /* @__PURE__ */ s("div", { className: h.boxSummaryWindow, ref: ot, children: /* @__PURE__ */ s("div", { className: h.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Nt }).map((l, u) => {
1420
- var ve, Ie, Pe, Ae;
1421
- const v = We[u], N = Ct.get(u), C = !!v, F = !!N, M = F && !C, $ = N ? `${N.discountPercent}% off` : null, ce = C ? v.displayName : `Slot ${u + 1}`;
1422
- return /* @__PURE__ */ S("div", { "data-box-slot": u, className: h.boxSlot, children: [
1520
+ /* @__PURE__ */ R("footer", { className: h.footer, ref: H, children: [
1521
+ /* @__PURE__ */ s("div", { className: h.boxSummaryWindow, ref: v, children: /* @__PURE__ */ s("div", { className: h.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: Ze }).map((o, l) => {
1522
+ var K, we, Se, De;
1523
+ const p = Le[l], S = We.get(l), C = !!p, N = !!S, x = N && !C, D = S ? `${S.discountPercent}% off` : null, I = C ? p.displayName : `Slot ${l + 1}`;
1524
+ return /* @__PURE__ */ R("div", { "data-box-slot": l, className: h.boxSlot, children: [
1423
1525
  /* @__PURE__ */ s(
1424
1526
  "div",
1425
1527
  {
1426
1528
  className: [
1427
1529
  h.boxItem,
1428
1530
  C ? h.boxItemFilled : h.boxItemPlaceholder,
1429
- F ? h.boxItemThreshold : null,
1531
+ N ? h.boxItemThreshold : null,
1430
1532
  C ? h.boxItemClickable : null
1431
1533
  ].filter(Boolean).join(" "),
1432
1534
  role: C ? "button" : void 0,
1433
1535
  tabIndex: C ? 0 : void 0,
1434
- onClick: C ? () => lt(v.id) : void 0,
1435
- onKeyDown: C ? (Ge) => {
1436
- (Ge.key === "Enter" || Ge.key === " ") && (Ge.preventDefault(), lt(v.id));
1536
+ onClick: C ? () => M(p.id) : void 0,
1537
+ onKeyDown: C ? (it) => {
1538
+ (it.key === "Enter" || it.key === " ") && (it.preventDefault(), M(p.id));
1437
1539
  } : void 0,
1438
- "aria-label": M && $ ? `${ce}. Unlocks ${$}.` : ce,
1439
- title: M && $ ? `${ce} • Unlocks ${$}` : ce,
1440
- children: C ? (ve = v.image) != null && ve.url ? /* @__PURE__ */ s(
1540
+ "aria-label": x && D ? `${I}. Unlocks ${D}.` : I,
1541
+ title: x && D ? `${I} • Unlocks ${D}` : I,
1542
+ children: C ? (K = p.image) != null && K.url ? /* @__PURE__ */ s(
1441
1543
  "img",
1442
1544
  {
1443
1545
  className: h.boxItemImage,
1444
- src: v.image.url,
1445
- alt: v.image.altText ?? v.displayName,
1546
+ src: p.image.url,
1547
+ alt: p.image.altText ?? p.displayName,
1446
1548
  loading: "lazy"
1447
1549
  }
1448
- ) : /* @__PURE__ */ s("div", { className: h.boxItemFallback, "aria-hidden": "true", children: ((Ae = (Pe = (Ie = v.product) == null ? void 0 : Ie.title) == null ? void 0 : Pe.slice(0, 1)) == null ? void 0 : Ae.toUpperCase()) ?? "•" }) : M && $ ? /* @__PURE__ */ s("div", { className: h.boxItemDiscountText, children: $ }) : /* @__PURE__ */ s("div", { className: h.boxItemPlus, "aria-hidden": "true", children: "+" })
1550
+ ) : /* @__PURE__ */ s("div", { className: h.boxItemFallback, "aria-hidden": "true", children: ((De = (Se = (we = p.product) == null ? void 0 : we.title) == null ? void 0 : Se.slice(0, 1)) == null ? void 0 : De.toUpperCase()) ?? "•" }) : x && D ? /* @__PURE__ */ s("div", { className: h.boxItemDiscountText, children: D }) : /* @__PURE__ */ s("div", { className: h.boxItemPlus, "aria-hidden": "true", children: "+" })
1449
1551
  }
1450
1552
  ),
1451
- F ? /* @__PURE__ */ s("div", { className: h.boxThresholdLabel, children: N.label }) : null
1452
- ] }, u);
1553
+ N ? /* @__PURE__ */ s("div", { className: h.boxThresholdLabel, children: S.label }) : null
1554
+ ] }, l);
1453
1555
  }) }) }),
1454
1556
  /* @__PURE__ */ s(
1455
1557
  "div",
1456
1558
  {
1457
- className: [h.ctaTotalsWrap, Me ? h.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1458
- "aria-hidden": !Me,
1459
- children: /* @__PURE__ */ S("div", { className: h.ctaTotals, "aria-label": "Totals", children: [
1460
- Z ? /* @__PURE__ */ S("span", { className: h.ctaDiscountBadge, children: [
1461
- Z,
1559
+ className: [h.ctaTotalsWrap, Ve ? h.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1560
+ "aria-hidden": !Ve,
1561
+ children: /* @__PURE__ */ R("div", { className: h.ctaTotals, "aria-label": "Totals", children: [
1562
+ se ? /* @__PURE__ */ R("span", { className: h.ctaDiscountBadge, children: [
1563
+ se,
1462
1564
  "% Discount"
1463
1565
  ] }) : /* @__PURE__ */ s("span", {}),
1464
- /* @__PURE__ */ s("span", { children: Z ? /* @__PURE__ */ S(Xe, { children: [
1465
- /* @__PURE__ */ s("span", { className: h.ctaTotalsStrike, children: E(Be.toFixed(2)) }),
1566
+ /* @__PURE__ */ s("span", { children: se ? /* @__PURE__ */ R(ut, { children: [
1567
+ /* @__PURE__ */ s("span", { className: h.ctaTotalsStrike, children: pe(_e.toFixed(2)) }),
1466
1568
  " ",
1467
- /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children: E(It.toFixed(2)) })
1468
- ] }) : /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children: E(Be.toFixed(2)) }) })
1569
+ /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children: pe(Xe.toFixed(2)) })
1570
+ ] }) : /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children: pe(_e.toFixed(2)) }) })
1469
1571
  ] })
1470
1572
  }
1471
1573
  ),
1472
1574
  (() => {
1473
- const l = (c == null ? void 0 : c.ctaButtonMode) || "add_to_cart";
1474
- return l === "add_to_cart_checkout" ? q > 0 ? /* @__PURE__ */ s("button", { type: "button", onClick: te, disabled: !H, className: h.cta, children: a ? "Adding…" : `Add ${q} more product${q === 1 ? "" : "s"}` }) : /* @__PURE__ */ S("div", { className: `${h.ctaButtonGroup} ${Ue ? h.ctaButtonGroupAnimating : ""}`, children: [
1575
+ const o = (c == null ? void 0 : c.ctaButtonMode) || "add_to_cart";
1576
+ return o === "add_to_cart_checkout" ? ne > 0 ? /* @__PURE__ */ s("button", { type: "button", onClick: le, disabled: !X, className: h.cta, children: r ? "Adding…" : `Add ${ne} more product${ne === 1 ? "" : "s"}` }) : /* @__PURE__ */ R("div", { className: `${h.ctaButtonGroup} ${Ue ? h.ctaButtonGroupAnimating : ""}`, children: [
1475
1577
  /* @__PURE__ */ s(
1476
1578
  "button",
1477
1579
  {
1478
1580
  type: "button",
1479
- onClick: te,
1480
- disabled: !H,
1581
+ onClick: le,
1582
+ disabled: !X,
1481
1583
  className: `${h.ctaDualLeft} ${Ue ? h.ctaDualLeftAnimating : ""}`,
1482
- children: /* @__PURE__ */ s("span", { children: a ? "Adding…" : "Add to Basket" })
1584
+ children: /* @__PURE__ */ s("span", { children: r ? "Adding…" : "Add to Basket" })
1483
1585
  }
1484
1586
  ),
1485
1587
  /* @__PURE__ */ s(
1486
1588
  "button",
1487
1589
  {
1488
1590
  type: "button",
1489
- onClick: ne,
1490
- disabled: !H,
1591
+ onClick: ce,
1592
+ disabled: !X,
1491
1593
  className: `${h.ctaDualRight} ${Ue ? h.ctaDualRightAnimating : ""}`,
1492
- children: /* @__PURE__ */ s("span", { children: a ? "Processing…" : "Checkout" })
1594
+ children: /* @__PURE__ */ s("span", { children: r ? "Processing…" : "Checkout" })
1493
1595
  }
1494
1596
  )
1495
- ] }) : l === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick: ne, disabled: !H, className: h.cta, children: a ? "Processing…" : q > 0 ? `Add ${q} more product${q === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ s("button", { type: "button", onClick: te, disabled: !H, className: h.cta, children: a ? "Adding…" : q > 0 ? `Add ${q} more product${q === 1 ? "" : "s"}` : "Add to Basket" });
1597
+ ] }) : o === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick: ce, disabled: !X, className: h.cta, children: r ? "Processing…" : ne > 0 ? `Add ${ne} more product${ne === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ s("button", { type: "button", onClick: le, disabled: !X, className: h.cta, children: r ? "Adding…" : ne > 0 ? `Add ${ne} more product${ne === 1 ? "" : "s"}` : "Add to Basket" });
1496
1598
  })(),
1497
- /* @__PURE__ */ S("div", { className: h.poweredBy, children: [
1599
+ /* @__PURE__ */ R("div", { className: h.poweredBy, children: [
1498
1600
  "powered by ",
1499
1601
  /* @__PURE__ */ s("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: " BestBundles" })
1500
1602
  ] })
@@ -1504,230 +1606,230 @@ function Di(o) {
1504
1606
  }
1505
1607
  ) : null;
1506
1608
  }
1507
- const ya = "_panel_1n9m6_2", va = "_header_1n9m6_20", wa = "_title_1n9m6_24", xa = "_status_1n9m6_32", ga = "_error_1n9m6_37", Ia = "_inactive_1n9m6_43", Ca = "_section_1n9m6_49", Na = "_sectionTitle_1n9m6_54", Sa = "_rulesVisual_1n9m6_107", Ba = "_rulesLabelsRow_1n9m6_114", Ta = "_rulesLinesRow_1n9m6_121", Ra = "_rulesLineLabelCell_1n9m6_128", ka = "_rulesLineLabel_1n9m6_128", Pa = "_rulesLine_1n9m6_121", Oa = "_rulesLineEmpty_1n9m6_162", Ma = "_rulesLineFilled_1n9m6_166", Fa = "_variants_1n9m6_170", Aa = "_variantList_1n9m6_178", La = "_variantRow_1n9m6_186", Da = "_variantRowInteractive_1n9m6_198", $a = "_variantRowSelected_1n9m6_202", Ea = "_variantRowSoldOut_1n9m6_207", qa = "_variantMedia_1n9m6_211", Va = "_variantContent_1n9m6_219", za = "_variantHeader_1n9m6_227", Wa = "_variantTitle_1n9m6_233", Ua = "_variantImage_1n9m6_247", ja = "_variantImageFallback_1n9m6_255", Ga = "_variantMeta_1n9m6_268", Ha = "_variantPrice_1n9m6_273", Qa = "_variantFooterRow_1n9m6_279", Ka = "_variantActions_1n9m6_286", Ya = "_qtyActions_1n9m6_292", Xa = "_soldOut_1n9m6_343", Za = "_qtyChip_1n9m6_351", Ja = "_qtyChipInteractive_1n9m6_366", ei = "_qtyChipValue_1n9m6_370", ti = "_qtyChipPlus_1n9m6_376", ni = "_qtyChipClear_1n9m6_381", ai = "_qtyTrash_1n9m6_400", ii = "_footer_1n9m6_412", ri = "_boxSummaryWindow_1n9m6_417", oi = "_boxSummaryRow_1n9m6_431", si = "_boxSlot_1n9m6_439", li = "_boxItem_1n9m6_448", ci = "_boxItemFilled_1n9m6_465", ui = "_boxItemPlaceholder_1n9m6_471", di = "_boxItemThreshold_1n9m6_477", hi = "_boxItemClickable_1n9m6_485", mi = "_boxItemImage_1n9m6_494", fi = "_boxItemFallback_1n9m6_505", pi = "_boxItemPlus_1n9m6_518", _i = "_boxItemDiscountText_1n9m6_530", bi = "_boxThresholdLabel_1n9m6_543", yi = "_totalsReveal_1n9m6_554", vi = "_totalsRevealOpen_1n9m6_562", wi = "_ctaTotalsWrap_1n9m6_567", xi = "_ctaTotalsWrapVisible_1n9m6_572", gi = "_ctaTotals_1n9m6_567", Ii = "_ctaDiscountBadge_1n9m6_587", Ci = "_ctaTotalsStrike_1n9m6_598", Ni = "_ctaTotalsPrice_1n9m6_604", Si = "_cta_1n9m6_567", Bi = "_ctaButtonGroup_1n9m6_636", Ti = "_ctaDualLeft_1n9m6_642", Ri = "_ctaDualRight_1n9m6_643", ki = "_poweredBy_1n9m6_670", f = {
1508
- panel: ya,
1509
- header: va,
1510
- title: wa,
1511
- status: xa,
1512
- error: ga,
1513
- inactive: Ia,
1514
- section: Ca,
1515
- sectionTitle: Na,
1516
- rulesVisual: Sa,
1517
- rulesLabelsRow: Ba,
1518
- rulesLinesRow: Ta,
1519
- rulesLineLabelCell: Ra,
1520
- rulesLineLabel: ka,
1521
- rulesLine: Pa,
1522
- rulesLineEmpty: Oa,
1523
- rulesLineFilled: Ma,
1524
- variants: Fa,
1525
- variantList: Aa,
1526
- variantRow: La,
1527
- variantRowInteractive: Da,
1528
- variantRowSelected: $a,
1529
- variantRowSoldOut: Ea,
1530
- variantMedia: qa,
1531
- variantContent: Va,
1532
- variantHeader: za,
1533
- variantTitle: Wa,
1534
- variantImage: Ua,
1535
- variantImageFallback: ja,
1536
- variantMeta: Ga,
1537
- variantPrice: Ha,
1538
- variantFooterRow: Qa,
1539
- variantActions: Ka,
1540
- qtyActions: Ya,
1541
- soldOut: Xa,
1542
- qtyChip: Za,
1543
- qtyChipInteractive: Ja,
1544
- qtyChipValue: ei,
1545
- qtyChipPlus: ti,
1546
- qtyChipClear: ni,
1547
- qtyTrash: ai,
1548
- footer: ii,
1549
- boxSummaryWindow: ri,
1550
- boxSummaryRow: oi,
1551
- boxSlot: si,
1552
- boxItem: li,
1553
- boxItemFilled: ci,
1554
- boxItemPlaceholder: ui,
1555
- boxItemThreshold: di,
1556
- boxItemClickable: hi,
1557
- boxItemImage: mi,
1558
- boxItemFallback: fi,
1559
- boxItemPlus: pi,
1560
- boxItemDiscountText: _i,
1561
- boxThresholdLabel: bi,
1562
- totalsReveal: yi,
1563
- totalsRevealOpen: vi,
1564
- ctaTotalsWrap: wi,
1565
- ctaTotalsWrapVisible: xi,
1566
- ctaTotals: gi,
1567
- ctaDiscountBadge: Ii,
1568
- ctaTotalsStrike: Ci,
1569
- ctaTotalsPrice: Ni,
1570
- cta: Si,
1571
- ctaButtonGroup: Bi,
1572
- ctaDualLeft: Ti,
1573
- ctaDualRight: Ri,
1574
- poweredBy: ki
1609
+ const Ca = "_panel_1n9m6_2", Ia = "_header_1n9m6_20", Sa = "_title_1n9m6_24", Na = "_status_1n9m6_32", Ba = "_error_1n9m6_37", Ta = "_inactive_1n9m6_43", ka = "_section_1n9m6_49", Ra = "_sectionTitle_1n9m6_54", Pa = "_rulesVisual_1n9m6_107", Oa = "_rulesLabelsRow_1n9m6_114", Fa = "_rulesLinesRow_1n9m6_121", Ma = "_rulesLineLabelCell_1n9m6_128", Aa = "_rulesLineLabel_1n9m6_128", La = "_rulesLine_1n9m6_121", Da = "_rulesLineEmpty_1n9m6_162", $a = "_rulesLineFilled_1n9m6_166", Ea = "_variants_1n9m6_170", qa = "_variantList_1n9m6_178", za = "_variantRow_1n9m6_186", Va = "_variantRowInteractive_1n9m6_198", ja = "_variantRowSelected_1n9m6_202", Wa = "_variantRowSoldOut_1n9m6_207", Ua = "_variantMedia_1n9m6_211", Ha = "_variantContent_1n9m6_219", Ga = "_variantHeader_1n9m6_227", Qa = "_variantTitle_1n9m6_233", Ka = "_variantImage_1n9m6_247", Ya = "_variantImageFallback_1n9m6_255", Xa = "_variantMeta_1n9m6_268", Za = "_variantPrice_1n9m6_273", Ja = "_variantFooterRow_1n9m6_279", er = "_variantActions_1n9m6_286", tr = "_qtyActions_1n9m6_292", nr = "_soldOut_1n9m6_343", ar = "_qtyChip_1n9m6_351", rr = "_qtyChipInteractive_1n9m6_366", ir = "_qtyChipValue_1n9m6_370", or = "_qtyChipPlus_1n9m6_376", sr = "_qtyChipClear_1n9m6_381", lr = "_qtyTrash_1n9m6_400", cr = "_footer_1n9m6_412", ur = "_boxSummaryWindow_1n9m6_417", dr = "_boxSummaryRow_1n9m6_431", hr = "_boxSlot_1n9m6_439", mr = "_boxItem_1n9m6_448", fr = "_boxItemFilled_1n9m6_465", br = "_boxItemPlaceholder_1n9m6_471", pr = "_boxItemThreshold_1n9m6_477", _r = "_boxItemClickable_1n9m6_485", yr = "_boxItemImage_1n9m6_494", wr = "_boxItemFallback_1n9m6_505", vr = "_boxItemPlus_1n9m6_518", gr = "_boxItemDiscountText_1n9m6_530", xr = "_boxThresholdLabel_1n9m6_543", Cr = "_totalsReveal_1n9m6_554", Ir = "_totalsRevealOpen_1n9m6_562", Sr = "_ctaTotalsWrap_1n9m6_567", Nr = "_ctaTotalsWrapVisible_1n9m6_572", Br = "_ctaTotals_1n9m6_567", Tr = "_ctaDiscountBadge_1n9m6_587", kr = "_ctaTotalsStrike_1n9m6_598", Rr = "_ctaTotalsPrice_1n9m6_604", Pr = "_cta_1n9m6_567", Or = "_ctaButtonGroup_1n9m6_636", Fr = "_ctaDualLeft_1n9m6_642", Mr = "_ctaDualRight_1n9m6_643", Ar = "_poweredBy_1n9m6_670", f = {
1610
+ panel: Ca,
1611
+ header: Ia,
1612
+ title: Sa,
1613
+ status: Na,
1614
+ error: Ba,
1615
+ inactive: Ta,
1616
+ section: ka,
1617
+ sectionTitle: Ra,
1618
+ rulesVisual: Pa,
1619
+ rulesLabelsRow: Oa,
1620
+ rulesLinesRow: Fa,
1621
+ rulesLineLabelCell: Ma,
1622
+ rulesLineLabel: Aa,
1623
+ rulesLine: La,
1624
+ rulesLineEmpty: Da,
1625
+ rulesLineFilled: $a,
1626
+ variants: Ea,
1627
+ variantList: qa,
1628
+ variantRow: za,
1629
+ variantRowInteractive: Va,
1630
+ variantRowSelected: ja,
1631
+ variantRowSoldOut: Wa,
1632
+ variantMedia: Ua,
1633
+ variantContent: Ha,
1634
+ variantHeader: Ga,
1635
+ variantTitle: Qa,
1636
+ variantImage: Ka,
1637
+ variantImageFallback: Ya,
1638
+ variantMeta: Xa,
1639
+ variantPrice: Za,
1640
+ variantFooterRow: Ja,
1641
+ variantActions: er,
1642
+ qtyActions: tr,
1643
+ soldOut: nr,
1644
+ qtyChip: ar,
1645
+ qtyChipInteractive: rr,
1646
+ qtyChipValue: ir,
1647
+ qtyChipPlus: or,
1648
+ qtyChipClear: sr,
1649
+ qtyTrash: lr,
1650
+ footer: cr,
1651
+ boxSummaryWindow: ur,
1652
+ boxSummaryRow: dr,
1653
+ boxSlot: hr,
1654
+ boxItem: mr,
1655
+ boxItemFilled: fr,
1656
+ boxItemPlaceholder: br,
1657
+ boxItemThreshold: pr,
1658
+ boxItemClickable: _r,
1659
+ boxItemImage: yr,
1660
+ boxItemFallback: wr,
1661
+ boxItemPlus: vr,
1662
+ boxItemDiscountText: gr,
1663
+ boxThresholdLabel: xr,
1664
+ totalsReveal: Cr,
1665
+ totalsRevealOpen: Ir,
1666
+ ctaTotalsWrap: Sr,
1667
+ ctaTotalsWrapVisible: Nr,
1668
+ ctaTotals: Br,
1669
+ ctaDiscountBadge: Tr,
1670
+ ctaTotalsStrike: kr,
1671
+ ctaTotalsPrice: Rr,
1672
+ cta: Pr,
1673
+ ctaButtonGroup: Or,
1674
+ ctaDualLeft: Fr,
1675
+ ctaDualRight: Mr,
1676
+ poweredBy: Ar
1575
1677
  };
1576
- function $i(o) {
1577
- var le;
1678
+ function Gr(a) {
1679
+ var de;
1578
1680
  const {
1579
1681
  loading: e,
1580
1682
  submitting: t,
1581
1683
  error: i,
1582
- currencyCode: a,
1684
+ currencyCode: r,
1583
1685
  config: n,
1584
1686
  eligibleVariants: d,
1585
1687
  selections: c,
1586
- selectionOrder: I,
1587
- setQuantity: G,
1588
- bundleSize: g,
1589
- minRequired: A,
1590
- canSubmit: P,
1591
- submit: z,
1592
- submitAndCheckout: H
1593
- } = ze(), {
1594
- className: te,
1595
- showRules: ne = !0,
1596
- showVariants: L = !0
1597
- } = o, Q = (m) => {
1598
- const p = Number.parseFloat(m);
1599
- return Number.isFinite(p) ? String(Math.round(p)) : m;
1600
- }, ee = (m) => {
1601
- const p = (m ?? []).filter((r) => {
1602
- var b, y;
1603
- const _ = (b = r == null ? void 0 : r.name) == null ? void 0 : b.trim(), x = (y = r == null ? void 0 : r.value) == null ? void 0 : y.trim();
1604
- return !(!_ || !x || _.toLowerCase() === "title");
1688
+ selectionOrder: k,
1689
+ setQuantity: Y,
1690
+ bundleSize: P,
1691
+ minRequired: Z,
1692
+ canSubmit: O,
1693
+ submit: E,
1694
+ submitAndCheckout: X
1695
+ } = rt(), {
1696
+ className: le,
1697
+ showRules: ce = !0,
1698
+ showVariants: j = !0
1699
+ } = a, te = (m) => {
1700
+ const b = Number.parseFloat(m);
1701
+ return Number.isFinite(b) ? String(Math.round(b)) : m;
1702
+ }, re = (m) => {
1703
+ const b = (m ?? []).filter((w) => {
1704
+ var q, T;
1705
+ const L = (q = w == null ? void 0 : w.name) == null ? void 0 : q.trim(), B = (T = w == null ? void 0 : w.value) == null ? void 0 : T.trim();
1706
+ return !(!L || !B || L.toLowerCase() === "title");
1605
1707
  });
1606
- return p.length ? p.map((r) => `${r.name}: ${r.value}`).join(" • ") : null;
1607
- }, ue = (m) => {
1608
- const p = Number(m);
1609
- if (!Number.isFinite(p)) return m;
1610
- if (a)
1708
+ return b.length ? b.map((w) => `${w.name}: ${w.value}`).join(" • ") : null;
1709
+ }, ie = (m) => {
1710
+ const b = Number(m);
1711
+ if (!Number.isFinite(b)) return m;
1712
+ if (r)
1611
1713
  try {
1612
- return new Intl.NumberFormat(void 0, { style: "currency", currency: a }).format(p);
1714
+ return new Intl.NumberFormat(void 0, { style: "currency", currency: r }).format(b);
1613
1715
  } catch {
1614
1716
  }
1615
- return `$${p.toFixed(2)}`;
1616
- }, w = k(() => [...d].sort((m, p) => m.displayName.localeCompare(p.displayName)), [d]), D = k(() => [...(n == null ? void 0 : n.rules) ?? []].sort((m, p) => m.minBundleSize - p.minBundleSize), [n == null ? void 0 : n.rules]), W = k(() => Math.max(0, A - g), [g, A]), Y = k(() => {
1717
+ return `$${b.toFixed(2)}`;
1718
+ }, J = A(() => [...d].sort((m, b) => m.displayName.localeCompare(b.displayName)), [d]), H = A(() => [...(n == null ? void 0 : n.rules) ?? []].sort((m, b) => m.minBundleSize - b.minBundleSize), [n == null ? void 0 : n.rules]), ee = A(() => Math.max(0, Z - P), [P, Z]), fe = A(() => {
1617
1719
  let m = null;
1618
- for (const p of D)
1619
- g >= p.minBundleSize && (m = p);
1720
+ for (const b of H)
1721
+ P >= b.minBundleSize && (m = b);
1620
1722
  return m;
1621
- }, [g, D]), de = k(() => {
1622
- if (!Y) return null;
1623
- const m = Number.parseFloat(Y.discountPercent);
1723
+ }, [P, H]), ue = A(() => {
1724
+ if (!fe) return null;
1725
+ const m = Number.parseFloat(fe.discountPercent);
1624
1726
  return !Number.isFinite(m) || m <= 0 ? null : m;
1625
- }, [Y]), Ce = D[0], Ne = !!(Ce && g >= Ce.minBundleSize), ae = k(() => {
1626
- const m = new Map(d.map((r) => [r.id, r]));
1627
- let p = 0;
1628
- for (const [r, _] of Object.entries(c)) {
1629
- const x = _ ?? 0;
1630
- if (x <= 0) continue;
1631
- const b = m.get(r), y = Number(b == null ? void 0 : b.price);
1632
- Number.isFinite(y) && (p += y * x);
1727
+ }, [fe]), Fe = H[0], Me = !!(Fe && P >= Fe.minBundleSize), be = A(() => {
1728
+ const m = new Map(d.map((w) => [w.id, w]));
1729
+ let b = 0;
1730
+ for (const [w, L] of Object.entries(c)) {
1731
+ const B = L ?? 0;
1732
+ if (B <= 0) continue;
1733
+ const q = m.get(w), T = Number(q == null ? void 0 : q.price);
1734
+ Number.isFinite(T) && (b += T * B);
1633
1735
  }
1634
- return Math.round(p * 100) / 100;
1635
- }, [d, c]), oe = k(() => {
1636
- if (!de) return ae;
1637
- const m = ae * (1 - de / 100);
1736
+ return Math.round(b * 100) / 100;
1737
+ }, [d, c]), Ge = A(() => {
1738
+ if (!ue) return be;
1739
+ const m = be * (1 - ue / 100);
1638
1740
  return Math.round(m * 100) / 100;
1639
- }, [de, ae]), we = k(() => D.length ? Math.max(...D.map((m) => m.minBundleSize)) : 0, [D]), xe = k(() => {
1640
- const m = new Map(d.map((p) => [p.id, p]));
1641
- return I.map((p) => m.get(p)).filter((p) => !!p);
1642
- }, [d, I]), X = k(() => {
1643
- var p;
1741
+ }, [ue, be]), Ne = A(() => H.length ? Math.max(...H.map((m) => m.minBundleSize)) : 0, [H]), ve = A(() => {
1742
+ const m = new Map(d.map((b) => [b.id, b]));
1743
+ return k.map((b) => m.get(b)).filter((b) => !!b);
1744
+ }, [d, k]), ge = A(() => {
1745
+ var b;
1644
1746
  const m = /* @__PURE__ */ new Map();
1645
- for (const r of D) {
1646
- const _ = Math.max(0, r.minBundleSize - 1);
1647
- m.set(_, {
1648
- discountPercent: r.discountPercent,
1649
- minBundleSize: r.minBundleSize,
1650
- label: ((p = r.label) == null ? void 0 : p.trim()) || `Buy ${r.minBundleSize}+`
1747
+ for (const w of H) {
1748
+ const L = Math.max(0, w.minBundleSize - 1);
1749
+ m.set(L, {
1750
+ discountPercent: w.discountPercent,
1751
+ minBundleSize: w.minBundleSize,
1752
+ label: ((b = w.label) == null ? void 0 : b.trim()) || `Buy ${w.minBundleSize}+`
1651
1753
  });
1652
1754
  }
1653
1755
  return m;
1654
- }, [D]), se = k(() => {
1655
- const m = Number((n == null ? void 0 : n.maxBundleSize) ?? NaN), p = Number.isFinite(m) ? Math.floor(m) : 100;
1656
- return Math.max(2, Math.min(100, p));
1657
- }, [n == null ? void 0 : n.maxBundleSize]), ke = ((le = n == null ? void 0 : n.title) == null ? void 0 : le.trim()) || "Build your bundle", ge = k(() => Math.max(we || A, xe.length), [xe.length, we, A]), he = g >= se, ye = J(null), me = J(null), fe = J(g);
1658
- V(() => {
1659
- const m = fe.current;
1660
- if (fe.current = g, g <= m) return;
1661
- const p = me.current;
1662
- if (!p) return;
1663
- const r = D.some((y) => y.minBundleSize === g), _ = D.find((y) => y.minBundleSize > g), x = _ && r ? _.minBundleSize - 1 : _ ? null : g - 1;
1664
- if (x == null || x < 0) return;
1665
- const b = requestAnimationFrame(() => {
1666
- const y = p.querySelector(`[data-box-slot="${x}"]`);
1667
- if (!y) return;
1668
- const R = p.getBoundingClientRect(), B = y.getBoundingClientRect().right - R.right;
1669
- if (B <= 1) return;
1670
- const E = Math.max(0, p.scrollWidth - p.clientWidth), K = Math.min(E, Math.max(0, p.scrollLeft + B));
1671
- p.scrollTo({ left: K, behavior: "smooth" });
1756
+ }, [H]), qe = A(() => {
1757
+ const m = Number((n == null ? void 0 : n.maxBundleSize) ?? NaN), b = Number.isFinite(m) ? Math.floor(m) : 100;
1758
+ return Math.max(2, Math.min(100, b));
1759
+ }, [n == null ? void 0 : n.maxBundleSize]), ke = ((de = n == null ? void 0 : n.title) == null ? void 0 : de.trim()) || "Build your bundle", ze = A(() => Math.max(Ne || Z, ve.length), [ve.length, Ne, Z]), je = P >= qe, Be = U(null), oe = U(null), xe = U(P);
1760
+ $(() => {
1761
+ const m = xe.current;
1762
+ if (xe.current = P, P <= m) return;
1763
+ const b = oe.current;
1764
+ if (!b) return;
1765
+ const w = H.some((T) => T.minBundleSize === P), L = H.find((T) => T.minBundleSize > P), B = L && w ? L.minBundleSize - 1 : L ? null : P - 1;
1766
+ if (B == null || B < 0) return;
1767
+ const q = requestAnimationFrame(() => {
1768
+ const T = b.querySelector(`[data-box-slot="${B}"]`);
1769
+ if (!T) return;
1770
+ const Q = b.getBoundingClientRect(), z = T.getBoundingClientRect().right - Q.right;
1771
+ if (z <= 1) return;
1772
+ const pe = Math.max(0, b.scrollWidth - b.clientWidth), Pe = Math.min(pe, Math.max(0, b.scrollLeft + z));
1773
+ b.scrollTo({ left: Pe, behavior: "smooth" });
1672
1774
  });
1673
- return () => cancelAnimationFrame(b);
1674
- }, [g, D]);
1675
- const pe = (m) => {
1676
- const p = ye.current;
1677
- if (!p) return;
1678
- const r = p.querySelector(`[data-variant-row="${m}"]`);
1679
- r && r.scrollIntoView({ behavior: "smooth", block: "nearest" });
1775
+ return () => cancelAnimationFrame(q);
1776
+ }, [P, H]);
1777
+ const Re = (m) => {
1778
+ const b = Be.current;
1779
+ if (!b) return;
1780
+ const w = b.querySelector(`[data-variant-row="${m}"]`);
1781
+ w && w.scrollIntoView({ behavior: "smooth", block: "nearest" });
1680
1782
  };
1681
- return /* @__PURE__ */ S("section", { className: [f.panel, te].filter(Boolean).join(" "), "aria-busy": e, children: [
1783
+ return /* @__PURE__ */ R("section", { className: [f.panel, le].filter(Boolean).join(" "), "aria-busy": e, children: [
1682
1784
  /* @__PURE__ */ s("header", { className: f.header, children: /* @__PURE__ */ s("h2", { className: f.title, children: ke }) }),
1683
1785
  e ? /* @__PURE__ */ s("div", { className: f.status, children: "Loading…" }) : null,
1684
1786
  i ? /* @__PURE__ */ s("div", { className: f.error, children: i }) : null,
1685
1787
  !e && n && !n.isActive ? /* @__PURE__ */ s("div", { className: f.inactive, children: "Bundles are not active." }) : null,
1686
- ne && D.length ? /* @__PURE__ */ s("div", { className: f.section, children: /* @__PURE__ */ S("div", { className: f.rulesVisual, children: [
1687
- /* @__PURE__ */ s("div", { className: f.rulesLabelsRow, children: Array.from({ length: we }).map((m, p) => {
1688
- const r = p + 1, _ = D.find((b) => b.minBundleSize === r), x = _ ? `${Q(_.discountPercent)}% off` : null;
1689
- return /* @__PURE__ */ s("div", { className: f.rulesLineLabelCell, children: x ? /* @__PURE__ */ s("span", { className: f.rulesLineLabel, children: x }) : null }, r);
1788
+ ce && H.length ? /* @__PURE__ */ s("div", { className: f.section, children: /* @__PURE__ */ R("div", { className: f.rulesVisual, children: [
1789
+ /* @__PURE__ */ s("div", { className: f.rulesLabelsRow, children: Array.from({ length: Ne }).map((m, b) => {
1790
+ const w = b + 1, L = H.find((q) => q.minBundleSize === w), B = L ? `${te(L.discountPercent)}% off` : null;
1791
+ return /* @__PURE__ */ s("div", { className: f.rulesLineLabelCell, children: B ? /* @__PURE__ */ s("span", { className: f.rulesLineLabel, children: B }) : null }, w);
1690
1792
  }) }),
1691
- /* @__PURE__ */ s("div", { className: f.rulesLinesRow, children: Array.from({ length: we }).map((m, p) => {
1692
- const r = p + 1, _ = g >= r;
1793
+ /* @__PURE__ */ s("div", { className: f.rulesLinesRow, children: Array.from({ length: Ne }).map((m, b) => {
1794
+ const w = b + 1, L = P >= w;
1693
1795
  return /* @__PURE__ */ s(
1694
1796
  "div",
1695
1797
  {
1696
1798
  className: [
1697
1799
  f.rulesLine,
1698
- _ ? f.rulesLineFilled : f.rulesLineEmpty
1800
+ L ? f.rulesLineFilled : f.rulesLineEmpty
1699
1801
  ].filter(Boolean).join(" ")
1700
1802
  },
1701
- r
1803
+ w
1702
1804
  );
1703
1805
  }) })
1704
1806
  ] }) }) : null,
1705
- L ? /* @__PURE__ */ S("div", { className: f.section, ref: ye, children: [
1807
+ j ? /* @__PURE__ */ R("div", { className: f.section, ref: Be, children: [
1706
1808
  /* @__PURE__ */ s("div", { className: f.sectionTitle, children: "Select items" }),
1707
- /* @__PURE__ */ s("div", { className: f.variants, children: /* @__PURE__ */ s("ul", { className: f.variantList, children: w.map((m) => {
1708
- var b;
1709
- const p = c[m.id] ?? 0, r = ee(m.selectedOptions), _ = m.availableForSale === !1, x = !_ && !he;
1710
- return /* @__PURE__ */ S(
1809
+ /* @__PURE__ */ s("div", { className: f.variants, children: /* @__PURE__ */ s("ul", { className: f.variantList, children: J.map((m) => {
1810
+ var q;
1811
+ const b = c[m.id] ?? 0, w = re(m.selectedOptions), L = m.availableForSale === !1, B = !L && !je;
1812
+ return /* @__PURE__ */ R(
1711
1813
  "li",
1712
1814
  {
1713
1815
  className: [
1714
1816
  f.variantRow,
1715
- x ? f.variantRowInteractive : null,
1716
- p > 0 ? f.variantRowSelected : null,
1717
- _ ? f.variantRowSoldOut : null
1817
+ B ? f.variantRowInteractive : null,
1818
+ b > 0 ? f.variantRowSelected : null,
1819
+ L ? f.variantRowSoldOut : null
1718
1820
  ].filter(Boolean).join(" "),
1719
1821
  "data-variant-row": m.id,
1720
- role: x ? "button" : void 0,
1721
- tabIndex: x ? 0 : void 0,
1722
- onClick: x ? () => {
1723
- G(m.id, p + 1);
1822
+ role: B ? "button" : void 0,
1823
+ tabIndex: B ? 0 : void 0,
1824
+ onClick: B ? () => {
1825
+ Y(m.id, b + 1);
1724
1826
  } : void 0,
1725
- onKeyDown: x ? (y) => {
1726
- (y.key === "Enter" || y.key === " ") && (y.preventDefault(), G(m.id, p + 1), pe(m.id));
1827
+ onKeyDown: B ? (T) => {
1828
+ (T.key === "Enter" || T.key === " ") && (T.preventDefault(), Y(m.id, b + 1), Re(m.id));
1727
1829
  } : void 0,
1728
- "aria-label": _ ? `${m.displayName} is sold out` : `Add ${m.displayName} to bundle`,
1830
+ "aria-label": L ? `${m.displayName} is sold out` : `Add ${m.displayName} to bundle`,
1729
1831
  children: [
1730
- /* @__PURE__ */ s("div", { className: f.variantMedia, children: (b = m.image) != null && b.url ? /* @__PURE__ */ s(
1832
+ /* @__PURE__ */ s("div", { className: f.variantMedia, children: (q = m.image) != null && q.url ? /* @__PURE__ */ s(
1731
1833
  "img",
1732
1834
  {
1733
1835
  src: m.image.url,
@@ -1738,57 +1840,57 @@ function $i(o) {
1738
1840
  loading: "lazy"
1739
1841
  }
1740
1842
  ) : /* @__PURE__ */ s("div", { className: f.variantImageFallback, children: "Item" }) }),
1741
- /* @__PURE__ */ S("div", { className: f.variantContent, children: [
1742
- /* @__PURE__ */ S("div", { className: f.variantHeader, children: [
1843
+ /* @__PURE__ */ R("div", { className: f.variantContent, children: [
1844
+ /* @__PURE__ */ R("div", { className: f.variantHeader, children: [
1743
1845
  /* @__PURE__ */ s("div", { className: f.variantTitle, children: m.displayName }),
1744
- r ? /* @__PURE__ */ s("div", { className: f.variantMeta, children: r }) : null
1846
+ w ? /* @__PURE__ */ s("div", { className: f.variantMeta, children: w }) : null
1745
1847
  ] }),
1746
- /* @__PURE__ */ S("div", { className: f.variantFooterRow, children: [
1747
- /* @__PURE__ */ s("div", { className: f.variantPrice, children: ue(m.price) }),
1748
- /* @__PURE__ */ s("div", { className: f.variantActions, children: _ ? /* @__PURE__ */ s("div", { className: f.soldOut, "aria-label": `${m.displayName} is sold out`, children: "Sold Out" }) : /* @__PURE__ */ S("div", { className: f.qtyActions, children: [
1749
- p > 0 ? /* @__PURE__ */ s(
1848
+ /* @__PURE__ */ R("div", { className: f.variantFooterRow, children: [
1849
+ /* @__PURE__ */ s("div", { className: f.variantPrice, children: ie(m.price) }),
1850
+ /* @__PURE__ */ s("div", { className: f.variantActions, children: L ? /* @__PURE__ */ s("div", { className: f.soldOut, "aria-label": `${m.displayName} is sold out`, children: "Sold Out" }) : /* @__PURE__ */ R("div", { className: f.qtyActions, children: [
1851
+ b > 0 ? /* @__PURE__ */ s(
1750
1852
  "button",
1751
1853
  {
1752
1854
  type: "button",
1753
1855
  className: f.qtyTrash,
1754
1856
  "aria-label": `Remove ${m.displayName} from bundle`,
1755
- onClick: (y) => {
1756
- y.stopPropagation(), G(m.id, 0);
1857
+ onClick: (T) => {
1858
+ T.stopPropagation(), Y(m.id, 0);
1757
1859
  },
1758
- onKeyDown: (y) => {
1759
- y.stopPropagation();
1860
+ onKeyDown: (T) => {
1861
+ T.stopPropagation();
1760
1862
  },
1761
- children: /* @__PURE__ */ s(en, { size: 14 })
1863
+ children: /* @__PURE__ */ s(on, { size: 14 })
1762
1864
  }
1763
1865
  ) : null,
1764
1866
  /* @__PURE__ */ s(
1765
1867
  "div",
1766
1868
  {
1767
- className: [f.qtyChip, p > 0 ? f.qtyChipInteractive : null].filter(Boolean).join(" "),
1768
- "aria-label": `${m.displayName} quantity ${p}`,
1769
- onClick: (y) => {
1770
- y.stopPropagation(), G(m.id, p + 1);
1869
+ className: [f.qtyChip, b > 0 ? f.qtyChipInteractive : null].filter(Boolean).join(" "),
1870
+ "aria-label": `${m.displayName} quantity ${b}`,
1871
+ onClick: (T) => {
1872
+ T.stopPropagation(), Y(m.id, b + 1);
1771
1873
  },
1772
- onKeyDown: (y) => {
1773
- y.stopPropagation();
1874
+ onKeyDown: (T) => {
1875
+ T.stopPropagation();
1774
1876
  },
1775
1877
  role: "button",
1776
1878
  tabIndex: 0,
1777
- children: p <= 0 ? /* @__PURE__ */ s("span", { className: f.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ s(yt, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ S(Xe, { children: [
1778
- /* @__PURE__ */ s("span", { className: f.qtyChipValue, children: p }),
1879
+ children: b <= 0 ? /* @__PURE__ */ s("span", { className: f.qtyChipPlus, "aria-hidden": "true", children: /* @__PURE__ */ s(Ct, { size: 18, strokeWidth: 1.8 }) }) : /* @__PURE__ */ R(ut, { children: [
1880
+ /* @__PURE__ */ s("span", { className: f.qtyChipValue, children: b }),
1779
1881
  /* @__PURE__ */ s(
1780
1882
  "button",
1781
1883
  {
1782
1884
  type: "button",
1783
1885
  className: f.qtyChipClear,
1784
1886
  "aria-label": `Add ${m.displayName}`,
1785
- onClick: (y) => {
1786
- y.stopPropagation(), G(m.id, p + 1);
1887
+ onClick: (T) => {
1888
+ T.stopPropagation(), Y(m.id, b + 1);
1787
1889
  },
1788
- onKeyDown: (y) => {
1789
- y.stopPropagation();
1890
+ onKeyDown: (T) => {
1891
+ T.stopPropagation();
1790
1892
  },
1791
- children: /* @__PURE__ */ s(yt, { size: 12, strokeWidth: 2 })
1893
+ children: /* @__PURE__ */ s(Ct, { size: 12, strokeWidth: 2 })
1792
1894
  }
1793
1895
  )
1794
1896
  ] })
@@ -1803,70 +1905,70 @@ function $i(o) {
1803
1905
  );
1804
1906
  }) }) })
1805
1907
  ] }) : null,
1806
- /* @__PURE__ */ S("footer", { className: f.footer, children: [
1807
- /* @__PURE__ */ s("div", { className: f.boxSummaryWindow, ref: me, children: /* @__PURE__ */ s("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ge }).map((m, p) => {
1808
- var B, E, K, _e;
1809
- const r = xe[p], _ = X.get(p), x = !!r, b = !!_, y = b && !x, R = _ ? `${_.discountPercent}% off` : null, U = x ? r.displayName : `Slot ${p + 1}`;
1810
- return /* @__PURE__ */ S("div", { "data-box-slot": p, className: f.boxSlot, children: [
1908
+ /* @__PURE__ */ R("footer", { className: f.footer, children: [
1909
+ /* @__PURE__ */ s("div", { className: f.boxSummaryWindow, ref: oe, children: /* @__PURE__ */ s("div", { className: f.boxSummaryRow, "aria-label": "Bundle box summary", children: Array.from({ length: ze }).map((m, b) => {
1910
+ var z, pe, Pe, he;
1911
+ const w = ve[b], L = ge.get(b), B = !!w, q = !!L, T = q && !B, Q = L ? `${L.discountPercent}% off` : null, Ce = B ? w.displayName : `Slot ${b + 1}`;
1912
+ return /* @__PURE__ */ R("div", { "data-box-slot": b, className: f.boxSlot, children: [
1811
1913
  /* @__PURE__ */ s(
1812
1914
  "div",
1813
1915
  {
1814
1916
  className: [
1815
1917
  f.boxItem,
1816
- x ? f.boxItemFilled : f.boxItemPlaceholder,
1817
- b ? f.boxItemThreshold : null,
1818
- x ? f.boxItemClickable : null
1918
+ B ? f.boxItemFilled : f.boxItemPlaceholder,
1919
+ q ? f.boxItemThreshold : null,
1920
+ B ? f.boxItemClickable : null
1819
1921
  ].filter(Boolean).join(" "),
1820
- role: x ? "button" : void 0,
1821
- tabIndex: x ? 0 : void 0,
1822
- onClick: x ? () => pe(r.id) : void 0,
1823
- onKeyDown: x ? (be) => {
1824
- (be.key === "Enter" || be.key === " ") && (be.preventDefault(), pe(r.id));
1922
+ role: B ? "button" : void 0,
1923
+ tabIndex: B ? 0 : void 0,
1924
+ onClick: B ? () => Re(w.id) : void 0,
1925
+ onKeyDown: B ? (g) => {
1926
+ (g.key === "Enter" || g.key === " ") && (g.preventDefault(), Re(w.id));
1825
1927
  } : void 0,
1826
- "aria-label": y && R ? `${U}. Unlocks ${R}.` : U,
1827
- title: y && R ? `${U} • Unlocks ${R}` : U,
1828
- children: x ? (B = r.image) != null && B.url ? /* @__PURE__ */ s(
1928
+ "aria-label": T && Q ? `${Ce}. Unlocks ${Q}.` : Ce,
1929
+ title: T && Q ? `${Ce} • Unlocks ${Q}` : Ce,
1930
+ children: B ? (z = w.image) != null && z.url ? /* @__PURE__ */ s(
1829
1931
  "img",
1830
1932
  {
1831
1933
  className: f.boxItemImage,
1832
- src: r.image.url,
1833
- alt: r.image.altText ?? r.displayName,
1934
+ src: w.image.url,
1935
+ alt: w.image.altText ?? w.displayName,
1834
1936
  width: 1,
1835
1937
  height: 1,
1836
1938
  loading: "lazy"
1837
1939
  }
1838
- ) : /* @__PURE__ */ s("div", { className: f.boxItemFallback, "aria-hidden": "true", children: ((_e = (K = (E = r.product) == null ? void 0 : E.title) == null ? void 0 : K.slice(0, 1)) == null ? void 0 : _e.toUpperCase()) ?? "•" }) : y && R ? /* @__PURE__ */ s("div", { className: f.boxItemDiscountText, children: R }) : /* @__PURE__ */ s("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
1940
+ ) : /* @__PURE__ */ s("div", { className: f.boxItemFallback, "aria-hidden": "true", children: ((he = (Pe = (pe = w.product) == null ? void 0 : pe.title) == null ? void 0 : Pe.slice(0, 1)) == null ? void 0 : he.toUpperCase()) ?? "•" }) : T && Q ? /* @__PURE__ */ s("div", { className: f.boxItemDiscountText, children: Q }) : /* @__PURE__ */ s("div", { className: f.boxItemPlus, "aria-hidden": "true", children: "+" })
1839
1941
  }
1840
1942
  ),
1841
- b ? /* @__PURE__ */ s("div", { className: f.boxThresholdLabel, children: _.label }) : null
1842
- ] }, p);
1943
+ q ? /* @__PURE__ */ s("div", { className: f.boxThresholdLabel, children: L.label }) : null
1944
+ ] }, b);
1843
1945
  }) }) }),
1844
- /* @__PURE__ */ s("div", { className: [f.totalsReveal, Ne ? f.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ s(
1946
+ /* @__PURE__ */ s("div", { className: [f.totalsReveal, Me ? f.totalsRevealOpen : null].filter(Boolean).join(" "), children: /* @__PURE__ */ s(
1845
1947
  "div",
1846
1948
  {
1847
- className: [f.ctaTotalsWrap, Ne ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1848
- "aria-hidden": !Ne,
1849
- children: /* @__PURE__ */ S("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
1850
- de ? /* @__PURE__ */ S("span", { className: f.ctaDiscountBadge, children: [
1851
- de,
1949
+ className: [f.ctaTotalsWrap, Me ? f.ctaTotalsWrapVisible : null].filter(Boolean).join(" "),
1950
+ "aria-hidden": !Me,
1951
+ children: /* @__PURE__ */ R("div", { className: f.ctaTotals, "aria-label": "Totals", children: [
1952
+ ue ? /* @__PURE__ */ R("span", { className: f.ctaDiscountBadge, children: [
1953
+ ue,
1852
1954
  "% Discount"
1853
1955
  ] }) : /* @__PURE__ */ s("span", {}),
1854
- /* @__PURE__ */ s("span", { children: de ? /* @__PURE__ */ S(Xe, { children: [
1855
- /* @__PURE__ */ s("span", { className: f.ctaTotalsStrike, children: ue(ae.toFixed(2)) }),
1956
+ /* @__PURE__ */ s("span", { children: ue ? /* @__PURE__ */ R(ut, { children: [
1957
+ /* @__PURE__ */ s("span", { className: f.ctaTotalsStrike, children: ie(be.toFixed(2)) }),
1856
1958
  " ",
1857
- /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children: ue(oe.toFixed(2)) })
1858
- ] }) : /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children: ue(ae.toFixed(2)) }) })
1959
+ /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children: ie(Ge.toFixed(2)) })
1960
+ ] }) : /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children: ie(be.toFixed(2)) }) })
1859
1961
  ] })
1860
1962
  }
1861
1963
  ) }),
1862
1964
  (() => {
1863
1965
  const m = (n == null ? void 0 : n.ctaButtonMode) || "add_to_cart";
1864
- return m === "add_to_cart_checkout" ? W > 0 ? /* @__PURE__ */ s("button", { type: "button", onClick: z, disabled: !P, className: f.cta, children: t ? "Adding…" : `Add ${W} more product${W === 1 ? "" : "s"}` }) : /* @__PURE__ */ S("div", { className: f.ctaButtonGroup, children: [
1865
- /* @__PURE__ */ s("button", { type: "button", onClick: z, disabled: !P, className: f.ctaDualLeft, children: /* @__PURE__ */ s("span", { children: t ? "Adding…" : "Add to Basket" }) }),
1866
- /* @__PURE__ */ s("button", { type: "button", onClick: H, disabled: !P, className: f.ctaDualRight, children: /* @__PURE__ */ s("span", { children: t ? "Processing…" : "Checkout" }) })
1867
- ] }) : m === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick: H, disabled: !P, className: f.cta, children: t ? "Processing…" : W > 0 ? `Add ${W} more product${W === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ s("button", { type: "button", onClick: z, disabled: !P, className: f.cta, children: t ? "Adding…" : W > 0 ? `Add ${W} more product${W === 1 ? "" : "s"}` : "Add to Basket" });
1966
+ return m === "add_to_cart_checkout" ? ee > 0 ? /* @__PURE__ */ s("button", { type: "button", onClick: E, disabled: !O, className: f.cta, children: t ? "Adding…" : `Add ${ee} more product${ee === 1 ? "" : "s"}` }) : /* @__PURE__ */ R("div", { className: f.ctaButtonGroup, children: [
1967
+ /* @__PURE__ */ s("button", { type: "button", onClick: E, disabled: !O, className: f.ctaDualLeft, children: /* @__PURE__ */ s("span", { children: t ? "Adding…" : "Add to Basket" }) }),
1968
+ /* @__PURE__ */ s("button", { type: "button", onClick: X, disabled: !O, className: f.ctaDualRight, children: /* @__PURE__ */ s("span", { children: t ? "Processing…" : "Checkout" }) })
1969
+ ] }) : m === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick: X, disabled: !O, className: f.cta, children: t ? "Processing…" : ee > 0 ? `Add ${ee} more product${ee === 1 ? "" : "s"}` : "Checkout" }) : /* @__PURE__ */ s("button", { type: "button", onClick: E, disabled: !O, className: f.cta, children: t ? "Adding…" : ee > 0 ? `Add ${ee} more product${ee === 1 ? "" : "s"}` : "Add to Basket" });
1868
1970
  })(),
1869
- /* @__PURE__ */ S("div", { className: f.poweredBy, children: [
1971
+ /* @__PURE__ */ R("div", { className: f.poweredBy, children: [
1870
1972
  "powered by",
1871
1973
  " ",
1872
1974
  /* @__PURE__ */ s("a", { href: "https://apps.shopify.com/best-bundles", target: "_blank", rel: "noopener noreferrer", children: "BestBundles" })
@@ -1874,19 +1976,36 @@ function $i(o) {
1874
1976
  ] })
1875
1977
  ] });
1876
1978
  }
1877
- function Ye(o) {
1878
- if (o != null && o.length)
1879
- return o.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
1979
+ function ct(a) {
1980
+ if (a != null && a.length)
1981
+ return a.reduce((e, t) => (t != null && t.key && (e[t.key] = t.value ?? ""), e), {});
1982
+ }
1983
+ function It(a) {
1984
+ const e = /\/(\d+)$/.exec(a);
1985
+ return e ? e[1] : a;
1986
+ }
1987
+ function Lr() {
1988
+ var a;
1989
+ return typeof window > "u" ? null : ((a = window.Shopify) == null ? void 0 : a.theme) ?? null;
1990
+ }
1991
+ function Dr() {
1992
+ const a = Lr();
1993
+ return a ? a.schema_name === "Sleek" ? !0 : /sleek/i.test(a.name ?? "") : !1;
1994
+ }
1995
+ function $r() {
1996
+ return typeof document > "u" ? !1 : !!document.querySelector("cart-drawer");
1880
1997
  }
1881
- function vt(o) {
1882
- const e = /\/(\d+)$/.exec(o);
1883
- return e ? e[1] : o;
1998
+ function Er() {
1999
+ return !Dr() || !$r() ? !1 : (document.dispatchEvent(new CustomEvent("cart:refresh", {
2000
+ bubbles: !0,
2001
+ detail: { open: !0 }
2002
+ })), !0);
1884
2003
  }
1885
- function Pi() {
2004
+ function qr() {
1886
2005
  window.location.reload();
1887
2006
  }
1888
- async function Ee(o, e) {
1889
- const t = await fetch(o, {
2007
+ async function nt(a, e) {
2008
+ const t = await fetch(a, {
1890
2009
  method: "POST",
1891
2010
  headers: {
1892
2011
  Accept: "application/json",
@@ -1900,38 +2019,38 @@ async function Ee(o, e) {
1900
2019
  }
1901
2020
  return t.json().catch(() => null);
1902
2021
  }
1903
- function Ei() {
2022
+ function Qr() {
1904
2023
  return {
1905
- async linesAdd(o) {
1906
- const e = o.map((t) => ({
1907
- id: vt(t.merchandiseId),
2024
+ async linesAdd(a) {
2025
+ const e = a.map((t) => ({
2026
+ id: It(t.merchandiseId),
1908
2027
  quantity: t.quantity,
1909
- properties: Ye(t.attributes)
2028
+ properties: ct(t.attributes)
1910
2029
  }));
1911
- await Ee("/cart/add.js", { items: e });
2030
+ await nt("/cart/add.js", { items: e });
1912
2031
  },
1913
- async linesAddForCheckout(o) {
1914
- const e = o.map((t) => ({
1915
- id: vt(t.merchandiseId),
2032
+ async linesAddForCheckout(a) {
2033
+ const e = a.map((t) => ({
2034
+ id: It(t.merchandiseId),
1916
2035
  quantity: t.quantity,
1917
- properties: Ye(t.attributes)
2036
+ properties: ct(t.attributes)
1918
2037
  }));
1919
- await Ee("/cart/add.js", { items: e });
2038
+ await nt("/cart/add.js", { items: e });
1920
2039
  },
1921
- async linesUpdate(o) {
1922
- for (const e of o)
1923
- await Ee("/cart/change.js", {
2040
+ async linesUpdate(a) {
2041
+ for (const e of a)
2042
+ await nt("/cart/change.js", {
1924
2043
  id: e.id,
1925
2044
  quantity: e.quantity,
1926
- properties: Ye(e.attributes)
2045
+ properties: ct(e.attributes)
1927
2046
  });
1928
2047
  },
1929
- async linesRemove(o) {
1930
- for (const e of o)
1931
- await Ee("/cart/change.js", { id: e, quantity: 0 });
2048
+ async linesRemove(a) {
2049
+ for (const e of a)
2050
+ await nt("/cart/change.js", { id: e, quantity: 0 });
1932
2051
  },
1933
2052
  openCartUI() {
1934
- window.setTimeout(() => Pi(), 0);
2053
+ Er() || window.setTimeout(() => qr(), 0);
1935
2054
  },
1936
2055
  navigateToCheckout() {
1937
2056
  window.location.href = "/checkout";
@@ -1939,13 +2058,13 @@ function Ei() {
1939
2058
  };
1940
2059
  }
1941
2060
  export {
1942
- Di as BundleBuilderDrawer,
1943
- $i as BundleBuilderPanel,
1944
- Li as BundleButton,
1945
- $e as BundleLineAttributeKeys,
1946
- Fi as BundleProvider,
1947
- Ei as createLiquidCartAdapter,
1948
- ze as useBundleBuilder,
1949
- Ai as useBundleBuilderDrawer
2061
+ Hr as BundleBuilderDrawer,
2062
+ Gr as BundleBuilderPanel,
2063
+ Ur as BundleButton,
2064
+ et as BundleLineAttributeKeys,
2065
+ jr as BundleProvider,
2066
+ Qr as createLiquidCartAdapter,
2067
+ rt as useBundleBuilder,
2068
+ Wr as useBundleBuilderDrawer
1950
2069
  };
1951
2070
  //# sourceMappingURL=index.js.map