@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/adapters/LiquidAdapter.d.ts.map +1 -1
- package/dist/api/fetchActiveBundleConfigs.d.ts +7 -0
- package/dist/api/fetchActiveBundleConfigs.d.ts.map +1 -0
- package/dist/api/fetchBundleConfig.d.ts +1 -0
- package/dist/api/fetchBundleConfig.d.ts.map +1 -1
- package/dist/api/fetchBundleConfigStatus.d.ts +8 -0
- package/dist/api/fetchBundleConfigStatus.d.ts.map +1 -0
- package/dist/context/BundleProvider.d.ts +19 -20
- package/dist/context/BundleProvider.d.ts.map +1 -1
- package/dist/index.js +1244 -1125
- package/dist/index.js.map +1 -1
- package/dist/liquid/bundle-ui.iife.js +17 -17
- package/dist/liquid/bundle-ui.iife.js.map +1 -1
- package/dist/liquid/iife.d.ts +8 -2
- package/dist/liquid/iife.d.ts.map +1 -1
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,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
|
|
3
|
-
import
|
|
4
|
-
const
|
|
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
|
|
11
|
-
const e = new URL("/api/public/bundle-
|
|
12
|
-
e.searchParams.set("shop",
|
|
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:
|
|
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
|
-
|
|
21
|
-
|
|
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
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
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(
|
|
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
|
|
63
|
+
async function He(a, e, t) {
|
|
44
64
|
if (!(typeof window > "u"))
|
|
45
65
|
try {
|
|
46
|
-
const i = new URL(
|
|
66
|
+
const i = new URL(a, window.location.origin);
|
|
47
67
|
i.searchParams.set("shop", e);
|
|
48
|
-
const
|
|
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
|
-
|
|
58
|
-
`[Bundle Analytics] Event tracking failed with status ${
|
|
59
|
-
await
|
|
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
|
|
66
|
-
function
|
|
67
|
-
const e = String(
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
98
|
-
function
|
|
99
|
-
const e = (
|
|
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
|
|
124
|
+
function At(a) {
|
|
103
125
|
var c;
|
|
104
126
|
if (typeof document > "u" || !document.head) return;
|
|
105
|
-
if (!
|
|
106
|
-
(c = document.getElementById(
|
|
127
|
+
if (!a) {
|
|
128
|
+
(c = document.getElementById(ot)) == null || c.remove();
|
|
107
129
|
return;
|
|
108
130
|
}
|
|
109
|
-
const e = (
|
|
110
|
-
e && i.push("family=" +
|
|
111
|
-
const
|
|
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
|
-
|
|
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 (
|
|
118
|
-
|
|
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 =
|
|
144
|
+
d.id = ot, d.rel = "stylesheet", d.href = n, document.head.appendChild(d);
|
|
123
145
|
}
|
|
124
|
-
function
|
|
125
|
-
if (!
|
|
126
|
-
|
|
146
|
+
function yt(a) {
|
|
147
|
+
if (!a) return;
|
|
148
|
+
At(a);
|
|
127
149
|
const e = document.documentElement;
|
|
128
|
-
Object.entries(
|
|
129
|
-
let
|
|
130
|
-
|
|
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
|
|
134
|
-
if (typeof window > "u") return
|
|
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 :
|
|
158
|
+
return e && typeof e == "object" ? e : a;
|
|
137
159
|
}
|
|
138
|
-
function
|
|
160
|
+
function Lt() {
|
|
139
161
|
try {
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
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
|
|
147
|
-
return Number.isFinite(
|
|
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
|
|
174
|
+
function jr(a) {
|
|
150
175
|
const {
|
|
151
176
|
apiBaseUrl: e,
|
|
152
177
|
shop: t,
|
|
153
178
|
cartAdapter: i,
|
|
154
|
-
configHandle:
|
|
179
|
+
configHandle: r = "default",
|
|
155
180
|
initialData: n,
|
|
156
181
|
configFetcher: d,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
), [
|
|
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
|
-
),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
|
229
|
-
|
|
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:
|
|
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 (
|
|
255
|
-
console.warn("[Bundle Analytics] Error in close() callback:",
|
|
214
|
+
} catch (u) {
|
|
215
|
+
console.warn("[Bundle Analytics] Error in close() callback:", u);
|
|
256
216
|
}
|
|
257
|
-
|
|
258
|
-
}, [
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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 _ =
|
|
274
|
-
|
|
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((
|
|
281
|
-
console.warn("[Bundle Analytics] Failed to track drawer opened:",
|
|
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
|
|
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
|
-
|
|
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
|
-
}, [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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
|
-
}, [
|
|
296
|
-
|
|
297
|
-
), [
|
|
298
|
-
const
|
|
299
|
-
return
|
|
300
|
-
}, [
|
|
301
|
-
if (!
|
|
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
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
let
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
} else
|
|
311
|
-
let
|
|
312
|
-
if (
|
|
313
|
-
|
|
314
|
-
else if (
|
|
315
|
-
let
|
|
316
|
-
const
|
|
317
|
-
for (let
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
320
|
-
|
|
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
|
-
|
|
424
|
+
x.push(I);
|
|
324
425
|
}
|
|
325
|
-
|
|
426
|
+
x.reverse(), p = x;
|
|
326
427
|
}
|
|
327
|
-
if (
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
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
|
|
432
|
+
const N = tt(), x = {
|
|
332
433
|
eventType: "VARIANT_SELECTION_CHANGED",
|
|
333
434
|
shop: t,
|
|
334
|
-
anonymousUserId:
|
|
335
|
-
before: { ...
|
|
336
|
-
after: { ...
|
|
435
|
+
anonymousUserId: N,
|
|
436
|
+
before: { ...v.selections },
|
|
437
|
+
after: { ...l },
|
|
337
438
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
338
439
|
};
|
|
339
|
-
|
|
340
|
-
...
|
|
440
|
+
He(E, t, x), S === 0 && C >= 1 && He(E, t, {
|
|
441
|
+
...x,
|
|
341
442
|
mixpanelEvent: "bundle_started"
|
|
342
|
-
}),
|
|
343
|
-
...
|
|
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:
|
|
449
|
+
return { selections: l, order: p };
|
|
349
450
|
});
|
|
350
|
-
}, [
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
const _ = Object.entries(
|
|
354
|
-
|
|
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
|
-
}, [
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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:
|
|
367
|
-
{ key:
|
|
368
|
-
{ key:
|
|
369
|
-
...
|
|
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 (!
|
|
373
|
-
const
|
|
374
|
-
let
|
|
375
|
-
for (const [
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
Number.isFinite(
|
|
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
|
-
|
|
382
|
-
const
|
|
383
|
-
let
|
|
384
|
-
for (const
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
const
|
|
388
|
-
return Number.isFinite(
|
|
389
|
-
})() : null,
|
|
390
|
-
|
|
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 (
|
|
493
|
+
if (u != null && u.checkout ? await i.linesAddForCheckout(v) : await i.linesAdd(v), E)
|
|
393
494
|
try {
|
|
394
|
-
const
|
|
395
|
-
|
|
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:
|
|
499
|
+
anonymousUserId: I,
|
|
399
500
|
bundleId: _,
|
|
400
|
-
productVariantIds:
|
|
401
|
-
grossPrice:
|
|
402
|
-
discountedPrice:
|
|
403
|
-
currency:
|
|
404
|
-
discountThresholdIdentifier:
|
|
405
|
-
discountLabel:
|
|
406
|
-
discountPercentage:
|
|
407
|
-
discountedAmount:
|
|
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:
|
|
410
|
-
mixpanelEvent:
|
|
510
|
+
checkout: K,
|
|
511
|
+
mixpanelEvent: K ? "checkout_started_with_bundle" : "bundle_added_to_cart"
|
|
411
512
|
});
|
|
412
513
|
} catch {
|
|
413
514
|
}
|
|
414
|
-
|
|
515
|
+
Ve(), B(), (D = u == null ? void 0 : u.onComplete) == null || D.call(u);
|
|
415
516
|
} finally {
|
|
416
|
-
|
|
517
|
+
te(!1);
|
|
417
518
|
}
|
|
418
519
|
}, [
|
|
419
|
-
|
|
520
|
+
E,
|
|
521
|
+
Oe,
|
|
522
|
+
Le,
|
|
420
523
|
i,
|
|
421
|
-
|
|
422
|
-
|
|
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
|
-
]),
|
|
433
|
-
await
|
|
434
|
-
{
|
|
435
|
-
|
|
436
|
-
|
|
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
|
-
}, [
|
|
442
|
-
await
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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
|
-
}, [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
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
|
|
498
|
-
const
|
|
499
|
-
if (!
|
|
599
|
+
function rt() {
|
|
600
|
+
const a = kt(Nt);
|
|
601
|
+
if (!a)
|
|
500
602
|
throw new Error("useBundleBuilder must be used within <BundleProvider />");
|
|
501
|
-
return
|
|
603
|
+
return a;
|
|
502
604
|
}
|
|
503
|
-
function
|
|
504
|
-
const { isOpen:
|
|
505
|
-
return { isOpen:
|
|
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
|
|
508
|
-
button:
|
|
609
|
+
const $t = "_button_18rtl_1", Et = {
|
|
610
|
+
button: $t
|
|
509
611
|
};
|
|
510
|
-
function
|
|
511
|
-
const { toggle: e } =
|
|
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: [
|
|
518
|
-
children:
|
|
619
|
+
className: [Et.button, a.className].filter(Boolean).join(" "),
|
|
620
|
+
children: a.children ?? "Build a bundle"
|
|
519
621
|
}
|
|
520
622
|
);
|
|
521
623
|
}
|
|
522
|
-
var
|
|
523
|
-
function
|
|
524
|
-
if (
|
|
525
|
-
|
|
526
|
-
var
|
|
527
|
-
linear: function(e, t, i,
|
|
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 /
|
|
631
|
+
return n * e / r + t;
|
|
530
632
|
},
|
|
531
|
-
easeInQuad: function(e, t, i,
|
|
633
|
+
easeInQuad: function(e, t, i, r) {
|
|
532
634
|
var n = i - t;
|
|
533
|
-
return n * (e /=
|
|
635
|
+
return n * (e /= r) * e + t;
|
|
534
636
|
},
|
|
535
|
-
easeOutQuad: function(e, t, i,
|
|
637
|
+
easeOutQuad: function(e, t, i, r) {
|
|
536
638
|
var n = i - t;
|
|
537
|
-
return -n * (e /=
|
|
639
|
+
return -n * (e /= r) * (e - 2) + t;
|
|
538
640
|
},
|
|
539
|
-
easeInOutQuad: function(e, t, i,
|
|
641
|
+
easeInOutQuad: function(e, t, i, r) {
|
|
540
642
|
var n = i - t;
|
|
541
|
-
return (e /=
|
|
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,
|
|
645
|
+
easeInCubic: function(e, t, i, r) {
|
|
544
646
|
var n = i - t;
|
|
545
|
-
return n * (e /=
|
|
647
|
+
return n * (e /= r) * e * e + t;
|
|
546
648
|
},
|
|
547
|
-
easeOutCubic: function(e, t, i,
|
|
649
|
+
easeOutCubic: function(e, t, i, r) {
|
|
548
650
|
var n = i - t;
|
|
549
|
-
return n * ((e = e /
|
|
651
|
+
return n * ((e = e / r - 1) * e * e + 1) + t;
|
|
550
652
|
},
|
|
551
|
-
easeInOutCubic: function(e, t, i,
|
|
653
|
+
easeInOutCubic: function(e, t, i, r) {
|
|
552
654
|
var n = i - t;
|
|
553
|
-
return (e /=
|
|
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,
|
|
657
|
+
easeInQuart: function(e, t, i, r) {
|
|
556
658
|
var n = i - t;
|
|
557
|
-
return n * (e /=
|
|
659
|
+
return n * (e /= r) * e * e * e + t;
|
|
558
660
|
},
|
|
559
|
-
easeOutQuart: function(e, t, i,
|
|
661
|
+
easeOutQuart: function(e, t, i, r) {
|
|
560
662
|
var n = i - t;
|
|
561
|
-
return -n * ((e = e /
|
|
663
|
+
return -n * ((e = e / r - 1) * e * e * e - 1) + t;
|
|
562
664
|
},
|
|
563
|
-
easeInOutQuart: function(e, t, i,
|
|
665
|
+
easeInOutQuart: function(e, t, i, r) {
|
|
564
666
|
var n = i - t;
|
|
565
|
-
return (e /=
|
|
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,
|
|
669
|
+
easeInQuint: function(e, t, i, r) {
|
|
568
670
|
var n = i - t;
|
|
569
|
-
return n * (e /=
|
|
671
|
+
return n * (e /= r) * e * e * e * e + t;
|
|
570
672
|
},
|
|
571
|
-
easeOutQuint: function(e, t, i,
|
|
673
|
+
easeOutQuint: function(e, t, i, r) {
|
|
572
674
|
var n = i - t;
|
|
573
|
-
return n * ((e = e /
|
|
675
|
+
return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
|
|
574
676
|
},
|
|
575
|
-
easeInOutQuint: function(e, t, i,
|
|
677
|
+
easeInOutQuint: function(e, t, i, r) {
|
|
576
678
|
var n = i - t;
|
|
577
|
-
return (e /=
|
|
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,
|
|
681
|
+
easeInSine: function(e, t, i, r) {
|
|
580
682
|
var n = i - t;
|
|
581
|
-
return -n * Math.cos(e /
|
|
683
|
+
return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
|
|
582
684
|
},
|
|
583
|
-
easeOutSine: function(e, t, i,
|
|
685
|
+
easeOutSine: function(e, t, i, r) {
|
|
584
686
|
var n = i - t;
|
|
585
|
-
return n * Math.sin(e /
|
|
687
|
+
return n * Math.sin(e / r * (Math.PI / 2)) + t;
|
|
586
688
|
},
|
|
587
|
-
easeInOutSine: function(e, t, i,
|
|
689
|
+
easeInOutSine: function(e, t, i, r) {
|
|
588
690
|
var n = i - t;
|
|
589
|
-
return -n / 2 * (Math.cos(Math.PI * e /
|
|
691
|
+
return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
|
|
590
692
|
},
|
|
591
|
-
easeInExpo: function(e, t, i,
|
|
693
|
+
easeInExpo: function(e, t, i, r) {
|
|
592
694
|
var n = i - t;
|
|
593
|
-
return e == 0 ? t : n * Math.pow(2, 10 * (e /
|
|
695
|
+
return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t;
|
|
594
696
|
},
|
|
595
|
-
easeOutExpo: function(e, t, i,
|
|
697
|
+
easeOutExpo: function(e, t, i, r) {
|
|
596
698
|
var n = i - t;
|
|
597
|
-
return e ==
|
|
699
|
+
return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t;
|
|
598
700
|
},
|
|
599
|
-
easeInOutExpo: function(e, t, i,
|
|
701
|
+
easeInOutExpo: function(e, t, i, r) {
|
|
600
702
|
var n = i - t;
|
|
601
|
-
return e === 0 ? t : e ===
|
|
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,
|
|
705
|
+
easeInCirc: function(e, t, i, r) {
|
|
604
706
|
var n = i - t;
|
|
605
|
-
return -n * (Math.sqrt(1 - (e /=
|
|
707
|
+
return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
|
|
606
708
|
},
|
|
607
|
-
easeOutCirc: function(e, t, i,
|
|
709
|
+
easeOutCirc: function(e, t, i, r) {
|
|
608
710
|
var n = i - t;
|
|
609
|
-
return n * Math.sqrt(1 - (e = e /
|
|
711
|
+
return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
|
|
610
712
|
},
|
|
611
|
-
easeInOutCirc: function(e, t, i,
|
|
713
|
+
easeInOutCirc: function(e, t, i, r) {
|
|
612
714
|
var n = i - t;
|
|
613
|
-
return (e /=
|
|
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,
|
|
616
|
-
var n = i - t, d, c,
|
|
617
|
-
return
|
|
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,
|
|
620
|
-
var n = i - t, d, c,
|
|
621
|
-
return
|
|
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,
|
|
624
|
-
var n = i - t, d, c,
|
|
625
|
-
return
|
|
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,
|
|
729
|
+
easeInBack: function(e, t, i, r, n) {
|
|
628
730
|
var d = i - t;
|
|
629
|
-
return n === void 0 && (n = 1.70158), d * (e /=
|
|
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,
|
|
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 /
|
|
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,
|
|
737
|
+
easeInOutBack: function(e, t, i, r, n) {
|
|
636
738
|
var d = i - t;
|
|
637
|
-
return n === void 0 && (n = 1.70158), (e /=
|
|
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,
|
|
741
|
+
easeInBounce: function(e, t, i, r) {
|
|
640
742
|
var n = i - t, d;
|
|
641
|
-
return d =
|
|
743
|
+
return d = a.easeOutBounce(r - e, 0, n, r), n - d + t;
|
|
642
744
|
},
|
|
643
|
-
easeOutBounce: function(e, t, i,
|
|
745
|
+
easeOutBounce: function(e, t, i, r) {
|
|
644
746
|
var n = i - t;
|
|
645
|
-
return (e /=
|
|
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,
|
|
749
|
+
easeInOutBounce: function(e, t, i, r) {
|
|
648
750
|
var n = i - t, d;
|
|
649
|
-
return e <
|
|
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
|
|
754
|
+
return st = a, st;
|
|
653
755
|
}
|
|
654
|
-
var
|
|
655
|
-
function
|
|
656
|
-
return
|
|
756
|
+
var zt = qt();
|
|
757
|
+
function Vt(a) {
|
|
758
|
+
return a * Math.PI / 180;
|
|
657
759
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
760
|
+
function ye(a, e) {
|
|
761
|
+
return a + Math.random() * (e - a);
|
|
660
762
|
}
|
|
661
|
-
function
|
|
662
|
-
return Math.floor(
|
|
763
|
+
function jt(a, e) {
|
|
764
|
+
return Math.floor(a + Math.random() * (e - a + 1));
|
|
663
765
|
}
|
|
664
|
-
var
|
|
665
|
-
(function(
|
|
666
|
-
|
|
667
|
-
})(
|
|
668
|
-
var
|
|
669
|
-
(function(
|
|
670
|
-
|
|
671
|
-
})(
|
|
672
|
-
const
|
|
673
|
-
class
|
|
674
|
-
constructor(e, t, i,
|
|
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 =
|
|
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:
|
|
681
|
-
this.x += this.vx * c, this.y += this.vy * c, this.vy += t * c, this.vx += i * c, this.vx *=
|
|
682
|
-
const
|
|
683
|
-
if (this.rotateY +=
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 = (
|
|
706
|
-
this.particles.splice(
|
|
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
|
|
709
|
-
return new
|
|
710
|
-
}, this.animate = (
|
|
711
|
-
const { canvas: n, context: d, particlesGenerated: c, lastNumberOfPieces:
|
|
712
|
-
if (!
|
|
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
|
|
715
|
-
if (
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
for (let
|
|
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 +=
|
|
822
|
+
this.particlesGenerated += te;
|
|
721
823
|
}
|
|
722
|
-
|
|
723
|
-
for (let
|
|
724
|
-
const
|
|
725
|
-
|
|
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
|
|
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
|
|
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:
|
|
867
|
+
tweenFunction: zt.easeInOutQuad,
|
|
766
868
|
tweenDuration: 5e3,
|
|
767
869
|
recycle: !0,
|
|
768
870
|
run: !0
|
|
769
871
|
};
|
|
770
|
-
class
|
|
872
|
+
class Gt {
|
|
771
873
|
constructor(e, t) {
|
|
772
|
-
this.lastFrameTime = 0, this.setOptionsWithDefaults = (
|
|
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
|
-
...
|
|
784
|
-
...
|
|
785
|
-
}, Object.assign(this,
|
|
786
|
-
}, this.update = (
|
|
787
|
-
const { options: { run: n, onConfettiComplete: d, frameRate: c }, canvas:
|
|
788
|
-
if (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 =
|
|
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
|
|
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
|
|
808
|
-
const t = (
|
|
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
|
|
813
|
-
class
|
|
914
|
+
const Qt = at.createRef();
|
|
915
|
+
class mt extends at.Component {
|
|
814
916
|
constructor(e) {
|
|
815
|
-
super(e), this.canvas =
|
|
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 =
|
|
820
|
-
this.confetti = new
|
|
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 =
|
|
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] =
|
|
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
|
-
|
|
845
|
-
...
|
|
946
|
+
mt.defaultProps = {
|
|
947
|
+
...ht
|
|
846
948
|
};
|
|
847
|
-
|
|
848
|
-
function
|
|
849
|
-
const e = {}, t = {}, i = {},
|
|
850
|
-
...Object.keys(
|
|
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
|
|
857
|
-
const c =
|
|
858
|
-
|
|
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
|
|
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
|
|
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
|
-
),
|
|
873
|
-
const e =
|
|
974
|
+
), xt = (a) => {
|
|
975
|
+
const e = Xt(a);
|
|
874
976
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
875
|
-
},
|
|
876
|
-
for (const e in
|
|
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
|
|
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
|
|
1005
|
+
const en = St(
|
|
904
1006
|
({
|
|
905
|
-
color:
|
|
1007
|
+
color: a = "currentColor",
|
|
906
1008
|
size: e = 24,
|
|
907
1009
|
strokeWidth: t = 2,
|
|
908
1010
|
absoluteStrokeWidth: i,
|
|
909
|
-
className:
|
|
1011
|
+
className: r = "",
|
|
910
1012
|
children: n,
|
|
911
1013
|
iconNode: d,
|
|
912
1014
|
...c
|
|
913
|
-
},
|
|
1015
|
+
}, k) => dt(
|
|
914
1016
|
"svg",
|
|
915
1017
|
{
|
|
916
|
-
ref:
|
|
917
|
-
...
|
|
1018
|
+
ref: k,
|
|
1019
|
+
...Jt,
|
|
918
1020
|
width: e,
|
|
919
1021
|
height: e,
|
|
920
|
-
stroke:
|
|
1022
|
+
stroke: a,
|
|
921
1023
|
strokeWidth: i ? Number(t) * 24 / Number(e) : t,
|
|
922
|
-
className:
|
|
923
|
-
...!n && !
|
|
1024
|
+
className: Bt("lucide", r),
|
|
1025
|
+
...!n && !Zt(c) && { "aria-hidden": "true" },
|
|
924
1026
|
...c
|
|
925
1027
|
},
|
|
926
1028
|
[
|
|
927
|
-
...d.map(([
|
|
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
|
|
939
|
-
const t =
|
|
940
|
-
({ className: i, ...
|
|
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:
|
|
944
|
-
`lucide-${
|
|
945
|
-
`lucide-${
|
|
1045
|
+
className: Bt(
|
|
1046
|
+
`lucide-${Yt(xt(a))}`,
|
|
1047
|
+
`lucide-${a}`,
|
|
946
1048
|
i
|
|
947
1049
|
),
|
|
948
|
-
...
|
|
1050
|
+
...r
|
|
949
1051
|
})
|
|
950
1052
|
);
|
|
951
|
-
return t.displayName =
|
|
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
|
|
1061
|
+
const tn = [
|
|
960
1062
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
961
1063
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
962
|
-
],
|
|
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
|
|
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
|
-
],
|
|
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
|
|
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
|
-
],
|
|
986
|
-
backdrop:
|
|
987
|
-
celebrationOverlay:
|
|
988
|
-
celebrationChip:
|
|
989
|
-
backdropOpen:
|
|
990
|
-
backdropClosed:
|
|
991
|
-
panel:
|
|
992
|
-
panelOpen:
|
|
993
|
-
panelClosed:
|
|
994
|
-
header:
|
|
995
|
-
headerCenter:
|
|
996
|
-
title:
|
|
997
|
-
searchIconButton:
|
|
998
|
-
headerTitleWrap:
|
|
999
|
-
headerSearchWrap:
|
|
1000
|
-
headerSearchOpen:
|
|
1001
|
-
searchBar:
|
|
1002
|
-
searchInput:
|
|
1003
|
-
searchClearButton:
|
|
1004
|
-
closeButton:
|
|
1005
|
-
body:
|
|
1006
|
-
muted:
|
|
1007
|
-
error:
|
|
1008
|
-
variants:
|
|
1009
|
-
variantList:
|
|
1010
|
-
variantRow:
|
|
1011
|
-
variantRowSoldOut:
|
|
1012
|
-
variantLeft:
|
|
1013
|
-
addToBundleButton:
|
|
1014
|
-
soldOutContainer:
|
|
1015
|
-
soldOut:
|
|
1016
|
-
variantThumb:
|
|
1017
|
-
variantThumbImg:
|
|
1018
|
-
variantThumbFallback:
|
|
1019
|
-
variantInfo:
|
|
1020
|
-
variantName:
|
|
1021
|
-
variantMeta:
|
|
1022
|
-
variantPriceRow:
|
|
1023
|
-
variantCompareAt:
|
|
1024
|
-
variantPrice:
|
|
1025
|
-
qtyControls:
|
|
1026
|
-
qtyButton:
|
|
1027
|
-
qtyValue:
|
|
1028
|
-
footer:
|
|
1029
|
-
poweredBy:
|
|
1030
|
-
boxSummaryWindow:
|
|
1031
|
-
boxSummaryRow:
|
|
1032
|
-
boxSlot:
|
|
1033
|
-
boxItem:
|
|
1034
|
-
boxItemClickable:
|
|
1035
|
-
boxThresholdLabel:
|
|
1036
|
-
boxItemPlaceholder:
|
|
1037
|
-
boxItemFilled:
|
|
1038
|
-
boxItemThreshold:
|
|
1039
|
-
boxItemDiscountText:
|
|
1040
|
-
boxItemPlus:
|
|
1041
|
-
boxItemImage:
|
|
1042
|
-
boxItemFallback:
|
|
1043
|
-
ctaButtonGroup:
|
|
1044
|
-
ctaButtonGroupAnimating:
|
|
1045
|
-
cta:
|
|
1046
|
-
ctaDualLeft:
|
|
1047
|
-
ctaDualLeftAnimating:
|
|
1048
|
-
ctaDualRight:
|
|
1049
|
-
ctaDualRightAnimating:
|
|
1050
|
-
ctaTotals:
|
|
1051
|
-
ctaDiscountBadge:
|
|
1052
|
-
ctaTotalsWrap:
|
|
1053
|
-
ctaTotalsWrapVisible:
|
|
1054
|
-
ctaTotalsStrike:
|
|
1055
|
-
ctaTotalsPrice:
|
|
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
|
|
1058
|
-
var
|
|
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:
|
|
1165
|
+
submitting: r,
|
|
1064
1166
|
error: n,
|
|
1065
1167
|
currencyCode: d,
|
|
1066
1168
|
config: c,
|
|
1067
|
-
eligibleVariants:
|
|
1068
|
-
selections:
|
|
1069
|
-
selectionOrder:
|
|
1070
|
-
setQuantity:
|
|
1071
|
-
bundleSize:
|
|
1072
|
-
minRequired:
|
|
1073
|
-
canSubmit:
|
|
1074
|
-
submit:
|
|
1075
|
-
submitAndCheckout:
|
|
1076
|
-
} =
|
|
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
|
-
],
|
|
1084
|
-
var
|
|
1085
|
-
const
|
|
1086
|
-
return Array.isArray(
|
|
1087
|
-
(
|
|
1088
|
-
) : [...
|
|
1089
|
-
}, [(
|
|
1090
|
-
const
|
|
1091
|
-
return Number.isFinite(
|
|
1092
|
-
},
|
|
1093
|
-
const
|
|
1094
|
-
var
|
|
1095
|
-
const
|
|
1096
|
-
return !(!
|
|
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
|
|
1099
|
-
},
|
|
1100
|
-
var
|
|
1101
|
-
return ((
|
|
1102
|
-
},
|
|
1103
|
-
const
|
|
1104
|
-
return [
|
|
1105
|
-
}, [
|
|
1106
|
-
const
|
|
1107
|
-
if (!Number.isFinite(
|
|
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(
|
|
1212
|
+
return new Intl.NumberFormat(void 0, { style: "currency", currency: d }).format(l);
|
|
1111
1213
|
} catch {
|
|
1112
1214
|
}
|
|
1113
|
-
return `$${
|
|
1114
|
-
},
|
|
1115
|
-
const
|
|
1116
|
-
return Math.max(2, Math.min(100,
|
|
1117
|
-
}, [c == null ? void 0 : c.maxBundleSize]),
|
|
1118
|
-
const
|
|
1119
|
-
if (!
|
|
1120
|
-
const
|
|
1121
|
-
var
|
|
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(
|
|
1124
|
-
for (const
|
|
1125
|
-
C.push(
|
|
1126
|
-
const
|
|
1127
|
-
return
|
|
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
|
|
1130
|
-
}, [
|
|
1131
|
-
let
|
|
1132
|
-
for (const
|
|
1133
|
-
|
|
1134
|
-
return
|
|
1135
|
-
}, [
|
|
1136
|
-
if (!
|
|
1137
|
-
const
|
|
1138
|
-
return !Number.isFinite(
|
|
1139
|
-
}, [
|
|
1140
|
-
const
|
|
1141
|
-
let
|
|
1142
|
-
for (const [
|
|
1143
|
-
const C =
|
|
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
|
|
1146
|
-
Number.isFinite(
|
|
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
|
-
}, [
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
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
|
|
1168
|
-
}, [
|
|
1169
|
-
|
|
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
|
|
1172
|
-
|
|
1273
|
+
const l = u.current > 0;
|
|
1274
|
+
Je(!(l && ne === 0));
|
|
1173
1275
|
}
|
|
1174
|
-
|
|
1175
|
-
}, [
|
|
1176
|
-
const
|
|
1177
|
-
const
|
|
1178
|
-
if (!
|
|
1179
|
-
const
|
|
1180
|
-
if (!
|
|
1181
|
-
const
|
|
1182
|
-
if (C.top >=
|
|
1183
|
-
const
|
|
1184
|
-
|
|
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
|
|
1288
|
+
return $(() => {
|
|
1187
1289
|
if (!e) return;
|
|
1188
|
-
const
|
|
1189
|
-
|
|
1290
|
+
const o = (l) => {
|
|
1291
|
+
l.key === "Escape" && t();
|
|
1190
1292
|
};
|
|
1191
|
-
return window.addEventListener("keydown",
|
|
1192
|
-
}, [t, e]),
|
|
1293
|
+
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
1294
|
+
}, [t, e]), $(() => {
|
|
1193
1295
|
if (typeof window > "u") return;
|
|
1194
|
-
const
|
|
1195
|
-
return
|
|
1196
|
-
}, []),
|
|
1197
|
-
if (
|
|
1198
|
-
|
|
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
|
-
|
|
1202
|
-
|
|
1303
|
+
z.current = window.setTimeout(() => {
|
|
1304
|
+
Ce(!1), z.current = null;
|
|
1203
1305
|
}, 220);
|
|
1204
|
-
}, [e]),
|
|
1205
|
-
|
|
1206
|
-
}, []),
|
|
1207
|
-
|
|
1208
|
-
}, []),
|
|
1209
|
-
|
|
1210
|
-
}, []),
|
|
1211
|
-
if (!e || !
|
|
1212
|
-
const
|
|
1213
|
-
var
|
|
1214
|
-
return (
|
|
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(
|
|
1217
|
-
}, [e,
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1222
|
-
const
|
|
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
|
|
1225
|
-
const
|
|
1226
|
-
if (!
|
|
1227
|
-
const
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
|
|
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(
|
|
1233
|
-
}, [
|
|
1334
|
+
return () => cancelAnimationFrame(N);
|
|
1335
|
+
}, [O, W]), $(() => {
|
|
1234
1336
|
if (!e) return;
|
|
1235
|
-
const
|
|
1236
|
-
if (
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
|
|
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
|
-
}, [
|
|
1242
|
-
if (!e || !
|
|
1243
|
-
const
|
|
1244
|
-
var
|
|
1245
|
-
const
|
|
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:
|
|
1349
|
+
y: N - 2,
|
|
1248
1350
|
w: 4,
|
|
1249
1351
|
h: 4
|
|
1250
1352
|
};
|
|
1251
|
-
|
|
1252
|
-
|
|
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(
|
|
1256
|
-
}, [
|
|
1257
|
-
var
|
|
1258
|
-
e && ((
|
|
1259
|
-
}, [e]),
|
|
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,
|
|
1266
|
-
onMouseDown: (
|
|
1267
|
-
|
|
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
|
-
|
|
1271
|
-
|
|
1372
|
+
Ne && be && fe.width > 0 && fe.height > 0 ? /* @__PURE__ */ s(
|
|
1373
|
+
Kt,
|
|
1272
1374
|
{
|
|
1273
|
-
width:
|
|
1274
|
-
height:
|
|
1275
|
-
confettiSource:
|
|
1276
|
-
colors:
|
|
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
|
-
|
|
1387
|
+
Fe
|
|
1286
1388
|
) : null,
|
|
1287
|
-
/* @__PURE__ */
|
|
1288
|
-
|
|
1289
|
-
/* @__PURE__ */
|
|
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":
|
|
1296
|
-
"aria-expanded":
|
|
1397
|
+
"aria-label": j ? "Search (expanded)" : "Search",
|
|
1398
|
+
"aria-expanded": j,
|
|
1297
1399
|
onClick: () => {
|
|
1298
|
-
|
|
1400
|
+
te(!0);
|
|
1299
1401
|
},
|
|
1300
|
-
children: /* @__PURE__ */ s(
|
|
1402
|
+
children: /* @__PURE__ */ s(an, { size: 18, "aria-hidden": "true" })
|
|
1301
1403
|
}
|
|
1302
1404
|
),
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */ s("div", { className: h.headerTitleWrap, "aria-hidden":
|
|
1305
|
-
/* @__PURE__ */ s("div", { className: h.headerSearchWrap, "aria-hidden": !
|
|
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:
|
|
1411
|
+
ref: J,
|
|
1310
1412
|
className: h.searchInput,
|
|
1311
1413
|
type: "search",
|
|
1312
|
-
value:
|
|
1414
|
+
value: re,
|
|
1313
1415
|
placeholder: "Search",
|
|
1314
|
-
onChange: (
|
|
1416
|
+
onChange: (o) => ie(o.target.value),
|
|
1315
1417
|
onBlur: () => {
|
|
1316
|
-
|
|
1418
|
+
re.trim() === "" && te(!1);
|
|
1317
1419
|
}
|
|
1318
1420
|
}
|
|
1319
1421
|
),
|
|
1320
|
-
|
|
1422
|
+
re.trim() ? /* @__PURE__ */ s(
|
|
1321
1423
|
"button",
|
|
1322
1424
|
{
|
|
1323
1425
|
type: "button",
|
|
1324
1426
|
className: h.searchClearButton,
|
|
1325
|
-
onMouseDown: (
|
|
1326
|
-
|
|
1427
|
+
onMouseDown: (o) => {
|
|
1428
|
+
o.preventDefault();
|
|
1327
1429
|
},
|
|
1328
1430
|
onClick: () => {
|
|
1329
|
-
var
|
|
1330
|
-
|
|
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:
|
|
1440
|
+
/* @__PURE__ */ s("button", { type: "button", onClick: t, disabled: r, className: h.closeButton, "aria-label": "Close", children: "×" })
|
|
1339
1441
|
] }),
|
|
1340
|
-
/* @__PURE__ */
|
|
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:
|
|
1344
|
-
var
|
|
1345
|
-
const
|
|
1346
|
-
return /* @__PURE__ */
|
|
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,
|
|
1350
|
-
"data-variant-row":
|
|
1451
|
+
className: [h.variantRow, o.availableForSale === !1 && h.variantRowSoldOut].filter(Boolean).join(" "),
|
|
1452
|
+
"data-variant-row": o.id,
|
|
1351
1453
|
children: [
|
|
1352
|
-
/* @__PURE__ */
|
|
1353
|
-
/* @__PURE__ */ s("div", { className: h.variantThumb, "aria-hidden": "true", children: (
|
|
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:
|
|
1358
|
-
alt:
|
|
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: ((
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */ s("div", { className: h.variantName, children:
|
|
1364
|
-
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
|
|
1367
|
-
/* @__PURE__ */ s("span", { className: h.variantPrice, children:
|
|
1368
|
-
|
|
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
|
-
|
|
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
|
-
] }) }) :
|
|
1479
|
+
] }) }) : l <= 0 ? /* @__PURE__ */ s(
|
|
1378
1480
|
"button",
|
|
1379
1481
|
{
|
|
1380
1482
|
type: "button",
|
|
1381
|
-
onClick: () =>
|
|
1382
|
-
disabled:
|
|
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__ */
|
|
1489
|
+
) : /* @__PURE__ */ R("div", { className: h.qtyControls, children: [
|
|
1388
1490
|
/* @__PURE__ */ s(
|
|
1389
1491
|
"button",
|
|
1390
1492
|
{
|
|
1391
1493
|
type: "button",
|
|
1392
|
-
onClick: () =>
|
|
1393
|
-
disabled:
|
|
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 ${
|
|
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: () =>
|
|
1405
|
-
disabled:
|
|
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
|
-
|
|
1516
|
+
o.id
|
|
1415
1517
|
);
|
|
1416
1518
|
}) }) })
|
|
1417
1519
|
] }),
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */ s("div", { className: h.boxSummaryWindow, ref:
|
|
1420
|
-
var
|
|
1421
|
-
const
|
|
1422
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
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 ? () =>
|
|
1435
|
-
onKeyDown: C ? (
|
|
1436
|
-
(
|
|
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":
|
|
1439
|
-
title:
|
|
1440
|
-
children: C ? (
|
|
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:
|
|
1445
|
-
alt:
|
|
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: ((
|
|
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
|
-
|
|
1452
|
-
] },
|
|
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,
|
|
1458
|
-
"aria-hidden": !
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1460
|
-
|
|
1461
|
-
|
|
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:
|
|
1465
|
-
/* @__PURE__ */ s("span", { className: h.ctaTotalsStrike, children:
|
|
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:
|
|
1468
|
-
] }) : /* @__PURE__ */ s("span", { className: h.ctaTotalsPrice, children:
|
|
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
|
|
1474
|
-
return
|
|
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:
|
|
1480
|
-
disabled: !
|
|
1581
|
+
onClick: le,
|
|
1582
|
+
disabled: !X,
|
|
1481
1583
|
className: `${h.ctaDualLeft} ${Ue ? h.ctaDualLeftAnimating : ""}`,
|
|
1482
|
-
children: /* @__PURE__ */ s("span", { children:
|
|
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:
|
|
1490
|
-
disabled: !
|
|
1591
|
+
onClick: ce,
|
|
1592
|
+
disabled: !X,
|
|
1491
1593
|
className: `${h.ctaDualRight} ${Ue ? h.ctaDualRightAnimating : ""}`,
|
|
1492
|
-
children: /* @__PURE__ */ s("span", { children:
|
|
1594
|
+
children: /* @__PURE__ */ s("span", { children: r ? "Processing…" : "Checkout" })
|
|
1493
1595
|
}
|
|
1494
1596
|
)
|
|
1495
|
-
] }) :
|
|
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__ */
|
|
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
|
|
1508
|
-
panel:
|
|
1509
|
-
header:
|
|
1510
|
-
title:
|
|
1511
|
-
status:
|
|
1512
|
-
error:
|
|
1513
|
-
inactive:
|
|
1514
|
-
section:
|
|
1515
|
-
sectionTitle:
|
|
1516
|
-
rulesVisual:
|
|
1517
|
-
rulesLabelsRow:
|
|
1518
|
-
rulesLinesRow:
|
|
1519
|
-
rulesLineLabelCell:
|
|
1520
|
-
rulesLineLabel:
|
|
1521
|
-
rulesLine:
|
|
1522
|
-
rulesLineEmpty:
|
|
1523
|
-
rulesLineFilled:
|
|
1524
|
-
variants:
|
|
1525
|
-
variantList:
|
|
1526
|
-
variantRow:
|
|
1527
|
-
variantRowInteractive:
|
|
1528
|
-
variantRowSelected:
|
|
1529
|
-
variantRowSoldOut:
|
|
1530
|
-
variantMedia:
|
|
1531
|
-
variantContent:
|
|
1532
|
-
variantHeader:
|
|
1533
|
-
variantTitle:
|
|
1534
|
-
variantImage:
|
|
1535
|
-
variantImageFallback:
|
|
1536
|
-
variantMeta:
|
|
1537
|
-
variantPrice:
|
|
1538
|
-
variantFooterRow:
|
|
1539
|
-
variantActions:
|
|
1540
|
-
qtyActions:
|
|
1541
|
-
soldOut:
|
|
1542
|
-
qtyChip:
|
|
1543
|
-
qtyChipInteractive:
|
|
1544
|
-
qtyChipValue:
|
|
1545
|
-
qtyChipPlus:
|
|
1546
|
-
qtyChipClear:
|
|
1547
|
-
qtyTrash:
|
|
1548
|
-
footer:
|
|
1549
|
-
boxSummaryWindow:
|
|
1550
|
-
boxSummaryRow:
|
|
1551
|
-
boxSlot:
|
|
1552
|
-
boxItem:
|
|
1553
|
-
boxItemFilled:
|
|
1554
|
-
boxItemPlaceholder:
|
|
1555
|
-
boxItemThreshold:
|
|
1556
|
-
boxItemClickable:
|
|
1557
|
-
boxItemImage:
|
|
1558
|
-
boxItemFallback:
|
|
1559
|
-
boxItemPlus:
|
|
1560
|
-
boxItemDiscountText:
|
|
1561
|
-
boxThresholdLabel:
|
|
1562
|
-
totalsReveal:
|
|
1563
|
-
totalsRevealOpen:
|
|
1564
|
-
ctaTotalsWrap:
|
|
1565
|
-
ctaTotalsWrapVisible:
|
|
1566
|
-
ctaTotals:
|
|
1567
|
-
ctaDiscountBadge:
|
|
1568
|
-
ctaTotalsStrike:
|
|
1569
|
-
ctaTotalsPrice:
|
|
1570
|
-
cta:
|
|
1571
|
-
ctaButtonGroup:
|
|
1572
|
-
ctaDualLeft:
|
|
1573
|
-
ctaDualRight:
|
|
1574
|
-
poweredBy:
|
|
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
|
|
1577
|
-
var
|
|
1678
|
+
function Gr(a) {
|
|
1679
|
+
var de;
|
|
1578
1680
|
const {
|
|
1579
1681
|
loading: e,
|
|
1580
1682
|
submitting: t,
|
|
1581
1683
|
error: i,
|
|
1582
|
-
currencyCode:
|
|
1684
|
+
currencyCode: r,
|
|
1583
1685
|
config: n,
|
|
1584
1686
|
eligibleVariants: d,
|
|
1585
1687
|
selections: c,
|
|
1586
|
-
selectionOrder:
|
|
1587
|
-
setQuantity:
|
|
1588
|
-
bundleSize:
|
|
1589
|
-
minRequired:
|
|
1590
|
-
canSubmit:
|
|
1591
|
-
submit:
|
|
1592
|
-
submitAndCheckout:
|
|
1593
|
-
} =
|
|
1594
|
-
className:
|
|
1595
|
-
showRules:
|
|
1596
|
-
showVariants:
|
|
1597
|
-
} =
|
|
1598
|
-
const
|
|
1599
|
-
return Number.isFinite(
|
|
1600
|
-
},
|
|
1601
|
-
const
|
|
1602
|
-
var
|
|
1603
|
-
const
|
|
1604
|
-
return !(!
|
|
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
|
|
1607
|
-
},
|
|
1608
|
-
const
|
|
1609
|
-
if (!Number.isFinite(
|
|
1610
|
-
if (
|
|
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:
|
|
1714
|
+
return new Intl.NumberFormat(void 0, { style: "currency", currency: r }).format(b);
|
|
1613
1715
|
} catch {
|
|
1614
1716
|
}
|
|
1615
|
-
return `$${
|
|
1616
|
-
},
|
|
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
|
|
1619
|
-
|
|
1720
|
+
for (const b of H)
|
|
1721
|
+
P >= b.minBundleSize && (m = b);
|
|
1620
1722
|
return m;
|
|
1621
|
-
}, [
|
|
1622
|
-
if (!
|
|
1623
|
-
const m = Number.parseFloat(
|
|
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
|
-
}, [
|
|
1626
|
-
const m = new Map(d.map((
|
|
1627
|
-
let
|
|
1628
|
-
for (const [
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1631
|
-
const
|
|
1632
|
-
Number.isFinite(
|
|
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(
|
|
1635
|
-
}, [d, c]),
|
|
1636
|
-
if (!
|
|
1637
|
-
const m =
|
|
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
|
-
}, [
|
|
1640
|
-
const m = new Map(d.map((
|
|
1641
|
-
return
|
|
1642
|
-
}, [d,
|
|
1643
|
-
var
|
|
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
|
|
1646
|
-
const
|
|
1647
|
-
m.set(
|
|
1648
|
-
discountPercent:
|
|
1649
|
-
minBundleSize:
|
|
1650
|
-
label: ((
|
|
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
|
-
}, [
|
|
1655
|
-
const m = Number((n == null ? void 0 : n.maxBundleSize) ?? NaN),
|
|
1656
|
-
return Math.max(2, Math.min(100,
|
|
1657
|
-
}, [n == null ? void 0 : n.maxBundleSize]), ke = ((
|
|
1658
|
-
|
|
1659
|
-
const m =
|
|
1660
|
-
if (
|
|
1661
|
-
const
|
|
1662
|
-
if (!
|
|
1663
|
-
const
|
|
1664
|
-
if (
|
|
1665
|
-
const
|
|
1666
|
-
const
|
|
1667
|
-
if (!
|
|
1668
|
-
const
|
|
1669
|
-
if (
|
|
1670
|
-
const
|
|
1671
|
-
|
|
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(
|
|
1674
|
-
}, [
|
|
1675
|
-
const
|
|
1676
|
-
const
|
|
1677
|
-
if (!
|
|
1678
|
-
const
|
|
1679
|
-
|
|
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__ */
|
|
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
|
-
|
|
1687
|
-
/* @__PURE__ */ s("div", { className: f.rulesLabelsRow, children: Array.from({ length:
|
|
1688
|
-
const
|
|
1689
|
-
return /* @__PURE__ */ s("div", { className: f.rulesLineLabelCell, children:
|
|
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:
|
|
1692
|
-
const
|
|
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
|
-
|
|
1800
|
+
L ? f.rulesLineFilled : f.rulesLineEmpty
|
|
1699
1801
|
].filter(Boolean).join(" ")
|
|
1700
1802
|
},
|
|
1701
|
-
|
|
1803
|
+
w
|
|
1702
1804
|
);
|
|
1703
1805
|
}) })
|
|
1704
1806
|
] }) }) : null,
|
|
1705
|
-
|
|
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:
|
|
1708
|
-
var
|
|
1709
|
-
const
|
|
1710
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
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:
|
|
1721
|
-
tabIndex:
|
|
1722
|
-
onClick:
|
|
1723
|
-
|
|
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:
|
|
1726
|
-
(
|
|
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":
|
|
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: (
|
|
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__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1846
|
+
w ? /* @__PURE__ */ s("div", { className: f.variantMeta, children: w }) : null
|
|
1745
1847
|
] }),
|
|
1746
|
-
/* @__PURE__ */
|
|
1747
|
-
/* @__PURE__ */ s("div", { className: f.variantPrice, children:
|
|
1748
|
-
/* @__PURE__ */ s("div", { className: f.variantActions, children:
|
|
1749
|
-
|
|
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: (
|
|
1756
|
-
|
|
1857
|
+
onClick: (T) => {
|
|
1858
|
+
T.stopPropagation(), Y(m.id, 0);
|
|
1757
1859
|
},
|
|
1758
|
-
onKeyDown: (
|
|
1759
|
-
|
|
1860
|
+
onKeyDown: (T) => {
|
|
1861
|
+
T.stopPropagation();
|
|
1760
1862
|
},
|
|
1761
|
-
children: /* @__PURE__ */ s(
|
|
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,
|
|
1768
|
-
"aria-label": `${m.displayName} quantity ${
|
|
1769
|
-
onClick: (
|
|
1770
|
-
|
|
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: (
|
|
1773
|
-
|
|
1874
|
+
onKeyDown: (T) => {
|
|
1875
|
+
T.stopPropagation();
|
|
1774
1876
|
},
|
|
1775
1877
|
role: "button",
|
|
1776
1878
|
tabIndex: 0,
|
|
1777
|
-
children:
|
|
1778
|
-
/* @__PURE__ */ s("span", { className: f.qtyChipValue, children:
|
|
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: (
|
|
1786
|
-
|
|
1887
|
+
onClick: (T) => {
|
|
1888
|
+
T.stopPropagation(), Y(m.id, b + 1);
|
|
1787
1889
|
},
|
|
1788
|
-
onKeyDown: (
|
|
1789
|
-
|
|
1890
|
+
onKeyDown: (T) => {
|
|
1891
|
+
T.stopPropagation();
|
|
1790
1892
|
},
|
|
1791
|
-
children: /* @__PURE__ */ s(
|
|
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__ */
|
|
1807
|
-
/* @__PURE__ */ s("div", { className: f.boxSummaryWindow, ref:
|
|
1808
|
-
var
|
|
1809
|
-
const
|
|
1810
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1918
|
+
B ? f.boxItemFilled : f.boxItemPlaceholder,
|
|
1919
|
+
q ? f.boxItemThreshold : null,
|
|
1920
|
+
B ? f.boxItemClickable : null
|
|
1819
1921
|
].filter(Boolean).join(" "),
|
|
1820
|
-
role:
|
|
1821
|
-
tabIndex:
|
|
1822
|
-
onClick:
|
|
1823
|
-
onKeyDown:
|
|
1824
|
-
(
|
|
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":
|
|
1827
|
-
title:
|
|
1828
|
-
children:
|
|
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:
|
|
1833
|
-
alt:
|
|
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: ((
|
|
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
|
-
|
|
1842
|
-
] },
|
|
1943
|
+
q ? /* @__PURE__ */ s("div", { className: f.boxThresholdLabel, children: L.label }) : null
|
|
1944
|
+
] }, b);
|
|
1843
1945
|
}) }) }),
|
|
1844
|
-
/* @__PURE__ */ s("div", { className: [f.totalsReveal,
|
|
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,
|
|
1848
|
-
"aria-hidden": !
|
|
1849
|
-
children: /* @__PURE__ */
|
|
1850
|
-
|
|
1851
|
-
|
|
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:
|
|
1855
|
-
/* @__PURE__ */ s("span", { className: f.ctaTotalsStrike, children:
|
|
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:
|
|
1858
|
-
] }) : /* @__PURE__ */ s("span", { className: f.ctaTotalsPrice, children:
|
|
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" ?
|
|
1865
|
-
/* @__PURE__ */ s("button", { type: "button", onClick:
|
|
1866
|
-
/* @__PURE__ */ s("button", { type: "button", onClick:
|
|
1867
|
-
] }) : m === "checkout" ? /* @__PURE__ */ s("button", { type: "button", onClick:
|
|
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__ */
|
|
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
|
|
1878
|
-
if (
|
|
1879
|
-
return
|
|
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
|
|
1882
|
-
|
|
1883
|
-
|
|
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
|
|
2004
|
+
function qr() {
|
|
1886
2005
|
window.location.reload();
|
|
1887
2006
|
}
|
|
1888
|
-
async function
|
|
1889
|
-
const t = await fetch(
|
|
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
|
|
2022
|
+
function Qr() {
|
|
1904
2023
|
return {
|
|
1905
|
-
async linesAdd(
|
|
1906
|
-
const e =
|
|
1907
|
-
id:
|
|
2024
|
+
async linesAdd(a) {
|
|
2025
|
+
const e = a.map((t) => ({
|
|
2026
|
+
id: It(t.merchandiseId),
|
|
1908
2027
|
quantity: t.quantity,
|
|
1909
|
-
properties:
|
|
2028
|
+
properties: ct(t.attributes)
|
|
1910
2029
|
}));
|
|
1911
|
-
await
|
|
2030
|
+
await nt("/cart/add.js", { items: e });
|
|
1912
2031
|
},
|
|
1913
|
-
async linesAddForCheckout(
|
|
1914
|
-
const e =
|
|
1915
|
-
id:
|
|
2032
|
+
async linesAddForCheckout(a) {
|
|
2033
|
+
const e = a.map((t) => ({
|
|
2034
|
+
id: It(t.merchandiseId),
|
|
1916
2035
|
quantity: t.quantity,
|
|
1917
|
-
properties:
|
|
2036
|
+
properties: ct(t.attributes)
|
|
1918
2037
|
}));
|
|
1919
|
-
await
|
|
2038
|
+
await nt("/cart/add.js", { items: e });
|
|
1920
2039
|
},
|
|
1921
|
-
async linesUpdate(
|
|
1922
|
-
for (const e of
|
|
1923
|
-
await
|
|
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:
|
|
2045
|
+
properties: ct(e.attributes)
|
|
1927
2046
|
});
|
|
1928
2047
|
},
|
|
1929
|
-
async linesRemove(
|
|
1930
|
-
for (const e of
|
|
1931
|
-
await
|
|
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(() =>
|
|
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
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
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
|