yt-uikit 0.8.80 → 0.8.81
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/esm/index.js +189 -189
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i,useLayoutEffect as a,forwardRef as l}from"react";import c,{keyframes as d,css as s}from"styled-components";import p from"react-otp-input";import{IoClose as u,IoChevronDown as m,IoArrowBackCircle as g,IoArrowForwardCircle as x,IoCalendar as f,IoChevronDownOutline as y,IoGiftSharp as b,IoPersonOutline as h,IoWalletOutline as v,IoShareSocialOutline as w,IoGiftOutline as C,IoCreateOutline as E,IoLogoFacebook as k,IoLogoInstagram as T,IoLogoTwitter as S,IoLogoYoutube as $,IoDiamondOutline as B,IoCheckmark as I,IoCopy as z,IoChevronBack as F,IoChevronForward as N}from"react-icons/io5";import{PhoneInput as D}from"react-international-phone";import P,{createPortal as A}from"react-dom";import{FaShoppingCart as _,FaAngleUp as R,FaAngleDown as O,FaChevronRight as L,FaArrowLeft as M,FaChevronDown as j,FaChevronUp as V,FaGift as W,FaRegQuestionCircle as H,FaCheckCircle as q,FaLockOpen as Q,FaPlus as U,FaLock as Y,FaTimes as G,FaCheck as X,FaChevronLeft as Z}from"react-icons/fa";import{RxInfoCircled as J,RxMinus as K}from"react-icons/rx";import{RiDeleteBinLine as ee,RiDeleteBinFill as te,RiCouponLine as ne,RiCloseLine as oe}from"react-icons/ri";import{atom as re,useAtom as ie,useAtomValue as ae,useSetAtom as le}from"jotai";import{atomWithStorage as ce}from"jotai/utils";import de from"currency-symbol-map";import{FaBagShopping as se,FaRegCopy as pe}from"react-icons/fa6";import{TbShoppingBagEdit as ue,TbTrashXFilled as me,TbTrashX as ge}from"react-icons/tb";import{MdChevronLeft as xe,MdChevronRight as fe,MdDiscount as ye,MdClose as be,MdVerified as he}from"react-icons/md";import ve from"canvas-confetti";import{IoMdCheckmark as we,IoIosCart as Ce,IoMdPricetags as Ee,IoMdArrowDropleft as ke,IoMdArrowDropright as Te,IoIosStar as Se,IoIosArrowDown as $e}from"react-icons/io";import{AiFillGift as Be,AiOutlineEdit as Ie}from"react-icons/ai";import{BiSolidTShirt as ze,BiCube as Fe,BiPlus as Ne,BiSearch as De,BiFilterAlt as Pe,BiSortAlt2 as Ae,BiMinus as _e,BiTrash as Re,BiCheck as Oe,BiPencil as Le,BiChevronDown as Me,BiSolidDiscount as je}from"react-icons/bi";import{BsCupHotFill as Ve,BsReceiptCutoff as We,BsInfoCircle as He,BsCheck as qe,BsX as Qe,BsArrowRight as Ue,BsXLg as Ye,BsChevronDown as Ge}from"react-icons/bs";import{PiPercentDuotone as Xe}from"react-icons/pi";import{HiOutlineShoppingBag as Ze,HiTag as Je}from"react-icons/hi";import{LuZap as Ke}from"react-icons/lu";import{GrFormNext as et,GrFormSubtract as tt,GrFormAdd as nt,GrGift as ot}from"react-icons/gr";import{ClipLoader as rt,ScaleLoader as it}from"react-spinners";import{FiLock as at,FiTrash as lt}from"react-icons/fi";import{HiOutlineShoppingBag as ct}from"react-icons/hi2";import{ImCheckboxChecked as dt,ImCheckboxUnchecked as st}from"react-icons/im";import pt from"react-calendar";import ut from"react-modal-image";var mt='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\n<path d="M26.5737 11.9615L23.9133 7.12431C23.845 6.99997 23.7314 6.89401 23.5865 6.81956C23.4416 6.74511 23.2718 6.70547 23.0983 6.70554H20.4378V5.32348C20.4378 5.1402 20.3444 4.96444 20.1781 4.83484C20.0118 4.70525 19.7862 4.63245 19.551 4.63245H5.36184V6.01451H18.6642V14.6911C18.2601 14.8739 17.9064 15.1173 17.6236 15.4072C17.3408 15.697 17.1345 16.0277 17.0165 16.38H11.4437C11.2278 15.7286 10.7145 15.1609 9.99991 14.7833C9.28533 14.4057 8.41855 14.2441 7.56205 14.3289C6.70554 14.4137 5.91811 14.739 5.34737 15.2438C4.77662 15.7486 4.46173 16.3982 4.46173 17.071C4.46173 17.7438 4.77662 18.3935 5.34737 18.8983C5.91811 19.4031 6.70554 19.7283 7.56205 19.8131C8.41855 19.8979 9.28533 19.7363 9.99991 19.3587C10.7145 18.9812 11.2278 18.4134 11.4437 17.762H17.0165C17.2094 18.3551 17.6506 18.8811 18.2702 19.2569C18.8899 19.6326 19.6526 19.8366 20.4378 19.8366C21.223 19.8366 21.9857 19.6326 22.6054 19.2569C23.2251 18.8811 23.6663 18.3551 23.8592 17.762H25.7587C25.9939 17.762 26.2195 17.6892 26.3858 17.5596C26.5521 17.43 26.6456 17.2543 26.6456 17.071V12.2338C26.6456 12.1402 26.6212 12.0475 26.5737 11.9615ZM8.02231 18.4531C7.67151 18.4531 7.3286 18.372 7.03692 18.2202C6.74525 18.0683 6.51792 17.8524 6.38367 17.5999C6.24943 17.3474 6.21431 17.0695 6.28274 16.8014C6.35118 16.5333 6.5201 16.287 6.76815 16.0937C7.0162 15.9005 7.33223 15.7688 7.67629 15.7155C8.02034 15.6622 8.37696 15.6895 8.70105 15.7942C9.02514 15.8988 9.30215 16.0759 9.49704 16.3032C9.69193 16.5305 9.79595 16.7977 9.79595 17.071C9.79548 17.4374 9.60846 17.7888 9.27594 18.0479C8.94342 18.307 8.49256 18.4527 8.02231 18.4531ZM20.4378 8.0876H22.513L24.4143 11.5428H20.4378V8.0876ZM20.4378 18.4531C20.087 18.4531 19.7441 18.372 19.4524 18.2202C19.1608 18.0683 18.9334 17.8524 18.7992 17.5999C18.6649 17.3474 18.6298 17.0695 18.6983 16.8014C18.7667 16.5333 18.9356 16.287 19.1837 16.0937C19.4317 15.9005 19.7477 15.7688 20.0918 15.7155C20.4358 15.6622 20.7925 15.6895 21.1166 15.7942C21.4406 15.8988 21.7177 16.0759 21.9125 16.3032C22.1074 16.5305 22.2115 16.7977 22.2115 17.071C22.211 17.4374 22.024 17.7888 21.6915 18.0479C21.3589 18.307 20.9081 18.4527 20.4378 18.4531ZM24.8719 16.38H23.8592C23.6638 15.7881 23.2219 15.2634 22.6028 14.8882C21.9836 14.513 21.2222 14.3086 20.4378 14.3069V12.9248H24.8719V16.38Z" fill="#4D4D4D"/>\n</svg>';function gt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}gt('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Space+Grotesk:wght@300..700&display=swap");');gt(".react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}\n");const xt=c.div`
|
|
1
|
+
import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i,useLayoutEffect as a,forwardRef as l}from"react";import c,{keyframes as s,css as d}from"styled-components";import p from"react-otp-input";import{IoClose as u,IoChevronDown as m,IoArrowBackCircle as g,IoArrowForwardCircle as x,IoCalendar as f,IoChevronDownOutline as y,IoGiftSharp as b,IoPersonOutline as h,IoWalletOutline as v,IoShareSocialOutline as w,IoGiftOutline as C,IoCreateOutline as E,IoLogoFacebook as k,IoLogoInstagram as T,IoLogoTwitter as S,IoLogoYoutube as $,IoDiamondOutline as N,IoCheckmark as B,IoCopy as I,IoChevronBack as z,IoChevronForward as F}from"react-icons/io5";import{PhoneInput as D}from"react-international-phone";import P,{createPortal as A}from"react-dom";import{FaShoppingCart as _,FaAngleUp as R,FaAngleDown as O,FaChevronRight as L,FaArrowLeft as M,FaChevronDown as j,FaChevronUp as V,FaGift as W,FaRegQuestionCircle as H,FaCheckCircle as q,FaLockOpen as Q,FaPlus as U,FaLock as Y,FaTimes as G,FaCheck as X,FaChevronLeft as Z}from"react-icons/fa";import{RxInfoCircled as J,RxMinus as K}from"react-icons/rx";import{RiDeleteBinLine as ee,RiDeleteBinFill as te,RiCouponLine as ne,RiCloseLine as oe}from"react-icons/ri";import{atom as re,useAtom as ie,useAtomValue as ae,useSetAtom as le}from"jotai";import{atomWithStorage as ce}from"jotai/utils";import se from"currency-symbol-map";import{FaBagShopping as de,FaRegCopy as pe}from"react-icons/fa6";import{TbShoppingBagEdit as ue,TbTrashXFilled as me,TbTrashX as ge}from"react-icons/tb";import{MdChevronLeft as xe,MdChevronRight as fe,MdDiscount as ye,MdClose as be,MdVerified as he}from"react-icons/md";import ve from"canvas-confetti";import{IoMdCheckmark as we,IoIosCart as Ce,IoMdPricetags as Ee,IoMdArrowDropleft as ke,IoMdArrowDropright as Te,IoIosStar as Se,IoIosArrowDown as $e}from"react-icons/io";import{AiFillGift as Ne,AiOutlineEdit as Be}from"react-icons/ai";import{BiSolidTShirt as Ie,BiCube as ze,BiPlus as Fe,BiSearch as De,BiFilterAlt as Pe,BiSortAlt2 as Ae,BiMinus as _e,BiTrash as Re,BiCheck as Oe,BiPencil as Le,BiChevronDown as Me,BiSolidDiscount as je}from"react-icons/bi";import{BsCupHotFill as Ve,BsReceiptCutoff as We,BsInfoCircle as He,BsCheck as qe,BsX as Qe,BsArrowRight as Ue,BsXLg as Ye,BsChevronDown as Ge}from"react-icons/bs";import{PiPercentDuotone as Xe}from"react-icons/pi";import{HiOutlineShoppingBag as Ze,HiTag as Je}from"react-icons/hi";import{LuZap as Ke}from"react-icons/lu";import{GrFormNext as et,GrFormSubtract as tt,GrFormAdd as nt,GrGift as ot}from"react-icons/gr";import{ClipLoader as rt,ScaleLoader as it}from"react-spinners";import{FiLock as at,FiTrash as lt}from"react-icons/fi";import{HiOutlineShoppingBag as ct}from"react-icons/hi2";import{ImCheckboxChecked as st,ImCheckboxUnchecked as dt}from"react-icons/im";import pt from"react-calendar";import ut from"react-modal-image";var mt='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\n<path d="M26.5737 11.9615L23.9133 7.12431C23.845 6.99997 23.7314 6.89401 23.5865 6.81956C23.4416 6.74511 23.2718 6.70547 23.0983 6.70554H20.4378V5.32348C20.4378 5.1402 20.3444 4.96444 20.1781 4.83484C20.0118 4.70525 19.7862 4.63245 19.551 4.63245H5.36184V6.01451H18.6642V14.6911C18.2601 14.8739 17.9064 15.1173 17.6236 15.4072C17.3408 15.697 17.1345 16.0277 17.0165 16.38H11.4437C11.2278 15.7286 10.7145 15.1609 9.99991 14.7833C9.28533 14.4057 8.41855 14.2441 7.56205 14.3289C6.70554 14.4137 5.91811 14.739 5.34737 15.2438C4.77662 15.7486 4.46173 16.3982 4.46173 17.071C4.46173 17.7438 4.77662 18.3935 5.34737 18.8983C5.91811 19.4031 6.70554 19.7283 7.56205 19.8131C8.41855 19.8979 9.28533 19.7363 9.99991 19.3587C10.7145 18.9812 11.2278 18.4134 11.4437 17.762H17.0165C17.2094 18.3551 17.6506 18.8811 18.2702 19.2569C18.8899 19.6326 19.6526 19.8366 20.4378 19.8366C21.223 19.8366 21.9857 19.6326 22.6054 19.2569C23.2251 18.8811 23.6663 18.3551 23.8592 17.762H25.7587C25.9939 17.762 26.2195 17.6892 26.3858 17.5596C26.5521 17.43 26.6456 17.2543 26.6456 17.071V12.2338C26.6456 12.1402 26.6212 12.0475 26.5737 11.9615ZM8.02231 18.4531C7.67151 18.4531 7.3286 18.372 7.03692 18.2202C6.74525 18.0683 6.51792 17.8524 6.38367 17.5999C6.24943 17.3474 6.21431 17.0695 6.28274 16.8014C6.35118 16.5333 6.5201 16.287 6.76815 16.0937C7.0162 15.9005 7.33223 15.7688 7.67629 15.7155C8.02034 15.6622 8.37696 15.6895 8.70105 15.7942C9.02514 15.8988 9.30215 16.0759 9.49704 16.3032C9.69193 16.5305 9.79595 16.7977 9.79595 17.071C9.79548 17.4374 9.60846 17.7888 9.27594 18.0479C8.94342 18.307 8.49256 18.4527 8.02231 18.4531ZM20.4378 8.0876H22.513L24.4143 11.5428H20.4378V8.0876ZM20.4378 18.4531C20.087 18.4531 19.7441 18.372 19.4524 18.2202C19.1608 18.0683 18.9334 17.8524 18.7992 17.5999C18.6649 17.3474 18.6298 17.0695 18.6983 16.8014C18.7667 16.5333 18.9356 16.287 19.1837 16.0937C19.4317 15.9005 19.7477 15.7688 20.0918 15.7155C20.4358 15.6622 20.7925 15.6895 21.1166 15.7942C21.4406 15.8988 21.7177 16.0759 21.9125 16.3032C22.1074 16.5305 22.2115 16.7977 22.2115 17.071C22.211 17.4374 22.024 17.7888 21.6915 18.0479C21.3589 18.307 20.9081 18.4527 20.4378 18.4531ZM24.8719 16.38H23.8592C23.6638 15.7881 23.2219 15.2634 22.6028 14.8882C21.9836 14.513 21.2222 14.3086 20.4378 14.3069V12.9248H24.8719V16.38Z" fill="#4D4D4D"/>\n</svg>';function gt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}gt('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Space+Grotesk:wght@300..700&display=swap");');gt(".react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}\n");const xt=c.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 10px;
|
|
4
4
|
right: 10px;
|
|
@@ -139,14 +139,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
139
139
|
`,St=c.p`
|
|
140
140
|
color: #ff0000;
|
|
141
141
|
font-size: 14px;
|
|
142
|
-
`,$t=c(p)``,
|
|
142
|
+
`,$t=c(p)``,Nt=c.p`
|
|
143
143
|
text-align: center;
|
|
144
144
|
margin-top: 10px;
|
|
145
145
|
font-size: 14px;
|
|
146
146
|
color: ${e=>(e.$clickable,"#000000")};
|
|
147
147
|
text-decoration: ${e=>e.$clickable?"underline":"none"};
|
|
148
148
|
cursor: ${e=>e.$clickable?"pointer":"default"};
|
|
149
|
-
`,
|
|
149
|
+
`,Bt=({ctaButtonColor:o="black",headerColor:r="black",handleLoginOrSignup:i,handleSubmit:a,title:l="Everything here to give you the Best Value!",subtitle:c="Sign up to avail upto 20% extra discount on all products and unlock exclusive offers",onClose:s,closeIconColor:d="white"})=>{const[p,m]=t(""),[g,x]=t(""),[f,y]=t(""),[b,h]=t(""),[v,w]=t(!1),[C,E]=t(!1),[k,T]=t(!1),[S,$]=t(30),[N,B]=t(!1);n(()=>{let e;return C&&S>0?e=setInterval(()=>{$(e=>e-1)},1e3):0===S&&B(!0),()=>clearInterval(e)},[C,S]),n(()=>{const e=()=>{T(window.innerWidth<540)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const I=async e=>{if(e.preventDefault(),w(!0),h(""),!(e=>{const t=e.replace(/\D/g,"");return t.length>5&&t.length<=15&&/^\+?([0-9]{1,3})?[-. ]?([0-9]{1,4})[-. ]?([0-9]{1,4})[-. ]?([0-9]{1,4})$/.test(e)})(p))return h("Please enter a valid phone number with country code"),void w(!1);if(!(e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))(g))return h("Please enter a valid email address"),void w(!1);try{i&&await i(p,g),E(!0),$(30),B(!1)}catch(e){h(e?.message||"An error occurred. Please try again.")}finally{w(!1)}};return e.createElement(e.Fragment,null,e.createElement(ft,{onClick:e=>{e.stopPropagation(),s&&s()}},e.createElement(yt,{onClick:e=>e.stopPropagation()},e.createElement(xt,{onClick:e=>{e.stopPropagation(),s&&s()}},e.createElement(u,{size:k?20:24,color:d})),e.createElement(bt,null,e.createElement(ht,{$headerColor:r},e.createElement(vt,{className:"yt-lead-generation-nudge-title"},l),e.createElement(wt,{className:"yt-lead-generation-nudge-subtitle"},c)),e.createElement(Ct,null,C?e.createElement("form",{onSubmit:async e=>{if(e.preventDefault(),w(!0),h(""),4!==f.length||!/^\d+$/.test(f))return h("Please enter a valid 4-digit OTP"),void w(!1);try{a&&await a(p,f)}catch(e){h(e?.message||"Invalid OTP. Please try again.")}finally{w(!1),b||s&&s()}}},e.createElement($t,{value:f,onChange:y,numInputs:4,containerStyle:{display:"flex",justifyContent:"center"},renderSeparator:()=>e.createElement("span",{style:{margin:"0 8px"}}),renderInput:t=>e.createElement("input",{...t,style:{display:"flex",fontFamily:"Poppins !important",alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"black",width:40,height:40,borderRadius:0,borderTopWidth:0,borderRightWidth:0,borderLeftWidth:0,textAlign:"center",background:"#FFFFFF",boxShadow:"none"}})}),b&&e.createElement(St,null,b),e.createElement(Tt,{type:"submit",$ctaButtonColor:o,disabled:v},v?"Verifying...":"Verify OTP"),S>0?e.createElement(Nt,null,"Resend OTP in 00:",S.toString().padStart(2,"0")):e.createElement(Nt,{$clickable:N,onClick:()=>{N&&I(new Event("submit"))}},"Resend OTP")):e.createElement("form",{onSubmit:I},e.createElement(kt,null,e.createElement(D,{defaultCountry:"in",value:p,onChange:e=>m(e),inputProps:{required:!0},inputStyle:{width:"100%",height:"40px",fontFamily:"Poppins !important",borderRadius:"0px",boxShadow:"none !important"},style:{boxShadow:"none !important"},countrySelectorStyleProps:{buttonStyle:{height:"40px",borderRight:"none",background:"white",padding:"0 10px"}}})),e.createElement(Et,{type:"email",value:g,onChange:e=>x(e.target.value),placeholder:"Email Address",required:!0}),b&&e.createElement(St,null,b),e.createElement(Tt,{type:"submit",$ctaButtonColor:o,disabled:v},v?"Loading...":"Submit")))))))},It=c.div`
|
|
150
150
|
font-family: sans-serif;
|
|
151
151
|
z-index: 12345;
|
|
152
152
|
position: fixed;
|
|
@@ -190,7 +190,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
190
190
|
right: 50%;
|
|
191
191
|
transform: translateX(50%);
|
|
192
192
|
}
|
|
193
|
-
`,
|
|
193
|
+
`,zt=e=>new Promise((t,n)=>{const o=new Image;o.src=e,o.onload=()=>t({width:o.width,height:o.height}),o.onerror=n}),Ft=c.div`
|
|
194
194
|
font-family: sans-serif;
|
|
195
195
|
position: fixed;
|
|
196
196
|
z-index: 12345;
|
|
@@ -289,7 +289,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
289
289
|
width: 250px;
|
|
290
290
|
background-color: ${e=>e.$backgroundColor};
|
|
291
291
|
}
|
|
292
|
-
`,Ot=({onClose:t})=>e.createElement("div",{onClick:t},e.createElement("svg",{style:{cursor:"pointer",marginRight:"0"},stroke:"#000000",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:".8em",width:".8em"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18",stroke:"#000000"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18",stroke:"#000000"}))),Lt=o=>{const{variant:r,title:i,text:a,highlightColor:l,backgroundColor:c,cartValue:
|
|
292
|
+
`,Ot=({onClose:t})=>e.createElement("div",{onClick:t},e.createElement("svg",{style:{cursor:"pointer",marginRight:"0"},stroke:"#000000",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:".8em",width:".8em"},e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18",stroke:"#000000"}),e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18",stroke:"#000000"}))),Lt=o=>{const{variant:r,title:i,text:a,highlightColor:l,backgroundColor:c,cartValue:s,freeDeliveryValue:d,onClickCheckout:p,onClose:u,isDev:m,onGotoCartClick:g,bannerCtaAction:x,bannerCtaText:f,postPurchaseCtaAction:y,postPurchaseCredits:b,ctaButtonBackgroundColor:h,ctaTextColor:v,ctaButtonPosition:w,ctaButtonLink:C,largeScreenImageUrl:E,smallScreenImageUrl:k,autoCloseTimeout:T,isCTAButtonEnabled:S,isCTARedirectionEnabled:$,borderRadius:N,padding:B,ctaButtonText:I,onClickCtaButton:z,position:F,nudgeImageUrl:D,closeIconColor:P,handleLoginOrSignup:A,handleSubmit:_}=o,[R,O]=t(!0),[L,M]=t(void 0),[j,V]=t("");n(()=>{let e;const t=async()=>{let t;window.innerWidth>=768&&E?(e=E,t=await zt(E)):window.innerWidth<768&&k&&(e=k,t=await zt(k)),M(t),V(e)};return t(),O(!1),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const[W,H]=t(!1);switch(n(()=>{const e=setTimeout(()=>{H(!0)},1e3);return()=>clearTimeout(e)},[]),r){case"leadGeneration":return e.createElement(Bt,{ctaButtonColor:h,headerColor:c,title:i,subtitle:a,handleLoginOrSignup:A,handleSubmit:_,onClose:u});case"campaign":return e.createElement(e.Fragment,null,e.createElement(Dt,{onClick:e=>{console.log("Backdrop clicked"),console.log("Target is backdrop:",e.target===e.currentTarget),u?(console.log("Calling onClose function"),u()):console.log("onClose function is not defined")}}),e.createElement(Ft,{onClick:$?x:void 0,style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},$width:`${L?.width}px`,$height:`${L?.height}px`,$largeScreenImageUrl:E??"",$smallScreenImageUrl:k??""},e.createElement("div",{onClick:e=>{e.stopPropagation(),u?.()},style:{position:"absolute",top:"10px",right:"10px",zIndex:12346}},e.createElement(At,{margin:"0",color:`${P??"black"}`,onClose:void 0})),!R&&$&&S&&W&&e.createElement(_t,{$ctaButtonPosition:w},e.createElement(Rt,{onClick:e=>{e.stopPropagation(),x?.()},$backgroundColor:h??"rgb(203, 242, 51)",$textColor:v},f))));case"delivery":return s&&d?e.createElement(It,{$minHeight:"none",$backgroundColor:c??"white"},e.createElement(At,{onClose:u}),e.createElement("div",{style:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"space-between"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"5px"}},s<d?e.createElement("div",{style:{fontWeight:"lighter",fontSize:"13px",color:"#808080"}},"You are"," ",e.createElement("span",{style:{fontWeight:"bold",color:l}},"only $",d-s," away")," ","from"):e.createElement("div",{style:{fontWeight:"bold",color:l,fontSize:"13px"}},"Congrats!"," ",e.createElement("span",{style:{fontWeight:"lighter",color:"#808080"}},"you are eligible for")),e.createElement("div",{style:{fontWeight:"bolder",fontSize:"25px",color:l}},"FREE Delivery")),e.createElement("div",{style:{color:"#999989",fontWeight:"lighter",fontSize:"11px"}},"Verified by"," ",e.createElement("span",{style:{fontWeight:"bold"}}," YourToken"))," "),e.createElement("img",{src:m?mt:`data:image/svg+xml;utf8,${encodeURIComponent(mt)}`,alt:"Delivery Truck",height:"80px",width:"80px"}))):e.createElement(e.Fragment,null);case"postPurchase":return e.createElement(It,{$minHeight:"200px",$backgroundColor:c??"white",$borderRadius:"50px",$padding:"0"},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",background:"linear-gradient(white, #f4f4f4)",boxShadow:"0 4px 6px rgba(0,0,0,0.1)",width:"100%",height:"100%",position:"relative",paddingBottom:"15px"}},e.createElement("img",{src:"https://i.imgur.com/mZgp8n4.png",alt:"Donut",style:{width:"100%",marginBottom:"20px"}}),e.createElement("img",{src:"https://i.imgur.com/K7D8NLG.png",alt:"Badge",style:{position:"absolute",top:"30%",left:"50%",transform:"translate(-50%, -50%)",width:"100px",zIndex:2}}),e.createElement("div",{style:{marginTop:"20%",textAlign:"center",display:"flex",flexDirection:"column",rowGap:"10px",marginBottom:"13px"}},e.createElement("h1",{style:{fontSize:"24px",margin:"0",color:"#333",fontFamily:"fantasy"}},"Congrats!"),e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("p",{style:{fontSize:"11px",margin:"0",color:"#989898",fontWeight:"bold"}},"CREDITS"),e.createElement("p",{style:{margin:"0",fontWeight:"bold",fontSize:"16px"}},"+",b," Points"))),e.createElement("button",{style:{background:"#333",color:"#fff",padding:"7px 20px",borderRadius:"50px",border:"none",cursor:"pointer",fontSize:"18px",fontWeight:"bold",letterSpacing:"1px",boxShadow:"0 4px 6px rgba(0,0,0,0.1)"},onClick:y},"Check Balance"),e.createElement("button",{style:{background:"transparent",color:"#666",borderRadius:"5px",border:"none",cursor:"pointer",fontSize:"13px",marginTop:"10px"},onClick:u},"Continue Shopping")));case"registration":return e.createElement(It,{$minHeight:"80px",$minWidth:"450px",$backgroundColor:c??"white",$borderRadius:N??"10px",$padding:B??"0 20px 20px 20px",$position:F},e.createElement("div",{style:{display:"flex",gap:"10px",justifyContent:"space-between",minHeight:"80px"}},e.createElement("img",{src:D||"https://r2.yourtoken.io/ribbon.svg",alt:"register-on-yourtoken",height:"90",width:"90",style:{alignSelf:"center"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"15px",justifyContent:"space-between",fontFamily:"Montserrat"}},e.createElement("div",null,e.createElement("div",{style:{color:"#101828",fontSize:"18px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"space-between"}},i,e.createElement(Ot,{onClose:u})),e.createElement("div",{style:{fontSize:"13px",marginTop:"5px",lineHeight:"16px"}},a)),e.createElement(Pt,{onClick:z,color:"white",$bgColor:h??"#5F5478",$borderRadius:"0px",$fontFamily:"Montserrat"},I??"Unlock Rewards!"))));default:return e.createElement(It,{$minHeight:"120px",$backgroundColor:c??"white"},e.createElement(At,{onClose:u}),e.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"10px",justifyContent:"space-between",minHeight:"110px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"5px"}},e.createElement("div",{style:{fontWeight:"bolder",fontSize:"20px"}},i),e.createElement("div",{style:{color:"#718096",fontSize:"15px",lineHeight:"21px"}},a)),e.createElement("div",{style:{display:"flex",columnGap:"5px"}},e.createElement(Pt,{onClick:p,color:"white",$bgColor:"black"},"Checkout Now"),e.createElement(Pt,{color:l??"white",onClick:g},"Go to cart"))))}},Mt=s`
|
|
293
293
|
0% { box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.3); }
|
|
294
294
|
100% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
|
|
295
295
|
`,jt=c.button`
|
|
@@ -381,7 +381,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
381
381
|
width: 50px;
|
|
382
382
|
height: 50px;
|
|
383
383
|
}
|
|
384
|
-
`,qt=({buttonColor:t,children:n,onClick:o})=>e.createElement(jt,{onClick:o,buttonColor:t},n),Qt=({segments:n,setWinningSegment:o,brandGameDefaultThemeColor:r,brandThemeColor:i,ctaButtonText:a,wheelSectionColor1:l,wheelSectionColor2:c,wheelCenterLogo:
|
|
384
|
+
`,qt=({buttonColor:t,children:n,onClick:o})=>e.createElement(jt,{onClick:o,buttonColor:t},n),Qt=({segments:n,setWinningSegment:o,brandGameDefaultThemeColor:r,brandThemeColor:i,ctaButtonText:a,wheelSectionColor1:l,wheelSectionColor2:c,wheelCenterLogo:s,isStatic:d})=>{const[p,u]=t(!1),[m,g]=t(0),[x,f]=t(!1),[y,b]=t(!1);return e.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"15px",height:"100%",overflow:"hidden"}},e.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement("div",{style:{borderRadius:"full",transform:"rotate(180deg)"}}),e.createElement(Wt,null),e.createElement(Vt,null,e.createElement(Ht,{$isDisabled:x,$brandThemeColor:i,$brandGameDefaultThemeColor:r},e.createElement("img",{src:s??"https://i.imgur.com/nZIyqNu.png",style:{height:"45px",width:"55px"},alt:"YourToken LOGO"})))),e.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}},!d&&e.createElement(qt,{buttonColor:i??r??"black",onClick:()=>!(d&&!0===d)&&(()=>{if(!x&&!y){b(!0),u(!p),f(!0);let e=0,t=[];if(n.forEach(t=>{t?.probability&&t.probability>0&&(e+=t.probability)}),0===e)t=Array.from({length:n.length},()=>0);else{let o=0;n.forEach(n=>{n?.probability&&n.probability>0?(o+=n.probability/e*100,t.push(o)):t.push(o)})}const o=100*Math.random();let r;for(let e=0;e<t.length;e++)if(o<=t[e]){r=e;break}const i=360/n.length;if(void 0===r){let e=0,t=0;n.forEach((n,o)=>{n?.probability&&n.probability>t&&(t=n.probability,e=o)}),r=e}const a=(r+.5)*i,l=360*Math.floor(5*Math.random()+5);g(l-a)}})()},a??"Spin Now!")))},Ut=re(void 0),Yt=ce("deliveryOptionStateValidity",{isPostalCodeValid:!1,isDateValid:!1}),Gt=re(e=>{const t=e(Yt);return t.isPostalCodeValid&&t.isDateValid}),Xt=ce("deliveryType","standard"),Zt=ce("deliverySlotDate",null),Jt=re({cartLoading:!1,showLoader:!1,showSkeletonLoader:!1,showLoyaltyCtaLoading:!1});function Kt(){const[e,t]=ie(Jt);return{cartLoading:e,setLoading:(e,n,o,r)=>{t({cartLoading:e,showLoader:n,showSkeletonLoader:void 0!==o&&o,showLoyaltyCtaLoading:void 0!==r&&r})}}}const en=re({open:!1,variantId:void 0,quantity:void 0,handle:void 0,freebieSelection:!1,stealDealSelection:!1,lineItemKey:void 0,productId:void 0,allowedVariantIds:void 0,productRec:!1}),tn=(e,t)=>"INR"===t||"₹"===t||"Rs"===t||"Rs."===t||"rs"===t||"rs."===t||"RS."===t?Number((e/100).toFixed(2)):e,nn={79:"Rs. "},on=(e,t)=>{const n=t??e?.currency??"INR";return"undefined"!=typeof window&&window.ytapp?.brandId?nn[window.ytapp.brandId]??se(n)??"₹":se(n)??"₹"},rn=(e,t=15)=>e.length>t?e.substring(0,t)+"...":e,an=(e,t,n,o="",r="16px")=>{const i=document.createElement("canvas").getContext("2d"),a=e.replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&");if(i){const e=o?`${r} ${o}`:r;i.font=e;const l=t/100*n;if(i.measureText(a).width>l){let e=a;for(let t=e.length-1;t>=0;t--){const n=e.slice(0,t)+"...";if(i.measureText(n).width<l)return n}return"..."}}return a};function ln(e,t){t=Math.max(0,Math.min(1,t));let n=Math.round(255*t).toString(16);return 1===n.length&&(n="0"+n),e+n}function cn(e,t){e=e.replace(/^#/,"");return`rgba(${parseInt(e.substring(0,2),16)}, ${parseInt(e.substring(2,4),16)}, ${parseInt(e.substring(4,6),16)}, ${t})`}const sn=e=>e?.split("/")?.pop();const dn=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function pn(e,t="#FFFFFF",n="#000000",o=.5){if(!e)return;const r=window.getComputedStyle(e).backgroundColor;let i=0,a=0,l=0;if("transparent"===r||"rgba(0, 0, 0, 0)"===r)return void(e.style.color=n);const c=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(c)i=parseInt(c[1],10),a=parseInt(c[2],10),l=parseInt(c[3],10);else{const t=document.createElement("div");t.style.color=r,document.body.appendChild(t);const o=window.getComputedStyle(t).color;document.body.removeChild(t);const c=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(!c)return console.warn("setContrastTextColor: Could not parse background color:",r,"Resolved to:",o),void(e.style.color=n);i=parseInt(c[1],10),a=parseInt(c[2],10),l=parseInt(c[3],10)}const s=[i/255,a/255,l/255].map(e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)),d=.2126*s[0]+.7152*s[1]+.0722*s[2];e.style.color=d>o?n:t}const un=e=>{if(null==e)return"";const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},mn=()=>{const e=window.ytapp?.storeDomain;return!!e&&["veeba-sauces.myshopify.com"].includes(e)},gn=(e,t=150,n=85,o="webp")=>{if(!e||"string"!=typeof e)return"/placeholder.svg";if(""===e.trim()||"/placeholder.svg"===e)return"/placeholder.svg";try{if(!(e.includes("cdn.shopify.com")||e.includes("shopify.com")||e.includes(".myshopify.com")))return e;let r=e.split("?")[0];const i=r.lastIndexOf(".");if(-1===i)return e;const a=r.substring(i),l=r.substring(0,i).replace(/_\d+x\d*$|_x\d+$|_\d+x$/,""),c=`${l}${`_${t}x${t}`}${a}`,s=new URLSearchParams;"auto"!==o&&s.append("format",o),85!==n&&s.append("quality",n.toString());const d=s.toString();return d?`${c}?${d}`:c}catch(t){return console.warn("Failed to optimize Shopify image URL:",t),e}},xn=e=>{if(!e||"string"!=typeof e)return e;const t=e.match(/^bundle-[^-]+-(.+)-([A-Za-z0-9]{5,8})$/);if(t&&t[1])return t[1].trim();const n=e.match(/^vol-(.+?)-([A-Za-z0-9\s-]{3,})$/i);if(n&&n[1])return n[1].trim();const o=e.match(/^(YTA-|YTP-|YT-)(.+)$/);return o&&o[2]?o[2].trim():e},fn=c.div`
|
|
385
385
|
min-width: 145px !important;
|
|
386
386
|
padding: ${e=>"vertical"===e.$variant?"3px":"10px 30px"};
|
|
387
387
|
background-color: ${e=>e.$backgroundColor};
|
|
@@ -560,12 +560,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
560
560
|
flex-basis: 100%;
|
|
561
561
|
position: relative;
|
|
562
562
|
max-width: 100px;
|
|
563
|
-
`;const $n=e=>{if(null!=e)return"string"==typeof e&&e.includes("/")?e.split("/").pop():String(e)},
|
|
563
|
+
`;const $n=e=>{if(null!=e)return"string"==typeof e&&e.includes("/")?e.split("/").pop():String(e)},Nn=c.div`
|
|
564
564
|
display: flex;
|
|
565
565
|
align-items: baseline;
|
|
566
566
|
gap: 4px;
|
|
567
567
|
flex-wrap: nowrap;
|
|
568
|
-
`,
|
|
568
|
+
`,Bn=c.span`
|
|
569
569
|
font-size: 14px;
|
|
570
570
|
font-weight: var(-yt-cart-product-rec-price-font-weight, 200);
|
|
571
571
|
color: ${e=>e.$secondaryTextColor||"#2d3748"};
|
|
@@ -574,7 +574,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
574
574
|
@media (max-width: 768px) {
|
|
575
575
|
font-size: 14px;
|
|
576
576
|
}
|
|
577
|
-
`,
|
|
577
|
+
`,In=c.span`
|
|
578
578
|
font-size: 13px;
|
|
579
579
|
color: #6b7280;
|
|
580
580
|
text-decoration: line-through;
|
|
@@ -584,7 +584,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
584
584
|
@media (max-width: 480px) {
|
|
585
585
|
font-size: 12px;
|
|
586
586
|
}
|
|
587
|
-
`,
|
|
587
|
+
`,zn=c.button`
|
|
588
588
|
width: 36px;
|
|
589
589
|
height: 36px;
|
|
590
590
|
display: flex;
|
|
@@ -616,7 +616,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
616
616
|
font-size: 15px;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
`,
|
|
619
|
+
`,Fn=c.div`
|
|
620
620
|
position: absolute;
|
|
621
621
|
top: 6px;
|
|
622
622
|
left: 6px;
|
|
@@ -636,7 +636,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
636
636
|
font-size: 10px;
|
|
637
637
|
line-height: normal;
|
|
638
638
|
display: flex;
|
|
639
|
-
`,Pn=({product:a,addCartItem:l,productRecsCtaButtonText:c,ctaButtonBackgroundColor:
|
|
639
|
+
`,Pn=({product:a,addCartItem:l,productRecsCtaButtonText:c,ctaButtonBackgroundColor:s,ctaButtonTextColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:g,cartComponentsCornerRadius:x,cartComponentsCornerType:f,isVerticalList:y,backgroundColor:b,tertiaryColor:h,tertiaryTextColor:v})=>{const w=ae(Ut),{setLoading:C}=Kt(),E=le(en),k=o(()=>{const e=a?._ytAllowedVariantIds??a?.ytAllowedVariantIds;if(!Array.isArray(e)||0===e.length)return;const t=e.map(e=>$n(e)).filter(e=>Boolean(e));return t.length>0?t:void 0},[a]),T=o(()=>Array.isArray(a?.variants)?a.variants.filter(e=>{if(!k?.length)return!0;const t=$n(e?.id);return!!t&&k.includes(t)}):[],[a,k]),[S,$]=t(!1),[N,B]=t(()=>{const e=T?.[0];return e?$n(e.id):void 0}),[I,z]=t(T?.[0]),F=r(null),D=i(()=>T.find(e=>e.available)??T[0],[T]);n(()=>{if(!T.length)return B(void 0),void z(void 0);if(!(N&&T.some(e=>$n(e?.id)===N))){const e=D();if(e){const t=$n(e.id);B(t),z(e)}}},[T,N,D]),n(()=>{(async()=>{try{if(N){const e=T.find(e=>$n(e?.id)===N);e&&z(e)}}catch(e){console.error("Error getting selected product variant id")}})()},[T,N]);const P=async()=>{C&&C(!0,!0);try{await l(N??$n(T?.[0]?.id)??a?.variants?.[0]?.id,void 0,"productSuggestion",void 0,a?.handle)}catch(e){console.error("yt::error adding recommended item to cart",e)}C&&C(!1,!1)},A=()=>{const e=$n(a?.id),t=k&&k.length>0?k:a?.variants?.map(e=>$n(e.id)).filter(e=>Boolean(e));E({open:!0,variantId:N??$n(T?.[0]?.id)??void 0,handle:a?.handle,freebieSelection:!1,productId:e,allowedVariantIds:t,productRec:!0})},_=m&&T.length>1,R=(a?.title??"").replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&");const O=(e,t)=>{let n;n="string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t.featured_image||"/placeholder.svg";return gn(n,"vertical"===g?300:200,85,"webp")},L={flexDirection:"horizontal"===g?"row":"column",width:"horizontal"===g?"325px":"145px",transform:S?"scale(1.025)":"scale(1)",justifyContent:"flex-start",gap:"horizontal"===g?"10px":""},M={width:"horizontal"===g?"100px":"auto",opacity:S?.8:1},j={color:u??"#212529",marginTop:"vertical"===g?"":"0"},V=(()=>{const e=Number(a?.compare_at_price),t=Number(a?.price);if(!e||!t||e<=t)return null;const n=Math.round((e-t)/e*100);return!isFinite(n)||n<=0?null:`${n}% OFF`})();return y?e.createElement(En,{className:"yt-cart-product-rec-vertical-card"},e.createElement(kn,{className:"yt-cart-product-rec-vertical-image",src:O(null,a),onClick:()=>{window.location.href=`${window.location.origin}${a?.url}`}}),e.createElement(Tn,{className:"yt-cart-product-rec-vertical-info"},e.createElement(Sn,{href:`${window.location.origin}${a?.url}`,$primaryTextColor:p},R),e.createElement(Nn,null,e.createElement(Bn,{$secondaryTextColor:u},on(w,w?.currency),un(tn(a?.price,w?.currency))),a?.compare_at_price&&e.createElement(In,null,on(w,w?.currency),un(tn(a?.compare_at_price,w?.currency))),V&&e.createElement(Dn,{$background:h,$color:v},V))),e.createElement(zn,{className:"yt-cart-product-rec-vertical-button",onClick:_?A:P,$ctaButtonBackgroundColor:s,$ctaButtonTextColor:d,$cartComponentsCornerType:f,$cartComponentsCornerRadius:x,style:{width:_?"auto":"36px",padding:_?"0 8px":"0"}},_?e.createElement(ue,null):e.createElement(de,null))):e.createElement(fn,{className:"yt-cart-product-rec-card-container",ref:F,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),style:L,$variant:g??"horizontal",$cartComponentsCornerType:f,$cartComponentsCornerRadius:x,$backgroundColor:b},V&&e.createElement(Fn,{$background:h,$color:v},V),e.createElement(yn,{className:"yt-cart-product-rec-image",src:O(null,a),style:M,$variant:g??"horizontal",$cartComponentsCornerType:f,$cartComponentsCornerRadius:x,onClick:()=>{window.location.href=`${window.location.origin}${a?.url}`}}),e.createElement(bn,{className:"yt-cart-product-rec-info"},e.createElement("div",null,e.createElement(hn,{href:`${window.location.origin}${a?.url}`,style:{color:p??"black"}},R),e.createElement("div",{style:{display:"flex"}},e.createElement(vn,{style:j},on(w,w?.currency),un(tn(a?.price,w?.currency))),e.createElement(Cn,null,Number(a?.compare_at_price)>Number(a?.price)&&e.createElement(e.Fragment,null," ",on(w,w?.currency),un(tn(a?.compare_at_price,w?.currency)))))),e.createElement(wn,{className:"yt-cart-product-rec-button",onClick:_?A:P,id:"yourtoken-product-rec-atc",style:{backgroundColor:s??"#3A4980",color:d??"white",height:"fit-content",marginTop:"auto",marginBottom:"0px"},$variant:g??"horizontal",$cartComponentsCornerType:f,$cartComponentsCornerRadius:x},c??"Add to Cart")))},An=c.div`
|
|
640
640
|
display: flex;
|
|
641
641
|
flex-direction: column;
|
|
642
642
|
row-gap: 8px;
|
|
@@ -760,7 +760,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
760
760
|
margin-bottom: 4px;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
`,Yn=({products:o,addCartItem:i,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,productRecsTitleText:
|
|
763
|
+
`,Yn=({products:o,addCartItem:i,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,productRecsTitleText:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,variant:g,cardLayout:x,cartComponentsCornerRadius:f,cartComponentsCornerType:y,backgroundSubdued:b,backgroundColor:h,tertiaryColor:v,tertiaryTextColor:w})=>{const C=r(null);n(()=>{const e=()=>{if(C.current){const e=Array.from(C?.current?.children)?.reduce((e,t)=>e+t?.offsetWidth,0);C.current.style.width=`${e}px`}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);const[E,k]=t(0),T=r(null),S=r(null),$=r(!1),N=()=>{k(e=>{const t=Math.max((I?.length||1)-1,0);return 0===e?t:e-1})},B=()=>{k(e=>e===Math.max((I?.length||1)-1,0)?0:e+1)},I=o?.filter(e=>e&&e.available&&"8627886358748"!==String(e?.id)&&"8627886358748"!==String(e?.product_id)),z=t=>I.map(n=>e.createElement(Pn,{key:n?.id,addCartItem:i,product:n,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:x,cartComponentsCornerRadius:f,cartComponentsCornerType:y,isVerticalList:"vertical"===t,backgroundColor:h,tertiaryColor:v,tertiaryTextColor:w}));return"vertical"===g?e.createElement(qn,{className:"yt-cart-product-recs-vertical-container"},s&&e.createElement(Qn,{$primaryTextColor:p,$themeColor:d,$backgroundSubdued:b},s),e.createElement(Un,{className:"yt-cart-product-recs-vertical-list"},z("vertical"))):e.createElement(An,{className:"yt-cart-product-recs-container"},e.createElement(_n,{className:"yt-cart-product-recs-title",$primaryTextColor:p??"black",$themeColor:d??"lightgrey",$backgroundSubdued:b},s??"People Also Bought"),"scroll"===g?e.createElement(Rn,{className:"yt-cart-product-recs-scroll"},e.createElement(On,{ref:C},z())):e.createElement(Ln,{className:"yt-cart-product-recs-carousel"},e.createElement(Mn,{onTouchStart:e=>{const t=e.touches[0];T.current=t.clientX,S.current=t.clientY,$.current=!1},onTouchMove:e=>{if(null===T.current||null===S.current)return;const t=e.touches[0],n=t.clientX-T.current,o=t.clientY-S.current;Math.abs(n)>10&&Math.abs(n)>Math.abs(o)&&($.current=!0,e.preventDefault())},onTouchEnd:e=>{if(null===T.current)return;const t=e.changedTouches[0].clientX-T.current;Math.abs(t)>50&&(t<0?B():N()),T.current=null,S.current=null,$.current=!1}},e.createElement(Wn,{onClick:N},e.createElement(xe,null)),e.createElement(jn,{style:{transform:`translateX(-${E*(100/I.length)}%)`}},z()),e.createElement(Hn,{onClick:B},e.createElement(fe,null)))))};gt('.progress-container {\n --yt-line-border-fill: #3498db;\n --yt-line-border-empty: #e0e0e0;\n display: flex;\n justify-content: space-between;\n position: relative;\n margin-bottom: 30px;\n max-width: 100%;\n width: 350px;\n}\n\n.progress-container::before {\n content: ""; /* Mandatory with ::before */\n background-color: var(--yt-line-border-empty);\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 4px;\n width: 100%;\n z-index: -1;\n}\n\n.progress {\n background-color: var(--yt-line-border-fill);\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 4px;\n width: 0%;\n z-index: -1;\n transition: 0.4s ease;\n}');const Gn=e=>100/e,Xn=e=>{switch(e){case 1:case 2:case 3:case 4:default:return 22;case 5:return 17}},Zn=c.div`
|
|
764
764
|
display: flex;
|
|
765
765
|
align-items: center;
|
|
766
766
|
// padding: 0 10px;
|
|
@@ -994,18 +994,18 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
994
994
|
flex-wrap: wrap;
|
|
995
995
|
text-align: center;
|
|
996
996
|
}
|
|
997
|
-
`,bo=({prefixMessageText:t="You are",suffixMessageText:n="away from",successMessageText:o="Best reward unlocked",...r})=>{const i=(o,r)=>e.createElement(yo,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},o)," ",n&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},r));let a=-1;const l=void 0!==r.currentCartAmount?r.currentCartAmount:r.cartData?.items_subtotal_price,c=void 0!==r.effectiveQuantityForProgressBar?r.effectiveQuantityForProgressBar:r.cartData?.item_count,
|
|
997
|
+
`,bo=({prefixMessageText:t="You are",suffixMessageText:n="away from",successMessageText:o="Best reward unlocked",...r})=>{const i=(o,r)=>e.createElement(yo,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},o)," ",n&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},r));let a=-1;const l=void 0!==r.currentCartAmount?r.currentCartAmount:r.cartData?.items_subtotal_price,c=void 0!==r.effectiveQuantityForProgressBar?r.effectiveQuantityForProgressBar:r.cartData?.item_count,s=on(r.cartData,r.cartData?.currency)??"Rs .";if("minimum_order_value"===r.customCartProgressBarCriteria){if(0===l&&r.cartData?.items_subtotal_price>0)return null;for(let e=0;e<r.checkpoints?.length;e++)if(l<r.checkpoints?.[e]?.minimumOrderValue){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},o);const t=r.checkpoints?.[a];return i(`${s}${un((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&r.cartData?.item_count>0)return null;for(let e=0;e<r.checkpoints?.length;e++)if(c<r.checkpoints?.[e]?.quantityThreshold){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},o);const d=r.checkpoints?.[a];return i(`${d?.quantityThreshold-c}`,d?.name)},ho=t=>e.createElement(so,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(bo,{...t})),vo=({particleCount:t,spread:o,origin:i,checkpointPosition:a=.5})=>{const l=r(null),c=r(!1);return n(()=>{if(l.current&&!c.current){ve.create(l.current,{resize:!0})({particleCount:10*t,spread:o,origin:{x:1,y:.8}}),c.current=!0}},[t,o,i,a]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},wo=({prefixMessageText:o,suffixMessageText:i,successMessageText:a,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}=c,y=ae(Ut),[b,h]=t(!1),[v,w]=t(-1),C=r({});return n(()=>{d?.forEach((e,t)=>{const n=fo(e,0,d??[],y?.item_count,c),o=String(e.couponTemplateId);(C.current[o]||0)<100&&n.progressPercentage>=100&&(w(t),h(!0),setTimeout(()=>h(!1),5e3)),C.current[o]=n.progressPercentage})},[y,d]),e.createElement(e.Fragment,null,e.createElement(ho,{currentCartAmount:s,checkpoints:d,cartData:y,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:o,suffixMessageText:i,successMessageText:a,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}),e.createElement(po,null,b&&l&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),e.createElement(uo,null,e.createElement(co,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[xo(u)]&&("minimum_order_value"!==u||1!==e?.[xo(u)]))?.map((...e)=>fo(...e,y?.item_count,c))?.map((t,n)=>e.createElement(mo,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(go,null,n<d?.length&&e.createElement(lo,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:x}))))))))},Co=t=>e.createElement(no,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(bo,{...t})),Eo=(t,n,o,r,i)=>{let a;if(a="free_product"===t?ko?.[r]:To?.[t],!a)return e.createElement(we,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${Xn(o)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const l=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(a,{style:{padding:"4px",border:"2px solid black",backgroundColor:l?"#000":"white",borderColor:l?"#fff":n,color:l?"#fff":n,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${Xn(o??3)}px`,marginLeft:"-2px"}})},ko={tshirt:Ie,box:ze,cup:Ve,gift:Ne,emptyCircle:Xe},To={percentage_discount_coupon:ye,amount_discount_coupon:ye,free_delivery:_,free_gift:Ne,dummy_coupon:Xe},So=({checkpointWithProgress:t,themeColor:n,checkpointsLength:o,progressBarFreeProductIconType:r,themeTextColor:i,ctaButtonTextColor:a})=>t?.progressPercentage>=100?e.createElement(we,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:a,borderColor:n,borderRadius:"9999px",fontSize:`${Xn(o)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):Eo(t?.couponType,"#707070",o,r??"tshirt"),$o=({showMOVForProgressTiers:t,minimumOrderValue:n,customCartProgressBarCriteria:o,cartData:r,quantityThreshold:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l})=>t?e.createElement(to,{$visible:n>1||i>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:a},"minimum_order_value"===o?`${on(r,r?.currency)} ${un(n)}`:`${i} item${i>1?"s":""}`):null,No="undefined"!=typeof window?a:n,Bo=({prefixMessageText:o,suffixMessageText:a,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:g,primaryTextColor:x,effectiveQuantityForProgressBar:f,progressBarFreeProductIconType:y,ctaButtonBackgroundColor:b,showMOVForProgressTiers:h,ctaButtonTextColor:v}=s,w=ae(Ut),[C,E]=t(!1),[k,T]=t(-1),S=r({}),[$,N]=t(0),[B,I]=t(0),z=r(null),F=r([]);F.current.length=0;const D=i(()=>{if("undefined"==typeof window)return;const e=F.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return N(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),o=parseFloat(n.lineHeight||""),r=parseFloat(n.fontSize||""),i=Number.isNaN(o)?Number.isNaN(r)?0:1.2*r:o,a=e.getBoundingClientRect(),l=i>0?Math.max(0,a.height-i):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;N(e=>e!==n?n:e);const o=z.current,r=e[e.length-1];if(!o||!r)return void I(e=>0!==e?0:e);const i=o.getBoundingClientRect(),a=r.getBoundingClientRect(),l=Math.ceil(a.right-i.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return No(()=>{D()}),n(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=z.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[D]),n(()=>{s.checkpoints?.forEach((e,t)=>{const n=fo(e,0,s.checkpoints??[],w?.item_count,s),o=String(e.couponTemplateId);(S.current[o]||0)<100&&n.progressPercentage>=100&&(T(t),E(!0),setTimeout(()=>E(!1),5e3)),S.current[o]=n.progressPercentage})},[w,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Co,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:w,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:x,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:b,prefixMessageText:o,suffixMessageText:a,successMessageText:l,ctaButtonTextColor:v}),e.createElement(oo,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:B,ref:z},C&&c&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(k+1)/(s.checkpoints?.length??1)}),e.createElement(ro,{$tagWrapOffsetPx:$},e.createElement(Zn,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[xo(s.customCartProgressBarCriteria)])?.map((...e)=>fo(...e,w?.item_count,s))?.map((t,n)=>e.createElement(io,{key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(ao,null,n<s.checkpoints?.length&&e.createElement(Kn,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:b}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(Jn,{$isDummy:t?.isDummyCouponTemplate},e.createElement(eo,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{F.current[n]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:b,$primaryTextColor:x,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(So,{checkpointWithProgress:t,themeColor:b,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:y,ctaButtonTextColor:v}),e.createElement($o,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:w,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:b,ctaButtonTextColor:v})))))))))},Io=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(wo,{...t}):e.createElement(Bo,{...t}):null,zo=c(c.span`
|
|
998
998
|
display: flex !important;
|
|
999
999
|
gap: 4px;
|
|
1000
1000
|
`)`
|
|
1001
1001
|
font-size: 13px;
|
|
1002
|
-
`,
|
|
1002
|
+
`,Fo=c.div`
|
|
1003
1003
|
display: flex;
|
|
1004
1004
|
flex-direction: column;
|
|
1005
1005
|
width: 100%;
|
|
1006
1006
|
gap: 10px;
|
|
1007
1007
|
margin-top: 16px;
|
|
1008
|
-
`;function Do({showLoyaltyCta:n,exploreCTAColor:o="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:i,isUserSignedIn:a=!1,joinNowFunction:l,exploreCtaRedirectLink:c,themeColor:d,emptyCartButtons:s=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:g,addCartItem:x,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,I]=t(!1),[z,F]=t(null);return e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},e.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},e.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),e.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),e.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),e.createElement("span",{style:{color:h,fontWeight:"semibold"}},r),i&&e.createElement("span",{style:{color:"#929292",fontSize:"14px"}},i),!a&&n&&e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(Ke,{color:o,fontSize:"14px",strokeWidth:2}),e.createElement(Fo,null,e.createElement("span",{onClick:l,style:{color:o,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{style:{color:"black"}},"to avail offers"))),s&&s.length>0&&e.createElement(No,null,s.map((t,n)=>e.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>F(n),onMouseLeave:()=>F(null),onClick:()=>window.location.href=t.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:z===n?d||"#73DABB":"#CACACA30",color:z===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&g&&g.length>0&&x&&e.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(Yn,{products:g,addCartItem:x,productRecsTitleText:E,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),e.createElement("button",{onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),onClick:()=>window.location.replace(c??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},e.createElement(Ze,{color:h}),e.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:h,cursor:"pointer"}},"Continue Shopping")))}const Po=ce("gstNumber",""),Ao=ce("gstCompanyName",""),_o=re("");gt("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Ro=ce("postalCode",void 0);function Oo({checkoutButtonColor:i,checkoutFontSize:a,checkoutFunction:l,discountApplied:c,discountInCheckoutButton:d,discountAmountApplied:s,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:g,applyNoteToCart:x,showNoteOption:f,enableGeoLocationDeliveryRestriction:y,applyPostalCodeAndDeliverySlotToCart:b,enableSlotPicker:h,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:I,toggleDecimal:z,disableCheckoutButton:F,checkoutButtonBottomSpacing:N=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:P,hideSubtotalAndBadge:A=!1,showTrustedBadge:_,trustedBadgeData:R}){const O=ae(Ut),L=ae(Po),M=ae(Ao),j=ae(_o),V=ae(Gt),W=ae(Yt),H=ae(Ro),q=ae(Zt),Q=ae(Xt),[U,Y]=t(!1),G=on(O,O?.currency),[X,Z]=t("closed"),J=r(null),[K,ee]=t(!1),te=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),o=parseInt(n.slice(3,5),16),r=parseInt(n.slice(5,7),16),i=9===n.length?parseInt(n.slice(7,9),16):void 0,a=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),d=`#${a.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==i?`${d}${i.toString(16).padStart(2,"0")}`:d}return e}catch{return e}})($,.22),[$]),ne=o(()=>tn(p??0,O?.currency??"INR"),[p,O?.currency]),oe=o(()=>un(z?ne.toFixed(2):ne.toFixed(0)),[ne,z]),re=r(null),ie=r(null),le=r(null),ce=()=>{Z("closing"),setTimeout(()=>{Z("closed")},300)},de=tn(O?.original_total_price,O?.currency),se=o(()=>I?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[I]),pe=o(()=>!(!se||!se.minimumOrderValue)&&de>=se.minimumOrderValue,[se,de]),ue=pe&&se&&se.discountValue||0,me=s?tn(s,O?.currency??"INR"):0,ge=Number((de-me).toFixed(2)),xe=o(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return tn(e,O?.currency)},[O?.items,S]),fe=o(()=>pe?xe+ue:xe,[pe,xe,ue]),ye=o(()=>ne&&ne>0?`Add products worth more than ${G}${oe}`:"",[ne,G,oe]),be=o(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),he=tn(be,O?.currency??"INR");n(()=>{re.current&&pn(re.current),ie.current&&pn(ie.current),le.current&&pn(le.current)},[i,me,S,he,X,ue]);const ve=o(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),we=o(()=>{const e=[];for(const t in ve)if(Object.prototype.hasOwnProperty.call(ve,t)){const n=ve[t],o=tn(n,O?.currency??"INR"),r=xn(t);e.push({title:r,amount:o})}return e},[ve,O?.currency]),Ee=o(()=>{let e=0;return e+=S?me+he:me,pe&&(e+=ue),e},[me,he,S,pe,ue]),ke=async e=>{if(Y(!0),ge<=0)Y(!1);else{if(y){if("standard"!==Q&&(h?!V:!W.isPostalCodeValid))return void Y(!1);if(b)try{"standard"===Q?await b(Q):await b(Q,String(H)||"",q&&h?new Date(q).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}g&&m&&""!==M&&""!==L&&await m(L,M),f&&x&&""!==j&&await x(j),await l(e),Y(!1)}},[Te,Se]=t(!1);n(()=>{Se(ge<=0||(!!F||!!y&&("standard"!==Q&&(h?!V:!W.isPostalCodeValid))))},[W,Q,y,h,V,q,F,ge]);const[$e,Be]=t(!1),Ie=r(null),[ze,Fe]=t("0px");n(()=>{Ie.current&&Fe($e?`${Ie.current.scrollHeight}px`:"0px")},[$e,we,pe]);const Ne=()=>{Be(!$e)};n(()=>{function e(e){J.current&&!J.current.contains(e.target)&&ce()}return"open"!==X&&"opening"!==X||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[X]);const De=(t,n="Checkout")=>t?e.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},n),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(et,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==n&&e.createElement(Ce,{fontSize:"20px"}),e.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},n));return e.createElement("div",{style:{position:"relative"}},!!E&&E.length>0&&!mn()&&(()=>{const t=k||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:A?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content",padding:"0 55px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===t?e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:te}),e.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:te}),e.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:te}),e.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:te}),e.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===d||"true"===d)&&"closed"!==X&&e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===X?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ce}),e.createElement("div",{ref:J,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===X?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},e.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},e.createElement("span",null,"Price Summary"),e.createElement("button",{onClick:ce,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),e.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},e.createElement(e.Fragment,null,(S&&he>0||c&&we.length>0||pe&&ue>0)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},G,un(pe?z?fe.toFixed(2):fe.toFixed(0):z?xe.toFixed(2):xe.toFixed(0)))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(z?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(z?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(z?t.amount.toFixed(2):t.amount.toFixed(0))))),Ee>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",null,"Total Savings"),e.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",G,un(z?Ee.toFixed(2):Ee.toFixed(0))))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:me>0||S&&he>0||pe&&ue>0?"10px":"0"}},e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},G,un(z?ge.toFixed(2):ge.toFixed(0)))),e.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},e.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",null,G,un(z?Ee.toFixed(2):Ee.toFixed(0)))," ","on your order")),e.createElement("button",{ref:ie,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},De(U)))),(!0===d||"true"===d)&&F&&Te&&ye&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),!0===d||"true"===d?e.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${N}px 8px`}},e.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:le,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",G,un(z?Ee.toFixed(2):Ee.toFixed(0))),U?e.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):c||pe&&se?e.createElement("div",null,e.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},G,un(z?ge.toFixed(2):ge.toFixed(0))),(me>0||he>0||pe&&ue>0)&&e.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},G,un(pe?fe.toFixed(0):xe.toFixed(0))))):e.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},G,un(z?ge.toFixed(2):ge.toFixed(0))),S&&he>0||c&&me>0||pe&&ue>0?e.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Z("opening"),requestAnimationFrame(()=>{Z("open")}),ee(!K)}},"See Details"):e.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(et,{fontSize:"24px"}))):"CHECKOUT"))),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}}))):e.createElement(e.Fragment,null,F&&Te&&ye&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:A?"0px":"10px"}},e.createElement("div",{style:{display:A?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:P}},(he>0||c&&we.length>0||pe&&ue>0)&&Ee>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px"}},G,un(pe?z?fe.toFixed(2):fe.toFixed(0):z?xe.toFixed(2):xe.toFixed(0)))),(me>0||he>0||pe&&ue>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",e.createElement("button",{onClick:Ne,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},$e?"Hide details":"See details")),e.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",G,un(z?Ee.toFixed(2):Ee.toFixed(0)))),e.createElement("div",{ref:Ie,style:{height:ze,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:$e?1:0,marginTop:$e?"5px":"0",borderTop:$e?"1px solid #E5E7EB":"none",paddingTop:$e?"5px":"0",fontWeight:"600"}},S&&he>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(z?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(z?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(z?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},G,un(z?ge.toFixed(2):ge.toFixed(0))))),e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==X||v?"0":`4px 1rem ${N}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:u??"white",textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"closed"!==X?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},De(U,D?"Checkout":"Proceed to Checkout")),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}})))))}const Lo=c.button`
|
|
1008
|
+
`;function Do({showLoyaltyCta:n,exploreCTAColor:o="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:i,isUserSignedIn:a=!1,joinNowFunction:l,exploreCtaRedirectLink:c,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:g,addCartItem:x,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[N,B]=t(!1),[I,z]=t(null);return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-empty-container",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},e.createElement("div",{className:"yt-cart-empty-content",style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},e.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},e.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),e.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),e.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:h,fontWeight:"semibold"}},r),i&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},i),!a&&n&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(Ke,{color:o,fontSize:"14px",strokeWidth:2}),e.createElement(zo,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:o,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(Fo,null,d.map((t,n)=>e.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>z(n),onMouseLeave:()=>z(null),onClick:()=>window.location.href=t.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?s||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&g&&g.length>0&&x&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(Yn,{products:g,addCartItem:x,productRecsTitleText:E,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),onClick:()=>window.location.replace(c??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:N?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},e.createElement(Ze,{color:h}),e.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:h,cursor:"pointer"}},"Continue Shopping")))}const Po=ce("gstNumber",""),Ao=ce("gstCompanyName",""),_o=re("");gt("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Ro=ce("postalCode",void 0);function Oo({checkoutButtonColor:i,checkoutFontSize:a,checkoutFunction:l,discountApplied:c,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:g,applyNoteToCart:x,showNoteOption:f,enableGeoLocationDeliveryRestriction:y,applyPostalCodeAndDeliverySlotToCart:b,enableSlotPicker:h,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:N,cartCheckpoints:B,toggleDecimal:I,disableCheckoutButton:z,checkoutButtonBottomSpacing:F=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:P,hideSubtotalAndBadge:A=!1,showTrustedBadge:_,trustedBadgeData:R}){const O=ae(Ut),L=ae(Po),M=ae(Ao),j=ae(_o),V=ae(Gt),W=ae(Yt),H=ae(Ro),q=ae(Zt),Q=ae(Xt),[U,Y]=t(!1),G=on(O,O?.currency),[X,Z]=t("closed"),J=r(null),[K,ee]=t(!1),te=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),o=parseInt(n.slice(3,5),16),r=parseInt(n.slice(5,7),16),i=9===n.length?parseInt(n.slice(7,9),16):void 0,a=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),s=`#${a.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==i?`${s}${i.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ne=o(()=>tn(p??0,O?.currency??"INR"),[p,O?.currency]),oe=o(()=>un(I?ne.toFixed(2):ne.toFixed(0)),[ne,I]),re=r(null),ie=r(null),le=r(null),ce=()=>{Z("closing"),setTimeout(()=>{Z("closed")},300)},se=tn(O?.original_total_price,O?.currency),de=o(()=>B?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[B]),pe=o(()=>!(!de||!de.minimumOrderValue)&&se>=de.minimumOrderValue,[de,se]),ue=pe&&de&&de.discountValue||0,me=d?tn(d,O?.currency??"INR"):0,ge=Number((se-me).toFixed(2)),xe=o(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return tn(e,O?.currency)},[O?.items,S]),fe=o(()=>pe?xe+ue:xe,[pe,xe,ue]),ye=o(()=>ne&&ne>0?`Add products worth more than ${G}${oe}`:"",[ne,G,oe]),be=o(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),he=tn(be,O?.currency??"INR");n(()=>{re.current&&pn(re.current),ie.current&&pn(ie.current),le.current&&pn(le.current)},[i,me,S,he,X,ue]);const ve=o(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),we=o(()=>{const e=[];for(const t in ve)if(Object.prototype.hasOwnProperty.call(ve,t)){const n=ve[t],o=tn(n,O?.currency??"INR"),r=xn(t);e.push({title:r,amount:o})}return e},[ve,O?.currency]),Ee=o(()=>{let e=0;return e+=S?me+he:me,pe&&(e+=ue),e},[me,he,S,pe,ue]),ke=async e=>{if(Y(!0),ge<=0)Y(!1);else{if(y){if("standard"!==Q&&(h?!V:!W.isPostalCodeValid))return void Y(!1);if(b)try{"standard"===Q?await b(Q):await b(Q,String(H)||"",q&&h?new Date(q).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}g&&m&&""!==M&&""!==L&&await m(L,M),f&&x&&""!==j&&await x(j),await l(e),Y(!1)}},[Te,Se]=t(!1);n(()=>{Se(ge<=0||(!!z||!!y&&("standard"!==Q&&(h?!V:!W.isPostalCodeValid))))},[W,Q,y,h,V,q,z,ge]);const[$e,Ne]=t(!1),Be=r(null),[Ie,ze]=t("0px");n(()=>{Be.current&&ze($e?`${Be.current.scrollHeight}px`:"0px")},[$e,we,pe]);const Fe=()=>{Ne(!$e)};n(()=>{function e(e){J.current&&!J.current.contains(e.target)&&ce()}return"open"!==X&&"opening"!==X||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[X]);const De=(t,n="Checkout")=>t?e.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},n),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(et,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==n&&e.createElement(Ce,{fontSize:"20px"}),e.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},n));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},!!E&&E.length>0&&!mn()&&(()=>{const t=k||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:N,marginBottom:A?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content",padding:"0 55px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===t?e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:te}),e.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:N,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:te}),e.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:te}),e.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:N,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:te}),e.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===s||"true"===s)&&"closed"!==X&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-checkout-popout-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===X?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ce}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:J,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===X?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},e.createElement("div",{className:"yt-cart-checkout-popout-header",style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},e.createElement("span",null,"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:ce,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),e.createElement("div",{className:"yt-cart-checkout-popout-content",style:{backgroundColor:"white",padding:"10px 1rem 0"}},e.createElement(e.Fragment,null,(S&&he>0||c&&we.length>0||pe&&ue>0)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},G,un(pe?I?fe.toFixed(2):fe.toFixed(0):I?xe.toFixed(2):xe.toFixed(0)))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?t.amount.toFixed(2):t.amount.toFixed(0))))),Ee>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",null,"Total Savings"),e.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",G,un(I?Ee.toFixed(2):Ee.toFixed(0))))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:me>0||S&&he>0||pe&&ue>0?"10px":"0"}},e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},G,un(I?ge.toFixed(2):ge.toFixed(0)))),e.createElement("div",{style:{display:"flex",background:$,color:N,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},e.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",null,G,un(I?Ee.toFixed(2):Ee.toFixed(0)))," ","on your order")),e.createElement("button",{ref:ie,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},De(U)))),(!0===s||"true"===s)&&z&&Te&&ye&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),!0===s||"true"===s?e.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${F}px 8px`}},e.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:le,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",G,un(I?Ee.toFixed(2):Ee.toFixed(0))),U?e.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):c||pe&&de?e.createElement("div",null,e.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},G,un(I?ge.toFixed(2):ge.toFixed(0))),(me>0||he>0||pe&&ue>0)&&e.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},G,un(pe?fe.toFixed(0):xe.toFixed(0))))):e.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},G,un(I?ge.toFixed(2):ge.toFixed(0))),S&&he>0||c&&me>0||pe&&ue>0?e.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Z("opening"),requestAnimationFrame(()=>{Z("open")}),ee(!K)}},"See Details"):e.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(et,{fontSize:"24px"}))):"CHECKOUT"))),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}}))):e.createElement(e.Fragment,null,z&&Te&&ye&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:A?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:A?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:P}},(he>0||c&&we.length>0||pe&&ue>0)&&Ee>0&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},G,un(pe?I?fe.toFixed(2):fe.toFixed(0):I?xe.toFixed(2):xe.toFixed(0)))),(me>0||he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-discounts-section",style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{className:"yt-cart-discounts-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-discounts-label",style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",e.createElement("button",{onClick:Fe,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},$e?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",G,un(I?Ee.toFixed(2):Ee.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Be,style:{height:Ie,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:$e?1:0,marginTop:$e?"5px":"0",borderTop:$e?"1px solid #E5E7EB":"none",paddingTop:$e?"5px":"0",fontWeight:"600"}},S&&he>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{className:"yt-cart-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-total-label",style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{className:"yt-cart-total-value",style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},G,un(I?ge.toFixed(2):ge.toFixed(0))))),e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==X||v?"0":`4px 1rem ${F}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:u??"white",textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"closed"!==X?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},De(U,D?"Checkout":"Proceed to Checkout")),_&&!A&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}})))))}const Lo=c.button`
|
|
1009
1009
|
background-color: ${e=>e.$ctaButtonBackgroundColor||"#BEB8EC"};
|
|
1010
1010
|
color: ${e=>e.$ctaButtonTextColor||"black"};
|
|
1011
1011
|
font-size: 11px;
|
|
@@ -1038,7 +1038,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1038
1038
|
`,Vo=c(Mo)`
|
|
1039
1039
|
font-size: 10px;
|
|
1040
1040
|
color: ${e=>e.color||"#868E96"};
|
|
1041
|
-
`,Wo=({cartSigninCTAMainText:t,signinCTAButtonVisible:n=!0,guestLoyaltyPercentage:o,joinNowFunction:r,themeColor:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:d,cartComponentsCornerType:s,cartComponentsCornerRadius:p,showCartLevelAltPay:u})=>e.createElement("div",{className:"yt-cart-guest-loyalty-container",style:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"10px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:u?"0px":"10px",borderBottomRightRadius:u?"0px":"10px",margin:"10px 1rem 6px",border:"1px solid #E8EBED",background:"#00000005"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}},e.createElement(jo,{className:"yt-cart-guest-loyalty-text",color:c},t??"Sign-in to avail Reward Points"),e.createElement(Vo,{className:"yt-cart-guest-loyalty-text",color:d},"Get"," ",e.createElement("span",{style:{fontWeight:"bold"}},"upto ",o,"% Off")," ","on all orders")),e.createElement(Lo,{className:"yt-cart-guest-loyalty-signin-button",$ctaButtonBackgroundColor:a,$ctaButtonTextColor:l,$cartComponentsCornerType:s,$cartComponentsCornerRadius:p,onClick:r},"Sign in Now"));class Ho extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("FooterSections error:",e,t)}render(){return this.state.hasError?e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",textDecorationLine:"underline",color:"blue",cursor:"pointer"},onClick:()=>window.location.reload()},"Something went wrong. Click here to reload the page"):this.props.children}}const qo=({children:o})=>{const[r,i]=t("0px");return n(()=>{const e=navigator.userAgent.toLowerCase(),t=e.indexOf("brave")>-1,n=/iphone|ipad|ipod/.test(e)&&!window.MSStream,o=e.includes("safari")&&!e.includes("chrome"),r=/android/.test(e);t?i("56px"):n?i(o?"44px":"34px"):r&&i("24px")},[]),e.createElement(Ho,null,e.createElement("div",{className:"yt-cart-footer-container",style:{display:"flex",flexDirection:"column",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"white",zIndex:999,width:"100%",boxShadow:"rgb(135 135 135 / 45%) 0px -2px 0px 0px",borderRadius:"17px 17px 0px 0px",gap:"10px"}},o))},Qo=()=>{const[o,r]=t(0);return n(()=>{const e=setTimeout(()=>{r(100)},1e3);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"yt-loyalty-cta-progress-bar-container"},e.createElement("div",{className:"yt-loyalty-cta-progress-bar",style:{width:`${o}%`}},""))},Uo=({removeDiscount:n,isDev:o,themeColor:r,ctaButtonBackgroundColor:i,ctaButtonTextColor:a,primaryTextColor:l,secondaryTextColor:c,loyaltyDiscount:d,pointsToBeUsed:s,brandTokenName:p,showCartLevelAltPay:u})=>{const m=ae(Ut),{cartLoading:g,setLoading:x}=Kt(),[f,y]=t(!1),b=g.showLoyaltyCtaLoading,h=tn(d?.total_allocated_amount??0,m?.currency);return b?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(rt,{color:"black",loading:b,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{className:"yt-loyalty-cta-applied-container",style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",borderRadius:"10px",padding:"12px 16px",margin:"10px 1rem",boxShadow:"0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549)",zIndex:100}},e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:r})),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"13px",fontWeight:"bold",color:l??"#000"}},on(m,m?.currency),Number(h?.toFixed(1))??0," Off Coupon Applied!"),e.createElement("span",{className:"yt-loyalty-cta-applied-code-text",style:{fontSize:"9px",color:r??"#EF4444"}},"Code: ",function(e){try{const t=e+"=",n=(()=>{try{return decodeURIComponent(document.cookie)}catch(e){return console.warn("Cookie decode failed, using raw cookie string"),document.cookie}})().split(";");for(let o=0;o<n.length;o++){let r=n[o].trim();if(0===r.indexOf(t)){const n=r.substring(t.length);try{return decodeURIComponent(n)}catch(t){return console.warn(`Failed to decode cookie value for ${e}`),n}}}return""}catch(t){return console.error(`Cookie parsing error for ${e}:`,t),""}}("discount_code")))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",cursor:"pointer"},onClick:async()=>{x&&x(!0,!1,!1,!0);try{await n()}catch(e){}x&&x(!1,!1,!1,!1)},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}," ",f?e.createElement(me,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}):e.createElement(ge,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}),e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"8px",color:c??"#6B7280",fontWeight:"600"}},"REMOVE")))},Yo=c.span`
|
|
1041
|
+
`,Wo=({cartSigninCTAMainText:t,signinCTAButtonVisible:n=!0,guestLoyaltyPercentage:o,joinNowFunction:r,themeColor:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:s,cartComponentsCornerType:d,cartComponentsCornerRadius:p,showCartLevelAltPay:u})=>e.createElement("div",{className:"yt-cart-guest-loyalty-container",style:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"10px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:u?"0px":"10px",borderBottomRightRadius:u?"0px":"10px",margin:"10px 1rem 6px",border:"1px solid #E8EBED",background:"#00000005"}},e.createElement("div",{className:"yt-cart-guest-loyalty-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}},e.createElement(jo,{className:"yt-cart-guest-loyalty-text",color:c},t??"Sign-in to avail Reward Points"),e.createElement(Vo,{className:"yt-cart-guest-loyalty-text",color:s},"Get"," ",e.createElement("span",{style:{fontWeight:"bold"}},"upto ",o,"% Off")," ","on all orders")),e.createElement(Lo,{className:"yt-cart-guest-loyalty-signin-button",$ctaButtonBackgroundColor:a,$ctaButtonTextColor:l,$cartComponentsCornerType:d,$cartComponentsCornerRadius:p,onClick:r},"Sign in Now"));class Ho extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("FooterSections error:",e,t)}render(){return this.state.hasError?e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",textDecorationLine:"underline",color:"blue",cursor:"pointer"},onClick:()=>window.location.reload()},"Something went wrong. Click here to reload the page"):this.props.children}}const qo=({children:o})=>{const[r,i]=t("0px");return n(()=>{const e=navigator.userAgent.toLowerCase(),t=e.indexOf("brave")>-1,n=/iphone|ipad|ipod/.test(e)&&!window.MSStream,o=e.includes("safari")&&!e.includes("chrome"),r=/android/.test(e);t?i("56px"):n?i(o?"44px":"34px"):r&&i("24px")},[]),e.createElement(Ho,null,e.createElement("div",{className:"yt-cart-footer-container",style:{display:"flex",flexDirection:"column",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"white",zIndex:999,width:"100%",boxShadow:"rgb(135 135 135 / 45%) 0px -2px 0px 0px",borderRadius:"17px 17px 0px 0px",gap:"10px"}},o))},Qo=()=>{const[o,r]=t(0);return n(()=>{const e=setTimeout(()=>{r(100)},1e3);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"yt-loyalty-cta-progress-bar-container"},e.createElement("div",{className:"yt-loyalty-cta-progress-bar",style:{width:`${o}%`}},""))},Uo=({removeDiscount:n,isDev:o,themeColor:r,ctaButtonBackgroundColor:i,ctaButtonTextColor:a,primaryTextColor:l,secondaryTextColor:c,loyaltyDiscount:s,pointsToBeUsed:d,brandTokenName:p,showCartLevelAltPay:u})=>{const m=ae(Ut),{cartLoading:g,setLoading:x}=Kt(),[f,y]=t(!1),b=g.showLoyaltyCtaLoading,h=tn(s?.total_allocated_amount??0,m?.currency);return b?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(rt,{color:"black",loading:b,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{className:"yt-loyalty-cta-applied-container",style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",borderRadius:"10px",padding:"12px 16px",margin:"10px 1rem",boxShadow:"0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549)",zIndex:100}},e.createElement("div",{className:"yt-cart-loyalty-applied-content",style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:r})),e.createElement("div",{className:"yt-cart-loyalty-applied-details",style:{display:"flex",flexDirection:"column",gap:"4px"}},e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"13px",fontWeight:"bold",color:l??"#000"}},on(m,m?.currency),Number(h?.toFixed(1))??0," Off Coupon Applied!"),e.createElement("span",{className:"yt-loyalty-cta-applied-code-text",style:{fontSize:"9px",color:r??"#EF4444"}},"Code: ",function(e){try{const t=e+"=",n=(()=>{try{return decodeURIComponent(document.cookie)}catch(e){return console.warn("Cookie decode failed, using raw cookie string"),document.cookie}})().split(";");for(let o=0;o<n.length;o++){let r=n[o].trim();if(0===r.indexOf(t)){const n=r.substring(t.length);try{return decodeURIComponent(n)}catch(t){return console.warn(`Failed to decode cookie value for ${e}`),n}}}return""}catch(t){return console.error(`Cookie parsing error for ${e}:`,t),""}}("discount_code")))),e.createElement("div",{className:"yt-cart-loyalty-applied-remove",style:{display:"flex",alignItems:"center",gap:"4px",cursor:"pointer"},onClick:async()=>{x&&x(!0,!1,!1,!0);try{await n()}catch(e){}x&&x(!1,!1,!1,!1)},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}," ",f?e.createElement(me,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}):e.createElement(ge,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}),e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"8px",color:c??"#6B7280",fontWeight:"600"}},"REMOVE")))},Yo=c.span`
|
|
1042
1042
|
display: flex !important;
|
|
1043
1043
|
flex-direction: row;
|
|
1044
1044
|
align-items: center;
|
|
@@ -1072,7 +1072,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1072
1072
|
width: 14px;
|
|
1073
1073
|
height: 14px;
|
|
1074
1074
|
}
|
|
1075
|
-
`,Zo=({discountAmountOff:t,loyaltyIcon:n,pointsToBeUsed:o,applyDiscount:r,themeColor:i,ctaButtonTextColor:a,ctaButtonBackgroundColor:l,primaryTextColor:c,secondaryTextColor:
|
|
1075
|
+
`,Zo=({discountAmountOff:t,loyaltyIcon:n,pointsToBeUsed:o,applyDiscount:r,themeColor:i,ctaButtonTextColor:a,ctaButtonBackgroundColor:l,primaryTextColor:c,secondaryTextColor:s,minimumOrderValueToAvailDiscount:d=0,brandTokenName:p,showCartLevelAltPay:u,redemptionMultiplier:m})=>{const g=ae(Ut),{cartLoading:x,setLoading:f}=Kt(),y=0===o||o<0,b="number"==typeof m&&m>0?o*m:o,h=tn(g?.items_subtotal_price,g?.currency);return x.showLoyaltyCtaLoading?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(rt,{color:"black",loading:x?.showLoyaltyCtaLoading,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",margin:"10px 1rem",zIndex:100},className:"yt-loyalty-cta-container"},e.createElement("div",{className:"yt-cart-loyalty-apply-content",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"10px"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:i})),e.createElement("div",{className:"yt-cart-loyalty-apply-details",style:{display:"flex",flexDirection:"column"}},e.createElement(Yo,{className:"yt-loyalty-cta-text",$primaryTextColor:c},0===o?"Insufficient Balance":e.createElement(e.Fragment,null,"Apply "," ",e.createElement("img",{src:n,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}),t<0?0:Number(b.toFixed(2))," ",p??"points"," ")),e.createElement("span",{className:"yt-loyalty-cta-info-text",style:{color:i??"#50D1AA",fontSize:"11px"}},0===o?"Place order to earn coins":e.createElement(e.Fragment,null,"Auto Applied on checkout")))),e.createElement(Go,{$insufficientPoints:y,$opacity:h<d?.2:1,onClick:async()=>{if(!(y||h<d)){f&&f(!0,!1,!1,!0);try{await r()}catch(e){}f&&f(!1,!1,!1,!1)}}},e.createElement(Xo,{className:"yt-loyalty-cta-radio-button",$insufficientPoints:y,$opacity:h<d?.2:1})))},Jo=({value:t,handleItemQuantityDecrement:n,handleItemQuantityIncrement:o,isDev:r,themeColor:i,cartComponentsCornerType:a,cartComponentsCornerRadius:l,backgroundSubdued:c})=>e.createElement("form",{className:"yt-cart-quantity-selector-form",style:{marginBottom:"0px",width:"auto",height:"auto"}},e.createElement("div",{className:"yt-cart-quantity-selector",style:{border:"1px solid #dddddd",display:"flex",flexDirection:"row",borderRadius:"rounded"===a?`${l}px`:"8px",overflow:"hidden"}},e.createElement("button",{className:"yt-cart-quantity-decrement qty-selector-decrement-button",onClick:()=>0!==t&&n(),type:"button",style:{backgroundColor:c??cn(i,.1)}},"-"),e.createElement("input",{readOnly:!0,type:"text","aria-describedby":"helper-text-explanation",className:"yt-cart-quantity-input qty-selector-input",style:{textIndent:0,border:0,margin:0,width:"28px",minHeight:"22px !important",fontSize:"14px",padding:0,height:"auto",textAlign:"center",color:"black !important",background:"#ffffff !important"},value:t,required:!0}),e.createElement("button",{onClick:()=>o(),type:"button",id:"increment-button",className:"yt-cart-quantity-increment qty-selector-decrement-button",style:{backgroundColor:c??cn(i,.1)}},"+"))),Ko=re(void 0),er="yt_variant_options",tr="yt-variant-options-updated",nr=e=>e?e.trim().toLowerCase().replace(/[^a-z0-9#]+/g,""):"",or=()=>{if("undefined"==typeof window)return null;let e=null;try{e=window.localStorage.getItem(er)}catch{return null}return(e=>{if(!e)return null;try{const t=JSON.parse(e);if(Array.isArray(t))return{options:t};if(t&&Array.isArray(t.options))return{options:t.options}}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}return null})(e)},rr=(e,t)=>{if(!e||!t)return;const n=nr(t),o=(e=>{if(!e)return null;const t=e.match(/#([0-9a-f]{3,8})/i);return t?`#${t[1]}`.toLowerCase():null})(t);return e.values.find(e=>{const t=nr(e.name);if(n&&t&&t===n)return!0;if(o&&"string"==typeof e.value){if(e.value.trim().toLowerCase()===o)return!0}return!1})},ir=()=>{const[e,o]=t(null);return n(()=>{const e=()=>{const e=or();o(e)};e();const t=(e=>{if("undefined"==typeof window)return()=>{};const t=t=>{t.key&&t.key!==er||e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener(tr,n),()=>{window.removeEventListener("storage",t),window.removeEventListener(tr,n)}})(e);return()=>{t()}},[]),e},ar=c.div`
|
|
1076
1076
|
display: flex;
|
|
1077
1077
|
flex-wrap: wrap;
|
|
1078
1078
|
align-items: center;
|
|
@@ -1089,7 +1089,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1089
1089
|
border-radius: 50%;
|
|
1090
1090
|
object-fit: cover;
|
|
1091
1091
|
border: 1px solid #eee;
|
|
1092
|
-
`,
|
|
1092
|
+
`,sr="480px",dr="768px",pr=c.a`
|
|
1093
1093
|
font-size: 14px;
|
|
1094
1094
|
font-weight: 500;
|
|
1095
1095
|
line-height: 1.4;
|
|
@@ -1118,7 +1118,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1118
1118
|
color: ${e=>e.$themeColor??"#6fd9b9"} !important;
|
|
1119
1119
|
}
|
|
1120
1120
|
|
|
1121
|
-
// @media (max-width: ${
|
|
1121
|
+
// @media (max-width: ${sr}) {
|
|
1122
1122
|
// font-size: 12px;
|
|
1123
1123
|
// }
|
|
1124
1124
|
`,ur=c.div`
|
|
@@ -1142,12 +1142,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1142
1142
|
// );
|
|
1143
1143
|
// }
|
|
1144
1144
|
|
|
1145
|
-
@media (max-width: ${
|
|
1145
|
+
@media (max-width: ${dr}) {
|
|
1146
1146
|
padding: ${e=>e.$hasVariantInfo?"6px 0":"4px 0"};
|
|
1147
1147
|
gap: 12px;
|
|
1148
1148
|
}
|
|
1149
1149
|
|
|
1150
|
-
@media (max-width: ${
|
|
1150
|
+
@media (max-width: ${sr}) {
|
|
1151
1151
|
padding: ${e=>e.$hasVariantInfo?"6px 0":"4px 0"};
|
|
1152
1152
|
gap: 12px;
|
|
1153
1153
|
}
|
|
@@ -1161,7 +1161,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1161
1161
|
position: ${e=>e.$isBundle?"relative":"static"};
|
|
1162
1162
|
z-index: ${e=>e.$isBundle?3:"auto"};
|
|
1163
1163
|
|
|
1164
|
-
@media (max-width: ${
|
|
1164
|
+
@media (max-width: ${sr}) {
|
|
1165
1165
|
width: 65px;
|
|
1166
1166
|
aspect-ratio: ${e=>"portrait"===e.$imageAspectSelector?"5/6":"1"};
|
|
1167
1167
|
}
|
|
@@ -1323,7 +1323,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1323
1323
|
max-width: 140px;
|
|
1324
1324
|
overflow: hidden;
|
|
1325
1325
|
|
|
1326
|
-
@media (max-width: ${
|
|
1326
|
+
@media (max-width: ${sr}) {
|
|
1327
1327
|
max-width: 110px;
|
|
1328
1328
|
}
|
|
1329
1329
|
`,Tr=c.span`
|
|
@@ -1333,7 +1333,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1333
1333
|
color: ${e=>e.$tertiaryTextColor??"#000"};
|
|
1334
1334
|
overflow: hidden;
|
|
1335
1335
|
text-overflow: ellipsis;
|
|
1336
|
-
@media (max-width: ${
|
|
1336
|
+
@media (max-width: ${sr}) {
|
|
1337
1337
|
font-size: 9px;
|
|
1338
1338
|
}
|
|
1339
1339
|
`,Sr=c.span`
|
|
@@ -1361,7 +1361,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1361
1361
|
padding: 2px 0px 4px 0px;
|
|
1362
1362
|
border-bottom-left-radius: 8px;
|
|
1363
1363
|
border-bottom-right-radius: 8px;
|
|
1364
|
-
`,Br=({imageUrl:t,overlayText:n,themeColor:o,themeTextColor:r})=>e.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},e.createElement("img",{src:t,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),e.createElement($r,{$themeColor:o,$themeTextColor:r},n)),Ir=({product:o,handleDecrement:i,handleIncrement:a,removeCartItem:l,addCartItem:c,isDev:d,themeColor:s,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:g,showQtySelector:x=!0,themeTextColor:f,showEditOptionOnProducts:y,percentageOff:b,removeFreebieFromCart:h,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k,backgroundColor:T,showDiscountOnMRP:S,freeLabelText:$})=>{const{setLoading:B}=Kt(),I=ae(Ut),[z,F]=ie(Ko),[N,D]=t(!1),P=le(en),A=ir(),_=!!o.properties?._isYtFreebie,L=!!o.properties?._isStealDeal,M=_&&"number"==typeof o.final_line_price&&o.final_line_price>0&&"number"==typeof o.original_line_price&&o.original_line_price>o.final_line_price;n(()=>{function e(){const e=window.innerWidth;D(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const j=r(null),[V,W]=t(0);n(()=>{let e=null;return j.current&&(e=new ResizeObserver(e=>{e[0]&&W(e[0].contentRect.width)}),e.observe(j.current)),()=>{e&&e.disconnect()}},[]),n(()=>{const e=setTimeout(()=>{j.current&&W(j.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const H=an(o.product_title,V<200?100:120,V,"","16px"),q=()=>{if(o.line_level_discount_allocations&&o.line_level_discount_allocations.length>0&&o.line_level_discount_allocations[0].discount_application){const e=o.line_level_discount_allocations[0].discount_application.title,t=xn(e);switch(o.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${t})`;case"percentage":case"fixed_amount":return t;default:return""}}};let Q=on(I,I?.currency);const U=["__Added with Frequently Bought Together button","_has_gpo","_y"],Y=o?.options_with_values&&o.options_with_values.filter(e=>"Title"!==e.name).length>0||o?.properties&&Object.keys(o.properties).filter(e=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||y,G=V?70/V*100:100,X=q(),Z=X&&(X.length>25||!N)?an(X,G,V,"","10px"):X,J=(()=>{const e=o?.properties?._bundleImage;if(!e||"string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0})(),K=!!J,ne=(()=>{const e=o?.properties?.itemsInBundle;return"string"!=typeof e?[]:e.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),oe=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}let t=0;for(const e of ne){const n=e.match(/^(\d+)\s*x\s*/i);t+=n?parseInt(n[1],10)||0:1}return t})(),re=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.price);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}return Number(o?.original_line_price)||0})(),[ce,de]=t(!0),se=N?"250px":"190px";return e.createElement(ur,{$hasVariantInfo:Y||K,$backgroundColor:T,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},e.createElement(gr,{$isBundle:K},e.createElement(mr,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:K},x?e.createElement("img",{style:{height:"100%",width:"100%",opacity:0===o.quantity?.5:1},src:gn(J??o.image,200,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(o),loading:"lazy"}):e.createElement(Br,{imageUrl:gn(J??o.image??o?.featuredImage?.url??"/placeholder.svg",200,85,"webp"),overlayText:L?"Steal Deal":M||b?"Special Offer":"Free Gift",themeColor:s,themeTextColor:f})),(x||o?.quantity>1)&&e.createElement(xr,null,o.quantity)),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},e.createElement(pr,{$themeColor:s,$primaryTextColor:p,href:`${window.location.origin}${o.url}`,ref:j},H),e.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(x||v)&&e.createElement(br,{onClick:x?async()=>{B&&B(!0,!0);try{l&&await l(o.key)}catch(e){}B&&B(!1,!1)}:async()=>{B&&B(!0,!0);try{h&&await h(o.key)}catch(e){}B&&B(!1,!1)}},e.createElement(fr,null,e.createElement(ee,{className:"outline"}),e.createElement(te,{className:"filled"})))))),K?e.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement("div",{role:"button",onClick:()=>de(!ce),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},e.createElement("span",null,`Contain ${oe} Items`),ce?e.createElement(R,null):e.createElement(O,null)),ce&&ne.length>0&&e.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:se,width:"fit-content"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:se}},ne.map((t,n)=>e.createElement("div",{key:`${t}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:se},title:t},t))))):Y&&e.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement(ar,null,o?.options_with_values?.filter(e=>"Title"!==e.name).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=rr(n,t.value);return"color"===n?.type?.toLowerCase()&&o?e.createElement(lr,{key:t.name,$colorValue:o.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&o?e.createElement(cr,{key:t.name,src:gn(o.value,36,85,"webp"),alt:t.value}):t.value.length>15||t.value.includes("#")?null:e.createElement(yr,{className:"yt-cart-variant-text",key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},t.value)}),o?.properties&&Object.entries(o.properties).filter(([e])=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([t,n])=>{const o=String(n);return o.includes("#")||(A?.options??[]).some(e=>e.name.trim().toLowerCase()===t.trim().toLowerCase()&&e.values.some(e=>e.name.trim().toLowerCase()===o.trim().toLowerCase()))?null:e.createElement(yr,{key:t,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},o)}),y&&!o?.product_has_only_default_variant&&e.createElement(br,{onClick:()=>{const e=!!o.properties?._isYtFreebie;let t;if(e){const e=o.properties?._yt_allowed_variants;if(e&&"string"==typeof e)try{t=JSON.parse(e)}catch(n){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${o.key}:`,e,n),t=[String(o.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${o.key}. Defaulting to current variant.`),t=[String(o.variant_id)]}P({open:!0,variantId:String(o.variant_id),quantity:o.quantity,handle:o.handle,lineItemKey:o.key,freebieSelection:e,productId:String(o.product_id),allowedVariantIds:t})},style:{display:"flex",alignItems:"center"}},e.createElement(Ie,null))),o?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());if(rr(n,t.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(t.value.includes("#"))return null;const o=N?t.value:an(t.value,V?120/V*100:100,V,"","10px");return e.createElement(yr,{key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},o)})),e.createElement(hr,null,e.createElement("div",{style:{display:"flex",flexDirection:N?"row":"column",alignItems:N?"center":"flex-start",gap:N?"0px":"4px"}},e.createElement(vr,null,K?e.createElement(e.Fragment,null,e.createElement(wr,{$primaryTextColor:p},Q,un(tn(o.final_line_price,I?.currency))),re>0&&e.createElement(Cr,null,Q,un(re))):e.createElement(wr,{$primaryTextColor:p},0===tn(o.final_line_price,I?.currency)?e.createElement(Sr,{$primaryColor:p,$themeColor:s,$backgroundSubdued:k},$||"FREE"):e.createElement(e.Fragment,null,Q,un(tn(o.final_line_price,I?.currency)))),!K&&(o.compare_at_price&&Number(o.compare_at_price)*o.quantity>Number(o.final_line_price)||!o.compare_at_price&&q()&&o.original_line_price)&&S&&e.createElement(Cr,null,Q,o.compare_at_price?un(tn(Number(o.compare_at_price)*o.quantity,I?.currency)):un(tn(o.original_line_price,I?.currency))),N&&(x||M)&&q()&&e.createElement(kr,{$tertiaryColor:m},e.createElement(Ee,{size:14,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),!N&&(x||M)&&q()&&e.createElement(kr,{$tertiaryColor:m},e.createElement(Ee,{size:12,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),e.createElement(Er,null,x?e.createElement(Jo,{handleItemQuantityDecrement:async()=>{B&&B(!0,!0);try{i&&await i(o.key,o.quantity-1)}catch(e){}B&&B(!1,!1)},handleItemQuantityIncrement:async()=>{B&&B(!0,!0);try{if(a){-1===await a(o.id,o.quantity+1,o.properties)&&(F(o?.key),setTimeout(()=>F(void 0),3e3))}}catch(e){}B&&B(!1,!1)},value:o.quantity,isDev:d,themeColor:s,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k}):!L||M||b?e.createElement("span",{className:"yt-cart-line-item-freebie-badge",style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:g??"#000",borderRadius:"4px"}},M&&o.original_line_price?`${((o.original_line_price-o.final_line_price)/o.original_line_price*100).toFixed(0)}% off`:b&&o?.properties?._isYtFreebie?`${b}% Off`:"Freebie"):null)),z&&z===o?.key&&e.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))},zr=c.div`
|
|
1364
|
+
`,Nr=({imageUrl:t,overlayText:n,themeColor:o,themeTextColor:r})=>e.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},e.createElement("img",{src:t,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),e.createElement($r,{$themeColor:o,$themeTextColor:r},n)),Br=({product:o,handleDecrement:i,handleIncrement:a,removeCartItem:l,addCartItem:c,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:g,showQtySelector:x=!0,themeTextColor:f,showEditOptionOnProducts:y,percentageOff:b,removeFreebieFromCart:h,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k,backgroundColor:T,showDiscountOnMRP:S,freeLabelText:$})=>{const{setLoading:N}=Kt(),B=ae(Ut),[I,z]=ie(Ko),[F,D]=t(!1),P=le(en),A=ir(),_=!!o.properties?._isYtFreebie,L=!!o.properties?._isStealDeal,M=_&&"number"==typeof o.final_line_price&&o.final_line_price>0&&"number"==typeof o.original_line_price&&o.original_line_price>o.final_line_price;n(()=>{function e(){const e=window.innerWidth;D(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const j=r(null),[V,W]=t(0);n(()=>{let e=null;return j.current&&(e=new ResizeObserver(e=>{e[0]&&W(e[0].contentRect.width)}),e.observe(j.current)),()=>{e&&e.disconnect()}},[]),n(()=>{const e=setTimeout(()=>{j.current&&W(j.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const H=an(o.product_title,V<200?100:120,V,"","16px"),q=()=>{if(o.line_level_discount_allocations&&o.line_level_discount_allocations.length>0&&o.line_level_discount_allocations[0].discount_application){const e=o.line_level_discount_allocations[0].discount_application.title,t=xn(e);switch(o.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${t})`;case"percentage":case"fixed_amount":return t;default:return""}}};let Q=on(B,B?.currency);const U=["__Added with Frequently Bought Together button","_has_gpo","_y"],Y=o?.options_with_values&&o.options_with_values.filter(e=>"Title"!==e.name).length>0||o?.properties&&Object.keys(o.properties).filter(e=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||y,G=V?70/V*100:100,X=q(),Z=X&&(X.length>25||!F)?an(X,G,V,"","10px"):X,J=(()=>{const e=o?.properties?._bundleImage;if(!e||"string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0})(),K=!!J,ne=(()=>{const e=o?.properties?.itemsInBundle;return"string"!=typeof e?[]:e.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),oe=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}let t=0;for(const e of ne){const n=e.match(/^(\d+)\s*x\s*/i);t+=n?parseInt(n[1],10)||0:1}return t})(),re=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.price);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}return Number(o?.original_line_price)||0})(),[ce,se]=t(!0),de=F?"250px":"190px";return e.createElement(ur,{className:"yt-cart-product-card",$hasVariantInfo:Y||K,$backgroundColor:T,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},e.createElement(gr,{className:"yt-cart-product-image-wrapper",$isBundle:K},e.createElement(mr,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:K},x?e.createElement("img",{style:{height:"100%",width:"100%",opacity:0===o.quantity?.5:1},src:gn(J??o.image,200,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(o),loading:"lazy"}):e.createElement(Nr,{imageUrl:gn(J??o.image??o?.featuredImage?.url??"/placeholder.svg",200,85,"webp"),overlayText:L?"Steal Deal":M||b?"Special Offer":"Free Gift",themeColor:d,themeTextColor:f})),(x||o?.quantity>1)&&e.createElement(xr,{className:"yt-cart-product-quantity-badge"},o.quantity)),e.createElement("div",{className:"yt-cart-product-details",style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},e.createElement("div",{className:"yt-cart-product-header",style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},e.createElement(pr,{className:"yt-cart-product-title",$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${o.url}`,ref:j},H),e.createElement("div",{className:"yt-cart-product-actions",style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(x||v)&&e.createElement(br,{onClick:x?async()=>{N&&N(!0,!0);try{l&&await l(o.key)}catch(e){}N&&N(!1,!1)}:async()=>{N&&N(!0,!0);try{h&&await h(o.key)}catch(e){}N&&N(!1,!1)}},e.createElement(fr,null,e.createElement(ee,{className:"outline"}),e.createElement(te,{className:"filled"})))))),K?e.createElement("div",{className:"yt-cart-product-bundle-info",style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement("div",{className:"yt-cart-product-bundle-toggle",role:"button",onClick:()=>se(!ce),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},e.createElement("span",null,`Contain ${oe} Items`),ce?e.createElement(R,null):e.createElement(O,null)),ce&&ne.length>0&&e.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:de,width:"fit-content"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:de}},ne.map((t,n)=>e.createElement("div",{key:`${t}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:de},title:t},t))))):Y&&e.createElement("div",{className:"yt-cart-product-variant-info",style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement(ar,{className:"yt-cart-product-variant-container"},o?.options_with_values?.filter(e=>"Title"!==e.name).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=rr(n,t.value);return"color"===n?.type?.toLowerCase()&&o?e.createElement(lr,{key:t.name,$colorValue:o.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&o?e.createElement(cr,{key:t.name,src:gn(o.value,36,85,"webp"),alt:t.value}):t.value.length>15||t.value.includes("#")?null:e.createElement(yr,{className:"yt-cart-variant-text",key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},t.value)}),o?.properties&&Object.entries(o.properties).filter(([e])=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([t,n])=>{const o=String(n);return o.includes("#")||(A?.options??[]).some(e=>e.name.trim().toLowerCase()===t.trim().toLowerCase()&&e.values.some(e=>e.name.trim().toLowerCase()===o.trim().toLowerCase()))?null:e.createElement(yr,{key:t,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},o)}),y&&!o?.product_has_only_default_variant&&e.createElement(br,{onClick:()=>{const e=!!o.properties?._isYtFreebie;let t;if(e){const e=o.properties?._yt_allowed_variants;if(e&&"string"==typeof e)try{t=JSON.parse(e)}catch(n){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${o.key}:`,e,n),t=[String(o.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${o.key}. Defaulting to current variant.`),t=[String(o.variant_id)]}P({open:!0,variantId:String(o.variant_id),quantity:o.quantity,handle:o.handle,lineItemKey:o.key,freebieSelection:e,productId:String(o.product_id),allowedVariantIds:t})},style:{display:"flex",alignItems:"center"}},e.createElement(Be,null))),o?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());if(rr(n,t.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(t.value.includes("#"))return null;const o=F?t.value:an(t.value,V?120/V*100:100,V,"","10px");return e.createElement(yr,{key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},o)})),e.createElement(hr,{className:"yt-cart-product-bottom-row"},e.createElement("div",{className:"yt-cart-product-pricing-row",style:{display:"flex",flexDirection:F?"row":"column",alignItems:F?"center":"flex-start",gap:F?"0px":"4px"}},e.createElement(vr,{className:"yt-cart-product-price-container"},K?e.createElement(e.Fragment,null,e.createElement(wr,{$primaryTextColor:p},Q,un(tn(o.final_line_price,B?.currency))),re>0&&e.createElement(Cr,null,Q,un(re))):e.createElement(wr,{$primaryTextColor:p},0===tn(o.final_line_price,B?.currency)?e.createElement(Sr,{$primaryColor:p,$themeColor:d,$backgroundSubdued:k},$||"FREE"):e.createElement(e.Fragment,null,Q,un(tn(o.final_line_price,B?.currency)))),!K&&(o.compare_at_price&&Number(o.compare_at_price)*o.quantity>Number(o.final_line_price)||!o.compare_at_price&&q()&&o.original_line_price)&&S&&e.createElement(Cr,null,Q,o.compare_at_price?un(tn(Number(o.compare_at_price)*o.quantity,B?.currency)):un(tn(o.original_line_price,B?.currency))),F&&(x||M)&&q()&&e.createElement(kr,{className:"yt-cart-product-discount",$tertiaryColor:m},e.createElement(Ee,{size:14,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),!F&&(x||M)&&q()&&e.createElement(kr,{className:"yt-cart-product-discount",$tertiaryColor:m},e.createElement(Ee,{size:12,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),e.createElement(Er,{className:"yt-cart-product-quantity-controls"},x?e.createElement(Jo,{handleItemQuantityDecrement:async()=>{N&&N(!0,!0);try{i&&await i(o.key,o.quantity-1)}catch(e){}N&&N(!1,!1)},handleItemQuantityIncrement:async()=>{N&&N(!0,!0);try{if(a){-1===await a(o.id,o.quantity+1,o.properties)&&(z(o?.key),setTimeout(()=>z(void 0),3e3))}}catch(e){}N&&N(!1,!1)},value:o.quantity,isDev:s,themeColor:d,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k}):!L||M||b?e.createElement("span",{className:"yt-cart-line-item-freebie-badge",style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:g??"#000",borderRadius:"4px"}},M&&o.original_line_price?`${((o.original_line_price-o.final_line_price)/o.original_line_price*100).toFixed(0)}% off`:b&&o?.properties?._isYtFreebie?`${b}% Off`:"Freebie"):null)),I&&I===o?.key&&e.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))},Ir=c.div`
|
|
1365
1365
|
margin: 8px 0 6px 0;
|
|
1366
1366
|
padding: 12px;
|
|
1367
1367
|
background: ${e=>e.$backgroundColor??"rgba(0,0,0,0.04)"};
|
|
@@ -1385,7 +1385,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1385
1385
|
.yt_subtitle { font-size: 11px; opacity: 0.9; }
|
|
1386
1386
|
|
|
1387
1387
|
.lock { margin-left: auto; width: 30px; height: 30px; border-radius: 999px; background: rgba(0,0,0,0.08); display: inline-flex; align-items: center; justify-content: center; }
|
|
1388
|
-
`,
|
|
1388
|
+
`,zr=({name:t,minimumOrderValue:n,currency:o,themeColor:r,tertiaryColor:i,imageUrl:a})=>{const l=i?`${i}22`:r?`${r}22`:void 0;return e.createElement(Ir,{className:"yt-cart-next-freebie-row",$backgroundColor:l},e.createElement("div",{className:"image-wrapper"},e.createElement("img",{src:a||"https://r2.yourtoken.io/image.png",alt:"Next freebie",style:{width:"100%",height:"100%",objectFit:"cover"},loading:"lazy"})),e.createElement("div",{className:"content"},e.createElement("span",{className:"yt_title"},`Unlock ${t}`),e.createElement("span",{className:"yt_subtitle"},`Buy items worth ${o}${n.toLocaleString()} or above`)),e.createElement("div",{className:"lock"},e.createElement(at,{size:16})))},Fr=()=>e.createElement("div",{className:"yt-cart-skeleton-loader-container"},e.createElement("div",{className:"yt-cart-skeleton-loader-item"},e.createElement("div",{className:"yt-cart-skeleton-loader-media"},""),e.createElement("div",{className:"yt-cart-skeleton-loader-line"},""),e.createElement("div",{className:"yt-cart-skeleton-loader-line"},"")),e.createElement("div",{className:"yt-cart-skeleton-loader-item"},e.createElement("div",{className:"yt-cart-skeleton-loader-media"},""),e.createElement("div",{className:"yt-cart-skeleton-loader-line"},""),e.createElement("div",{className:"yt-cart-skeleton-loader-line"},"")),e.createElement("div",{className:"yt-cart-skeleton-loader-item"},e.createElement("div",{className:"yt-cart-skeleton-loader-media"},""),e.createElement("div",{className:"yt-cart-skeleton-loader-line"},""),e.createElement("div",{className:"yt-cart-skeleton-loader-line"},""))),Dr=c.div`
|
|
1389
1389
|
padding: 5px 0;
|
|
1390
1390
|
position: relative;
|
|
1391
1391
|
|
|
@@ -1398,7 +1398,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1398
1398
|
border-bottom: 0.8px solid rgb(135 135 135 / 50%);
|
|
1399
1399
|
width: calc(100% + 2rem);
|
|
1400
1400
|
}
|
|
1401
|
-
`,Pr=({addCartItem:t,handleDecrement:n,handleIncrement:o,removeCartItem:r,isDev:i,themeColor:a,primaryTextColor:l,secondaryTextColor:c,freeProduct:d,themeTextColor:s,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:g,freeProductAdjustedCartTotal:x,freebieCouponTemplates:f,cartCheckpoints:y,freebieFlowCheckpoints:b,imageAspectSelector:h,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:E,showGiftWrapAsLineItem:k=!1,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:I,checkoutSectionMessage:z,checkoutSectionMessageRedirectLink:F,showFreebieMilestone:N,freebieMilestoneData:D,freeLabelText:P})=>{const A=ae(Ut),{cartLoading:_}=Kt(),R=!_.cartLoading&&A?.items,O=(x??Number(A?.items_subtotal_price))/100;let L=!0,M=0;if(A?.items?.length>0)for(const e of A.items)e?.properties?._isYtFreebie&&(M+=e?.quantity);if(M===A?.item_count&&(L=!1),!R&&0===A?.item_count)return e.createElement(Nr,null);if(!(R&&0!==A?.item_count||A?.items))return null;const j=D?.campaignFilter??"all_campaigns";let V=[];"all_campaigns"===j?V=f??[]:"progress_bar_tiers"===j?V=y??[]:"freebie_campaigns"===j&&(V=b??[]);const W=Array.isArray(V)?V.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>O):void 0,H=on(A,A?.currency);return e.createElement(e.Fragment,null,A.items.filter(e=>!!k||!(String(e?.id)===sn(String(C))||String(e?.id)===sn(String(E)))).map(d=>{const x=u?.[d?.key],y=f?.find(e=>e?._allVariantIds?.includes(String(d.id)));let b=!1;if(y&&O>=y.minimumOrderValue&&0===d?.line_price&&(b=!0),!k&&(String(d?.id)===sn(String(C))||sn(String(E))===String(d?.id)))return null;const z=d.discounts&&d.discounts.length>0;return d.properties?._isYtFreebie&&(x||b)&&z&&L?e.createElement(e.Fragment,null,e.createElement(Dr,{key:d?.key??d?.id},e.createElement(Ir,{product:d,themeColor:a,isDev:i,primaryTextColor:l,secondaryTextColor:c,themeTextColor:s,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:x,imageAspectSelector:h,showDeleteOnFreebies:g,removeFreebieFromCart:m,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:!0,freeLabelText:P}))):e.createElement(Dr,{key:d?.key??d?.id},e.createElement(Ir,{themeColor:a,handleDecrement:n,handleIncrement:o,removeCartItem:r,addCartItem:t,product:d,isDev:i,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!d.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:g,imageAspectSelector:h,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:I,freeLabelText:P}))}),N&&L&&W&&e.createElement(Fr,{name:W.name,minimumOrderValue:W.minimumOrderValue,currency:H,themeColor:a,tertiaryColor:S,imageUrl:D?.milestoneImage?.path}),mn()&&z&&z.length>0?e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:S,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:F?"pointer":"default"},onClick:()=>{F&&(window.location.href=F)}},z):e.createElement("div",{style:{display:"list-item",height:"12px",background:"#87878717"}}))};const Ar=({bundleProducts:t})=>{const n=ae(Ut);return e.createElement("div",{className:"flex flex-col gap-y-2"},e.createElement("div",{className:"flex items-center justify-center"},e.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),e.createElement("div",{className:"flex items-center justify-center gap-2 relative"},e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[0].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[0].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[0].price)),t[0]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[1].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[1].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[1].price)),t[1]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"absolute",style:{left:"50%",transform:"translateX(-50%)"}},e.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),e.createElement("div",{className:"flex flex-row justify-between items-center"},e.createElement("div",{className:"flex flex-row gap-x-4 items-center"},e.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),e.createElement("span",null,e.createElement("span",{className:"font-bold text-black"},on(n,n?.currency),t[0].price+t[1].price)," ",e.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},on(n,n?.currency),t[0].original_price+t[1].original_price))),e.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].original_price-t[0].price+(t[1].original_price-t[1].price)))),e.createElement("button",{className:"flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},e.createElement(ct,{color:"white"}),e.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].price+t[1].price))))},_r=({backgroundSubdued:o,themeColor:i,themeTextColor:a,primaryTextColor:l,cartComponentsCornerRadius:c,applyCouponCode:d,removeDiscount:s,enableConfetti:p,hideAppliedCodes:u})=>{const m=ae(Ut),[g,x]=t(""),[f,y]=t(null),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),{setLoading:k}=Kt(),[T,S]=t(null),[$,B]=t(!1),[I,z]=t(!1),F=r(null);n(()=>{if(T){B(!0);const e=setTimeout(()=>{B(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}B(!1)},[T]),n(()=>{if(m&&m.discount_codes&&f){const e=m.discount_codes.find(e=>e.code===f);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(z(!0),setTimeout(()=>z(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),y(null))}},[m,f]);const N=async()=>{if(d&&g&&!b){S(null),h(!0),y(g);try{await d(g),x("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),y(null)}finally{h(!1)}}},D=async()=>{if(s&&!C){S(null),E(!0),k&&k(!0,!1,!1,!0);try{await s()}catch(e){S({message:"Failed to remove coupon.",type:"error"})}finally{k&&k(!1,!1,!1,!1),E(!1)}}},P="error"===T?.type,A=m?.discount_codes?.filter(e=>!1!==e?.applicable);return e.createElement("div",{ref:F,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},I&&p&&e.createElement(vo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),e.createElement("div",{style:{display:"flex",alignItems:"stretch",border:P?"0.5px solid #FF4E4E":v?`1px solid ${i||"#007bff"}`:"1px solid #e0e0e0",borderRadius:c??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},e.createElement("input",{type:"text",placeholder:"Have a Coupon Code?",value:g,disabled:b,onFocus:()=>{w(!0),setTimeout(()=>{F.current&&window.innerWidth<=768&&F.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>w(!1),onChange:e=>{x(e.target.value),T&&S(null)},onKeyDown:e=>{"Enter"===e.key&&N()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:c??4,borderBottomLeftRadius:c??4,backgroundColor:o,color:l,boxShadow:"none",cursor:b?"not-allowed":"auto",margin:"0"}}),e.createElement("button",{onClick:N,disabled:!g||b,style:{padding:"10px 15px",border:"none",backgroundColor:P?"#D98181":g?i||"#007bff":"#cccccc",color:g||P?a||"#ffffff":"#666666",cursor:!g||b?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:c??4,borderBottomRightRadius:c??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:b?.7:1}},b?e.createElement(rt,{color:a||"#ffffff",size:18}):"Apply")),T&&e.createElement("div",{style:{color:"success"===T.type?"#28a745":"#dc3545",fontSize:"12px",marginTop:"4px",fontStyle:"italic",transition:"opacity 0.5s ease-in-out, transform 0.5s ease-in-out, max-height 0.5s ease-in-out",opacity:$?1:0,transform:$?"translateY(0)":"translateY(-10px)",maxHeight:$?"50px":"0",overflow:"hidden"}},T.message),!u&&A&&A.length>0&&e.createElement("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},A.map(t=>e.createElement("div",{key:t.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},e.createElement("div",{style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:o,paddingInlineStart:"6px",gap:"4px"}},e.createElement(Je,{size:12,color:"#4D4D4D"}),e.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},t.code)," applied!",e.createElement("button",{onClick:D,disabled:C,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},C?e.createElement(rt,{color:i||"#007bff",size:14}):e.createElement(be,{size:16})))))))},Rr="yt-coupon-selection-animations",Or=({rewardCoupons:o,applyCouponCode:r,removeDiscount:i,enableConfetti:a,backgroundSubdued:l,themeColor:c,themeTextColor:d,primaryTextColor:s,cartComponentsCornerRadius:p})=>{const u=ae(Ut),[m,g]=t(!1),[x,f]=t(!1),[y,b]=t(null),[h,v]=t(null),[w,C]=t(!1),[E,k]=t(null);n(()=>{(()=>{if(document.getElementById(Rr))return;const e=document.createElement("style");e.id=Rr,e.textContent="\n @keyframes ytSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes ytSlideDown {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n }\n @keyframes ytSuccessPulse {\n 0% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }\n 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }\n }\n @keyframes ytCheckFade {\n 0% { opacity: 0; transform: scale(0.5); }\n 50% { opacity: 1; transform: scale(1.2); }\n 100% { opacity: 1; transform: scale(1); }\n }\n ",document.head.appendChild(e)})()},[]);const T=u?.discount_codes?.filter(e=>!1!==e?.applicable),S=T?.[0],$=h?o.find(e=>e.couponTemplateId===h):null,B=o;n(()=>{const e=u?.discount_codes?.filter(e=>!1!==e?.applicable)??[];if(null!==h){const t=o.find(e=>e.couponTemplateId===h);return void(t&&e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase())||v(null))}if(e.length>0){const t=o.find(t=>e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase()));t&&v(t.couponTemplateId)}},[u?.discount_codes,o,h]),n(()=>{if(m){window.history.pushState({couponSelectionOpen:!0},"");const e=()=>z();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}},[m]);const I=()=>{f(!1),g(!0)},z=()=>{f(!0),setTimeout(()=>{g(!1),f(!1)},280)},F=async()=>{if(i&&!w){C(!0);try{await i(),v(null)}catch(e){console.error("Failed to remove coupon:",e)}finally{C(!1)}}},N=()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved extra ${$.discountPercentage}% off`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved extra ₹${$.discountValue} off`}return""},D=(t,n=!1)=>{const o=y===t.couponTemplateId,i=E===t.couponTemplateId,a=!n&&!1===t.isEligible;return e.createElement("div",{key:t.couponTemplateId,style:{border:n?`1.5px solid ${c||"#4A7C59"}`:"1px solid #E8E8E8",borderRadius:p??8,overflow:"hidden",marginBottom:"12px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",animation:i?"ytSuccessPulse 0.6s ease-out":void 0,transition:"border-color 0.3s ease, box-shadow 0.3s ease"}},e.createElement("div",{style:{padding:"14px 16px",background:"linear-gradient(135deg, #FFFFFF 60%, #FFF5F5 100%)",position:"relative"}},i&&e.createElement("div",{style:{position:"absolute",top:"10px",right:"10px",width:24,height:24,borderRadius:"50%",backgroundColor:"#2E7D32",display:"flex",alignItems:"center",justifyContent:"center",animation:"ytCheckFade 0.4s ease-out forwards"}},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:700}},"✓")),e.createElement("div",{style:{display:"flex",alignItems:"flex-start",gap:"10px"}},e.createElement("div",{style:{width:32,height:32,borderRadius:4,backgroundColor:"#FDE8E8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},e.createElement(ne,{size:18,color:a?"#6b7280":"#8B0000"})),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:s||"#1A1A1A",marginBottom:"2px"}},(e=>"percentage_discount_coupon"===e.couponType&&e.discountPercentage?`Get an additional ${e.discountPercentage}% off`:"fixed_amount_coupon"===e.couponType&&e.discountValue?`Get an additional ₹${e.discountValue} off`:e.name)(t)),e.createElement("div",{style:{fontSize:"12px",color:a?"#6b7280":"#2E7D32",fontWeight:500}},(e=>{if("minimum_quantity"===e.customCartProgressBarCriteria){if(e.quantityThreshold)return`On orders with ${e.quantityThreshold}+ items.`}else if(e.minimumOrderValue)return`On purchases above ₹${e.minimumOrderValue.toLocaleString("en-IN")}.`;return""})(t)))),e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",border:"1px solid #E0E0E0",borderRadius:p??6,padding:"8px 12px",backgroundColor:"#FAFAFA"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:700,color:s||"#1A1A1A",letterSpacing:"0.5px"}},t.name),e.createElement("button",{onClick:e=>{e.stopPropagation(),n?F():(async e=>{if(null===y){b(e.couponTemplateId);try{r&&e.name&&await r(e.name),v(e.couponTemplateId),k(e.couponTemplateId),setTimeout(()=>{k(null),z()},1200)}catch(e){console.error("Failed to collect coupon:",e)}finally{b(null)}}})(t)},disabled:o||w||a,style:{background:"none",border:"none",color:a?"#6b7280":"#8B0000",fontSize:"14px",fontWeight:600,cursor:o||w||a?"not-allowed":"pointer",padding:0,display:"flex",alignItems:"center",gap:"4px"}},o||n&&w?e.createElement(rt,{color:"#8B0000",size:14}):n?"Remove":"Collect"))),e.createElement("div",{style:{padding:"6px 16px",fontSize:"11px",fontWeight:500,textAlign:"center",backgroundColor:"#FFF0F0",color:a?"#6b7280":"#8B0000",borderTop:"1px solid '#FECACA'"}},(e=>{const t=e.resolvedCollectionNames;return t&&t.length>0?1===t.length?`Applicable on '${t[0]}' collection only.`:`Applicable on '${t.join("', '")}' collections.`:e.allowedCollections?.ids&&e.allowedCollections.ids.length>0?"Applicable on select collections.":"Applicable storewide"})(t)))};return e.createElement(e.Fragment,null,(()=>{const t=!!$||!!S,n=$?.name??S?.code??"",r=$?"#F0FFF4":S?"#F3E8FF":"#FDE8E8",i=$?"#2E7D32":"#C53030",a=$?"#2E7D32":"#666666";return e.createElement("div",{style:{padding:"0 16px",marginTop:"10px",marginBottom:"10px"}},e.createElement("div",{onClick:I,style:{display:"flex",alignItems:"center",padding:"12px 14px",border:"1px solid #E8E8E8",borderRadius:p??8,cursor:"pointer",backgroundColor:"#FFFFFF",transition:"box-shadow 0.2s ease"}},e.createElement("div",{style:{width:36,height:36,borderRadius:6,backgroundColor:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"12px",transition:"background-color 0.3s ease"}},$?e.createElement(Je,{size:20,color:i}):e.createElement(ne,{size:20,color:i})),e.createElement("div",{style:{flex:1}},t?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:s||"#1A1A1A"}},e.createElement("span",{style:{fontWeight:600}},n),e.createElement("span",{style:{fontStyle:"italic"}}," applied!")),e.createElement("div",{style:{fontSize:"12px",color:a,marginTop:"1px",fontStyle:$?"italic":"normal"}},(()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved additional ${$.discountPercentage}% on your purchase`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved additional ₹${$.discountValue} on your purchase`}return"coupon applied on your purchase"})())):e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",fontWeight:700,color:s||"#1A1A1A"}},"Coupons and Offers"),e.createElement("div",{style:{fontSize:"12px",color:"#888888",marginTop:"1px"}},"collect and save more"))),e.createElement(L,{size:14,color:"#888888"})),!t&&o.length>0&&e.createElement("div",{style:{textAlign:"center",fontSize:"12px",fontWeight:600,color:"#2E7D32",backgroundColor:"#F0FFF4",padding:"6px 0",borderRadius:`0 0 ${p??8}px ${p??8}px`,marginTop:"-1px",border:"1px solid #C6F6D5",borderTop:"none"}},o.length,"+ coupons eligible for your order"))})(),m&&e.createElement("div",{style:{position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",backgroundColor:"#FFFFFF",zIndex:2147483645,display:"flex",flexDirection:"column",animation:x?"ytSlideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards":"ytSlideUp 0.32s cubic-bezier(0, 0, 0.2, 1) forwards"}},e.createElement("div",{style:{display:"flex",alignItems:"center",padding:"16px",flexShrink:0}},e.createElement("button",{onClick:z,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",marginRight:"12px"}},e.createElement(M,{size:18,color:s||"#1A1A1A"})),e.createElement("span",{style:{fontSize:"18px",fontWeight:700,color:s||"#1A1A1A"}},"Coupons and Offers")),e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{style:{flex:1,overflowY:"auto"}},S&&e.createElement("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"8px",flexWrap:"wrap"}},e.createElement(Je,{size:16,color:"#333333"}),e.createElement("span",{style:{fontWeight:700,fontSize:"14px",color:s||"#1A1A1A"}},S.code),e.createElement("span",{style:{fontStyle:"italic",fontSize:"14px",color:s||"#1A1A1A"}},"applied!"),e.createElement("button",{onClick:F,disabled:w,style:{background:"none",border:"none",cursor:w?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center"}},w?e.createElement(rt,{color:"#666",size:14}):e.createElement(be,{size:18,color:"#666666"})),N()&&e.createElement("span",{style:{fontSize:"14px",color:"#2E7D32",fontStyle:"italic"}},N())),e.createElement(_r,{backgroundSubdued:l,themeColor:c,themeTextColor:d,primaryTextColor:s,cartComponentsCornerRadius:p,applyCouponCode:r,removeDiscount:i,enableConfetti:a,hideAppliedCodes:!0}),e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{style:{padding:"16px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:700,color:s||"#1A1A1A",marginBottom:"4px"}},"Collect Coupon"),e.createElement("div",{style:{fontSize:"13px",color:"#888888",marginBottom:"16px"}},"Pick any one coupon deal"),B.map(e=>D(e,e.couponTemplateId===h))))))},Lr=ce("showGSTInput",!1),Mr=c.div`
|
|
1401
|
+
`,Pr=({addCartItem:t,handleDecrement:n,handleIncrement:o,removeCartItem:r,isDev:i,themeColor:a,primaryTextColor:l,secondaryTextColor:c,freeProduct:s,themeTextColor:d,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:g,freeProductAdjustedCartTotal:x,freebieCouponTemplates:f,cartCheckpoints:y,freebieFlowCheckpoints:b,imageAspectSelector:h,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:E,showGiftWrapAsLineItem:k=!1,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:N,showDiscountOnMRP:B,checkoutSectionMessage:I,checkoutSectionMessageRedirectLink:z,showFreebieMilestone:F,freebieMilestoneData:D,freeLabelText:P})=>{const A=ae(Ut),{cartLoading:_}=Kt(),R=!_.cartLoading&&A?.items,O=(x??Number(A?.items_subtotal_price))/100;let L=!0,M=0;if(A?.items?.length>0)for(const e of A.items)e?.properties?._isYtFreebie&&(M+=e?.quantity);if(M===A?.item_count&&(L=!1),!R&&0===A?.item_count)return e.createElement(Fr,null);if(!(R&&0!==A?.item_count||A?.items))return null;const j=D?.campaignFilter??"all_campaigns";let V=[];"all_campaigns"===j?V=f??[]:"progress_bar_tiers"===j?V=y??[]:"freebie_campaigns"===j&&(V=b??[]);const W=Array.isArray(V)?V.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>O):void 0,H=on(A,A?.currency);return e.createElement(e.Fragment,null,A.items.filter(e=>!!k||!(String(e?.id)===dn(String(C))||String(e?.id)===dn(String(E)))).map(s=>{const x=u?.[s?.key],y=f?.find(e=>e?._allVariantIds?.includes(String(s.id)));let b=!1;if(y&&O>=y.minimumOrderValue&&0===s?.line_price&&(b=!0),!k&&(String(s?.id)===dn(String(C))||dn(String(E))===String(s?.id)))return null;const I=s.discounts&&s.discounts.length>0;return s.properties?._isYtFreebie&&(x||b)&&I&&L?e.createElement(e.Fragment,null,e.createElement(Dr,{className:"yt-cart-product-card-wrapper",key:s?.key??s?.id},e.createElement(Br,{product:s,themeColor:a,isDev:i,primaryTextColor:l,secondaryTextColor:c,themeTextColor:d,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:x,imageAspectSelector:h,showDeleteOnFreebies:g,removeFreebieFromCart:m,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:N,showDiscountOnMRP:!0,freeLabelText:P}))):e.createElement(Dr,{className:"yt-cart-product-card-wrapper",key:s?.key??s?.id},e.createElement(Br,{themeColor:a,handleDecrement:n,handleIncrement:o,removeCartItem:r,addCartItem:t,product:s,isDev:i,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!s.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:g,imageAspectSelector:h,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:N,showDiscountOnMRP:B,freeLabelText:P}))}),F&&L&&W&&e.createElement(zr,{name:W.name,minimumOrderValue:W.minimumOrderValue,currency:H,themeColor:a,tertiaryColor:S,imageUrl:D?.milestoneImage?.path}),mn()&&I&&I.length>0?e.createElement("div",{className:"yt-cart-checkout-message yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:S,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:z?"pointer":"default"},onClick:()=>{z&&(window.location.href=z)}},I):e.createElement("div",{className:"yt-cart-products-list-separator",style:{display:"list-item",height:"12px",background:"#87878717"}}))};const Ar=({bundleProducts:t})=>{const n=ae(Ut);return e.createElement("div",{className:"yt-cart-bundle-container flex flex-col gap-y-2"},e.createElement("div",{className:"yt-cart-bundle-title flex items-center justify-center"},e.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),e.createElement("div",{className:"yt-cart-bundle-products flex items-center justify-center gap-2 relative"},e.createElement("div",{className:"yt-cart-bundle-product-card w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[0].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[0].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[0].price)),t[0]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[1].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[1].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[1].price)),t[1]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"yt-cart-bundle-plus-icon absolute",style:{left:"50%",transform:"translateX(-50%)"}},e.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),e.createElement("div",{className:"yt-cart-bundle-pricing flex flex-row justify-between items-center"},e.createElement("div",{className:"flex flex-row gap-x-4 items-center"},e.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),e.createElement("span",null,e.createElement("span",{className:"font-bold text-black"},on(n,n?.currency),t[0].price+t[1].price)," ",e.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},on(n,n?.currency),t[0].original_price+t[1].original_price))),e.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].original_price-t[0].price+(t[1].original_price-t[1].price)))),e.createElement("button",{className:"yt-cart-bundle-buy-button flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},e.createElement(ct,{color:"white"}),e.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].price+t[1].price))))},_r=({backgroundSubdued:o,themeColor:i,themeTextColor:a,primaryTextColor:l,cartComponentsCornerRadius:c,applyCouponCode:s,removeDiscount:d,enableConfetti:p,hideAppliedCodes:u})=>{const m=ae(Ut),[g,x]=t(""),[f,y]=t(null),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),{setLoading:k}=Kt(),[T,S]=t(null),[$,N]=t(!1),[B,I]=t(!1),z=r(null);n(()=>{if(T){N(!0);const e=setTimeout(()=>{N(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}N(!1)},[T]),n(()=>{if(m&&m.discount_codes&&f){const e=m.discount_codes.find(e=>e.code===f);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(I(!0),setTimeout(()=>I(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),y(null))}},[m,f]);const F=async()=>{if(s&&g&&!b){S(null),h(!0),y(g);try{await s(g),x("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),y(null)}finally{h(!1)}}},D=async()=>{if(d&&!C){S(null),E(!0),k&&k(!0,!1,!1,!0);try{await d()}catch(e){S({message:"Failed to remove coupon.",type:"error"})}finally{k&&k(!1,!1,!1,!1),E(!1)}}},P="error"===T?.type,A=m?.discount_codes?.filter(e=>!1!==e?.applicable);return e.createElement("div",{className:"yt-cart-apply-container",ref:z,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},B&&p&&e.createElement(vo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),e.createElement("div",{className:"yt-cart-apply-input-wrapper",style:{display:"flex",alignItems:"stretch",border:P?"0.5px solid #FF4E4E":v?`1px solid ${i||"#007bff"}`:"1px solid #e0e0e0",borderRadius:c??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},e.createElement("input",{className:"yt-cart-apply-input",type:"text",placeholder:"Have a Coupon Code?",value:g,disabled:b,onFocus:()=>{w(!0),setTimeout(()=>{z.current&&window.innerWidth<=768&&z.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>w(!1),onChange:e=>{x(e.target.value),T&&S(null)},onKeyDown:e=>{"Enter"===e.key&&F()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:c??4,borderBottomLeftRadius:c??4,backgroundColor:o,color:l,boxShadow:"none",cursor:b?"not-allowed":"auto",margin:"0"}}),e.createElement("button",{className:"yt-cart-apply-button",onClick:F,disabled:!g||b,style:{padding:"10px 15px",border:"none",backgroundColor:P?"#D98181":g?i||"#007bff":"#cccccc",color:g||P?a||"#ffffff":"#666666",cursor:!g||b?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:c??4,borderBottomRightRadius:c??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:b?.7:1}},b?e.createElement(rt,{color:a||"#ffffff",size:18}):"Apply")),T&&e.createElement("div",{className:"yt-cart-apply-status",style:{color:"success"===T.type?"#28a745":"#dc3545",fontSize:"12px",marginTop:"4px",fontStyle:"italic",transition:"opacity 0.5s ease-in-out, transform 0.5s ease-in-out, max-height 0.5s ease-in-out",opacity:$?1:0,transform:$?"translateY(0)":"translateY(-10px)",maxHeight:$?"50px":"0",overflow:"hidden"}},T.message),!u&&A&&A.length>0&&e.createElement("div",{className:"yt-cart-apply-applied-list",style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},A.map(t=>e.createElement("div",{className:"yt-cart-apply-applied-item",key:t.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},e.createElement("div",{className:"yt-cart-apply-applied-badge",style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:o,paddingInlineStart:"6px",gap:"4px"}},e.createElement(Je,{size:12,color:"#4D4D4D"}),e.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},t.code)," applied!",e.createElement("button",{className:"yt-cart-apply-remove-button",onClick:D,disabled:C,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},C?e.createElement(rt,{color:i||"#007bff",size:14}):e.createElement(be,{size:16})))))))},Rr="yt-coupon-selection-animations",Or=({rewardCoupons:o,applyCouponCode:r,removeDiscount:i,enableConfetti:a,backgroundSubdued:l,themeColor:c,themeTextColor:s,primaryTextColor:d,cartComponentsCornerRadius:p})=>{const u=ae(Ut),[m,g]=t(!1),[x,f]=t(!1),[y,b]=t(null),[h,v]=t(null),[w,C]=t(!1),[E,k]=t(null);n(()=>{(()=>{if(document.getElementById(Rr))return;const e=document.createElement("style");e.id=Rr,e.textContent="\n @keyframes ytSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes ytSlideDown {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n }\n @keyframes ytSuccessPulse {\n 0% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }\n 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }\n }\n @keyframes ytCheckFade {\n 0% { opacity: 0; transform: scale(0.5); }\n 50% { opacity: 1; transform: scale(1.2); }\n 100% { opacity: 1; transform: scale(1); }\n }\n ",document.head.appendChild(e)})()},[]);const T=u?.discount_codes?.filter(e=>!1!==e?.applicable),S=T?.[0],$=h?o.find(e=>e.couponTemplateId===h):null,N=o;n(()=>{const e=u?.discount_codes?.filter(e=>!1!==e?.applicable)??[];if(null!==h){const t=o.find(e=>e.couponTemplateId===h);return void(t&&e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase())||v(null))}if(e.length>0){const t=o.find(t=>e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase()));t&&v(t.couponTemplateId)}},[u?.discount_codes,o,h]),n(()=>{if(m){window.history.pushState({couponSelectionOpen:!0},"");const e=()=>I();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}},[m]);const B=()=>{f(!1),g(!0)},I=()=>{f(!0),setTimeout(()=>{g(!1),f(!1)},280)},z=async()=>{if(i&&!w){C(!0);try{await i(),v(null)}catch(e){console.error("Failed to remove coupon:",e)}finally{C(!1)}}},F=()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved extra ${$.discountPercentage}% off`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved extra ₹${$.discountValue} off`}return""},D=(t,n=!1)=>{const o=y===t.couponTemplateId,i=E===t.couponTemplateId,a=!n&&!1===t.isEligible;return e.createElement("div",{className:`yt-cart-coupon-selection-card${n?" yt-cart-coupon-selection-card-selected":""}${a?" yt-cart-coupon-selection-card-ineligible":""}`,key:t.couponTemplateId,style:{border:n?`1.5px solid ${c||"#4A7C59"}`:"1px solid #E8E8E8",borderRadius:p??8,overflow:"hidden",marginBottom:"12px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",animation:i?"ytSuccessPulse 0.6s ease-out":void 0,transition:"border-color 0.3s ease, box-shadow 0.3s ease"}},e.createElement("div",{className:"yt-cart-coupon-selection-card-body",style:{padding:"14px 16px",background:"linear-gradient(135deg, #FFFFFF 60%, #FFF5F5 100%)",position:"relative"}},i&&e.createElement("div",{className:"yt-cart-coupon-selection-card-checkmark",style:{position:"absolute",top:"10px",right:"10px",width:24,height:24,borderRadius:"50%",backgroundColor:"#2E7D32",display:"flex",alignItems:"center",justifyContent:"center",animation:"ytCheckFade 0.4s ease-out forwards"}},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:700}},"✓")),e.createElement("div",{className:"yt-cart-coupon-selection-card-header",style:{display:"flex",alignItems:"flex-start",gap:"10px"}},e.createElement("div",{className:"yt-cart-coupon-selection-card-icon",style:{width:32,height:32,borderRadius:4,backgroundColor:"#FDE8E8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},e.createElement(ne,{size:18,color:a?"#6b7280":"#8B0000"})),e.createElement("div",{className:"yt-cart-coupon-selection-card-text",style:{flex:1}},e.createElement("div",{className:"yt-cart-coupon-selection-card-title",style:{fontSize:"14px",fontWeight:600,color:d||"#1A1A1A",marginBottom:"2px"}},(e=>"percentage_discount_coupon"===e.couponType&&e.discountPercentage?`Get an additional ${e.discountPercentage}% off`:"fixed_amount_coupon"===e.couponType&&e.discountValue?`Get an additional ₹${e.discountValue} off`:e.name)(t)),e.createElement("div",{className:"yt-cart-coupon-selection-card-subtitle",style:{fontSize:"12px",color:a?"#6b7280":"#2E7D32",fontWeight:500}},(e=>{if("minimum_quantity"===e.customCartProgressBarCriteria){if(e.quantityThreshold)return`On orders with ${e.quantityThreshold}+ items.`}else if(e.minimumOrderValue)return`On purchases above ₹${e.minimumOrderValue.toLocaleString("en-IN")}.`;return""})(t)))),e.createElement("div",{className:"yt-cart-coupon-selection-code-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",border:"1px solid #E0E0E0",borderRadius:p??6,padding:"8px 12px",backgroundColor:"#FAFAFA"}},e.createElement("span",{className:"yt-cart-coupon-selection-code",style:{fontSize:"14px",fontWeight:700,color:d||"#1A1A1A",letterSpacing:"0.5px"}},t.name),e.createElement("button",{className:"yt-cart-coupon-selection-action",onClick:e=>{e.stopPropagation(),n?z():(async e=>{if(null===y){b(e.couponTemplateId);try{r&&e.name&&await r(e.name),v(e.couponTemplateId),k(e.couponTemplateId),setTimeout(()=>{k(null),I()},1200)}catch(e){console.error("Failed to collect coupon:",e)}finally{b(null)}}})(t)},disabled:o||w||a,style:{background:"none",border:"none",color:a?"#6b7280":"#8B0000",fontSize:"14px",fontWeight:600,cursor:o||w||a?"not-allowed":"pointer",padding:0,display:"flex",alignItems:"center",gap:"4px"}},o||n&&w?e.createElement(rt,{color:"#8B0000",size:14}):n?"Remove":"Collect"))),e.createElement("div",{className:"yt-cart-coupon-selection-applicability",style:{padding:"6px 16px",fontSize:"11px",fontWeight:500,textAlign:"center",backgroundColor:"#FFF0F0",color:a?"#6b7280":"#8B0000",borderTop:"1px solid '#FECACA'"}},(e=>{const t=e.resolvedCollectionNames;return t&&t.length>0?1===t.length?`Applicable on '${t[0]}' collection only.`:`Applicable on '${t.join("', '")}' collections.`:e.allowedCollections?.ids&&e.allowedCollections.ids.length>0?"Applicable on select collections.":"Applicable storewide"})(t)))};return e.createElement(e.Fragment,null,(()=>{const t=!!$||!!S,n=$?.name??S?.code??"",r=$?"#F0FFF4":S?"#F3E8FF":"#FDE8E8",i=$?"#2E7D32":"#C53030",a=$?"#2E7D32":"#666666";return e.createElement("div",{className:"yt-cart-coupon-selection-banner-container",style:{padding:"0 16px",marginTop:"10px",marginBottom:"10px"}},e.createElement("div",{className:"yt-cart-coupon-selection-banner",onClick:B,style:{display:"flex",alignItems:"center",padding:"12px 14px",border:"1px solid #E8E8E8",borderRadius:p??8,cursor:"pointer",backgroundColor:"#FFFFFF",transition:"box-shadow 0.2s ease"}},e.createElement("div",{className:"yt-cart-coupon-selection-banner-icon",style:{width:36,height:36,borderRadius:6,backgroundColor:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"12px",transition:"background-color 0.3s ease"}},$?e.createElement(Je,{size:20,color:i}):e.createElement(ne,{size:20,color:i})),e.createElement("div",{className:"yt-cart-coupon-selection-banner-content",style:{flex:1}},t?e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-coupon-selection-banner-title",style:{fontSize:"14px",color:d||"#1A1A1A"}},e.createElement("span",{className:"yt-cart-coupon-selection-banner-code",style:{fontWeight:600}},n),e.createElement("span",{className:"yt-cart-coupon-selection-banner-applied",style:{fontStyle:"italic"}}," applied!")),e.createElement("div",{className:"yt-cart-coupon-selection-banner-subtitle",style:{fontSize:"12px",color:a,marginTop:"1px",fontStyle:$?"italic":"normal"}},(()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved additional ${$.discountPercentage}% on your purchase`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved additional ₹${$.discountValue} on your purchase`}return"coupon applied on your purchase"})())):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-coupon-selection-banner-title",style:{fontSize:"14px",fontWeight:700,color:d||"#1A1A1A"}},"Coupons and Offers"),e.createElement("div",{className:"yt-cart-coupon-selection-banner-subtitle",style:{fontSize:"12px",color:"#888888",marginTop:"1px"}},"collect and save more"))),e.createElement(L,{className:"yt-cart-coupon-selection-banner-arrow",size:14,color:"#888888"})),!t&&o.length>0&&e.createElement("div",{className:"yt-cart-coupon-selection-eligible-count",style:{textAlign:"center",fontSize:"12px",fontWeight:600,color:"#2E7D32",backgroundColor:"#F0FFF4",padding:"6px 0",borderRadius:`0 0 ${p??8}px ${p??8}px`,marginTop:"-1px",border:"1px solid #C6F6D5",borderTop:"none"}},o.length,"+ coupons eligible for your order"))})(),m&&e.createElement("div",{className:"yt-cart-coupon-selection-overlay",style:{position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",backgroundColor:"#FFFFFF",zIndex:2147483645,display:"flex",flexDirection:"column",animation:x?"ytSlideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards":"ytSlideUp 0.32s cubic-bezier(0, 0, 0.2, 1) forwards"}},e.createElement("div",{className:"yt-cart-coupon-selection-overlay-header",style:{display:"flex",alignItems:"center",padding:"16px",flexShrink:0}},e.createElement("button",{className:"yt-cart-coupon-selection-back-button",onClick:I,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",marginRight:"12px"}},e.createElement(M,{size:18,color:d||"#1A1A1A"})),e.createElement("span",{className:"yt-cart-coupon-selection-overlay-title",style:{fontSize:"18px",fontWeight:700,color:d||"#1A1A1A"}},"Coupons and Offers")),e.createElement("div",{className:"yt-cart-coupon-selection-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{className:"yt-cart-coupon-selection-overlay-content",style:{flex:1,overflowY:"auto"}},S&&e.createElement("div",{className:"yt-cart-coupon-selection-applied-badge",style:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"8px",flexWrap:"wrap"}},e.createElement(Je,{size:16,color:"#333333"}),e.createElement("span",{className:"yt-cart-coupon-selection-applied-code",style:{fontWeight:700,fontSize:"14px",color:d||"#1A1A1A"}},S.code),e.createElement("span",{className:"yt-cart-coupon-selection-applied-text",style:{fontStyle:"italic",fontSize:"14px",color:d||"#1A1A1A"}},"applied!"),e.createElement("button",{className:"yt-cart-coupon-selection-applied-remove",onClick:z,disabled:w,style:{background:"none",border:"none",cursor:w?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center"}},w?e.createElement(rt,{color:"#666",size:14}):e.createElement(be,{size:18,color:"#666666"})),F()&&e.createElement("span",{className:"yt-cart-coupon-selection-applied-savings",style:{fontSize:"14px",color:"#2E7D32",fontStyle:"italic"}},F())),e.createElement("div",{className:"yt-cart-coupon-selection-apply-section"},e.createElement(_r,{backgroundSubdued:l,themeColor:c,themeTextColor:s,primaryTextColor:d,cartComponentsCornerRadius:p,applyCouponCode:r,removeDiscount:i,enableConfetti:a,hideAppliedCodes:!0})),e.createElement("div",{className:"yt-cart-coupon-selection-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{className:"yt-cart-coupon-selection-collect-section",style:{padding:"16px"}},e.createElement("div",{className:"yt-cart-coupon-selection-collect-title",style:{fontSize:"16px",fontWeight:700,color:d||"#1A1A1A",marginBottom:"4px"}},"Collect Coupon"),e.createElement("div",{className:"yt-cart-coupon-selection-collect-subtitle",style:{fontSize:"13px",color:"#888888",marginBottom:"16px"}},"Pick any one coupon deal"),e.createElement("div",{className:"yt-cart-coupon-selection-list"},N.map(e=>D(e,e.couponTemplateId===h)))))))},Lr=ce("showGSTInput",!1),Mr=c.div`
|
|
1402
1402
|
width: 95%;
|
|
1403
1403
|
background: white;
|
|
1404
1404
|
border-radius: 2px;
|
|
@@ -1474,7 +1474,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1474
1474
|
color: #ff3b30;
|
|
1475
1475
|
font-size: 12px;
|
|
1476
1476
|
margin-left: 4px;
|
|
1477
|
-
`,Zr=({companyName:o,gstNumber:r,themeColor:a,iconColor:l=a||"#1a1a1a",showIcon:c=!0,backgroundColor:
|
|
1477
|
+
`,Zr=({companyName:o,gstNumber:r,themeColor:a,iconColor:l=a||"#1a1a1a",showIcon:c=!0,backgroundColor:s="white",textColor:d="#1A1A1A",title:p})=>{const[u,m]=ie(Ao),[g,x]=ie(Po),[f,y]=ie(Lr),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),k=e=>!!e.match("[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9a-zA-Z]{1}[zZ]{1}[0-9a-zA-Z]")&&15===e.length;n(()=>{r&&o&&!g&&!u&&(x(r),m(o));const e=g||r||"";if(e){const t=k(e);h(t),w(!t),t&&y(!1)}},[g,u,r,o]);const T=i(e=>{const t=e.target.value.toUpperCase();if(x(t),E(!0),""===t)w(!1),h(!1);else{const e=k(t);h(e),w(!e)}},[]);return e.createElement(Mr,{className:"yt-cart-gst-container",$bgColor:s},e.createElement(jr,{className:"yt-cart-gst-button",onClick:()=>{if(f&&(g||u)){if(k(g))return h(!0),w(!1),void y(!1);if(g)return void w(!0)}y(!f)},$active:f,$bgColor:s},e.createElement(Vr,{className:"yt-cart-gst-left"},c&&e.createElement(Wr,{color:l}),e.createElement(Hr,{$textColor:d},p||"Get GST Invoice")),e.createElement(qr,{className:"yt-cart-gst-right"},e.createElement(Qr,{$bgColor:"white"!==s?"rgba(245, 245, 245, 0.4)":"rgba(245, 245, 245, 1)"},b&&!f?e.createElement(qe,{size:18,color:d??"#4A4A4A"}):f?e.createElement(Qe,{size:18,color:d??"#4A4A4A"}):e.createElement(Ue,{size:18,color:d??"#4A4A4A",strokeWidth:"0.1"})))),f&&e.createElement(Ur,{className:"yt-cart-gst-form"},e.createElement(Gr,{className:"yt-cart-gst-company-input",placeholder:"Company Name",value:u,onChange:e=>m(e.target.value)}),e.createElement(Yr,{className:"yt-cart-gst-input-wrapper"},e.createElement(Gr,{className:"yt-cart-gst-number-input",placeholder:"GST Number",value:g,onChange:T,onBlur:()=>{g&&!k(g)&&(w(!0),h(!1))},maxLength:15,$hasError:v}),v&&C&&e.createElement(Xr,null,"Please enter a valid GST number"))))};gt('.form-group {\n position: relative;\n display: block;\n}\n\n.floating-input-note {\n position: relative;\n display: block;\n width: 95%;\n max-width: 95%;\n border: 1px solid rgba(0, 0, 0, 0.37);\n background-color: transparent;\n margin: 0px 1rem;\n outline: none !important;\n font-size: 14px;\n color: rgba(0, 0, 0, 0.85);\n transition: all 0.2s ease-in-out;\n}\n\n.icon-transition {\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n}\n\n.floating-label {\n position: absolute;\n top: -6px;\n left: 12px;\n text-align: left;\n display: inline-block;\n padding: 0 4px;\n height: 14px;\n line-height: 14px;\n font-size: 12px;\n font-weight: 400;\n background: #fff;\n color: rgba(0, 0, 0, 0.5);\n margin: 0px auto;\n cursor: text;\n transition: all 0.15s ease-in-out;\n}\n\n.floating-input-note:hover,\n.floating-input-note:focus {\n border: 1px solid #000;\n}\n\n.floating-input-note:valid + label,\n.floating-input-note:focus + label {\n color: #000;\n font-size: 9px;\n}\n\n.gl-form-asterisk {\n background-color: inherit;\n color: rgba(0, 0, 0, 0.5);\n padding: 0;\n padding-left: 3px;\n}\n\n.gl-form-asterisk:after {\n content: "*";\n color: #000;\n}');const Jr=({note:o,noteSectionTitle:r="Order Note"})=>{const[i,a]=ie(_o),[l,c]=t(!1);return n(()=>{""===i&&o&&""!==o&&a(o)},[o]),e.createElement("div",{className:"yt-cart-note-section form-group"},e.createElement("div",{className:"yt-cart-note-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem"},onClick:()=>c(!l)},e.createElement("span",{className:"yt-cart-note-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},r," ",e.createElement(J,null)),e.createElement("div",{className:"yt-cart-note-toggle icon-transition"},l?e.createElement(j,null):e.createElement(V,null))),l&&e.createElement("textarea",{className:"yt-cart-note-textarea floating-input-note",value:i,onChange:e=>{a(e.target.value)}}))},Kr=(e,t)=>!!t&&(!e?.tracksInventory||(!t?.inventoryItem?.tracked||("continue"===t.inventoryPolicy||t.inventoryQuantity>0))),ei=(e,t,n)=>{const o=e?.variants?.edges?.filter(t=>Kr(e,t?.node))||[];if(0===o.length)return{selectedVariantId:void 0,selectedVariantGid:void 0,selectedVariantPrice:0,availableVariants:[],displayVariantCount:0,effectiveDiscount:1,effectivePrice:0,dealAmount:0,showOptions:!1,isFree:!0};let r;n&&(r=o.find(e=>String(e?.node?.id)===`gid://shopify/ProductVariant/${n}`)),r||(r=o[0]);const i=r?.node?.id,a=n||sn(i),l=Number(r?.node?.price)||0,c=e?.percentageOffOnCustomerGetsProducts?.01*e.percentageOffOnCustomerGetsProducts:1;let s=0;if(t&&t.length>0&&i){const e=sn(i),n=t.find(t=>"deal_amount"===t.freebieType&&t.discountValue&&(t.customerGetsProductIds?.ids?.includes(e)||t._allVariantIds?.includes(e)));n&&(s=n.discountValue)}const d=1===c?0:(1-c)*l;return{selectedVariantId:a,selectedVariantGid:i,selectedVariantPrice:l,availableVariants:o,displayVariantCount:e?._claim_allowed_variants?.length||1,effectiveDiscount:c,effectivePrice:d,dealAmount:s,showOptions:e?.variants?.edges?.length>1,isFree:0===d}},ti=c.div`
|
|
1478
1478
|
display: flex;
|
|
1479
1479
|
flex-direction: row;
|
|
1480
1480
|
column-gap: 10px;
|
|
@@ -1540,18 +1540,18 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1540
1540
|
@media (max-width: 768px) {
|
|
1541
1541
|
font-size: 11px;
|
|
1542
1542
|
}
|
|
1543
|
-
`,ai=({product:n,themeColor:r,themeTextColor:i,addFreebieToCart:a,productClaimCtaButtonText:l,imageAspectSelector:c,freebieCouponTemplates:
|
|
1543
|
+
`,ai=({product:n,themeColor:r,themeTextColor:i,addFreebieToCart:a,productClaimCtaButtonText:l,imageAspectSelector:c,freebieCouponTemplates:s,isMultiClaim:d=!1,isSelected:p=!1,isDisabled:u=!1,onToggleSelection:m})=>{const{setLoading:g}=Kt(),x=le(en),f=o(()=>{const e=n?.variants?.edges?.filter(e=>Kr(n,e?.node));return((e,t,n)=>{if(e?.length){if(t?.length)for(const n of e){const e=sn(String(n?.node?.id));if(t.find(t=>"deal_amount"===t.freebieType&&t.discountValue&&(t.customerGetsProductIds?.ids?.includes(e)||t._allVariantIds?.includes(e))))return e}if(n?.length){const t=e.find(e=>{const t=sn(String(e?.node?.id));return t&&n.includes(t)});if(t)return sn(String(t?.node?.id))}return sn(String(e[0]?.node?.id))}})(e,s,n?._claim_allowed_variants)},[n,s]),[y,b]=t({variantId:f}),h=o(()=>ei(n,s,y?.variantId),[n,s,y?.variantId]);if(!h.availableVariants?.length)return null;const v=d?()=>{!u&&m&&m(n.id)}:()=>{(async(e,t,n,o)=>{e(!0,!0);try{const r=t._claim_allowed_variants||[],i=r[0];if(!i)return console.error("No allowed variant ID found for claiming freebie:",t),void e(!1,!1);if(r.length<=1)n&&await n(i,r);else if(o){const e=t?.id?.split("/").pop();o({open:!0,variantId:i,handle:t?.handle,freebieSelection:!0,productId:e,allowedVariantIds:r})}else console.error("Cannot open variant modal: setVariantSelectionModal not provided.")}catch(e){console.error("yt::uikit handleFreebieClaim error:",e)}finally{e(!1,!1)}})(g,n,a,x)};return e.createElement(ti,{className:"yt-cart-freebie-card",$isDisabled:u,$isSelected:p},e.createElement(ni,{className:"yt-cart-freebie-card-image",src:n?.featuredMedia?.preview?.image?.url,alt:n?.title,$imageAspectSelector:c}),e.createElement(oi,{className:"yt-cart-freebie-card-content"},e.createElement(ri,null,e.createElement(ii,{href:`/products/${n?.handle}?variant=${y?.variantId}`},n?.title),h.showOptions&&h.displayVariantCount>1&&e.createElement("div",{style:{fontSize:"10px",marginBottom:"5px"}},`${h.displayVariantCount} variants available`),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"5px",fontSize:"10px",marginBottom:"10px"}},e.createElement("span",{style:{fontWeight:"bold"}},h.dealAmount>0?`₹${h.dealAmount.toFixed(2)}`:h.isFree?"FREE":`₹${h.effectivePrice.toFixed(2)}`),e.createElement("span",{style:{color:"gray",textDecorationLine:"line-through"}},"₹",h.selectedVariantPrice),h.effectivePrice>0?e.createElement("span",{style:{padding:"2px",background:"#FFEAF2",color:"#E2454B",fontSize:"8px",fontWeight:"bold"}},"Save ",n?.percentageOffOnCustomerGetsProducts,"%"):"")),e.createElement("button",{className:"yt-cart-freebie-card-button",style:{cursor:u?"not-allowed":"pointer",border:d?p?"1px solid #51B286":"1px solid #888888":"none",color:d?p?"#ffffff":"#000000":i||"#ffffff",backgroundColor:d?p?"#51B286":"#ffffff":r||"#000000",fontSize:"12px",padding:"5px 7px",width:"80%",borderRadius:"14px",fontWeight:d?p?"600":"normal":"600",display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",fontFamily:"Poppins"},onClick:v,disabled:u},e.createElement("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},d&&e.createElement("span",{style:{display:"inline-flex"}},p?e.createElement(tt,{size:16}):e.createElement(nt,{size:16})),e.createElement("span",null,d?p?"Added":"Add":l||"Add")))))},li=async(e,t,n)=>{if(n&&0!==e.length)for(const o of e){const e=t.find(e=>e.id===o);if(!e){console.error("Product not found for ID:",o);continue}const r=e._claim_allowed_variants||[],i=r[0];i?await n(i,r):console.error("No allowed variant ID found for claiming freebie:",e)}},ci=c.div`
|
|
1544
1544
|
position: relative;
|
|
1545
1545
|
width: 100%;
|
|
1546
1546
|
display: flex;
|
|
1547
1547
|
justify-content: center;
|
|
1548
1548
|
padding: 0 20px;
|
|
1549
1549
|
overflow: hidden;
|
|
1550
|
-
`,
|
|
1550
|
+
`,si=c.div`
|
|
1551
1551
|
width: ${e=>e.$cardWidth}px;
|
|
1552
1552
|
margin: 0 auto;
|
|
1553
1553
|
position: relative;
|
|
1554
|
-
`,
|
|
1554
|
+
`,di=c.div`
|
|
1555
1555
|
position: absolute;
|
|
1556
1556
|
top: 0;
|
|
1557
1557
|
${({position:e})=>e}: 0;
|
|
@@ -1637,7 +1637,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1637
1637
|
transition: all 0.2s ease;
|
|
1638
1638
|
letter-spacing: 0.8px;
|
|
1639
1639
|
font-family: 'Poppins';
|
|
1640
|
-
`,Ci=({freebieProductsInCart:i,themeColor:a,themeTextColor:l,primaryTextColor:c,addFreebieToCart:
|
|
1640
|
+
`,Ci=({freebieProductsInCart:i,themeColor:a,themeTextColor:l,primaryTextColor:c,addFreebieToCart:s,freebiesInCart:d,imageAspectSelector:p,freebieCouponTemplates:u,maxFreebiesInTier:f=1,tierName:y="Freebie",freebieClaimData:b})=>{const[h,v]=t(0),[w,C]=t(0),[E,k]=t([]),[T,S]=t(!1),[$,N]=t(!1),B=r(null),I=r(null),z=r(null),F=r(!1),D=o(()=>i?.length?i.filter(e=>(e?.variants?.edges||[]).some(t=>Kr(e,t?.node))):[],[i]),P=f>1||(u?.some(e=>(e.maxFreebiesInTier??1)>1)??!1),A=e=>u?.find(t=>t.couponTemplateId===e?.couponTemplateId),_=e=>{const t=A(e);if(!t)return E.length>=f;const n=t.maxFreebiesInTier??1,o=(r=t.couponTemplateId)?E.filter(e=>{const t=D.find(t=>String(t?.id)===e);return t?.couponTemplateId===r}).length:0;var r;return o>=n},R=o(()=>{const e=new Set;D.forEach(t=>{t?.couponTemplateId&&e.add(t.couponTemplateId)});let t=0;return e.forEach(e=>{const n=u?.find(t=>t.couponTemplateId===e);t+=n?.maxFreebiesInTier??1}),t>0?t:f},[D,u,f]),O=E.length,L=`${O}/${R} selected`,M=O===R&&O>0,j=b?.freebieSectionTitle,V=b?.productClaimCtaButtonText??"Claim Freebie";n(()=>{k(e=>e.filter(e=>D.some(t=>String(t?.id)===e)))},[D]);n(()=>{if(B.current){const e=B.current.offsetWidth,t=window.innerWidth<=768;C(t?Math.min(.95*e,280):Math.min(.8*e,320))}},[D.length]);const W=Math.max(0,(D.length||0)-1);n(()=>{h>W&&v(W)},[W,h]);const H=()=>{v(e=>0===e?W:e-1)},q=()=>{v(e=>e===W?0:e+1)};return 0===D.length?null:e.createElement("div",{className:"yt-cart-freebie-claim-section",style:{display:"flex",flexDirection:"column",marginTop:"5px"}},e.createElement(xi,{className:"yt-cart-freebie-claim-header",onClick:()=>S(e=>!e)},e.createElement(fi,{$primaryTextColor:c},e.createElement(yi,{$isCollapsed:T},e.createElement(m,{size:16})),j??"Freebies",P&&!M&&` • ${L}`),e.createElement(bi,null)),e.createElement(hi,{className:"yt-cart-freebie-claim-list",$isCollapsed:T},e.createElement(ci,{className:"yt-cart-freebie-claim-carousel",ref:B,onTouchStart:e=>{const t=e.touches[0];I.current=t.clientX,z.current=t.clientY,F.current=!1},onTouchMove:e=>{if(null===I.current||null===z.current)return;const t=e.touches[0],n=t.clientX-I.current,o=t.clientY-z.current;Math.abs(n)>10&&Math.abs(n)>Math.abs(o)&&(F.current=!0,e.preventDefault())},onTouchEnd:e=>{if(null===I.current)return;const t=e.changedTouches[0].clientX-I.current;Math.abs(t)>50&&(t<0?q():H()),I.current=null,z.current=null,F.current=!1}},D.length>1&&e.createElement(mi,{className:"yt-cart-freebie-carousel-nav-left",onClick:H},e.createElement(g,{size:30,color:"#4D4D4D",className:"yt-freebie-carousel-icon"})),e.createElement(di,{position:"left",style:{display:"flex"}}),e.createElement(di,{position:"right",style:{display:"flex"}}),e.createElement(si,{$cardWidth:w},e.createElement(pi,{$translate:h*(w+10)},D.map((t,n)=>e.createElement("div",{key:`${t?.id}-${E.includes(String(t.id))?"selected":"unselected"}`,style:{width:`${w}px`,flexShrink:0}},e.createElement(ai,{addFreebieToCart:s,product:t,themeColor:a,themeTextColor:l,productClaimCtaButtonText:V,imageAspectSelector:p,freebieCouponTemplates:u,isMultiClaim:P,isSelected:E.includes(String(t.id)),isDisabled:P&&!E.includes(String(t.id))&&_(t),onToggleSelection:P?e=>{k(t=>{const n=String(e);if(t.includes(n))return t.filter(e=>e!==n);const o=D.find(e=>String(e?.id)===n),r=A(o),i=r?.maxFreebiesInTier??f,a=r?.couponTemplateId;if((a?t.filter(e=>{const t=D.find(t=>String(t?.id)===e);return t?.couponTemplateId===a}).length:t.length)<i){return t.length+1<R&&setTimeout(()=>{q()},600),[...t,n]}return t})}:void 0}))))),D.length>1&&e.createElement(gi,{className:"yt-cart-freebie-carousel-nav-right",onClick:q},e.createElement(x,{size:30,color:"#4D4D4D",className:"yt-freebie-carousel-icon"})))),P&&M&&e.createElement(vi,{className:"yt-cart-freebie-claim-button-container"},e.createElement(wi,{className:"yt-cart-freebie-claim-button",$themeColor:a,$themeTextColor:l,$disabled:$,onClick:async()=>{if(s&&0!==E.length&&!$){N(!0);try{await li(E,i,s),k([])}catch(e){console.error("Failed to claim gifts:",e)}finally{N(!1)}}},disabled:$},$?"Adding to Cart...":`${V} • ${O}/${R} added`)))},Ei="yt-multiclaim-selection",ki=e=>{try{if("undefined"==typeof window||!window.sessionStorage)return;sessionStorage.setItem(Ei,JSON.stringify(e))}catch{}},Ti=re((()=>{try{if("undefined"==typeof window||!window.sessionStorage)return null;const e=sessionStorage.getItem(Ei);return e?JSON.parse(e):null}catch{return null}})()??{selectedProducts:[],maxAllowed:1,tierName:""}),Si=re(e=>{const t=e(Ti);return t.selectedProducts.length>=t.maxAllowed}),$i=re(e=>e(Ti).selectedProducts.length),Ni=re(null,(e,t,n)=>{const o=e(Ti),r="string"==typeof n?n:n.productId,i="object"==typeof n?n:void 0;let a;if(o.selectedProducts.includes(r))a={...o,selectedProducts:o.selectedProducts.filter(e=>e!==r)};else{if(void 0!==i?.tierId&&void 0!==i?.tierMax&&i?.getProductTierId){if(o.selectedProducts.filter(e=>i.getProductTierId(e)===i.tierId).length>=i.tierMax)return}else if(o.selectedProducts.length>=o.maxAllowed)return;a={...o,selectedProducts:[...o.selectedProducts,r]}}t(Ti,a),ki(a)}),Bi=re(null,(e,t)=>{const n={...e(Ti),selectedProducts:[]};t(Ti,n),ki(n)}),Ii=re(null,(e,t,n,o)=>{const r={selectedProducts:[],maxAllowed:n,tierName:o};t(Ti,r),ki(r)}),zi=c.div`
|
|
1641
1641
|
display: flex;
|
|
1642
1642
|
flex-direction: row;
|
|
1643
1643
|
align-items: center;
|
|
@@ -1656,7 +1656,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1656
1656
|
&:focus-visible {
|
|
1657
1657
|
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
|
|
1658
1658
|
}
|
|
1659
|
-
`,
|
|
1659
|
+
`,Fi=c.img.attrs({className:"yt-cart-freebie-overlay-card-image"})`
|
|
1660
1660
|
width: 60px;
|
|
1661
1661
|
height: 60px;
|
|
1662
1662
|
aspect-ratio: ${e=>"portrait"===e.$imageAspectSelector?"5/6":"1"};
|
|
@@ -1665,30 +1665,30 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1665
1665
|
object-fit: cover;
|
|
1666
1666
|
margin-right: 12px;
|
|
1667
1667
|
background: #fafafa;
|
|
1668
|
-
`,Di=c.div`
|
|
1668
|
+
`,Di=c.div.attrs({className:"yt-cart-freebie-overlay-card-content"})`
|
|
1669
1669
|
flex: 1;
|
|
1670
1670
|
display: flex;
|
|
1671
1671
|
flex-direction: column;
|
|
1672
1672
|
gap: 4px;
|
|
1673
|
-
`,Pi=c.div`
|
|
1673
|
+
`,Pi=c.div.attrs({className:"yt-cart-freebie-overlay-card-title"})`
|
|
1674
1674
|
font-size: 14px;
|
|
1675
1675
|
font-weight: 600;
|
|
1676
1676
|
color: #000;
|
|
1677
1677
|
margin: 0;
|
|
1678
|
-
`,Ai=c.div`
|
|
1678
|
+
`,Ai=c.div.attrs({className:"yt-cart-freebie-overlay-card-price-row"})`
|
|
1679
1679
|
display: flex;
|
|
1680
1680
|
align-items: center;
|
|
1681
1681
|
gap: 8px;
|
|
1682
|
-
`,_i=c.span`
|
|
1682
|
+
`,_i=c.span.attrs({className:"yt-cart-freebie-overlay-card-current-price"})`
|
|
1683
1683
|
font-size: 13px;
|
|
1684
1684
|
font-weight: 600;
|
|
1685
1685
|
color: #000;
|
|
1686
1686
|
text-decoration: line-through;
|
|
1687
|
-
`,Ri=c.span`
|
|
1687
|
+
`,Ri=c.span.attrs({className:"yt-cart-freebie-overlay-card-original-price"})`
|
|
1688
1688
|
font-size: 12px;
|
|
1689
1689
|
color: #999;
|
|
1690
1690
|
text-decoration: line-through;
|
|
1691
|
-
`,Oi=c.span`
|
|
1691
|
+
`,Oi=c.span.attrs({className:"yt-cart-freebie-overlay-card-free-label"})`
|
|
1692
1692
|
font-size: 9px;
|
|
1693
1693
|
font-weight: 600;
|
|
1694
1694
|
color: #000;
|
|
@@ -1696,14 +1696,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1696
1696
|
padding: 2px 5px;
|
|
1697
1697
|
border-radius: 4px;
|
|
1698
1698
|
text-transform: uppercase;
|
|
1699
|
-
`,Li=c.div`
|
|
1699
|
+
`,Li=c.div.attrs({className:"yt-cart-freebie-overlay-card-checkbox"})`
|
|
1700
1700
|
width: 22px;
|
|
1701
1701
|
height: 22px;
|
|
1702
1702
|
display: flex !important;
|
|
1703
1703
|
align-items: center;
|
|
1704
1704
|
justify-content: center;
|
|
1705
1705
|
margin-left: 12px;
|
|
1706
|
-
`,Mi=({product:t,imageAspectSelector:n="square",freebieCouponTemplates:r=[],accentColor:i,freebieProductsInCart:a=[]})=>{const[l]=ie(Ti),[c]=ie(Si),
|
|
1706
|
+
`,Mi=({product:t,imageAspectSelector:n="square",freebieCouponTemplates:r=[],accentColor:i,freebieProductsInCart:a=[]})=>{const[l]=ie(Ti),[c]=ie(Si),s=le(Ni),d=l.selectedProducts.includes(t.id),p=e=>r?.find(t=>t.couponTemplateId===e?.couponTemplateId),u=!d&&(()=>{const e=p(t);if(!e)return c;const n=e.maxFreebiesInTier??1;return l.selectedProducts.filter(t=>{const n=a.find(e=>String(e?.id)===t);return n?.couponTemplateId===e.couponTemplateId}).length>=n})(),m=o(()=>ei(t,r),[t,r]);if(!m.availableVariants?.length)return null;const g=e=>{const t=a.find(t=>String(t?.id)===e);return t?.couponTemplateId};return e.createElement(zi,{className:`yt-cart-freebie-overlay-card${d?" yt-cart-freebie-overlay-card-selected":""}${u?" yt-cart-freebie-overlay-card-disabled":""}`,$isSelected:d,$isDisabled:u,$accentColor:i,onClick:()=>{if(!u){const e=p(t);s({productId:t.id,tierId:e?.couponTemplateId,tierMax:e?.maxFreebiesInTier??1,getProductTierId:g})}},onKeyDown:e=>{if(!u&&("Enter"===e.key||" "===e.key)){e.preventDefault();const n=p(t);s({productId:t.id,tierId:n?.couponTemplateId,tierMax:n?.maxFreebiesInTier??1,getProductTierId:g})}},role:"checkbox","aria-checked":d,tabIndex:u?-1:0,"aria-disabled":u},e.createElement(Fi,{src:t.featuredMedia?.preview?.image?.url,alt:t.title,$imageAspectSelector:n}),e.createElement(Di,null,e.createElement(Pi,null,t.title),e.createElement(Ai,null,m.dealAmount>0?e.createElement(e.Fragment,null,e.createElement(_i,null,"₹",m.dealAmount.toFixed(0)),e.createElement(Ri,null,"₹",m.selectedVariantPrice.toFixed(0))):m.isFree?e.createElement(e.Fragment,null,e.createElement(_i,null,"₹",m.selectedVariantPrice.toFixed(0)),e.createElement(Oi,null,"Free")):e.createElement(e.Fragment,null,e.createElement(_i,null,"₹",m.effectivePrice.toFixed(0)),e.createElement(Ri,null,"₹",m.selectedVariantPrice.toFixed(0))))),e.createElement(Li,{$isSelected:d,$accentColor:i,"aria-hidden":"true"},d?e.createElement(st,{color:"#000",size:18}):e.createElement(dt,{color:"#777",size:18})))},ji=re({isOpen:!1}),Vi=c.div`
|
|
1707
1707
|
position: fixed;
|
|
1708
1708
|
top: 0;
|
|
1709
1709
|
left: 0;
|
|
@@ -1812,7 +1812,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1812
1812
|
border: none;
|
|
1813
1813
|
max-width: unset;
|
|
1814
1814
|
margin-left: 10px;
|
|
1815
|
-
`,ta=({freebieProductsInCart:t,maxFreebiesInTier:r,tierName:i,themeColor:a,themeTextColor:l,primaryTextColor:c,addFreebieToCart:
|
|
1815
|
+
`,ta=({freebieProductsInCart:t,maxFreebiesInTier:r,tierName:i,themeColor:a,themeTextColor:l,primaryTextColor:c,addFreebieToCart:s,imageAspectSelector:d="square",freebieCouponTemplates:p=[],freebieClaimData:u,isCartDrawerOpen:g=!0})=>{const[x]=ie(Ti),[f]=ie($i),y=le(Bi),b=le(Ii),[h,v]=ie(ji),[w,C]=e.useState(!1),E=u?.allowOverlayClose??!0,k=u?.freebieSectionTitle,T=o(()=>{const e=new Set;t.forEach(t=>{t?.couponTemplateId&&e.add(t.couponTemplateId)});let n=0;return e.forEach(e=>{const t=p?.find(t=>t.couponTemplateId===e);n+=t?.maxFreebiesInTier??1}),n>0?n:r},[t,p,r]);n(()=>g?(b(T,i),v({isOpen:!0}),()=>{y(),v({isOpen:!1})}):(v({isOpen:!1}),void y()),[g,T,i,b,y,v]);const S=()=>{v({isOpen:!1}),y()},$=()=>{v({isOpen:!0})};n(()=>{const e=e=>{"Escape"===e.key&&S()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);x.selectedProducts.length;const N=f>=T,B=w?"Adding to Cart...":N?`Claim Gifts • ${f}/${T} added`:`${f}/${T} added`;if(!h.isOpen)return e.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},e.createElement(Ji,{onClick:$},e.createElement(Ki,{$primaryTextColor:c},e.createElement(m,{size:16}),k??"Freebies"," • ",T," items available"),e.createElement(ea,null)));const I=e.createElement(Vi,{role:"dialog","aria-modal":"true",onClick:E?S:void 0},e.createElement(Wi,{onClick:e=>e.stopPropagation(),"aria-labelledby":"freebie-modal-title"},e.createElement(Hi,null,e.createElement(qi,null,e.createElement(W,{color:"#4D4D4D",size:22})),e.createElement(Qi,{id:"freebie-modal-title"},e.createElement("span",{className:"bold"},"Freebie")," Unlocked!"),e.createElement(Ui,null,"claim up to ",e.createElement("span",{className:"bold"},T," items")," for free")),e.createElement(Yi,null,e.createElement(Gi,null,t.map(n=>e.createElement(Mi,{key:n.id,product:n,imageAspectSelector:d,freebieCouponTemplates:p,accentColor:a,freebieProductsInCart:t})))),e.createElement(Xi,null,e.createElement(Zi,{$themeColor:a||"#000",$themeTextColor:l,$disabled:!N||w,onClick:async()=>{if(x.selectedProducts.length>0&&!w){C(!0);try{await s(x.selectedProducts),S()}catch(e){console.error("Failed to add freebies:",e)}finally{C(!1)}}},disabled:!N||w},B))));return"undefined"!=typeof document&&document.body?P.createPortal(I,document.body):null},na=({freebieProductsInCart:t,themeColor:n,themeTextColor:o,primaryTextColor:r,addFreebieToCart:i,freebiesInCart:a,freebieClaimData:l,imageAspectSelector:c,freebieCouponTemplates:s,cartCheckpoints:d,isCartDrawerOpen:p})=>{const u=e.useMemo(()=>{const e=d?.filter(e=>"free_product"===e?.couponType);if(!e||0===e.length)return;const n=Array.from(new Set((t??[]).map(e=>e?.couponTemplateId).filter(e=>"number"==typeof e)));if(n.length>0){const t=e.find(e=>n.includes(e.couponTemplateId));if(t)return t}},[d,t]),m=e.useMemo(()=>{const e=u?.maxFreebiesInTier;return"number"!=typeof e||isNaN(e)?1:e},[u]),g=e.useMemo(()=>u?.name??"Freebie",[u]),x=async e=>{try{await li(e,t,i)}catch(e){console.error("Failed to add multiclaim freebies:",e)}},f=l?.type||"section";return"section"===f?e.createElement(Ci,{freebieProductsInCart:t,themeColor:n,themeTextColor:o,primaryTextColor:r,addFreebieToCart:i,freebiesInCart:a,imageAspectSelector:c,freebieCouponTemplates:s,maxFreebiesInTier:m,tierName:g,freebieClaimData:l}):"overlay"===f?e.createElement(ta,{freebieProductsInCart:t,maxFreebiesInTier:m,tierName:g,themeColor:n,themeTextColor:o,primaryTextColor:r,addFreebieToCart:x,imageAspectSelector:c,freebieCouponTemplates:s,freebieClaimData:l,isCartDrawerOpen:p}):(console.warn(`Unknown claimDisplayType: ${f}`),null)};function oa({inlineCartOfferInfoText:n,inlineCartOfferInfoRedirectLink:o,themeColor:r,tooltipText:i,themeTextColor:a}){const[l,c]=t(!1),s="polygon(0% 100%, 100% 100%, 100% 0%, 100% 0%, 90% 18%, 0% 18%)",d=e.createElement("div",{className:"yt-cart-top-bar",style:{marginTop:"4px",display:"flex",flexDirection:"row",width:"100%",fontSize:"12px",borderRadius:"none",textAlign:"center",justifyContent:"center",position:"relative",background:cn(r,1),color:a,fontWeight:"var(--yt-cart-font-weight)",padding:"3px",cursor:o?"pointer":"default"}},n,i&&e.createElement("div",{className:"yt-cart-offer-info-tooltip-wrapper",style:{position:"relative",alignSelf:"center",justifySelf:"center",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(H,{size:16,style:{marginLeft:"5px",cursor:"pointer",alignSelf:"center",color:a},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)}),l&&e.createElement("div",{className:"yt-cart-offer-info-tooltip",style:{position:"absolute",top:"100%",right:"100%",zIndex:1e3,filter:"drop-shadow(0px 0px 10px rgba(0,0,0,0.1))"}},e.createElement("div",{className:"yt-cart-offer-info-tooltip-border",style:{backgroundColor:"gray",clipPath:s,padding:".5px"}},e.createElement("div",{className:"yt-cart-offer-info-tooltip-content",style:{backgroundColor:"white",clipPath:s,padding:"10px",fontSize:"10px",color:"black",whiteSpace:"nowrap",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"15px",height:"10px"}},i)))));return o?e.createElement("a",{href:o,style:{textDecoration:"none",color:"inherit"}},d):d}gt(".react-calendar {\n width: 350px;\n max-width: 100%;\n background: white;\n border: 1px solid #a0a096;\n font-family: 'Arial', 'Helvetica', sans-serif;\n line-height: 1.125em;\n}\n\n.react-calendar--doubleView {\n width: 700px;\n}\n\n.react-calendar--doubleView .react-calendar__viewContainer {\n display: flex;\n margin: -0.5em;\n}\n\n.react-calendar--doubleView .react-calendar__viewContainer > * {\n width: 50%;\n margin: 0.5em;\n}\n\n.react-calendar,\n.react-calendar *,\n.react-calendar *:before,\n.react-calendar *:after {\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.react-calendar button {\n margin: 0;\n border: 0;\n outline: none;\n}\n\n.react-calendar button:enabled:hover {\n cursor: pointer;\n}\n\n.react-calendar__navigation {\n display: flex;\n height: 44px;\n margin-bottom: 1em;\n}\n\n.react-calendar__navigation button {\n min-width: 44px;\n background: none;\n}\n\n.react-calendar__navigation button:disabled {\n background-color: #f0f0f0;\n}\n\n.react-calendar__navigation button:enabled:hover,\n.react-calendar__navigation button:enabled:focus {\n background-color: #e6e6e6;\n}\n\n.react-calendar__month-view__weekdays {\n text-align: center;\n text-transform: uppercase;\n font: inherit;\n font-size: 0.75em;\n font-weight: bold;\n}\n\n.react-calendar__month-view__weekdays__weekday {\n padding: 0.5em;\n}\n\n.react-calendar__month-view__weekNumbers .react-calendar__tile {\n display: flex;\n align-items: center;\n justify-content: center;\n font: inherit;\n font-size: 0.75em;\n font-weight: bold;\n}\n\n.react-calendar__month-view__days__day--weekend {\n color: #d10000;\n}\n\n.react-calendar__month-view__days__day--neighboringMonth,\n.react-calendar__decade-view__years__year--neighboringDecade,\n.react-calendar__century-view__decades__decade--neighboringCentury {\n color: #757575;\n}\n\n.react-calendar__year-view .react-calendar__tile,\n.react-calendar__decade-view .react-calendar__tile,\n.react-calendar__century-view .react-calendar__tile {\n padding: 2em 0.5em;\n}\n\n.react-calendar__tile {\n max-width: 100%;\n padding: 10px 6.6667px;\n background: none;\n text-align: center;\n font: inherit;\n font-size: 0.833em;\n}\n\n.react-calendar__tile:disabled {\n background-color: #f0f0f0;\n color: #ababab;\n}\n\n.react-calendar__month-view__days__day--neighboringMonth:disabled,\n.react-calendar__decade-view__years__year--neighboringDecade:disabled,\n.react-calendar__century-view__decades__decade--neighboringCentury:disabled {\n color: #cdcdcd;\n}\n\n.react-calendar__tile:enabled:hover,\n.react-calendar__tile:enabled:focus {\n background-color: #e6e6e6;\n}\n\n.react-calendar__tile--now {\n background: #ffff76;\n}\n\n.react-calendar__tile--now:enabled:hover,\n.react-calendar__tile--now:enabled:focus {\n background: #ffffa9;\n}\n\n.react-calendar__tile--hasActive {\n background: #76baff;\n}\n\n.react-calendar__tile--hasActive:enabled:hover,\n.react-calendar__tile--hasActive:enabled:focus {\n background: #a9d4ff;\n}\n\n.react-calendar__tile--active {\n background: #006edc;\n color: white;\n}\n\n.react-calendar__tile--active:enabled:hover,\n.react-calendar__tile--active:enabled:focus {\n background: #1087ff;\n}\n\n.react-calendar--selectRange .react-calendar__tile--hover {\n background-color: #e6e6e6;\n}\n");gt(".custom-date-picker {\n position: relative;\n width: 100%;\n}\n\n.date-display {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n}\n\n.date-display span {\n color: black;\n}\n\n.date-display svg {\n width: 20px;\n height: 20px;\n color: rgb(73, 69, 69);\n}\n\n.calendar-container {\n position: absolute;\n bottom: 100%;\n left: -10%;\n z-index: 10;\n margin-top: 10px;\n}\n\n.custom-calendar {\n background-color: white;\n border-radius: 6px;\n box-shadow: 0 4px 6px rgba(10, 8, 8, 0.1);\n border: 1px solid darken(#674918, 50%);\n}\n");const ra=c(pt)`
|
|
1816
1816
|
.react-calendar {
|
|
1817
1817
|
font-family: Arial, sans-serif;
|
|
1818
1818
|
color: ${e=>e.tileTextColor||"#374151"} !important;
|
|
@@ -1909,7 +1909,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1909
1909
|
.active-date abbr {
|
|
1910
1910
|
color: ${e=>e.tileTextColor||"#374151"} !important;
|
|
1911
1911
|
}
|
|
1912
|
-
`,ia=({themeColor:o,themeTextColor:r,disabledDates:a=[]})=>{const[l,c]=t(!1),[d
|
|
1912
|
+
`,ia=({themeColor:o,themeTextColor:r,disabledDates:a=[]})=>{const[l,c]=t(!1),[s,d]=ie(Zt),p=le(Yt),u=e.useRef(null),m=s?new Date(s):null,g=Array.isArray(a)?a:[a],x=i(()=>{const e=new Date;return e.setDate(e.getDate()+1),e},[]),y=i(e=>g.some(t=>t instanceof Date&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())),[g]),b=i(e=>{if(!e)return!1;const t=x(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!y(n)},[x,y]);n(()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return l&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l]),n(()=>{const e=b(m);p(t=>t.isDateValid!==e?{...t,isDateValid:e}:t)},[m,b,p]);const h=i(({date:e,view:t})=>{if("month"===t){const t=x(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!y(n)){const e=s?new Date(s):null;return e&&n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()?"active-date":"black-date"}}return null},[x,s,y]);return e.createElement("div",{className:"yt-cart-date-picker custom-date-picker"},e.createElement("div",{className:"yt-cart-date-display date-display",onClick:()=>c(!l)},e.createElement("span",{style:{fontSize:"12px"}},(v=s?new Date(s):null)?v.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"/"):"Select a date"),e.createElement(f,null)),l&&e.createElement("div",{className:"yt-cart-calendar-container calendar-container",ref:u},e.createElement(ra,{onChange:(e,t)=>{e instanceof Date&&!y(e)&&(d(e.toISOString()),c(!1));const n=b(e instanceof Date?e:null);p(e=>e.isDateValid!==n?{...e,isDateValid:n}:e)},value:s?new Date(s):null,className:"custom-calendar",minDate:x(),tileBackgroundColor:o,tileTextColor:r,tileHoverColor:cn(o,.2),tileClassName:h,tileDisabled:({date:e,view:t})=>"month"===t&&y(e)})));var v};gt(".shipment-container {\n font-family: Arial, sans-serif;\n max-width: 400px;\n padding: 3px;\n padding-bottom: 0;\n background-color: #fff;\n border-radius: 8px;\n margin: 8px 1rem;\n}\n\n.shipment-header {\n background-color: #f6efdd;\n padding: 4px;\n border-radius: 0px;\n margin-bottom: 12px;\n}\n\n.shipment-header-text {\n color: #ae8846;\n font-size: 14px;\n font-weight: 500;\n text-align: center;\n margin: 0;\n line-height: normal;\n}\n\n.shipment-option {\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 8px;\n cursor: pointer;\n transition: all 0.3s ease;\n}\n\n.shipment-option:hover {\n background-color: #f9fafb;\n}\n\n.shipment-option.selected {\n border-color: #ae8846;\n border-width: 1 1 0 2 px;\n box-shadow: 0 0 0 1px #ae8846;\n}\n\n.option-content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.option-title {\n font-size: 12px;\n margin-bottom: 4px;\n font-weight: 600;\n}\n\n.option-subtitle {\n color: #6b7280;\n font-size: 10px;\n}\n\n.checkmark {\n color: #ae8846;\n font-size: 20px;\n font-weight: bold;\n}\n\n.availability-check {\n margin-top: 8px;\n}\n\n.availability-title {\n font-size: 12px;\n color: #374151;\n margin-bottom: 3px;\n font-weight: 600;\n}\n\n.availability-input {\n width: 98%;\n padding: 2px;\n border: none;\n border-bottom: 2px solid #d1d5db;\n border-radius: 0;\n font-size: 12px;\n transition: border-color 0.3s ease;\n background: none;\n outline: none;\n font-weight: 500 !important;\n box-shadow: none;\n text-shadow: none;\n}\n\n.availability-input:focus {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n font-weight: 500 !important;\n box-shadow: none;\n text-shadow: none;\n}\n\n.availability-input:hover {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n font-weight: 500 !important;\n}\n\n.error-message {\n background-color: #fee2e2;\n color: #b91c1c;\n padding: 6px;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n font-size: 13px;\n margin-top: 10px;\n display: flex;\n align-items: center;\n margin-bottom: -12px;\n margin-left: -12px;\n margin-right: -12px;\n line-height: normal;\n justify-content: center;\n text-align: center;\n}\n\n.error-icon {\n margin-right: 8px;\n}\n\n.slot {\n width: 98%;\n margin-top: 4px;\n padding: 4px;\n display: flex;\n justify-content: space-between;\n align-items: left;\n flex-direction: column;\n border-bottom: 2px solid #e5e7eb;\n}\n\n.slot:focus {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n}\n\n.slot:hover {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n}\n\n.slot-label {\n font-size: 12px;\n margin-bottom: 4px;\n color: #374151;\n margin-left: -4px;\n font-weight: 600;\n}\n\n.success-message {\n background-color: #dcf6ee;\n color: #307d66;\n padding: 6px;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n font-size: 13px;\n margin-top: 6px;\n display: flex;\n align-items: center;\n margin-bottom: -12px;\n margin-left: -12px;\n margin-right: -12px;\n line-height: normal;\n justify-content: center;\n}");const aa=({title:o="Cart Item(s) available in NCR only",backgroundColor:a="#F6EFDD78",tag:l="NCR",postalCodeList:c=[110001,110002,110003,110004,110005],themeColor:s,themeTextColor:d,enableSlotPicker:p,deliveryHeaderTitle:u,deliveryAvailableText:m,deliveryNotAvailableText:g,disabledDates:x})=>{const[f,y]=t(!1),[b,h]=ie(Ro),[v,w]=ie(Yt),[C,E]=ie(Xt),k=ae(Gt),T=r(null),S=i(e=>{const t=c.includes(e);y(!t),w(e=>({...e,isPostalCodeValid:t}))},[c,w]);return n(()=>{E("specific")},[]),n(()=>{void 0!==b&&S(b)},[b,S]),n(()=>{!1===p&&w(e=>e.isDateValid?e:{...e,isDateValid:!0})},[p,w]),e.createElement("div",null,u&&e.createElement("div",{className:"shipment-header"},e.createElement("h2",{className:"shipment-header-text"},u)),e.createElement("div",{className:"availability-check",style:{border:`2px solid ${s||"black"}`,padding:"12px",borderRadius:"8px",margin:"8px 1rem"}},e.createElement("div",{className:"availability-title"},"Check Shipment Availability"),e.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:b||"",onChange:e=>{const t=e.target.value;if(""===t)return h(void 0),y(!1),void w(e=>({...e,isPostalCodeValid:!1}));if(!/^\d+$/.test(t))return;const n=Number(t);h(n),y(!1),w(e=>({...e,isPostalCodeValid:!1})),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{S(n)},1e3)},onBlur:()=>{T.current&&clearTimeout(T.current),void 0!==b&&S(b)}}),f&&e.createElement("div",{className:"error-message"},g||"Cart items aren't available at your address"),v.isPostalCodeValid&&p&&e.createElement("div",{className:"slot"},e.createElement("label",{className:"slot-label"},"Select Delivery Slot"),e.createElement(ia,{themeColor:s,themeTextColor:d,disabledDates:x})),k&&e.createElement("div",{className:"success-message"},m||"Voila! Local delivery is available")))},la=({postalCodeList:o=[110001,110002,110003,110004,110005],themeColor:a,themeTextColor:l,enableSlotPicker:c,disabledDates:s})=>{const[d,p]=t("standard"),[u,m]=t(!1),[g,x]=ie(Ro),[f,y]=ie(Yt),[b,h]=ie(Xt),v=ae(Gt),w=r(null),C=i(e=>{const t=o.includes(e);e?(m(!t),y(e=>({...e,isPostalCodeValid:t}))):y(e=>({...e,isPostalCodeValid:!1}))},[o,y]);return n(()=>{h("delhi-ncr"===d?"specific":"standard"),g&&C(g)},[d]),e.createElement("div",{className:"shipment-container"},e.createElement("div",{className:"shipment-header"},e.createElement("p",{className:"shipment-header-text"},"Cart Item(s) are available for standard shipment")),e.createElement("div",{className:"shipment-option "+("standard"===d?"selected":""),onClick:()=>p("standard")},e.createElement("div",{className:"option-content"},e.createElement("div",{className:"option-text"},e.createElement("div",{className:"option-title"},"Pan India"),e.createElement("div",{className:"option-subtitle"},"7-10 days")),"standard"===d&&e.createElement(q,{className:"checkmark"}))),e.createElement("div",{className:"shipment-option "+("delhi-ncr"===d?"selected":""),onClick:()=>p("delhi-ncr")},e.createElement("div",{className:"option-content"},e.createElement("div",{className:"option-text"},e.createElement("div",{className:"option-title"},"Delhi NCR"),e.createElement("div",{className:"option-subtitle"},"Single day delivery")),"delhi-ncr"===d&&e.createElement(q,{className:"checkmark"})),"delhi-ncr"===d&&e.createElement("div",{className:"availability-check"},e.createElement("div",{className:"availability-title"},"Check Product Availability"),e.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:g,onChange:e=>{const t=e.target.value;if(""===t)return x(void 0),m(!1),void y(e=>({...e,isPostalCodeValid:!1}));if(!/^\d+$/.test(t))return;const n=Number(t);x(n),m(!1),y(e=>({...e,isPostalCodeValid:!1})),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{C(n)},1e3)},onBlur:()=>{w.current&&clearTimeout(w.current),C(g)}}),u&&e.createElement("div",{className:"error-message"},"Cart items aren't available on your selected pincode for quick shipment"),f.isPostalCodeValid&&c&&e.createElement("div",{className:"slot"},e.createElement("label",{className:"slot-label"},"Pick a Selivery Slot"),e.createElement(ia,{themeColor:a,themeTextColor:l,disabledDates:s})),v&&e.createElement("div",{className:"success-message"},"Voila! Local delivery is available"))))},ca=ce("gift_wrap",!1);ce("gift_wrap_id","");const sa=c.img`
|
|
1913
1913
|
width: 24px !important;
|
|
1914
1914
|
height: 24px !important;
|
|
1915
1915
|
min-width: 24px !important;
|
|
@@ -1918,7 +1918,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1918
1918
|
border-radius: 4px;
|
|
1919
1919
|
display: block !important;
|
|
1920
1920
|
flex-shrink: 0;
|
|
1921
|
-
`,
|
|
1921
|
+
`,da=c.div`
|
|
1922
1922
|
display: flex;
|
|
1923
1923
|
flex-direction: column;
|
|
1924
1924
|
margin-left: 16px;
|
|
@@ -1955,7 +1955,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1955
1955
|
font-size: 12px;
|
|
1956
1956
|
margin-top: 5px;
|
|
1957
1957
|
padding: 0 20px;
|
|
1958
|
-
`,xa=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function fa({themeColor:o,id:r,showPrice:i,detail:a,errorText:l,customText:c,showGiftIcon:
|
|
1958
|
+
`,xa=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function fa({themeColor:o,id:r,showPrice:i,detail:a,errorText:l,customText:c,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,g]=ie(ca),[x,f]=t(null),[y,b]=t(!1),[h,v]=t(null),{setLoading:w}=Kt();n(()=>{a?.availableForSale&&b(!0),a?.variants?.nodes&&a?.variants?.nodes.length>0&&f(a?.variants?.nodes[0])},[a]);const C=x?.price?.amount,E=x?.image?.url||a?.featuredImage?.url;return y?e.createElement(da,{className:"yt-cart-gift-wrap-container"},e.createElement(pa,{className:"yt-cart-gift-wrap-row"},e.createElement(ua,{className:"yt-cart-gift-wrap-text-container"},d&&E?e.createElement(sa,{className:"yt-cart-gift-wrap-product-image",src:E,alt:"Gift wrap"}):s?e.createElement(W,{className:"yt-cart-gift-wrap-icon",size:24,color:o,style:{height:"24px",width:"24px"}}):null,c||"+ Gift-Wrap",i?e.createElement("span",{className:"yt-cart-gift-wrap-price",style:{color:o}},"₹",Number(C).toFixed(0)):""),e.createElement(ma,{className:"yt-cart-gift-wrap-checkbox",type:"checkbox",checked:m,onChange:async()=>{try{w(!0,!0),v(null),g(!m),!m&&p&&x?await p(xa(x?.id),1):m&&u&&x&&await u(xa(x?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),g(m),console.error("Error updating gift wrap:",e)}},$themeColor:o,disabled:!y})),h&&e.createElement(ga,{className:"yt-cart-gift-wrap-error-message"},h)):null}const ya=c.div`
|
|
1959
1959
|
margin-top: 10px;
|
|
1960
1960
|
margin-bottom: 5px;
|
|
1961
1961
|
margin-left: 1rem;
|
|
@@ -1974,7 +1974,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
1974
1974
|
`,ba=c.span`
|
|
1975
1975
|
font-size: 12px;
|
|
1976
1976
|
color: #333;
|
|
1977
|
-
`,ha=({minutes:o=5,customText:r="Your products are reserved in cart for",onTimerComplete:a})=>{const[l,c]=t(()=>{const e=localStorage.getItem("cartTimerTimeLeft");return e?Math.max(0,parseInt(e,10)):60*o}),
|
|
1977
|
+
`,ha=({minutes:o=5,customText:r="Your products are reserved in cart for",onTimerComplete:a})=>{const[l,c]=t(()=>{const e=localStorage.getItem("cartTimerTimeLeft");return e?Math.max(0,parseInt(e,10)):60*o}),s=i(()=>{c(0),localStorage.removeItem("cartTimerTimeLeft"),a()},[a]);n(()=>{if(l<=0)return void s();const e=setInterval(()=>{c(t=>{const n=t-1;return n<=0?(clearInterval(e),s(),0):(localStorage.setItem("cartTimerTimeLeft",n.toString()),n)})},1e3);return()=>clearInterval(e)},[l,s]);return e.createElement(ya,{className:"yt-cart-timer-container"},e.createElement(ba,{className:"yt-cart-timer-text"},r," ",e.createElement("span",{style:{fontWeight:"bold"}},(e=>{const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")} mins`})(l))))},va=c.div`
|
|
1978
1978
|
display: flex;
|
|
1979
1979
|
height: 49px;
|
|
1980
1980
|
padding: 15px var(--spacing-none, 0px);
|
|
@@ -2039,7 +2039,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2039
2039
|
line-height: 140%;
|
|
2040
2040
|
height: auto;
|
|
2041
2041
|
color: inherit;
|
|
2042
|
-
`,
|
|
2042
|
+
`,Na=c.div`
|
|
2043
2043
|
@keyframes clickAnimation {
|
|
2044
2044
|
0% {
|
|
2045
2045
|
transform: scale(1);
|
|
@@ -2058,19 +2058,19 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2058
2058
|
.copy-icon:hover {
|
|
2059
2059
|
cursor: pointer;
|
|
2060
2060
|
}
|
|
2061
|
-
`,
|
|
2061
|
+
`,Ba=c.div`
|
|
2062
2062
|
position: relative;
|
|
2063
2063
|
width: 100%;
|
|
2064
2064
|
overflow: hidden;
|
|
2065
|
-
`,
|
|
2065
|
+
`,Ia=c.div`
|
|
2066
2066
|
display: flex;
|
|
2067
2067
|
transition: transform 0.5s ease;
|
|
2068
2068
|
transform: translateX(-${e=>100*e.$currentIndex}%);
|
|
2069
|
-
`,
|
|
2069
|
+
`,za=c.div`
|
|
2070
2070
|
min-width: 100%;
|
|
2071
2071
|
flex-shrink: 0;
|
|
2072
2072
|
align-content: center;
|
|
2073
|
-
`,
|
|
2073
|
+
`,Fa=c.button`
|
|
2074
2074
|
position: absolute;
|
|
2075
2075
|
top: 50%;
|
|
2076
2076
|
transform: translateY(-50%);
|
|
@@ -2158,7 +2158,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2158
2158
|
object-fit: cover;
|
|
2159
2159
|
display: block;
|
|
2160
2160
|
}
|
|
2161
|
-
`,_a=({imageUrls:t,redirectionLink:n,cartOffersCarouselHeight:o,enableMarquee:r=!0})=>{if(!t||0===t.length)return null;const i=()=>{n&&(window.location.href=n)};if(!r)return e.createElement(Aa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("img",{src:t[0],alt:"banner"}));const a=[...t,...t];return e.createElement(Pa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content"},a.map((t,n)=>e.createElement("img",{key:`marquee-img-${n}`,src:t,alt:`banner ${n+1}`})))))},Ra=({backgroundColor:o,titleText:r,descriptionText:i,criteria:a=[],pauseTimer:l,textAlignment:c="center",redirectionUrl:
|
|
2161
|
+
`,_a=({imageUrls:t,redirectionLink:n,cartOffersCarouselHeight:o,enableMarquee:r=!0})=>{if(!t||0===t.length)return null;const i=()=>{n&&(window.location.href=n)};if(!r)return e.createElement(Aa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("img",{src:t[0],alt:"banner"}));const a=[...t,...t];return e.createElement(Pa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content"},a.map((t,n)=>e.createElement("img",{key:`marquee-img-${n}`,src:t,alt:`banner ${n+1}`})))))},Ra=({backgroundColor:o,titleText:r,descriptionText:i,criteria:a=[],pauseTimer:l,textAlignment:c="center",redirectionUrl:s,enableCustomCriteria:d=!0,cartData:p})=>{const[u,m]=t(0),g=e.useRef(null),x=e.useRef([]),f=d?a.filter(e=>{if(!p)return!1;if("mov"===e.type){return tn(p?.items_subtotal_price??0,p?.currency??"INR")>=e.value}if("moq"===e.type){return p.items.filter(e=>!e.properties?._isYtFreebie).reduce((e,t)=>e+(t.quantity||1),0)>=e.value}return!1}):[],y=Boolean(r&&r.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:r,descriptionText:i}]:[],...f.map(e=>({type:"criteria",titleText:e.message,descriptionText:"",redirectionUrl:e.redirectionUrl}))],h=b.length,v=h>0,w=h>1,C=e=>{"criteria"===e.type&&e.redirectionUrl?window.location.href=e.redirectionUrl:"default"===e.type&&s&&(window.location.href=s)};let E,k=!1;h>0&&(E=b[u]??b[0],k="criteria"===E.type&&Boolean(E.redirectionUrl)||"default"===E.type&&Boolean(s)),n(()=>{const e=f.filter(e=>!x.current.some(t=>t.id===e.id));if(e.length>0){const t=e[0],n=f.findIndex(e=>e.id===t.id);if(-1!==n){const e=(y?1:0)+n;e<b.length&&m(e)}}x.current=f},[f,b,y]),n(()=>{h>0&&u>=h&&m(h-1)},[u,h]),n(()=>{g.current&&pn(g.current)},[o,b,u]),n(()=>{if(!w)return void m(0);const e=setInterval(()=>{m(e=>(e+1)%h)},1e3*l);return()=>clearInterval(e)},[w,h,l]);return v?e.createElement(wa,{ref:g,$backgroundColor:o},e.createElement(Ea,null,w?e.createElement(Ba,null,e.createElement(Fa,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(ke,null)),e.createElement(Ia,{$currentIndex:u},b.map((t,n)=>e.createElement(za,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&s?"pointer":"default"}},e.createElement(Ta,null,e.createElement(Sa,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement($a,{style:{textAlign:"center"}},t.descriptionText))))),e.createElement(Fa,{$position:"right",onClick:()=>{m(e=>(e+1)%h)}},e.createElement(Te,null))):e.createElement(Ta,{onClick:()=>E&&C(E),style:{cursor:k?"pointer":"default"}},(()=>{const t=b[u]??b[0];return e.createElement(e.Fragment,null,e.createElement(Sa,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement($a,{style:{textAlign:"center"}},t.descriptionText))})()))):null},Oa=({backgroundColor:t,imageUrl:o,titleText:r,descriptionText:i,textAlignment:a,redirectionUrl:l})=>{const c=e.useRef(null);n(()=>{c.current&&pn(c.current)},[t]);return e.createElement(va,{ref:c,$backgroundColor:t,onClick:()=>{l&&(window.location.href=l)},style:{cursor:l?"pointer":"default"}},e.createElement(Ca,null,e.createElement(ka,{$imageUrl:o}),e.createElement(Ta,null,e.createElement(Sa,{style:{textAlign:"center"}},r),e.createElement($a,{style:{textAlign:"center"}},i))))},La=({backgroundColor:t,couponCode:o,copySuccess:r,setCopySuccess:i,titleText:a,descriptionText:l,textAlignment:c="center"})=>{const s=e.useRef(null);n(()=>{s.current&&pn(s.current)},[t]);return e.createElement(va,{ref:s,$backgroundColor:t,style:{position:"relative"}},e.createElement(Ca,{style:{filter:r?"blur(5px)":"none",zIndex:1}},e.createElement(Ta,{style:{borderRight:"1px solid #d9d9d9",paddingRight:"5px"}},e.createElement(Sa,{style:{textAlign:"center"}},a),e.createElement($a,{style:{textAlign:"center"}},l)),e.createElement(Na,null,e.createElement(pe,{className:"copy-icon",size:24,onClick:()=>(e=>{navigator.clipboard.writeText(e).then(()=>{i(!0)},e=>{i(!1)}),setTimeout(()=>{i(!1)},3e3)})(o),style:{height:"24px",width:"24px"}}))))},Ma=({children:o,autoSlide:r=!0,autoSlideInterval:i,copySuccess:a,themeColor:l})=>{const[c,s]=t(0),d=e.Children.count(o),[p,u]=t(!1),[m,g]=t(r),x=()=>{s(e=>e===d-1?0:e+1)};return n(()=>{if(!m)return;const e=setInterval(x,i);return()=>clearInterval(e)},[m,i]),e.createElement(Da,null,a&&e.createElement("div",{className:"coupon-code-copied",style:{position:"absolute",top:"20%",left:"50%",transform:"translate(-50%, -20%)",backgroundColor:l,display:"flex",alignItems:"center",justifyContent:"center",gap:"9px",borderRadius:"9px",padding:"12px 30px",color:"#FFF",fontFamily:"Poppins",fontSize:"12px",fontWeight:"400",lineHeight:"118%",zIndex:2,minWidth:"70%"}},e.createElement(q,{size:20,color:"white",style:{height:"24px",width:"24px"}}),"Coupon Code Copied"),e.createElement("div",{onMouseEnter:()=>{u(!0),g(!1)},onMouseLeave:()=>{u(!1),g(!0)},style:{display:"flex",transition:p?"none":"transform 0.5s ease",transform:`translateX(-${100*c}%)`,cursor:"pointer"}},e.Children.toArray(o)))};function ja({cartOffersCarousalData:n,themeColor:o,cartOffersCarouselHeight:r,cartData:i}){const[a,l]=t(!1),{enableCartOffersCarousel:c,pauseTimer:s,backgroundColor:d,slides:p}=n,u=p.filter(e=>"ImageOnly"===e.slideType).map(e=>e.imageUrl).filter(e=>!!e),m=p.findIndex(e=>"ImageOnly"===e.slideType),g=[];let x=!1;return p.forEach((t,n)=>{if("ImageOnly"===t.slideType)n===m&&u.length>0&&!x&&(g.push(e.createElement(_a,{key:`image-only-marquee-${t.slideNumber}`,imageUrls:u,redirectionLink:t.redirectionUrl||t.carouselRedirectionLink,cartOffersCarouselHeight:r,enableMarquee:!1!==t.enableMarquee})),x=!0);else switch(t.slideType){case"TextFieldOnly":g.push(e.createElement(Ra,{key:t.slideNumber,backgroundColor:d,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",criteria:t.criteria,pauseTimer:s,textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink,enableCustomCriteria:t.enableCustomCriteria,cartData:i}));break;case"TextImage":g.push(e.createElement(Oa,{key:t.slideNumber,backgroundColor:d,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",imageUrl:t.imageUrl||"",textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink}));break;case"TextCode":g.push(e.createElement(La,{key:t.slideNumber,backgroundColor:d,couponCode:t.campaignCode??"",titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",copySuccess:a,setCopySuccess:l,textAlignment:t.textAlignment}))}}),c&&0!==g.length?e.createElement(Ma,{copySuccess:a,autoSlideInterval:1e3*s,themeColor:o},g):null}const Va=s`
|
|
2162
2162
|
0% {
|
|
2163
2163
|
background-position: 200% 0;
|
|
2164
2164
|
}
|
|
@@ -2178,14 +2178,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2178
2178
|
margin: 5px 0 0 0 !important;
|
|
2179
2179
|
visibility: ${({$show:e})=>e?"visible":"hidden"};
|
|
2180
2180
|
|
|
2181
|
-
${({$show:e})=>e&&
|
|
2181
|
+
${({$show:e})=>e&&d`
|
|
2182
2182
|
animation: ${Va} 1.5s linear infinite;
|
|
2183
2183
|
`}
|
|
2184
|
-
`,qa=({$themeColor:t,show:n})=>e.createElement(Wa,
|
|
2184
|
+
`,qa=({$themeColor:t,show:n})=>e.createElement(Wa,{className:"yt-cart-progress-loader"},e.createElement(Ha,{$themeColor:t,$show:n})),Qa=c.span`
|
|
2185
2185
|
display: flex !important;
|
|
2186
2186
|
align-items: center !important;
|
|
2187
2187
|
column-gap: 3px !important;
|
|
2188
|
-
`,Ua=({loyaltyIcon:t,backgroundSubdued:n,primaryTextColor:o,pointsRewardRate:r,rewardMultiplier:i})=>{const a=ae(Ut),l=.01*r*tn(a?.total_price,a?.currency),c="number"==typeof i&&i>0?l*i:l;return e.createElement("div",{style:{paddingTop:"10px",paddingBottom:"5px",justifyContent:"center",display:"flex",fontSize:"11px",alignItems:"center",margin:"0px 1rem",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"0.2px solid #00000040",borderTop:"none",transform:"translateY(-5px)",background:n??"#9090901F",color:o??"#000000"}},e.createElement(Qa,
|
|
2188
|
+
`,Ua=({loyaltyIcon:t,backgroundSubdued:n,primaryTextColor:o,pointsRewardRate:r,rewardMultiplier:i})=>{const a=ae(Ut),l=.01*r*tn(a?.total_price,a?.currency),c="number"==typeof i&&i>0?l*i:l;return e.createElement("div",{className:"yt-cart-reward-points-preview",style:{paddingTop:"10px",paddingBottom:"5px",justifyContent:"center",display:"flex",fontSize:"11px",alignItems:"center",margin:"0px 1rem",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"0.2px solid #00000040",borderTop:"none",transform:"translateY(-5px)",background:n??"#9090901F",color:o??"#000000"}},e.createElement(Qa,{className:"yt-cart-reward-points-text"},"you earn"," ",e.createElement("img",{style:{alignSelf:"center",height:"18px",width:"18px"},src:t,height:"18px",width:"18px"})," ",e.createElement("span",{style:{fontWeight:600}},c.toFixed(2)," points")," ","on this order"))},Ya=c.span`
|
|
2189
2189
|
position: relative;
|
|
2190
2190
|
overflow: hidden;
|
|
2191
2191
|
border-radius: 9999px;
|
|
@@ -2233,7 +2233,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2233
2233
|
left: 150%;
|
|
2234
2234
|
}
|
|
2235
2235
|
}
|
|
2236
|
-
`,Ga=({loyaltyIcon:t,pointsRewardRate:n=0,brandTokenName:o,themeColor:r,themeTextColor:i,rewardMultiplier:a})=>{const l=ae(Ut),c=.01*n*tn(l?.total_price,l?.currency),
|
|
2236
|
+
`,Ga=({loyaltyIcon:t,pointsRewardRate:n=0,brandTokenName:o,themeColor:r,themeTextColor:i,rewardMultiplier:a})=>{const l=ae(Ut),c=.01*n*tn(l?.total_price,l?.currency),s="number"==typeof a&&a>0?c*a:c;return n<=0?null:e.createElement(Ya,{className:"yt-cart-loyalty-badge",$themeColor:r,$themeTextColor:i},"Get"," ",t&&e.createElement("img",{src:t,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}),Number(s.toFixed(0))," ",o??"points"," ",e.createElement("div",{className:"yt-cart-loyalty-badge-shine shine-container"},e.createElement("div",{className:"shine-element"})))};function Xa({showDiscountOnMRP:i,cartCheckpoints:a,toggleDecimal:l,primaryTextColor:c,discountApplied:s,discountAmountApplied:d,showTrustedBadge:p=!0}){const u=ae(Ut),m=on(u,u?.currency),[g,x]=t(!1),f=r(null),[y,b]=t("0px"),h=tn(u?.original_total_price,u?.currency),v=o(()=>a?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[a]),w=o(()=>!(!v||!v.minimumOrderValue)&&h>=v.minimumOrderValue,[v,h]),C=w&&v&&v.discountValue||0,E=o(()=>{if(!u?.items?.length)return 0;const e=u.items.reduce((e,t)=>e+(i&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return tn(e,u?.currency)},[u?.items,i]),k=o(()=>w?E+C:E,[w,E,C]),T=o(()=>u?.items?.length?u.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[u?.items]),S=tn(T,u?.currency??"INR"),$=o(()=>{const e={};return u?.items?.length?(u.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[u?.items]),N=o(()=>{const e=[];for(const t in $)if(Object.prototype.hasOwnProperty.call($,t)){const n=$[t],o=tn(n,u?.currency??"INR"),r=xn(t);e.push({title:r,amount:o})}return e},[$,u?.currency]),B=o(()=>{let e=0;return i&&(e+=S),N.forEach(t=>{e+=t.amount}),w&&(e+=C),e},[S,N,i,w,C]),I=d?tn(d,u?.currency??"INR"):0,z=Number((h-I).toFixed(2));n(()=>{f.current&&b(g?`${f.current.scrollHeight}px`:"0px")},[g,N,w]);const F=S>0||s&&N.length>0||w&&C>0;return u?.item_count?e.createElement("div",{className:"yt-cart-subtotal-section-scroll",style:{backgroundColor:"rgba(138, 138, 138, 0.08)",padding:"10px 1rem",marginTop:"8px"}},e.createElement("div",{className:"yt-cart-subtotal-breakdown",style:{display:"flex",flexDirection:"column",rowGap:"2px",color:c}},F&&B>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px"}},m,un(w?l?k.toFixed(2):k.toFixed(0):l?E.toFixed(2):E.toFixed(0)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{className:"yt-cart-discounts-section",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",e.createElement("button",{onClick:()=>{x(!g)},className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},g?"Hide details":"See details")),e.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",m,un(l?B.toFixed(2):B.toFixed(0)))),e.createElement("div",{ref:f,style:{height:y,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:g?1:0,marginTop:g?"5px":"0",borderTop:g?"1px solid #E5E7EB":"none",paddingTop:g?"5px":"0",fontWeight:"600"}},i&&S>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",m,un(l?S.toFixed(2):S.toFixed(0)))),w&&C>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",m,un(l?C.toFixed(2):C.toFixed(0)))),N.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",m,un(l?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},m,un(l?z.toFixed(2):z.toFixed(0))))),p&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"6px 0"}},e.createElement("img",{src:"https://r2.yourtoken.io/Frame%2038702.png",alt:"Powered by YourToken",style:{height:"auto",width:"340px"}}))):null}const Za=c.div`
|
|
2237
2237
|
padding: 8px 0 12px;
|
|
2238
2238
|
`,Ja=c.div`
|
|
2239
2239
|
display: flex;
|
|
@@ -2315,7 +2315,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2315
2315
|
gap: 10px;
|
|
2316
2316
|
transition: transform 0.3s ease;
|
|
2317
2317
|
transform: translateX(-${e=>e.$translate}px);
|
|
2318
|
-
`,
|
|
2318
|
+
`,sl=c.div`
|
|
2319
2319
|
position: absolute;
|
|
2320
2320
|
top: 0;
|
|
2321
2321
|
${({position:e})=>e}: 0;
|
|
@@ -2324,7 +2324,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2324
2324
|
pointer-events: none;
|
|
2325
2325
|
z-index: 1;
|
|
2326
2326
|
background: ${({position:e})=>"left"===e?"linear-gradient(to left, rgba(255,255,255,0), rgba(255,255,255,1))":"linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1))"};
|
|
2327
|
-
`,
|
|
2327
|
+
`,dl=c.button`
|
|
2328
2328
|
position: absolute;
|
|
2329
2329
|
top: 50%;
|
|
2330
2330
|
transform: translateY(-50%);
|
|
@@ -2343,9 +2343,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2343
2343
|
opacity: 0.5;
|
|
2344
2344
|
cursor: not-allowed;
|
|
2345
2345
|
}
|
|
2346
|
-
`,pl=c(
|
|
2346
|
+
`,pl=c(dl)`
|
|
2347
2347
|
left: -3px;
|
|
2348
|
-
`,ul=c(
|
|
2348
|
+
`,ul=c(dl)`
|
|
2349
2349
|
right: -4px;
|
|
2350
2350
|
`,ml=c.div`
|
|
2351
2351
|
display: flex;
|
|
@@ -2433,7 +2433,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2433
2433
|
&:hover {
|
|
2434
2434
|
opacity: ${e=>e.$locked?.5:.85};
|
|
2435
2435
|
}
|
|
2436
|
-
`,kl=(e,t)=>e.find(e=>(e?.variants?.edges??e?.variants?.nodes??[]).some(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t})),Tl=(e,t)=>{const n=(e?.variants?.edges??e?.variants?.nodes??[]).find(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t});return n?.node??n},Sl=({stealDealCheckpoints:i,stealDealProducts:a,freeProductAdjustedCartTotal:l,effectiveQuantityForProgressBar:c,addFreebieToCart:
|
|
2436
|
+
`,kl=(e,t)=>e.find(e=>(e?.variants?.edges??e?.variants?.nodes??[]).some(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t})),Tl=(e,t)=>{const n=(e?.variants?.edges??e?.variants?.nodes??[]).find(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t});return n?.node??n},Sl=({stealDealCheckpoints:i,stealDealProducts:a,freeProductAdjustedCartTotal:l,effectiveQuantityForProgressBar:c,addFreebieToCart:s,freebiesInCart:d,primaryTextColor:p})=>{const u=ae(Ut),{setLoading:m}=Kt(),f=le(en),y=i?.[0],[b,h]=t(0),[v,w]=t(0),C=r(null),E=r(null),k=r(null),T=o(()=>(l||Number(u?.items_subtotal_price))/100,[l,u?.items_subtotal_price]),S=on(u,u?.currency),$=o(()=>{if(!y)return!1;return"minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value")?T>=y.minimumOrderValue:(u?.item_count??0)>=y.quantityThreshold},[y,T,u?.item_count]),N=y?.maxFreebiesInTier??1,B=o(()=>{if(!y)return 0;return(y.customerGetsProductIds?.ids??[]).filter(e=>d.includes(e)).length},[y,d])>=N,I=o(()=>{if(!y||!a?.length)return[];const e=y.customerGetsProductIds?.ids??[],t=[];for(const n of e){const e=kl(a,n);if(!e)continue;const o=Tl(e,n),r=Number(o?.price?.amount?o.price.amount:o?.price??0);let i,l;"no_discount"===y.freebieType?(i=r,l=0):"percentage_off"===y.freebieType&&y.discountPercentage?(l=y.discountPercentage,i=r*(1-l/100)):(i=y.discountValue??r,l=r>0?Math.round((r-i)/r*100):0);const c=d.includes(n),s=e?._claim_allowed_variants??[n];t.push({product:e,variantId:n,isUnlocked:$,isClaimed:c,discountPercent:l,dealPrice:i,originalPrice:r,allowedVariantIds:s})}return t},[y,a,d,$]);n(()=>{if(C.current){const e=C.current.offsetWidth,t=window.innerWidth<=768;w(t?Math.min(.95*e,280):Math.min(.8*e,320))}},[I.length]);const z=Math.max(0,I.length-1);n(()=>{b>z&&h(z)},[z,b]);const F=()=>{h(e=>0===e?z:e-1)},D=()=>{h(e=>e===z?0:e+1)};if(!y||!I.length)return null;return e.createElement(Za,null,e.createElement(Ja,null,e.createElement(Ka,{style:{color:p}},e.createElement(el,null,"STEAL"),e.createElement(tl,null,"DEALS")),B?e.createElement(il,null,"Max ",N," claims reached"):$?e.createElement(rl,null,e.createElement(Q,{size:10}),"UNLOCKED"):e.createElement(nl,null,e.createElement(ol,null),"minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value")?e.createElement(e.Fragment,null,"UNLOCK AT ",S,y.minimumOrderValue):e.createElement(e.Fragment,null,"UNLOCK AT ",y.quantityThreshold," ITEMS"))),e.createElement(al,{ref:C,onTouchStart:e=>{E.current=e.touches[0].clientX,k.current=e.touches[0].clientY},onTouchMove:e=>{if(null===E.current||null===k.current)return;const t=e.touches[0].clientX-E.current,n=e.touches[0].clientY-k.current;Math.abs(t)>10&&Math.abs(t)>Math.abs(n)&&e.preventDefault()},onTouchEnd:e=>{if(null===E.current)return;const t=e.changedTouches[0].clientX-E.current;Math.abs(t)>50&&(t<0?D():F()),E.current=null,k.current=null}},I.length>1&&e.createElement(pl,{onClick:F},e.createElement(g,{size:30,color:"#4D4D4D"})),e.createElement(sl,{position:"left",style:{display:"flex"}}),e.createElement(sl,{position:"right",style:{display:"flex"}}),e.createElement(ll,{$cardWidth:v},e.createElement(cl,{$translate:b*(v+10)},I.map(t=>{return e.createElement("div",{key:t.variantId,style:{width:`${v}px`,flexShrink:0},className:"yt-steal-deal-card"},e.createElement(ml,null,e.createElement(gl,null,e.createElement(xl,{src:(n=t.product,n?.featuredMedia?.preview?.image?.url??n?.featuredImage?.url??n?.images?.edges?.[0]?.node?.url??n?.image?.src??""),alt:t.product?.title??""}),t.discountPercent>0&&e.createElement(fl,null,"-",t.discountPercent,"% OFF")),e.createElement(yl,null,e.createElement(bl,null,t.product?.title??""),e.createElement(Cl,null,e.createElement(hl,null,e.createElement(vl,null,S,t.dealPrice.toLocaleString()),t.originalPrice>t.dealPrice&&e.createElement(wl,null,S,t.originalPrice.toLocaleString())),e.createElement(El,{$locked:!t.isUnlocked||t.isClaimed||B,onClick:()=>(async e=>{if(e.isUnlocked&&!e.isClaimed&&!B&&s){if(e.allowedVariantIds.length>1){const t=e.product?.variants?.edges??e.product?.variants?.nodes??[];if(e.allowedVariantIds.some(n=>t.some(t=>{const o=t?.node??t;return(String(o?.id??"").split("/").pop()===n||String(o?.id??"").includes(n))&&Kr(e.product,o)}))){const t=e.product?.id?.split("/").pop();return void f({open:!0,variantId:e.variantId,handle:e.product?.handle,freebieSelection:!0,stealDealSelection:!0,productId:t,allowedVariantIds:e.allowedVariantIds})}}m(!0,!0);try{await s(e.variantId,e.allowedVariantIds),window.dispatchEvent(new CustomEvent("yt:autoFreebieAdded"))}catch(e){}finally{m(!1,!1)}}})(t),disabled:!t.isUnlocked||t.isClaimed||B},t.isUnlocked?e.createElement(U,{size:12}):e.createElement(Y,{size:12}))))));var n}))),I.length>1&&e.createElement(ul,{onClick:D},e.createElement(x,{size:30,color:"#4D4D4D"}))))},$l=c.div`
|
|
2437
2437
|
line-height: normal;
|
|
2438
2438
|
position: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"relative":"fixed"};
|
|
2439
2439
|
top: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"auto":"0"};
|
|
@@ -2456,7 +2456,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2456
2456
|
width: ${e=>e.$switchWidthVariant||e.$enableCustomCartOnCartPage&&e.$isCartPage&&!e.$isLargeScreen?"100%":"91%"};
|
|
2457
2457
|
max-width: ${e=>e.$switchWidthVariant||e.$enableCustomCartOnCartPage&&e.$isCartPage&&!e.$isLargeScreen?"100%":"97%"};
|
|
2458
2458
|
}
|
|
2459
|
-
`,
|
|
2459
|
+
`,Nl=c.span`
|
|
2460
2460
|
background-color: ${e=>e.$backgroundSubdued||"#e1e1e1"};
|
|
2461
2461
|
border-radius: 50%;
|
|
2462
2462
|
width: 14px;
|
|
@@ -2468,7 +2468,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2468
2468
|
font-weight: 400;
|
|
2469
2469
|
min-width: 14px;
|
|
2470
2470
|
line-height: 14px;
|
|
2471
|
-
`,Il=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:B,removeDiscount:I,applyDiscount:z,checkoutFunction:F,joinNowFunction:N,guestLoyaltyPercentage:D,isDev:P,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:O,redemptionRate:L,pointsRewardRate:M,showCartLevelAltPay:W,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:le,emptyProductRecsTitleText:ce,showProductRecsOnDesktop:de,showProductRecsOnMobile:se,themeColor:pe,themeTextColor:ue,companyName:me,gstNumber:ge,showGSTOption:xe,applyGSTToCart:fe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:he=!1,freeProductAdjustedCartTotal:ve,minimumOrderValueToAvailDiscount:we,signinCTAButtonVisible:Ce,cartSigninCTAMainText:Ee,applyNoteToCart:ke,note:Te,showNoteOption:Se,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:ze,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:De,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Oe,productPercentageOffMapping:Le,removeFreebieFromCart:Me,postalCodeList:je,enableGeoLocationDeliveryRestriction:Ve=!1,getProductDetailsByVariantId:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Je,deliveryNotAvailableText:Ke,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:nt,enableCustomCartOnCartPage:ot,isCartPage:rt,showCartTimer:it,showFreebieMilestone:at,freebieMilestoneData:lt,cartTimerInMinutes:ct,cartTimerCustomText:dt,productRecsCardLayout:st,productRecsCardListVariant:pt,imageAspectSelector:ut,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,cartOffersCarousalData:xt,gstSectionCustomizationData:ft,noteSectionTitle:yt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,showVariantSelectionDropdownInProductClaim:vt,loyaltyDiscount:wt,brandTokenName:Ct,showDiscountOnMRP:Et,switchWidthVariant:kt,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,toggleDecimal:Bt,cartOffersCarouselHeight:It,disableCheckoutButton:zt,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Nt,applyCouponCode:Dt,showApplyCoupon:Pt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Ot,stealDealProducts:Lt,stealDealAddToCart:Mt,showCouponOptions:jt,rewardCoupons:Vt,applyTemplateDiscount:Wt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt})=>{const Gt=ae(Ut),nn=ae(Jt),[on,rn]=t(!1),[an,ln]=t(!1),[cn,dn]=t(!0),{setLoading:sn}=Kt();e.useEffect(()=>{Fe&&Fe(sn)},[Fe]);const pn=r(!!Ht&&(window.ytCartShellState?.isOpen??!1)),un=r(null),mn=r(null);n(()=>{const e=()=>{i(!1)};return o?(pn.current||(un.current=window.history.state,mn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),pn.current=!0):(pn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(un.current,"",mn.current??window.location.href),pn.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[gn,xn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(ot&&rt?e.classList.remove("drawer-open"):!gn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,ot,rt,gn]),n(()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const fn=Gt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{rn(!0),window.setTimeout(()=>rn(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[yn,bn]=t("normal"),[hn,vn]=t("normal"),[wn,Cn]=t("auto");n(()=>{CSS.supports("font-weight","500")?bn("500"):CSS.supports("font-weight","400")?bn("400"):CSS.supports("font-weight","600")&&bn("600"),CSS.supports("font-weight","400")?vn("400"):CSS.supports("font-weight","300")?vn("300"):CSS.supports("font-weight","200")&&vn("200"),CSS.supports("width","-webkit-fill-available")?Cn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Cn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",yn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",hn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",wn)},[yn,hn]);const[En]=ie(Yt),[kn]=ie(Zt),[Tn]=ie(Xt);n(()=>{dn(!("all-products"!==Ge&&("specific-tags"!==Ge||En.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||En.isPostalCodeValid||kn||!Xe)&&("specific-tags"===Ge&&"standard"===Tn||an&&(Xe?En.isPostalCodeValid&&kn:En.isPostalCodeValid))))},[En.isPostalCodeValid,kn,an,Ge,Xe]),ie(en);const[Sn,$n]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&$n(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&$n(!1)},[]);const Bn=new Date("2024-11-01");tn(Gt?.items_subtotal_price,Gt?.currency);const In=Ht?document.getElementById("yt-cart-shell-content"):null,zn=e.createElement(e.Fragment,null,nn.cartLoading?e.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},nn.showLoader&&!nn.showSkeletonLoader&&e.createElement("div",{className:"loader"},"")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",null,e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:te,fontSize:"16px"}},e.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Gt?.item_count>0&&W&&!(he&&W)&&M>0&&e.createElement(Ga,{pointsRewardRate:M,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),fn>0&&e.createElement(Bl,{$backgroundSubdued:l},fn)),e.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(ot&&rt)&&e.createElement("div",{className:"close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(oe,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),nn&&e.createElement(qa,{$themeColor:pe,show:nn.showLoader}),xt?.enableCartOffersCarousel&&e.createElement(ja,{themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:It,cartData:Gt}),it&&Sn&&Gt?.item_count?e.createElement(ha,{minutes:ct,customText:dt,onTimerComplete:()=>{$n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,on&&At&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3}}),$e?e.createElement(oa,{inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,themeColor:pe,tooltipText:Ie,themeTextColor:ue}):null),R&&Gt?.items_subtotal_price>0&&Gt?.currency&&!!O&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[xo(o)]&&("minimum_order_value"!==o||1!==e?.[xo(o)])).some((e,a)=>fo(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(O,tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),void 0===Oe?Gt?.item_count:Oe,X??"minimum_order_value",Gt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(zo,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:O,effectiveQuantityForProgressBar:void 0===Oe?Gt?.item_count:Oe,currentCartAmount:tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Gt?.item_count>0&&e.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Gt?.items?.length&&0===Gt?.item_count&&!1===nn?.showSkeletonLoader?e.createElement(Do,{showLoyaltyCta:he,joinNowFunction:N,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:H,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,recProductsList:_,addCartItem:h,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ne,emptyProductRecsTitleText:ce,backgroundSubdued:l,showEmptyCartRecommendations:Ft,tertiaryColor:c,tertiaryTextColor:d}):e.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},e.createElement(Pr,{isDev:P,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:ze,productPercentageOffMapping:Le,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:O,freeProductAdjustedCartTotal:ve,imageAspectSelector:ut,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,giftWrapVariantId:tt?.variants?.nodes[0]?.id,giftWrapProductId:et?.giftProductId,showGiftWrapAsLineItem:et?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:d,backgroundColor:a,showDiscountOnMRP:Et,checkoutSectionMessage:bt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:at,freebieMilestoneData:lt,freeLabelText:Ye?.freeLabelText}),Ot&&Ot.length>0&&Lt&&Lt.length>0&&Gt?.item_count>0&&e.createElement(Sl,{stealDealCheckpoints:Ot,stealDealProducts:Lt,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Oe,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}),gn&&de&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ne,cardLayout:st,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:d}),!gn&&se&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ne,cardLayout:st,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:d}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Xa,{showDiscountOnMRP:Et,cartCheckpoints:O,toggleDecimal:Bt,primaryTextColor:te,discountApplied:B,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(qo,null,Gt?.item_count>0&&w&&C&&e.createElement(Ar,{bundleProducts:C}),xe&&!!fe&&Gt?.item_count>0&&e.createElement(Zr,{companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}),!!Gt&&Gt?.item_count>0&&!!_e&&!!Pe&&!!Re&&Pe.length>0&&e.createElement(na,{freebieProductsInCart:Pe,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:O,isCartDrawerOpen:o}),Ve&&(je?.length??0)>0&&!!He&&Gt?.item_count>0&&e.createElement("div",{className:"form-group"},e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>dn(!cn)},e.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(J,null)),e.createElement("div",{className:"icon-transition"},cn?e.createElement(j,null):e.createElement(V,null))),"all-products"===Ge&&cn?e.createElement(aa,{postalCodeList:je,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Je,deliveryNotAvailableText:Ke,disabledDates:Bn}):cn&&(an?e.createElement(aa,{postalCodeList:je,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Je,deliveryNotAvailableText:Ke,disabledDates:Bn}):e.createElement(la,{postalCodeList:je,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Bn}))),Se&&!!ke&&Gt?.item_count>0&&e.createElement(Jr,{note:Te,noteSectionTitle:yt}),et?.showGiftWrapOption&&Gt?.item_count>0&&e.createElement(fa,{themeColor:pe,id:et?.giftProductId,detail:tt,showPrice:et?.showPrice,errorText:et?.errorText,customText:et?.customText,showGiftIcon:et?.showGiftIcon,showProductImage:et?.showProductImage,addCartItem:h,removeCartItem:f}),Gt?.item_count>0&&jt&&Vt&&Dt&&!he&&e.createElement(Or,{rewardCoupons:Vt,applyCouponCode:Dt,removeDiscount:I,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt}),Gt?.item_count>0&&Pt&&!jt&&!he&&Dt&&e.createElement(_r,{backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Dt,removeDiscount:I,enableConfetti:At}),e.createElement("div",null,Gt?.item_count>0&&e.createElement(e.Fragment,null,v||!he||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&he&&!!z&&e.createElement(Zo,{themeColor:pe,applyDiscount:z,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:W,redemptionMultiplier:$}):!!D&&!!N&&e.createElement(Wo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:N,guestLoyaltyPercentage:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:W})),Gt?.item_count>0&&!!wt&&!!I&&he&&wt&&void 0!==T&&e.createElement(Uo,{themeColor:pe,removeDiscount:I,loyaltyDiscount:wt,isDev:P,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:W}),he&&W&&L&&k&&Gt?.item_count>0&&e.createElement(Ua,{loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:M,rewardMultiplier:S})),he&&Gt&&Gt.item_count>0&&!!we&&we>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:pe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ce?"space-between":"center"}},"Minimum order value to use ",Ct,":"," ",we),Gt&&F&&Gt?.item_count>0&&e.createElement("div",null,e.createElement(Oo,{disableCheckoutButton:!!zt||nn.cartLoading,discountApplied:B,checkoutFunction:F,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:U,isStickyCheckout:Y,discountAmountApplied:q,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:fe,showGSTOption:xe,applyNoteToCart:ke,showNoteOption:Se,enableGeoLocationDeliveryRestriction:Ve,applyPostalCodeAndDeliverySlotToCart:He,enableSlotPicker:Xe,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Et,tertiaryColor:c,tertiaryTextColor:d,cartCheckpoints:O,toggleDecimal:Bt,checkoutButtonBottomSpacing:Nt,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt}))))));return Ht&&In?A(zn,In):e.createElement($l,{className:"yt-cart-drawer",$isDev:P,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:ot,$isCartPage:rt,$isLargeScreen:gn,$switchWidthVariant:kt},zn)};gt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const zl=c.div`
|
|
2471
|
+
`,Bl=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:N,removeDiscount:B,applyDiscount:I,checkoutFunction:z,joinNowFunction:F,guestLoyaltyPercentage:D,isDev:P,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:O,redemptionRate:L,pointsRewardRate:M,showCartLevelAltPay:W,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:le,emptyProductRecsTitleText:ce,showProductRecsOnDesktop:se,showProductRecsOnMobile:de,themeColor:pe,themeTextColor:ue,companyName:me,gstNumber:ge,showGSTOption:xe,applyGSTToCart:fe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:he=!1,freeProductAdjustedCartTotal:ve,minimumOrderValueToAvailDiscount:we,signinCTAButtonVisible:Ce,cartSigninCTAMainText:Ee,applyNoteToCart:ke,note:Te,showNoteOption:Se,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Ne,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Oe,productPercentageOffMapping:Le,removeFreebieFromCart:Me,postalCodeList:je,enableGeoLocationDeliveryRestriction:Ve=!1,getProductDetailsByVariantId:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Je,deliveryNotAvailableText:Ke,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:nt,enableCustomCartOnCartPage:ot,isCartPage:rt,showCartTimer:it,showFreebieMilestone:at,freebieMilestoneData:lt,cartTimerInMinutes:ct,cartTimerCustomText:st,productRecsCardLayout:dt,productRecsCardListVariant:pt,imageAspectSelector:ut,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,cartOffersCarousalData:xt,gstSectionCustomizationData:ft,noteSectionTitle:yt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,showVariantSelectionDropdownInProductClaim:vt,loyaltyDiscount:wt,brandTokenName:Ct,showDiscountOnMRP:Et,switchWidthVariant:kt,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,toggleDecimal:Nt,cartOffersCarouselHeight:Bt,disableCheckoutButton:It,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:Ft,applyCouponCode:Dt,showApplyCoupon:Pt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Ot,stealDealProducts:Lt,stealDealAddToCart:Mt,showCouponOptions:jt,rewardCoupons:Vt,applyTemplateDiscount:Wt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt})=>{const Gt=ae(Ut),nn=ae(Jt),[on,rn]=t(!1),[an,ln]=t(!1),[cn,sn]=t(!0),{setLoading:dn}=Kt();e.useEffect(()=>{ze&&ze(dn)},[ze]);const pn=r(!!Ht&&(window.ytCartShellState?.isOpen??!1)),un=r(null),mn=r(null);n(()=>{const e=()=>{i(!1)};return o?(pn.current||(un.current=window.history.state,mn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),pn.current=!0):(pn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(un.current,"",mn.current??window.location.href),pn.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[gn,xn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(ot&&rt?e.classList.remove("drawer-open"):!gn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,ot,rt,gn]),n(()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const fn=Gt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{rn(!0),window.setTimeout(()=>rn(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[yn,bn]=t("normal"),[hn,vn]=t("normal"),[wn,Cn]=t("auto");n(()=>{CSS.supports("font-weight","500")?bn("500"):CSS.supports("font-weight","400")?bn("400"):CSS.supports("font-weight","600")&&bn("600"),CSS.supports("font-weight","400")?vn("400"):CSS.supports("font-weight","300")?vn("300"):CSS.supports("font-weight","200")&&vn("200"),CSS.supports("width","-webkit-fill-available")?Cn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Cn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",yn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",hn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",wn)},[yn,hn]);const[En]=ie(Yt),[kn]=ie(Zt),[Tn]=ie(Xt);n(()=>{sn(!("all-products"!==Ge&&("specific-tags"!==Ge||En.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||En.isPostalCodeValid||kn||!Xe)&&("specific-tags"===Ge&&"standard"===Tn||an&&(Xe?En.isPostalCodeValid&&kn:En.isPostalCodeValid))))},[En.isPostalCodeValid,kn,an,Ge,Xe]),ie(en);const[Sn,$n]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&$n(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&$n(!1)},[]);const Nn=new Date("2024-11-01");tn(Gt?.items_subtotal_price,Gt?.currency);const Bn=Ht?document.getElementById("yt-cart-shell-content"):null,In=e.createElement(e.Fragment,null,nn.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},nn.showLoader&&!nn.showSkeletonLoader&&e.createElement("div",{className:"loader"},"")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:te,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},u),Gt?.item_count>0&&W&&!(he&&W)&&M>0&&e.createElement(Ga,{pointsRewardRate:M,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),fn>0&&e.createElement(Nl,{$backgroundSubdued:l},fn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(ot&&rt)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(oe,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),nn&&e.createElement(qa,{$themeColor:pe,show:nn.showLoader}),xt?.enableCartOffersCarousel&&e.createElement(ja,{themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:Bt,cartData:Gt}),it&&Sn&&Gt?.item_count?e.createElement(ha,{minutes:ct,customText:st,onTimerComplete:()=>{$n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,on&&At&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3}}),$e?e.createElement(oa,{inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Ne,themeColor:pe,tooltipText:Be,themeTextColor:ue}):null),R&&Gt?.items_subtotal_price>0&&Gt?.currency&&!!O&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[xo(o)]&&("minimum_order_value"!==o||1!==e?.[xo(o)])).some((e,a)=>fo(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(O,tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),void 0===Oe?Gt?.item_count:Oe,X??"minimum_order_value",Gt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Io,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:O,effectiveQuantityForProgressBar:void 0===Oe?Gt?.item_count:Oe,currentCartAmount:tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Gt?.items?.length&&0===Gt?.item_count&&!1===nn?.showSkeletonLoader?e.createElement(Do,{showLoyaltyCta:he,joinNowFunction:F,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:H,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,recProductsList:_,addCartItem:h,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:ce,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},e.createElement(Pr,{isDev:P,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:O,freeProductAdjustedCartTotal:ve,imageAspectSelector:ut,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,giftWrapVariantId:tt?.variants?.nodes[0]?.id,giftWrapProductId:et?.giftProductId,showGiftWrapAsLineItem:et?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:a,showDiscountOnMRP:Et,checkoutSectionMessage:bt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:at,freebieMilestoneData:lt,freeLabelText:Ye?.freeLabelText}),Ot&&Ot.length>0&&Lt&&Lt.length>0&&Gt?.item_count>0&&e.createElement(Sl,{stealDealCheckpoints:Ot,stealDealProducts:Lt,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Oe,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}),gn&&se&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),!gn&&de&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Xa,{showDiscountOnMRP:Et,cartCheckpoints:O,toggleDecimal:Nt,primaryTextColor:te,discountApplied:N,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(qo,null,Gt?.item_count>0&&w&&C&&e.createElement(Ar,{bundleProducts:C}),xe&&!!fe&&Gt?.item_count>0&&e.createElement(Zr,{companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}),!!Gt&&Gt?.item_count>0&&!!_e&&!!Pe&&!!Re&&Pe.length>0&&e.createElement(na,{freebieProductsInCart:Pe,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:O,isCartDrawerOpen:o}),Ve&&(je?.length??0)>0&&!!He&&Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>sn(!cn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(J,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},cn?e.createElement(j,null):e.createElement(V,null))),"all-products"===Ge&&cn?e.createElement(aa,{postalCodeList:je,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Je,deliveryNotAvailableText:Ke,disabledDates:Nn}):cn&&(an?e.createElement(aa,{postalCodeList:je,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Je,deliveryNotAvailableText:Ke,disabledDates:Nn}):e.createElement(la,{postalCodeList:je,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Nn}))),Se&&!!ke&&Gt?.item_count>0&&e.createElement(Jr,{note:Te,noteSectionTitle:yt}),et?.showGiftWrapOption&&Gt?.item_count>0&&e.createElement(fa,{themeColor:pe,id:et?.giftProductId,detail:tt,showPrice:et?.showPrice,errorText:et?.errorText,customText:et?.customText,showGiftIcon:et?.showGiftIcon,showProductImage:et?.showProductImage,addCartItem:h,removeCartItem:f}),Gt?.item_count>0&&jt&&Vt&&Dt&&!he&&e.createElement(Or,{rewardCoupons:Vt,applyCouponCode:Dt,removeDiscount:B,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt}),Gt?.item_count>0&&Pt&&!jt&&!he&&Dt&&e.createElement(_r,{backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Dt,removeDiscount:B,enableConfetti:At}),e.createElement("div",null,Gt?.item_count>0&&e.createElement(e.Fragment,null,v||!he||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&he&&!!I&&e.createElement(Zo,{themeColor:pe,applyDiscount:I,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:W,redemptionMultiplier:$}):!!D&&!!F&&e.createElement(Wo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:F,guestLoyaltyPercentage:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:W})),Gt?.item_count>0&&!!wt&&!!B&&he&&wt&&void 0!==T&&e.createElement(Uo,{themeColor:pe,removeDiscount:B,loyaltyDiscount:wt,isDev:P,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:W}),he&&W&&L&&k&&Gt?.item_count>0&&e.createElement(Ua,{loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:M,rewardMultiplier:S})),he&&Gt&&Gt.item_count>0&&!!we&&we>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:pe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ce?"space-between":"center"}},"Minimum order value to use ",Ct,":"," ",we),Gt&&z&&Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Oo,{disableCheckoutButton:!!It||nn.cartLoading,discountApplied:N,checkoutFunction:z,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:U,isStickyCheckout:Y,discountAmountApplied:q,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:fe,showGSTOption:xe,applyNoteToCart:ke,showNoteOption:Se,enableGeoLocationDeliveryRestriction:Ve,applyPostalCodeAndDeliverySlotToCart:He,enableSlotPicker:Xe,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Et,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:O,toggleDecimal:Nt,checkoutButtonBottomSpacing:Ft,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt}))))));return Ht&&Bn?A(In,Bn):e.createElement($l,{className:"yt-cart-drawer",$isDev:P,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:ot,$isCartPage:rt,$isLargeScreen:gn,$switchWidthVariant:kt},In)};gt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const Il=c.div`
|
|
2472
2472
|
display: flex;
|
|
2473
2473
|
flex-direction: row;
|
|
2474
2474
|
height: 100%;
|
|
@@ -2491,14 +2491,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2491
2491
|
&:disabled {
|
|
2492
2492
|
cursor: not-allowed;
|
|
2493
2493
|
}
|
|
2494
|
-
`;const
|
|
2494
|
+
`;const zl=c.div`
|
|
2495
2495
|
display: flex;
|
|
2496
2496
|
align-items: center;
|
|
2497
2497
|
justify-content: center;
|
|
2498
2498
|
border: 0;
|
|
2499
2499
|
width: 100%;
|
|
2500
2500
|
font-size: 14px;
|
|
2501
|
-
`,
|
|
2501
|
+
`,Fl=c.button`
|
|
2502
2502
|
font-weight: 600;
|
|
2503
2503
|
width: 100%;
|
|
2504
2504
|
cursor: pointer;
|
|
@@ -2608,7 +2608,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2608
2608
|
position: relative;
|
|
2609
2609
|
width: 100%;
|
|
2610
2610
|
height: 40px;
|
|
2611
|
-
`;c(
|
|
2611
|
+
`;c(Fl)`
|
|
2612
2612
|
background-color: #747474;
|
|
2613
2613
|
border-radius: ${({borderRadius:e})=>e};
|
|
2614
2614
|
color: #fff;
|
|
@@ -2654,7 +2654,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2654
2654
|
background-color: ${({primaryColor:e})=>e||"#000"};
|
|
2655
2655
|
color: ${({primaryContrastColor:e})=>e||"#fff"};
|
|
2656
2656
|
padding: 5px 10px;
|
|
2657
|
-
${({theme:e})=>
|
|
2657
|
+
${({theme:e})=>d`
|
|
2658
2658
|
@media (max-width: 768px) {
|
|
2659
2659
|
font-size: 12px;
|
|
2660
2660
|
left: 0;
|
|
@@ -2705,7 +2705,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2705
2705
|
justify-content: center;
|
|
2706
2706
|
row-gap: 15px;
|
|
2707
2707
|
padding: 0px 5px;
|
|
2708
|
-
${({isMobile:e})=>e&&
|
|
2708
|
+
${({isMobile:e})=>e&&d`
|
|
2709
2709
|
width: 100%;
|
|
2710
2710
|
`}
|
|
2711
2711
|
`;c.div`
|
|
@@ -2832,14 +2832,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2832
2832
|
@media (max-width: 600px) {
|
|
2833
2833
|
padding: 2px 6px;
|
|
2834
2834
|
}
|
|
2835
|
-
`,
|
|
2835
|
+
`,sc=c.div`
|
|
2836
2836
|
display: flex;
|
|
2837
2837
|
flex-direction: row;
|
|
2838
2838
|
column-gap: 5px;
|
|
2839
2839
|
font-size: 16px;
|
|
2840
2840
|
margin: 5px 0px;
|
|
2841
2841
|
align-items: flex-end;
|
|
2842
|
-
`,
|
|
2842
|
+
`,dc=c.span`
|
|
2843
2843
|
font-weight: bold;
|
|
2844
2844
|
text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
|
|
2845
2845
|
`,pc=c.span`
|
|
@@ -2926,7 +2926,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
2926
2926
|
text-align: center;
|
|
2927
2927
|
display: flex;
|
|
2928
2928
|
flex-shrink: 0;
|
|
2929
|
-
`,bc=({tiers:t,isMobile:n=!1,selectedProductsByTier:o,selectedProducts:r,themeColor:i,showProductDetailsInTracker:a,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:d})=>e.createElement(e.Fragment,null,t.map((i,s)=>{const p=i.minimumQuantity-(o[s]?.length??0),u=r?.filter(e=>e.tierIndex===s);return Math.min(o[s]?.length/i.minimumQuantity*100,100),e.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},e.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},e.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(t=>{const r=t.product.variants?.edges?.find(e=>e.node.id===t.variantId),p=o[s]?.filter(e=>e===r?.node.id).length||0;return a?e.createElement(fc,{className:"yt-byob-tracker-detailed-product-item",key:t.variantId},e.createElement(Kl,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.isFree&&e.createElement("div",{style:{position:"absolute",bottom:4,left:"30%",background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"40px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},"FREE",e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),t?.quantity>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},t.quantity,"x")),e.createElement(tc,{className:"yt-byob-tracker-info-block"},e.createElement(nc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(oc,{className:"yt-byob-tracker-product-price"},d,Sp(r?.node?.price)),e.createElement(Zl,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(t.variantId,s),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[s]?.length?{display:"none"}:{}}},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(xc,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},t?.isFree&&e.createElement("div",{style:{position:"absolute",top:4,left:4,background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"8px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},e.createElement(ot,null),e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),p>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),e.createElement(Zl,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(t.variantId,s),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[s]?.length?{display:"none"}:{}}},e.createElement(K,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((t,o)=>e.createElement(ic,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:o},e.createElement(Ne,{size:40,color:"#A0A0A0"}))))),s<t.length-1&&e.createElement(yc,{className:"yt-byob-tracker-plus-icon-container"},e.createElement(Ne,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),hc=({builderTiers:o,handleAddToCart:r,minimumQuantity:i,selectedProducts:a,showProductDetailsInTracker:l,loading:c,handleRemoveItem:d,percentageOff:s,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:g,dealAmount:x,isMobile:f=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:h,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[E,k]=t(!1),[T,S]=t(0),[$,B]=t([]),[I,z]=t(0),[F,N]=t(0),[D,P]=t(!1),[A,_]=t(null),R=u?.price||0,O=o?.type,L=e=>{if(e<0||!$[e])return R;const t=$[e].discountValue??0;return s?R*(1-t/100):x?t:m?R-t:R};n(()=>{if(o&&"none"!==o.type)if("productTier"===O&&o.productTier){const e=o.productTier||[];B(e);let t=0;o.productTier.map(e=>{t+=e.minimumQuantity}),N(t-p)}else if($.length)I>0&&p<$[I-1]?.minimumQuantity?(z(I-1),_(I-1)):p<$[I]?.minimumQuantity&&_(I-1),S(L(I));else{const e=o.offerTier||[];B(e),z(0),N(e[0]?.minimumQuantity-p||i-p)}else B([]),N(i-p),z(0)},[o,i,p]),n(()=>{$.length&&"productTier"!=O?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===O)for(let o=0;o<$.length&&(n+=$[o].minimumQuantity,p>=n);o++)t=o,e=o+1<$.length?o+1:o;if(z(e),_(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),k(!0),S(L(t))}else P(!1),k(!1),S(R);const o=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;N(o)})():p===i?(k(!0),S(s?R*(1-s/100):x||(m?R-m:R)),P(!0)):(P(!1),k(!1))},[p,$]);const M=E?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=E?T.toFixed(2):u?.price?.toFixed(2),V=M&&j?(M-Number(j)).toFixed(2):0,W=o&&"none"!==O&&o.offerTier?"offerTier"===O?Math.min(p/(p+F)*100,100):void 0:p/i*100;n(()=>{if(E&&g.byob.enableConfetti){console.log("remainingItems",F);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,o=(t.top+t.height/2)/window.innerHeight;ve({particleCount:100,spread:70,origin:{x:n,y:o},zIndex:9999})}},[E,g]),I>=0&&I<$.length&&$[I].tier;const H=e.useMemo(()=>null!==A&&$[A+1]?$[A+1]?.customText||"":o?.offerTier?.[0]?.customText||"",[A,$,o]),q="number"==typeof A?$[A]?.customText:void 0,Q="string"==typeof q&&""!==q.trim();return e.createElement(jl,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(f?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:f,style:{justifyContent:g.byob.selectedProductsVisibility&&!f?"space-between":"center"}},"offerTier"==O&&null!==A&&A>=0&&e.createElement(Vl,{className:"yt-byob-tracker-offer-tier-tag"},Q?e.createElement(e.Fragment,null,q," unlocked"):e.createElement(e.Fragment,null,e.createElement(e.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||x?e.createElement(e.Fragment,null," ",$p(g.general.currencySymbol,C)):""," ",Sp($[A]?.discountValue),s?e.createElement(e.Fragment,null,"% "):Sp(x)?e.createElement(e.Fragment,null):"",s||m?e.createElement(e.Fragment,null," Off"):""),e.createElement("span",{style:{fontStyle:"italic"}}," applied"))),f&&F>=1&&!D&&"offerTier"!==O?e.createElement(Wl,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},0===$.length?e.createElement(e.Fragment,null,"Select ",F," more item(s)"," ",0!==x||0!==s?"to get the bundle at":"",0!==x&&e.createElement(e.Fragment,null,` ${$p(g.general.currencySymbol,C)}${x}`),0!==s&&e.createElement(e.Fragment,null," ",` ${s}% Off`)):e.createElement(e.Fragment,null," Select ",F," more item(s)")):e.createElement(e.Fragment,null),"productTier"!==O&&e.createElement(Hl,{className:"yt-byob-tracker-tier-progress-container"},e.createElement(ql,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==O&&$.length>0&&F>0&&e.createElement(e.Fragment,null,H?e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",F," more to unlock ",H):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",F," More Item(s)",e.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+F," at"," ",m||x?e.createElement(e.Fragment,null,$p(g.general.currencySymbol,C)):""," ",Sp($[I>=0?I:0]?.discountValue),s?e.createElement(e.Fragment,null,"% "):Sp(x)?e.createElement(e.Fragment,null):"",s||m?e.createElement(e.Fragment,null," Off"):"")))),e.createElement(Ql,{className:"yt-byob-tracker-progress-bar-bg"},e.createElement(Ul,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:y??g?.general.primaryColor}," "))),g.byob.selectedProductsVisibility&&e.createElement(Yl,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(f?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:O??"",isMobile:f},"productTier"===O?e.createElement(bc,{tiers:$,isMobile:f,selectedProductsByTier:w??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:l,handleRemoveItemProductTier:v,cornerRadius:g.byob.borderRadius,currencySymbol:$p(g.general.currencySymbol,C)}):e.createElement(e.Fragment,null,a?.map?.(t=>{const n=t.product.variants?.edges?.find(e=>e.node.id===t.variantId);return l?e.createElement(Jl,{className:"yt-byob-tracker-detailed-item-container",borderRadius:g.byob.borderRadius,key:t.variantId},e.createElement(Kl,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.quantity>1&&e.createElement(ec,{className:"yt-byob-tracker-badge"},t.quantity,"x")),e.createElement(tc,{className:"yt-byob-tracker-info-block"},e.createElement(nc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(oc,{className:"yt-byob-tracker-product-price"},g.general.currencySymbol,n?.node?.price),e.createElement(rc,{className:"yt-byob-tracker-remove-link",onClick:()=>d(t.variantId)},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(gc,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:f,borderRadius:g.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url},t?.quantity>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:g.byob.borderRadius},t.quantity,"x"),e.createElement(Zl,{className:"yt-byob-tracker-remove-btn",onClick:()=>d(t.variantId)},e.createElement(K,{fontSize:"12px"}))))}),F>=1&&[...Array(F)].map((t,n)=>e.createElement(ic,{className:"yt-byob-tracker-placeholder-box",isMobile:f,borderRadius:g.byob.borderRadius,key:n},e.createElement(Ne,{size:40,color:"#A0A0A0"}))))),(!f||D)&&e.createElement(Gl,{className:"yt-byob-tracker-summary-container bundle-summary "+(f?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:f},Number(j)>0&&e.createElement(ac,{className:"yt-byob-tracker-summary-info summary-info"},e.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},f?e.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},e.createElement(lc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&e.createElement(cc,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",$p(g.general.currencySymbol,C),Sp(V))):e.createElement(e.Fragment,null,e.createElement(lc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!f&&e.createElement(cc,{className:"yt-byob-tracker-save-label"},"Save:"," ",$p(g.general.currencySymbol,C),Sp(V)))),e.createElement(dc,{className:"yt-byob-tracker-subtotal-row"},e.createElement(sc,{className:"yt-byob-tracker-final-price"},$p(g.general.currencySymbol,C),Number(j)>=0?Sp(Number(j).toFixed(2)):0),M&&g.byob.compareAtPriceVisibility&&Number(M)>Number(j)&&e.createElement(pc,{className:"yt-byob-tracker-line-through-price"},$p(g.general.currencySymbol,C),Sp(Number(M).toFixed(2))))),e.createElement(uc,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:D,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:g.general.ctaBackgroundColor,ctaBorderColor:g.general.ctaBorderColor,ctaHoverBackgroundColor:g.general.ctaHoverBackgroundColor,ctaHoverTextColor:g.general.ctaHoverTextColor},borderRadius:g.general.ctaBorderRadius,disabled:!D&&F>=1,onClick:e=>{c||console.log("saving"),r(e.target??e.currentTarget)},id:"checkoutButton"},c?e.createElement(rt,{color:"black",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):F>=1&&!D?e.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",F," More Item(s)"):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement(mc,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:g.general.ctaTextColor,ctaHoverTextColor:h??g.general.ctaHoverTextColor},g.byob.checkoutCTAText??"Checkout"),g?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))))},vc={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},wc={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Cc=o=>{const[r,i]=t(!1);n(()=>{const e=()=>{i(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const a="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,l=((e,t=!1)=>{const n=e&&vc[e]?vc[e]:{},o={...wc,...n};return t&&n.mobile?{...o,...n.mobile}:o})(String(a),r);o.renderingOnPage||(l.position="static",l.zIndex=0);const c={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...l};return e.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(r?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...c,width:r?"100%":l.width,...!o.styles.byob.selectedProductsVisibility&&{width:r?"96%":"fit-content",paddingInline:"10px"},...r&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===l.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=l.transform||"translateY(0)"}},e.createElement(hc,{...o,isMobile:r}))},Ec=re(void 0),kc=c.div`
|
|
2929
|
+
`,bc=({tiers:t,isMobile:n=!1,selectedProductsByTier:o,selectedProducts:r,themeColor:i,showProductDetailsInTracker:a,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>e.createElement(e.Fragment,null,t.map((i,d)=>{const p=i.minimumQuantity-(o[d]?.length??0),u=r?.filter(e=>e.tierIndex===d);return Math.min(o[d]?.length/i.minimumQuantity*100,100),e.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},e.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},e.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(t=>{const r=t.product.variants?.edges?.find(e=>e.node.id===t.variantId),p=o[d]?.filter(e=>e===r?.node.id).length||0;return a?e.createElement(fc,{className:"yt-byob-tracker-detailed-product-item",key:t.variantId},e.createElement(Kl,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.isFree&&e.createElement("div",{style:{position:"absolute",bottom:4,left:"30%",background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"40px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},"FREE",e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),t?.quantity>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},t.quantity,"x")),e.createElement(tc,{className:"yt-byob-tracker-info-block"},e.createElement(nc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(oc,{className:"yt-byob-tracker-product-price"},s,Sp(r?.node?.price)),e.createElement(Zl,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(t.variantId,d),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[d]?.length?{display:"none"}:{}}},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(xc,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},t?.isFree&&e.createElement("div",{style:{position:"absolute",top:4,left:4,background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"8px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},e.createElement(ot,null),e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),p>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),e.createElement(Zl,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(t.variantId,d),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[d]?.length?{display:"none"}:{}}},e.createElement(K,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((t,o)=>e.createElement(ic,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:o},e.createElement(Fe,{size:40,color:"#A0A0A0"}))))),d<t.length-1&&e.createElement(yc,{className:"yt-byob-tracker-plus-icon-container"},e.createElement(Fe,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),hc=({builderTiers:o,handleAddToCart:r,minimumQuantity:i,selectedProducts:a,showProductDetailsInTracker:l,loading:c,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:g,dealAmount:x,isMobile:f=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:h,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[E,k]=t(!1),[T,S]=t(0),[$,N]=t([]),[B,I]=t(0),[z,F]=t(0),[D,P]=t(!1),[A,_]=t(null),R=u?.price||0,O=o?.type,L=e=>{if(e<0||!$[e])return R;const t=$[e].discountValue??0;return d?R*(1-t/100):x?t:m?R-t:R};n(()=>{if(o&&"none"!==o.type)if("productTier"===O&&o.productTier){const e=o.productTier||[];N(e);let t=0;o.productTier.map(e=>{t+=e.minimumQuantity}),F(t-p)}else if($.length)B>0&&p<$[B-1]?.minimumQuantity?(I(B-1),_(B-1)):p<$[B]?.minimumQuantity&&_(B-1),S(L(B));else{const e=o.offerTier||[];N(e),I(0),F(e[0]?.minimumQuantity-p||i-p)}else N([]),F(i-p),I(0)},[o,i,p]),n(()=>{$.length&&"productTier"!=O?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===O)for(let o=0;o<$.length&&(n+=$[o].minimumQuantity,p>=n);o++)t=o,e=o+1<$.length?o+1:o;if(I(e),_(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),k(!0),S(L(t))}else P(!1),k(!1),S(R);const o=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;F(o)})():p===i?(k(!0),S(d?R*(1-d/100):x||(m?R-m:R)),P(!0)):(P(!1),k(!1))},[p,$]);const M=E?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=E?T.toFixed(2):u?.price?.toFixed(2),V=M&&j?(M-Number(j)).toFixed(2):0,W=o&&"none"!==O&&o.offerTier?"offerTier"===O?Math.min(p/(p+z)*100,100):void 0:p/i*100;n(()=>{if(E&&g.byob.enableConfetti){console.log("remainingItems",z);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,o=(t.top+t.height/2)/window.innerHeight;ve({particleCount:100,spread:70,origin:{x:n,y:o},zIndex:9999})}},[E,g]),B>=0&&B<$.length&&$[B].tier;const H=e.useMemo(()=>null!==A&&$[A+1]?$[A+1]?.customText||"":o?.offerTier?.[0]?.customText||"",[A,$,o]),q="number"==typeof A?$[A]?.customText:void 0,Q="string"==typeof q&&""!==q.trim();return e.createElement(jl,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(f?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:f,style:{justifyContent:g.byob.selectedProductsVisibility&&!f?"space-between":"center"}},"offerTier"==O&&null!==A&&A>=0&&e.createElement(Vl,{className:"yt-byob-tracker-offer-tier-tag"},Q?e.createElement(e.Fragment,null,q," unlocked"):e.createElement(e.Fragment,null,e.createElement(e.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||x?e.createElement(e.Fragment,null," ",$p(g.general.currencySymbol,C)):""," ",Sp($[A]?.discountValue),d?e.createElement(e.Fragment,null,"% "):Sp(x)?e.createElement(e.Fragment,null):"",d||m?e.createElement(e.Fragment,null," Off"):""),e.createElement("span",{style:{fontStyle:"italic"}}," applied"))),f&&z>=1&&!D&&"offerTier"!==O?e.createElement(Wl,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},0===$.length?e.createElement(e.Fragment,null,"Select ",z," more item(s)"," ",0!==x||0!==d?"to get the bundle at":"",0!==x&&e.createElement(e.Fragment,null,` ${$p(g.general.currencySymbol,C)}${x}`),0!==d&&e.createElement(e.Fragment,null," ",` ${d}% Off`)):e.createElement(e.Fragment,null," Select ",z," more item(s)")):e.createElement(e.Fragment,null),"productTier"!==O&&e.createElement(Hl,{className:"yt-byob-tracker-tier-progress-container"},e.createElement(ql,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==O&&$.length>0&&z>0&&e.createElement(e.Fragment,null,H?e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",z," more to unlock ",H):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",z," More Item(s)",e.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+z," at"," ",m||x?e.createElement(e.Fragment,null,$p(g.general.currencySymbol,C)):""," ",Sp($[B>=0?B:0]?.discountValue),d?e.createElement(e.Fragment,null,"% "):Sp(x)?e.createElement(e.Fragment,null):"",d||m?e.createElement(e.Fragment,null," Off"):"")))),e.createElement(Ql,{className:"yt-byob-tracker-progress-bar-bg"},e.createElement(Ul,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:y??g?.general.primaryColor}," "))),g.byob.selectedProductsVisibility&&e.createElement(Yl,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(f?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:O??"",isMobile:f},"productTier"===O?e.createElement(bc,{tiers:$,isMobile:f,selectedProductsByTier:w??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:l,handleRemoveItemProductTier:v,cornerRadius:g.byob.borderRadius,currencySymbol:$p(g.general.currencySymbol,C)}):e.createElement(e.Fragment,null,a?.map?.(t=>{const n=t.product.variants?.edges?.find(e=>e.node.id===t.variantId);return l?e.createElement(Jl,{className:"yt-byob-tracker-detailed-item-container",borderRadius:g.byob.borderRadius,key:t.variantId},e.createElement(Kl,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.quantity>1&&e.createElement(ec,{className:"yt-byob-tracker-badge"},t.quantity,"x")),e.createElement(tc,{className:"yt-byob-tracker-info-block"},e.createElement(nc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(oc,{className:"yt-byob-tracker-product-price"},g.general.currencySymbol,n?.node?.price),e.createElement(rc,{className:"yt-byob-tracker-remove-link",onClick:()=>s(t.variantId)},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(gc,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:f,borderRadius:g.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url},t?.quantity>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:g.byob.borderRadius},t.quantity,"x"),e.createElement(Zl,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(t.variantId)},e.createElement(K,{fontSize:"12px"}))))}),z>=1&&[...Array(z)].map((t,n)=>e.createElement(ic,{className:"yt-byob-tracker-placeholder-box",isMobile:f,borderRadius:g.byob.borderRadius,key:n},e.createElement(Fe,{size:40,color:"#A0A0A0"}))))),(!f||D)&&e.createElement(Gl,{className:"yt-byob-tracker-summary-container bundle-summary "+(f?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:f},Number(j)>0&&e.createElement(ac,{className:"yt-byob-tracker-summary-info summary-info"},e.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},f?e.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},e.createElement(lc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&e.createElement(cc,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",$p(g.general.currencySymbol,C),Sp(V))):e.createElement(e.Fragment,null,e.createElement(lc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!f&&e.createElement(cc,{className:"yt-byob-tracker-save-label"},"Save:"," ",$p(g.general.currencySymbol,C),Sp(V)))),e.createElement(sc,{className:"yt-byob-tracker-subtotal-row"},e.createElement(dc,{className:"yt-byob-tracker-final-price"},$p(g.general.currencySymbol,C),Number(j)>=0?Sp(Number(j).toFixed(2)):0),M&&g.byob.compareAtPriceVisibility&&Number(M)>Number(j)&&e.createElement(pc,{className:"yt-byob-tracker-line-through-price"},$p(g.general.currencySymbol,C),Sp(Number(M).toFixed(2))))),e.createElement(uc,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:D,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:g.general.ctaBackgroundColor,ctaBorderColor:g.general.ctaBorderColor,ctaHoverBackgroundColor:g.general.ctaHoverBackgroundColor,ctaHoverTextColor:g.general.ctaHoverTextColor},borderRadius:g.general.ctaBorderRadius,disabled:!D&&z>=1,onClick:e=>{c||console.log("saving"),r(e.target??e.currentTarget)},id:"checkoutButton"},c?e.createElement(rt,{color:"black",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):z>=1&&!D?e.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",z," More Item(s)"):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement(mc,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:g.general.ctaTextColor,ctaHoverTextColor:h??g.general.ctaHoverTextColor},g.byob.checkoutCTAText??"Checkout"),g?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))))},vc={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},wc={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Cc=o=>{const[r,i]=t(!1);n(()=>{const e=()=>{i(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const a="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,l=((e,t=!1)=>{const n=e&&vc[e]?vc[e]:{},o={...wc,...n};return t&&n.mobile?{...o,...n.mobile}:o})(String(a),r);o.renderingOnPage||(l.position="static",l.zIndex=0);const c={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...l};return e.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(r?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...c,width:r?"100%":l.width,...!o.styles.byob.selectedProductsVisibility&&{width:r?"96%":"fit-content",paddingInline:"10px"},...r&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===l.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=l.transform||"translateY(0)"}},e.createElement(hc,{...o,isMobile:r}))},Ec=re(void 0),kc=c.div`
|
|
2930
2930
|
position: absolute;
|
|
2931
2931
|
top: 0px;
|
|
2932
2932
|
right: 0px;
|
|
@@ -3145,7 +3145,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3145
3145
|
font-size: 1em;
|
|
3146
3146
|
justify-content: center;
|
|
3147
3147
|
align-items: center;
|
|
3148
|
-
`;const Bc=({options:t,selectedValue:n,onChange:o,type:r="text",isOptionAvailable:i,isMobile:a})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const a=!i||i(t.name);return e.createElement("div",{key:t.name,onClick:()=>{a&&o(t)},style:{cursor:a?"pointer":"not-allowed"}},((t,n)=>{const o=!i||i(t.name),a={cursor:o?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:o?1:.5};if("color"===r)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...a,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name);return"image"===r?e.createElement("img",{src:gn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...a,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name)})(t,n?.name===t.name))})),Ic=({product:r,isOpen:i,onClose:a,variantOptions:l,cta:c,onConfirm:d})=>{const s=o(()=>e=>e?r?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[r?.tracksInventory]),p=o(()=>{const e=r.variants.edges.find(e=>{const t=e.node;return s(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):r.options?.map(e=>e.values[0])||[]},[r,s]),[u,m]=t(p),[g,x]=t(window.innerWidth<1024);n(()=>{const e=()=>x(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&a()};return i&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,a]);const f=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,y=f?.image?.url||r.featuredMedia?.preview?.image?.url,b=gn(y,150,85,"webp"),h=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},w=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!i)return null;const C=e.createElement("div",{onClick:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:r.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},r.title))),e.createElement("div",{style:{padding:"20px"}},r.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},w(t,n)?.name||t.values[0])),e.createElement(Bc,{options:v(t),selectedValue:w(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(n,e)},type:h(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const o=r.options?.length>0?n.join(" / "):n[0],i=r.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&s(i)>0})(n,e),isMobile:g}))))),e.createElement("button",{onClick:()=>{const e=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&s(e)>0;if(e?.id&&t)d(e.id),a();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=r.variants.edges.find(e=>s(e.node)>0)?.node.id;e&&(d(e),a())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return P.createPortal(C,document.body)},zc=l((a,l)=>{const[c,d]=ie(Ec),s=o(()=>e=>{const t=a?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:a?.bundleProductsCustomQuantity?a?.bundleProductsCustomQuantity:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[c?.tracksInventory,a?.customVariantsQuantity,a?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>s(e.node)>0)||[],[u,m]=t(p?.[0]?.node),[g,x]=t(0),[f,y]=t("undefined"!=typeof window&&window.innerWidth<=600),[b,h]=t(1),[v,w]=t("idle"),C=r(null),E=r(null),k=r(!1),[T,S]=t(0),$=o(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return s(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,s]),[B,I]=t($);n(()=>{if(c){const e=c.variants.edges?.filter(e=>s(e.node)>0),t=c?.selectedVariant??e[0]?.node;m(t),t?.title&&"Default Title"!==t.title&&I(t.title.split(" / "))}},[c,s]),n(()=>{const e=a.selectedProducts.find(e=>e.variantId===u?.id);h(e?e.quantity:0)},[b,a.selectedProducts,u]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>y(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:z,descriptionHtml:F,media:N,variants:D}=c,A=N.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),_=i(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&s(n)>0&&(k.current=!0,m(n),n.title&&"Default Title"!==n.title&&I(n.title.split(" / ")))},[p,s]),R=i(e=>{if(!a.bundleVariantOptions?.options)return"text";const t=a.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[a.bundleVariantOptions]),O=i(e=>{if(!a?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=a?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[a.bundleVariantOptions]),L=i((e,t)=>{const n=[...B];n[e]=t.name,I(n);const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;r&&s(r)>0&&(k.current=!0,m(r))},[B,c,s]),M=i((e,t)=>{const n=B[t];if(!n)return null;return O(e).find(e=>e.name===n)||null},[B,O]),j=i((e,t)=>{const n=[...B];n[e]=t;const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;return!!r&&s(r)>0},[B,c,s]);n(()=>{if(c&&u?.image?.url&&Array.isArray(A)){const e=A.findIndex(e=>e?.url===u?.image?.url);-1!==e&&e!==g&&x(e)}},[u,g,A]),n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{d(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,d]),n(()=>{if(f&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[f,c]);const V=a.selectedProducts.filter(e=>e.variantId===u?.id).reduce((e,t)=>e+t.quantity,0),W=a.customVariantsQuantity?.find(e=>e.variantId===u?.id)?.quantity??a.bundleProductsCustomQuantity??1/0,H=W!==1/0&&V>=W,q=a.hideAddToBundle||!u||s(u)<=0||H||"idle"!==v||a?.disableQuantitySelector&&1===b,Q=({className:t})=>{const n=c?.rating?.averageRating??a?.rating?.averageRating??0,o=c?.rating?.ratingCount??a?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14}),n,e.createElement(he,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",o," reviews)"))},U=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(ut,{small:Bp(t?.url),medium:Bp(t?.url),large:Bp(t?.url),alt:t.altText||`${z} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(ut,{small:Bp(A[g]?.url),medium:Bp(A[g]?.url),large:Bp(A[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.filter(e=>e?.url?.length>0).map((n,o)=>e.createElement("img",{key:o,src:Bp(n?.url),alt:n.altText||`${z} - Image ${o+1}`,onClick:()=>x(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===o?`2px solid ${a.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),Y=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},u?.title)),e.createElement("select",{className:`${t}-select`,value:u?.id||"",onChange:_,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},c?.variants?.edges?.map(({node:t})=>e.createElement("option",{key:t.id,value:t.id,disabled:0===s(t)},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(Ge,null)))),X=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,o)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},B[o]||n.values[0])),e.createElement(Bc,{options:O(n),selectedValue:M(n,o),onChange:e=>{L(o,e)},type:R(n.name),isOptionAvailable:e=>j(o,e),isMobile:t}))))),Z=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},a?.isFreebieTier&&!a.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},$p(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Sp(u?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:a.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,u?.compareAtPrice&&parseFloat(u.compareAtPrice)>parseFloat(u?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},$p(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Sp(u?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},$p(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Sp(u?.price))))),J=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:a.themeColor||"#111",borderRadius:a.cornerRadius,color:a.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:q?.5:1,cursor:q?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),u?.id&&c&&(w("check"),a.handleAddToBundle(u?.id,c,1),setTimeout(()=>{w("idle"),d(void 0)},500))},disabled:q},a.styles.byob.addToBundleCTAText??"Add to bundle")),K=e.createElement(Tc,{className:"yt-byob-modal-desktop-overlay"},e.createElement(Sc,{$isSmallScreen:f,ref:l},e.createElement($c,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},e.createElement(kc,{className:"yt-byob-modal-desktop-close",onClick:()=>{d(void 0)},style:{backgroundColor:"white"}},e.createElement(G,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(U,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(Q,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===a?.styles?.byob.variantSelectorType&&e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===a?.styles?.byob.variantSelectorType&&e.createElement(X,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!1}),e.createElement(J,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:F}})))))),ee=e.createElement(Tc,{className:"yt-byob-modal-mobile-overlay"},e.createElement(Sc,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:l},e.createElement($c,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{d(void 0)}},e.createElement(Ye,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(U,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(Q,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:F}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===a?.styles?.byob.variantSelectorType?e.createElement(X,{isMobile:!0}):e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!0}),e.createElement(J,{isMobile:!0})))));return P.createPortal(f?ee:K,document.body)}),Fc=({coverImageUrl:t,mobileCoverImageUrl:n,alt:o="Background",styles:r})=>{const i=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],a=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality","80"),o.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?i.map(({imageWidth:t,descriptor:n})=>{const o=a(e,t);return o?`${o} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const c=t||n||"",d=a(c,800)||c,s=[];if(n&&n!==t){const t=l(n);t&&s.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(s.length>0?s.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):s.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&s.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},s,e.createElement("img",{src:d,alt:o,style:{width:"100%",height:"auto",display:"block",...r},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Nc=({title:t,isOpen:n,onToggle:o,children:r})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:o,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(_e,{className:"yt-byob-icon-minus",size:20}):e.createElement(Ne,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},r)),Dc=({availableFilters:n,appliedFilters:o,toggleFilter:r,clearAllFilters:i,applyPriceFilter:a,priceMin:l,setPriceMin:c,priceMax:d,setPriceMax:s,maxPossiblePrice:p,styles:u,availableProductCount:m,products:g,unavailableProductCount:x,storeCurrencyCode:f,showActions:y=!0,openSections:b,toggleSection:h})=>{const[v,w]=t(null),C=$p(u?.general?.currencySymbol,f)??"₹";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Nc,{key:t.id,title:t.label,isOpen:!!b[t.id],onToggle:()=>h(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const i=o[t.id]?.includes(n.id)||!1,a="filter.v.availability.1"===n.id?m??g.length:"filter.v.availability.0"===n.id?x??0:n.count;return e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:i,onChange:()=>r(t.id,n.id),style:{width:"18px",height:"18px",accentColor:u?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)),e.createElement("span",{className:"yt-byob-filter-item-count",style:{fontSize:"12px",background:"#f3f4f6",padding:"2px 8px",borderRadius:"4px",color:"#666",minWidth:"24px",textAlign:"center"}},a))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,d.toLocaleString(),d>=p?"+":""),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-d/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>w("min"),onTouchStart:()=>w("min"),onChange:e=>{const t=Math.min(Number(e.target.value),d-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===v?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:d,onMouseDown:()=>w("max"),onTouchStart:()=>w("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);s(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===v?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),y&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:i,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:a,style:{flex:1,padding:"8px",background:u?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},Pc=t=>{const{showFiltersDrawer:n,handleClose:o,isAnimating:r,isMobile:i}=t;return n?A(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:r?1:0,transition:"opacity 300ms ease-in-out"},onClick:o},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:i?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Dc,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),o()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},Ac=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Dc,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},_c=({enableSortAndFilter:o,isMobile:r,setSearchTerm:i,searchTerm:a,styles:l,setSortBy:c,appliedFilters:d,setAppliedFilters:s,availableFilters:p=[],products:u,availableProductCount:m,unavailableProductCount:g,maxPossiblePrice:x,storeCurrencyCode:f,sharedFiltersState:b,openSections:h,toggleSection:v,sortBy:w})=>{const[C,E]=t(!1),[k,T]=t(a),{showFilters:S,setShowFilters:$,priceMax:B,setPriceMax:I,priceMin:z,setPriceMin:F}=b,[N,D]=t(!1),P=l?.byob?.productFiltersDisplay||"drawer",A=!r&&"sidebar"===P,_="none"===P;n(()=>{d["filter.v.price"]||(I(x),F(0))},[x,d]);n(()=>{const e=setTimeout(()=>{i(k)},300);return()=>clearTimeout(e)},[k,i]),n(()=>(S&&!A?(document.body.style.overflow="hidden",D(!0)):(document.body.style.overflow="",D(!1)),()=>{document.body.style.overflow=""}),[S,A]);const R=Object.entries(d).reduce((e,[t,n])=>"filter.v.price"===t?z>0||B<x?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:r?"column":"row",justifyContent:"space-between",alignItems:r?"flex-end":"center",marginBottom:"20px",width:"100%",gap:r?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:o?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},o&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:r?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},r&&!C?e.createElement(De,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:r?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(De,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),r&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>$(!S),style:{display:_?"none":"flex",alignItems:"center",gap:r?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Pe,{className:"yt-byob-filter-toggle-icon",size:18}),!r&&"Filters",R>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},R)),o&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!r&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),r&&e.createElement(Ae,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:w,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(y,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(Pc,{showFiltersDrawer:S,handleClose:()=>{A?$(!1):(document.body.style.overflow="",D(!1),setTimeout(()=>{$(!1)},300))},isAnimating:N,isMobile:r,availableFilters:p,appliedFilters:d,toggleFilter:(e,t)=>{s(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{I(x),F(0),s({})},applyPriceFilter:()=>{s(e=>{const t={...e};return t["filter.v.price"]=[`min:${z}-max:${B}`],t})},priceMin:z,setPriceMin:F,priceMax:B,setPriceMax:I,maxPossiblePrice:x,styles:l,availableProductCount:m,products:u,unavailableProductCount:g,storeCurrencyCode:f,openSections:h,toggleSection:v}))};function Rc({quantity:t,setQuantity:n,remainingQuantity:o,handleAddToBundle:r,variantId:i,product:a,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:d}){const s={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<d;return e.createElement(zl,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const o=Math.max(0,t-1);n(o),l&&i&&l(i,1)},style:s},"-"),e.createElement(Fl,{className:"yt-byob-quantity-display"},t," added"),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(o,t+1,d);n(l),r&&i&&a&&r(i,a,1)},disabled:!p||c,style:{...s,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const Oc=({product:r,styles:i,selectedVariant:a})=>{const[l,c]=t(!1),d=o(()=>Bp(a?.image?.url||r?.featuredMedia?.preview?.image?.url||r?.media?.edges?.[0]?.node?.image?.url)||"",[a?.image?.url,r?.featuredMedia?.preview?.image?.url,r?.media?.edges]),s=o(()=>r?.media?.edges?.map(e=>Bp(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[r?.media?.edges]),p=o(()=>s?.[1]??d??"",[s,d]);n(()=>{if(d){(new Image).src=d}},[d]);const u=o(()=>d||s?.[0],[d,s]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:i.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&u!==p?0:1,transition:s?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:u,alt:r.title}),u!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:r.title})))},Lc=({product:o,bundle:r,handleAddToBundle:a,hideAddToBundle:l,remainingQuantity:c,themeColor:d,handleRemoveItem:s,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:g,currentProductTier:x,showFreebieTierProductPrices:f,tierIndex:b})=>{const h=le(Ec),v=r.customizations,w=v?.byob?.variantSelectorType,[C,E]=t(!1),k=v.general?.variantTitleSuffix?o?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const o=t[e];let r=0;for(;r<n.length&&r<o.length&&n[n.length-1-r]===o[o.length-1-r];)r++;n=n.slice(n.length-r)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),o=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:o,commonSuffix:n.join(" ")}}})})(o?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=i(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;if(r?.customProductsQuantity)return r?.customProductsQuantity;const n=k?.find(t=>t.node.id===e),i=n?.node;return i?o.tracksInventory&&i.inventoryItem?.tracked?i.inventoryQuantity>0?i.inventoryQuantity:i.inventoryQuantity<=0&&"continue"===i.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[k,g,o.tracksInventory]),S=k?.find(e=>T(e.node.id)>0)?.node?.id;if(!S&&!v.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[$,B]=t(k?.find(e=>T(e.node.id)>0)?.node?.id||k[0]?.node?.id),[I,z]=t(0),[F,N]=t(window.innerWidth<450),[D,P]=t("normal"),A=k?.find(e=>e?.node?.id===$)?.node,_=T($||"");n(()=>{const e=m.find(e=>e.variantId===$&&(void 0===b||e.tierIndex===b));z(e?e.quantity:0)},[m,$,b]),n(()=>{const e=()=>{N(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if($&&!k?.some(e=>e.node.id===$)){const e=k.find(e=>T(e.node.id)>0)?.node.id||k[0]?.node?.id;e&&B(e)}},[$,k,T]);const R=o.variants&&o.variants.edges?.length>1&&"customOptions"!==w,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,L="53933408435"===O,M="75851235630"===O,j=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(o),V=j.length>0;return e.createElement(e.Fragment,null,e.createElement(Pl,{borderRadius:v?.byob.borderRadius,borderColor:v?.byob.borderColor,shadowType:v?.byob.shadowType,backgroundColor:v?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(_<=0)return;const e={...o,variants:{...o.variants,edges:k},selectedVariant:A};h(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:v?.byob?.productCardDetailsAlignment||"left"}},e.createElement(Al,{className:"yt-byob-image-wrapper"},e.createElement(Oc,{product:o,styles:v,selectedVariant:A}),r?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:v.byob.borderRadius}},r.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(_l,{className:"yt-byob-variant-selector",isCoralHaze:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:$||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),B(e.target.value)}},k?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,o=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id},o)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(y,null)))),e.createElement("div",{className:"yt-byob-product-content"},"enabled"===r?.customizations?.byob?.productCardCategoryVisibility&&V&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},j.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:F?"8px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),j.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",j.length-2," more"))),e.createElement(Rl,{isMobile:F,showBorder:r?.showBorder??!0,style:{...!v?.byob.productsPriceVisibility&&{padding:"8px"},...v?.byob.productTitleFontSize&&{fontSize:v?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:v?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(A?.displayName).replace("- Default Title",""):o.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&v?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:r?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},o?.rating?.averageRating," rating")),"ratingAndReviewCount"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(he,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," reviews)"),v?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:r?.showBorder?"0px 10px":"0 4px"}},x?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},$p(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Sp(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:v.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},$p(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Sp(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!x?.isFreebieTier||f)&&A?.compareAtPrice&&v?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},$p(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Sp(A.compareAtPrice))),(_>0||_===1/0)&&e.createElement(Ol,{borderRadius:v?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===I||void 0===I)&&e.createElement(Nl,{style:{...!l&&{backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),z(1),(()=>{if(!$)return;"customOptions"===w&&k.length>1?E(!0):a($,o,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},v?.byob.addToBundleCTAText),!r?.disableQuantitySelector&&I>0&&$&&e.createElement(Dl,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(Rc,{remainingQuantity:c,setQuantity:z,quantity:I,handleAddToBundle:a,variantId:$,product:o,handleRemoveItem:s,hideAddToBundle:l,selectedVariantInventoryQty:_})),r?.disableQuantitySelector&&I>0&&$&&e.createElement(Nl,{style:{backgroundColor:"#747474",color:v?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(Ll,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(Ml,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,I-1);z(t),s&&$&&s($,b)}},e.createElement(Re,{style:{color:"#fff",fontSize:"20px"}})))),_<=0&&_!==1/0&&e.createElement(Nl,{style:{backgroundColor:v.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},v?.general.outOfStockLabel||"Out of Stock")),"customOptions"===w&&C&&k.length>1&&e.createElement(Ic,{product:o,isOpen:C,onClose:()=>E(!1),variantOptions:r.variantOptions,cta:{textColor:v.general.ctaTextColor,backgroundColor:v.general.primaryColor},onConfirm:e=>{B(e),a(e,o,1)}}))},Mc=({currentStep:t,setCurrentProductTier:n,totalSteps:o,tiers:r,isMobile:i,selectedProductsByTier:a,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:d})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:o}).map((c,s)=>{const p=s+1,u=r[s].minimumQuantity-(a[s]?.length??0)===0,m=s===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:i?"4px":"8px"},onClick:()=>!1===d?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:s<o?i?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:i?"16px 0px":"15px 0px",fontSize:i?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},r[t]?.title)),jc=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o;return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(t.general.primaryColor,.07):"transparent",borderBottom:i?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:r===o?t?.general.primaryColor:"white",color:r===o?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{r!==o&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{r!==o&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},o.charAt(0).toUpperCase()+o.slice(1)))))},Vc=(e,t)=>{const n=[],o=e=>!t||0===t.length||t.includes(e);let r=0,i=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id)),n=t?.some(e=>e.node.availableForSale);n?r++:i++}),o("Availability")&&n.push({id:"filter.v.availability",label:"Availability",type:"LIST",values:[{id:"filter.v.availability.1",label:"In stock",count:r,input:'{"available":true}'},{id:"filter.v.availability.0",label:"Out of stock",count:i,input:'{"available":false}'}]});let a=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id));t?.forEach(e=>{const t=parseFloat(e.node.price);t>a&&(a=t)})}),o("Price")&&n.push({id:"filter.v.price",label:"Price",type:"PRICE_RANGE",values:[{id:"filter.v.price",label:"Price",count:e.length,input:JSON.stringify({price:{min:0,max:a}})}]});const l={};e.forEach(e=>{const t=e.productDetails.productType;t&&(l[t]=(l[t]||0)+1)}),Object.keys(l).length>0&&o("Product Type")&&n.push({id:"filter.p.product_type",label:"Product Type",type:"LIST",values:Object.entries(l).map(([e,t])=>({id:`filter.p.product_type.${e}`,label:e,count:t,input:JSON.stringify({productType:e})}))});const c={};e.forEach(e=>{const t=e.productDetails.vendor;t&&(c[t]=(c[t]||0)+1)}),Object.keys(c).length>0&&o("Vendor")&&n.push({id:"filter.p.vendor",label:"Vendor",type:"LIST",values:Object.entries(c).map(([e,t])=>({id:`filter.p.vendor.${e}`,label:e,count:t,input:JSON.stringify({vendor:e})}))});const d={};e.forEach(e=>{e.productDetails.tags?.forEach(e=>{e&&(d[e]=(d[e]||0)+1)})}),Object.keys(d).length>0&&o("Tags")&&n.push({id:"filter.p.tag",label:"Tag",type:"LIST",values:Object.entries(d).map(([e,t])=>({id:`filter.p.tag.${e}`,label:e,count:t,input:JSON.stringify({tag:e})}))});const s={};return e.forEach(e=>{(e.productDetails.options||[]).forEach((t,n)=>{if("Title"===t.name)return;s[t.name]||(s[t.name]={});const o=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];t.values?.forEach(e=>{void 0===s[t.name][e]&&(s[t.name][e]=0);o.some(t=>(t.node.title.split(" / ")[n]||t.node.title).toLowerCase()===e.toLowerCase())&&s[t.name][e]++})})}),o("Variant Options")&&Object.entries(s).forEach(([e,t])=>{const o=Object.entries(t).filter(([e,t])=>t>0).map(([t,n])=>({id:`${e.toLowerCase()}.${t}`,label:t,count:n,input:JSON.stringify({variantOption:{name:e,value:t}})}));o.length>0&&n.push({id:`filter.v.option.${e.toLowerCase()}`,label:e,type:"LIST",values:o})}),n},Wc=({bundle:a,selectedItems:l,setSelectedItems:c,handleAddToCart:d,bundleAddToCartLoading:s,renderingOnPage:p,selectedItemsQuantity:u,handleRemoveItem:m,bundleSubtotal:g,dispatchAnalyticsEvent:x,fetchStoreDetails:f})=>{const[y,b]=t(void 0),[h,v]=t(window.innerWidth<450),[w,C]=t(0),[E,k]=t({}),T=a.builderTiers?.type,S=a.customizations,$=a.builderTiers?.productTier??[],B=a.builderTiers?.offerTier??[],[I,z]=t([]),[F,N]=t(!1),[D,P]=t("All"),[A,_]=t(0),R=r(null),[O,L]=t({}),[M,j]=t([]),[V,W]=t(!1),[H,q]=t(0),[Q,U]=t(0),[Y,G]=t({}),X=e=>{G(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{M.length>0&&G(e=>{const t={...e};return M.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[M]);const Z=a.customStoreDetails?.fixedInventoryDetails;n(()=>{const e=new Set;let t=!1;a?.products?.forEach(n=>{const o=n.productDetails;if(o.metafield&&"yourtoken_bundles_app"===o.metafield.namespace&&"categories"===o.metafield.key){let n=[];if(o.metafield.jsonValue&&Array.isArray(o.metafield.jsonValue))n=o.metafield.jsonValue;else if(o.metafield.value)try{const e=JSON.parse(o.metafield.value);Array.isArray(e)&&(n=e)}catch(e){console.error("Failed to parse categories:",e)}n.length>0&&(t=!0,n.forEach(t=>e.add(t)))}}),z(Array.from(e)),N(t);S?.byob?.productFiltersDisplay&&"none"!==S?.byob?.productFiltersDisplay&&(async()=>{const e=S?.byob?.filtersProvider??"products-data",t=S?.byob?.selectedFilterOptions;if("search-and-discovery-app-sync"===e)try{const e=await(f?.());e?.productFilters&&j(e.productFilters??[])}catch(e){j(Vc(a.products,t))}else j(Vc(a.products,t))})()},[a.products,S?.byob,f]),n(()=>{L({})},[w,D]);const J=((e,t)=>"All"===t?e:e.filter(e=>{const n=e.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(a.products.filter(e=>"active"===e.productDetails.status?.toLowerCase()||"unlisted"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status),D),K="productTier"===T?$.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===T?B.reduce((e,t)=>e+t.minimumQuantity,0):a.minimumQuantity,ee=i((e,t)=>{const n=Z?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const o=(e.variants?.edges||[]).find(e=>e.node.id===t),r=o?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[Z]),[te,ne]=t(3e3);n(()=>{let e=0;a.products.forEach(t=>{const n=Number(t.productDetails.variants?.edges?.[0]?.node?.price||0);n>e&&(e=n)}),ne(100*Math.ceil(e/100)||5e3)},[a.products]);const[oe,re]=t(""),[ae,le]=t(""),ce=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(J,oe),de=((e,t)=>[...e].sort((e,n)=>{const o=e?.productDetails?.title?.toLowerCase(),r=n?.productDetails?.title?.toLowerCase(),i=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),a=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return o.localeCompare(r);case"title-desc":return r.localeCompare(o);case"price-low-to-high":return i-a;case"price-high-to-low":return a-i;default:return 0}}))(ce,ae),se=de.filter(e=>((e,t,n,o)=>{if(0===Object.keys(t).length)return!0;for(const[r,i]of Object.entries(t)){if(0===i.length)continue;const a=n.find(e=>e.id===r);if(!a)continue;let l=!1;if("filter.v.price"===r){const n=t[r][0];if(!n)continue;const[o,i]=n.split("-"),a=parseFloat(o.replace("min:",""))||0,c="max:∞"===i?1/0:parseFloat(i.replace("max:",""))||1/0;(e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=Number(e.node.price||0);return t>=a&&t<=c})&&(l=!0)}else for(const t of i){const n=a.values.find(e=>e.id===t);if(n)try{const t=JSON.parse(n.input);if(void 0!==t.available){const n=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];if(!0===t.available){if(n.some(t=>o(e.productDetails,t.node.id)>0)){l=!0;break}}else if(!1===t.available&&n.every(t=>0===o(e.productDetails,t.node.id))){l=!0;break}}else if(t.productType){if(e.productDetails.productType===t.productType){l=!0;break}}else if(t.vendor){if(e.productDetails.vendor===t.vendor){l=!0;break}}else if(t.tag){if(e.productDetails.tags?.includes(t.tag)){l=!0;break}}else if(t.variantOption){const{name:n,value:o}=t.variantOption,r=e.productDetails.options?.findIndex(e=>e.name===n);if(void 0!==r&&-1!==r){if((e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=(e.node.title||"").split(" / ")[r]||e.node.title;return t?.toLowerCase()===o.toLowerCase()})){l=!0;break}}}}catch(e){console.warn("Bad filter input",n.input)}}if(!l)return!1}return!0})(e,O,M,ee)),pe=((e,t,n,o,r)=>(e[r]?.products.filter(e=>t.some(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))||[]).sort((e,n)=>{let r=t.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))),i=t.find(e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0])));if(!r||!i)return 0;const a=r.productDetails?.title?.toLowerCase(),l=i.productDetails?.title?.toLowerCase(),c=parseFloat(r?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),d=parseFloat(i?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(o){case"title-asc":return a.localeCompare(l);case"title-desc":return l.localeCompare(a);case"price-low-to-high":return c-d;case"price-high-to-low":return d-c;default:return 0}}))($,se,oe,ae,w),[ue,me]=ie(Ec),[ge,xe]=t(!1),fe="productTier"===T?pe:se,ye=fe.slice(0,20*(A+1));n(()=>{x?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a?._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder"}}),setTimeout(()=>{xe(!0)},100)},[]);const be=r(null);n(()=>{const e=()=>{v(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(a.coverImageUrl){const e=new Image;e.src=Bp(a.coverImageUrl)??"",e.onload=()=>{b(e.width/e.height)}}},[a.coverImageUrl]),n(()=>{xe(!1),setTimeout(()=>xe(!0),100)},[w]);const he=(e,t)=>{if("productTier"===T){let n={...E},o=!1;if(n[t]){const r=n[t].indexOf(e);-1!==r&&(n[t]=[...n[t]],n[t].splice(r,1),o=!0)}if(!o)for(let t=$.length;t>=0;t--){const o=n[t].indexOf(e);if(-1!==o){n[t]=[...n[t]],n[t].splice(o,1);break}}k(n);const r=$.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==r&&C(r)}m(e,t)},ve=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if("productTier"===T){const e=Object.fromEntries($.map(e=>[e.tier,[]]));k(e)}},[a]),n(()=>{if("productTier"!==T||!$[w])return;if(K===u)return;const e=$.findIndex((e,t)=>{const n=E[t]||[];return t>=w&&n.length<e.minimumQuantity});if(-1!==e&&e!==w){C(e);$[w].products.length>1&&ve()}},[E,$,T]),n(()=>{re("")},[w]),n(()=>{function e(e){if(!be.current||!e.target)return;!be.current.contains(e.target)&&me(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const we=(e,t,n)=>{var o;"productTier"===T&&(o=e,k(e=>{const t={...e},n=$.findIndex((e,n)=>{const o=t[n]||[];return n>=w&&o.length<e.minimumQuantity});return-1!==n&&C(n),t[n]||(t[n]=[]),t[n].push(o),t}));const r=!0===$[w]?.isFreebieTier;x?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Ip(e,t,n,l,c,r,w)},Ce=(()=>{if(!a?.builderTiers)return a.minimumQuantity;const{type:e,offerTier:t,productTier:n}=a.builderTiers,o="offerTier"===e?t:"productTier"===e?n:null;if(!o)return a.minimumQuantity;let r=0;return o.map(e=>{r+=e.minimumQuantity}),r})(),Ee=h&&a.mobileCoverImageUrl?Bp(a.mobileCoverImageUrl):Bp(a.coverImageUrl??"")||null,ke=i(e=>{const t=S?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,o=n?.variants?.edges||[];if(Z){if(o.some(e=>Z.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return o.some(e=>ee(n,e.node.id)>0)},[S?.general?.showOutOfStockProducts,Z,ee]);n(()=>{if("productTier"!==T)return;const e=$[w];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;const t=e.products[0],n=a.products.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const o=n.variants?.edges?.find(e=>ee(n,e.node.id)>0)?.node;if(!o)return;const r=o.id,i=E[w]?.includes(r);if(!i&&(we(r,n,1),w<$.length-1)){C(w+1);const e=$?.[w];e?.products?.length>1&&ve()}},[T,$,w,a.products,E,ee,we]);const Te=o(()=>J.filter(e=>{const t=e.productDetails;return(t.variants?.edges||[]).some(e=>ee(t,e.node.id)>0)}).length,[J,ee]),Se=o(()=>J.length-Te,[J,Te]),$e="bundles"==a.appName?a.pageHeader?.title:a?.title,Be="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;n(()=>{_(0)},[oe,ae,D,w,O]);const Ie=i(()=>{ye.length<fe.length&&_(e=>e+1)},[ye.length,fe.length]);n(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&Ie()},{threshold:.1});return R.current&&e.observe(R.current),()=>{R.current&&e.unobserve(R.current)}},[Ie]);const ze=()=>{x?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:S.byob.sectionBackgroundColor,..."transparent"!==S.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},Ee?e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...a?.coverImageVerticalMargin&&{marginBottom:a?.coverImageVerticalMargin,marginTop:a?.coverImageVerticalMargin}}},Ee&&e.createElement(Fc,{coverImageUrl:Ee,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:S?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},$e),e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Be))):($e||Be)&&e.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},$e&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:S?.byob?.titleBackgroundColor??"transparent"}},$e),Be&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"}},Be)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===T&&$.length>0&&S?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(Mc,{currentStep:w,totalSteps:$.length,tiers:$,isMobile:h,primaryColor:S?.general?.primaryColor,primaryTextColorCta:S?.general?.primaryContrastColor,setCurrentProductTier:C,selectedProductsByTier:E,tierNavigation:S.byob.tierNavigation})))),e.createElement("div",{style:{display:"flex",flexDirection:"row",width:h?"100%":"90%",marginInline:"auto"}},"sidebar"===S?.byob?.productFiltersDisplay&&!h&&e.createElement(Ac,{showFiltersDrawer:V,handleClose:()=>W(!1),isAnimating:!1,isMobile:!1,availableFilters:M,appliedFilters:O,toggleFilter:(e,t)=>{L(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{L({}),U(0),q(te)},applyPriceFilter:()=>{L(e=>{const t={...e};return t["filter.v.price"]=[`min:${Q}-max:${H}`],t})},priceMin:Q,setPriceMin:U,priceMax:H,setPriceMax:q,maxPossiblePrice:te,styles:S,products:a.products,unavailableProductCount:Se,storeCurrencyCode:a?.storeCurrencyCode,openSections:Y,toggleSection:X}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},e.createElement("div",{style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(_c,{enableSortAndFilter:a?.enableSortAndFilter??!1,isMobile:h,searchTerm:oe,setSearchTerm:re,setSortBy:le,styles:S,appliedFilters:O,setAppliedFilters:L,availableFilters:M,products:a.products,availableProductCount:Te,unavailableProductCount:Se,maxPossiblePrice:te,storeCurrencyCode:a?.storeCurrencyCode,sharedFiltersState:{showFilters:V,setShowFilters:W,priceMax:H,setPriceMax:q,priceMin:Q,setPriceMin:U},openSections:Y,toggleSection:X}),a?.customizations?.byob?.enableProductCategories&&F&&e.createElement("div",null,e.createElement(jc,{styles:S,isMobile:h,categories:I,activeCategory:D,onCategoryChange:e=>{P(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:V&&"sidebar"===S?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},0===fe?.length?e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===T&&$.length>0?ye.filter(e=>ke(se.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))).map((t,n)=>{const o=($[w]?.minimumQuantity??0)>(E[w]?.length??0),r=se.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return r?e.createElement(Lc,{bundle:a,idx:n,key:t?.variantIds?.[0]??t.productId,product:r?.productDetails,handleAddToBundle:we,hideAddToBundle:!o,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>he(e,w),selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,currentProductTier:$[w],showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:w}):null}):ye.filter(ke).map((t,n)=>e.createElement(Lc,{bundle:a,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:we,hideAddToBundle:u>=Ce,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:m,selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,tierIndex:w})),ye.length<fe.length&&e.createElement("div",{ref:R,style:{height:"1px",width:"100%",display:"block"}})),!p&&e.createElement(Cc,{builderTiers:a?.builderTiers,handleAddToCart:async e=>{await d(e),ze()},minimumQuantity:K,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,handleRemoveItem:m,handleRemoveItemProductTier:he,selectedItemsQuantity:u,percentageOff:a.percentageOff,loading:s,bundleSubtotal:g,amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:a?.dealTextColor??"#333",primaryTextColorCta:a?.primaryTextColorCta??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p}),p&&e.createElement("div",{style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(Cc,{handleAddToCart:async e=>{await d(e),ze()},minimumQuantity:K,builderTiers:a?.builderTiers,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,loading:s,handleRemoveItem:m,handleRemoveItemProductTier:he,percentageOff:a.percentageOff,selectedItemsQuantity:u??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:S.general.primaryContrastColor??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p})))),ue&&void 0!==u&&(()=>{let t=u<a.minimumQuantity;return"productTier"==T?t=($[w]?.minimumQuantity??0)>(E[w]?.length??0):"offerTier"==T&&(t=u<B.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(zc,{handleAddToBundle:we,ref:be,remainingQuantity:a.minimumQuantity-u,hideAddToBundle:!t,disableQuantitySelector:a?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:E,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:a?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:S?.general.primaryColor||"#000",cornerRadius:a?.customizations.byob.borderRadius,styles:a.customizations,reviewRatingType:a?.reviewRatingType??"none",customVariantsQuantity:Z,bundleProductsCustomQuantity:a?.customProductsQuantity,isFreebieTier:$?.[w]?.isFreebieTier,showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:a?.variantOptions})})()))},Hc=({product:t,selectedVariantId:n,onVariantChange:r,styles:i,originalPrice:a,dealPrice:l,totalPriceSum:c,isVertical:d=!1,variantOptions:s,storeCurrencyCode:p})=>{const u=o(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),o=n?.node;return o?t.productDetails.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t.productDetails]),m=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const g=o(()=>{if(m?.title&&t.productDetails.options){const e=m.title.split(" / ");if(e.length===t.productDetails.options.length)return e}return t.productDetails.options?.map(e=>e.values[0])||[]},[m,t.productDetails.options]),x=e=>{r(e)};return d?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},i.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Bp(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:i.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null)))))),(i.comboBundle.subProductsProductTitleVisibility||i.comboBundle.subProductsProductPriceVisibility)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},$p(i.general.currencySymbol,p),Sp((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),m?.compareAtPrice&&Number(m.compareAtPrice)>Number(m.price)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},$p(i.general.currencySymbol,p),m.compareAtPrice?Sp(m.compareAtPrice):Sp(m.price))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===i.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===i.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},i.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Bp(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===i.comboBundle?.infoAlignment?"flex-start":"right"===i.comboBundle?.infoAlignment?"flex-end":"center"===i.comboBundle?.infoAlignment?"flex-start":void 0}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==i.comboBundle.comboVariantTypeSelector&&t.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&s&&g&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},g.length>1?g.join(" / "):g)),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},$p(i.general.currencySymbol,p),Sp((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),m?.compareAtPrice&&Number(m.compareAtPrice)>Number(m.price)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},$p(i.general.currencySymbol,p),Sp(m?.compareAtPrice?m?.compareAtPrice:m?.price))),t.productDetails.variants.edges.length>1&&("dropdown"===i.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null))):t.productDetails.options.length>0?e.createElement(e.Fragment,null,t.productDetails.options.map((n,o)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(r=>{const a=[...g];a[o]=r;const l=t.productDetails.options.length>0?a.join(" / "):a[o],c=t.productDetails.variants.edges.find(e=>e.node.title===l)?.node,d=0===(c?u(c.id):0),p=g[o]===r,m=s&&s?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&x(c.id)},disabled:d,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!d?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"}},m?.values.find(e=>e.name===r)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!d?"26px":"24px",height:p&&!d?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===r)?.value}},e.createElement("span",null)):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!d?`1px solid ${i.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):m&&"image"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&x(c.id)},disabled:d,style:{border:p&&!d?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!d?"#F7F7F7":"transparent",cursor:d?"not-allowed":"pointer",padding:"0px",width:p&&!d?"26px":"24px",height:p&&!d?"26px":"24px",overflow:"hidden",opacity:d?.5:1}},m?.values.find(e=>e.name===r)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Bp(m?.values.find(e=>e.name===r)?.value||"/placeholder.svg"),alt:r,style:{width:p&&!d?"26px":"24px",height:p&&!d?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!d?`1px solid ${i.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&x(c.id)},disabled:d,style:{padding:"4px 8px",border:p&&!d?`1px solid ${i.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",cursor:d?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:d?.5:1}},r)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const o=0===u(t?.node?.id);return e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${o?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>x(t?.node?.id),disabled:o,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:o?"#ccc":"#707070",cursor:o?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:o?.5:1}},t?.node?.title)}))))))},qc=({bundle:r,addToCartFunction:i,dispatchAnalyticsEvent:a})=>{const[l,c]=t(!1),[d,s]=t(window.innerWidth<786),p=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[u,m]=t(()=>{const e={};return r.products.forEach((t,n)=>{const o=t.productDetails?.variants?.edges?.find(e=>p(t.productDetails,e?.node?.id)>0)?.node;e[n]=o?o.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e});n(()=>(i&&(window.ytComboBundle={bundle:r,addToCart:i,selectedVariants:u},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[r,i,u]);const g=r.products?.every((e,t)=>{const n=u[t];return p(e.productDetails,n)>0}),x=(e,t)=>{m(n=>({...n,[e]:t}))},{originalPrice:f,dealPrice:y,offerValue:b,totalPriceSum:h}=o(()=>{const{price:e,compareAtPrice:t}=Object.entries(u).reduce((e,[t,n])=>{const o=r.products[parseInt(t)],i=o.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(i?.price??"0"),l=parseFloat(i?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);r?.percentageOff?o=e*(1-r.percentageOff/100):r?.dealAmount?o=r.dealAmount:r?.amountOff&&(o=e-r.amountOff);const i=t-o;return{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),offerValue:i.toFixed(2),totalPriceSum:e.toFixed(2)}},[u,r.products,r.percentageOff,r.dealAmount,r.amountOff]);n(()=>{a?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"combo-bundle"}});const e=()=>{s(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const v=r.customizations,w=v.comboBundle?.comboCardStyle||"auto",C="vertical"===w||"auto"===w&&!d,E=v.comboBundle?.embedContentVisibility,k="bundles"==r.appName?r.pageHeader?.title:r?.title,T="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===v.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===v.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===v.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:v.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===v.comboBundle?.infoAlignment?"flex-start":"right"===v.comboBundle?.infoAlignment?"flex-end":"center"===v.comboBundle?.infoAlignment?"center":void 0,textAlign:v.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},E&&v.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:v.comboBundle?.productTitleFontSize||"28px",color:v.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},k)),E&&v?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:v.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(v.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},$p(v.general.currencySymbol,r.storeCurrencyCode),Sp(y)),!isNaN(Number(f))&&!isNaN(Number(y))&&Number(f)>Number(y)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:v.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},$p(v.general.currencySymbol,r.storeCurrencyCode),Sp(f)),Number(b)>0&&e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},r?.percentageOff?`${r?.percentageOff}% Off`:r?.amountOff?`${$p(v.general.currencySymbol,r.storeCurrencyCode)}${Sp(r?.amountOff)} Off`:`Save ${$p(v.general.currencySymbol,r.storeCurrencyCode)}${Sp(b)}`))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:v.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:v.comboBundle.productDescriptionFontSize||"16px",color:v.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),v.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,C?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(d?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},r.products.map((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===u[n])?.node;return o?e.createElement(Hc,{key:`combo-product-${n}-${t.productId}`,product:t,styles:v,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),isVertical:C,variantOptions:r.variantOptions,storeCurrencyCode:r.storeCurrencyCode}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(d?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},v.comboBundle.subProductsSectionVisibility&&r.products.map((t,n)=>e.createElement(Hc,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:v,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),variantOptions:r.variantOptions})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${g?"":"yt-comboBundle-bundle-cta-button-disabled"} ${d?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:g?v.general?.ctaBackgroundColor||"#121212":v.general.disabledButtonColor,color:v.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:v.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:g?"pointer":"not-allowed",border:`1px solid ${g?v.general?.ctaBackgroundColor||"#121212":v.general.disabledButtonColor}`,boxShadow:v.general.ctaShadowType,padding:v.general?.ctaPadding,width:v.general?.ctaWidth,margin:"0"},disabled:!g,onMouseOver:e=>{v.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=v.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=v.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{v.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=v.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=v.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{const e=Object.entries(u).map(([e])=>({id:r.products[parseInt(e)].productId,title:r.products[parseInt(e)]?.productDetails?.title}));a?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"combo-bundle",selectedProducts:e}});try{if(c(!0),!i)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const e=Object.entries(u).map(([e,t])=>{const n=r.products[parseInt(e)],o=n.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return o?{variantId:t,price:Number(o.price)}:null}).filter(e=>null!==e),t=Object.values(u);await i(Number(f),t,Number(y),e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}c(!1)}},l?e.createElement(rt,{color:"white",loading:l,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,g?v.comboBundle?.ctaTitle??"Add Bundle to cart":v.general.outOfStockLabel||"Out of Stock"," "))),E&&v.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:v.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:v.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:v.comboBundle.productDescriptionFontSize||"16px",color:v.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:v.general.primaryColor+"08"}},e.createElement("p",null,T))))},Qc=c.div`
|
|
3148
|
+
`;const Nc=({options:t,selectedValue:n,onChange:o,type:r="text",isOptionAvailable:i,isMobile:a})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const a=!i||i(t.name);return e.createElement("div",{key:t.name,onClick:()=>{a&&o(t)},style:{cursor:a?"pointer":"not-allowed"}},((t,n)=>{const o=!i||i(t.name),a={cursor:o?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:o?1:.5};if("color"===r)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...a,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name);return"image"===r?e.createElement("img",{src:gn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...a,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name)})(t,n?.name===t.name))})),Bc=({product:r,isOpen:i,onClose:a,variantOptions:l,cta:c,onConfirm:s})=>{const d=o(()=>e=>e?r?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[r?.tracksInventory]),p=o(()=>{const e=r.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):r.options?.map(e=>e.values[0])||[]},[r,d]),[u,m]=t(p),[g,x]=t(window.innerWidth<1024);n(()=>{const e=()=>x(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&a()};return i&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,a]);const f=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,y=f?.image?.url||r.featuredMedia?.preview?.image?.url,b=gn(y,150,85,"webp"),h=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},w=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!i)return null;const C=e.createElement("div",{onClick:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:r.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},r.title))),e.createElement("div",{style:{padding:"20px"}},r.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},w(t,n)?.name||t.values[0])),e.createElement(Nc,{options:v(t),selectedValue:w(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(n,e)},type:h(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const o=r.options?.length>0?n.join(" / "):n[0],i=r.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&d(i)>0})(n,e),isMobile:g}))))),e.createElement("button",{onClick:()=>{const e=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&d(e)>0;if(e?.id&&t)s(e.id),a();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=r.variants.edges.find(e=>d(e.node)>0)?.node.id;e&&(s(e),a())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return P.createPortal(C,document.body)},Ic=l((a,l)=>{const[c,s]=ie(Ec),d=o(()=>e=>{const t=a?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:a?.bundleProductsCustomQuantity?a?.bundleProductsCustomQuantity:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[c?.tracksInventory,a?.customVariantsQuantity,a?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[u,m]=t(p?.[0]?.node),[g,x]=t(0),[f,y]=t("undefined"!=typeof window&&window.innerWidth<=600),[b,h]=t(1),[v,w]=t("idle"),C=r(null),E=r(null),k=r(!1),[T,S]=t(0),$=o(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[N,B]=t($);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;m(t),t?.title&&"Default Title"!==t.title&&B(t.title.split(" / "))}},[c,d]),n(()=>{const e=a.selectedProducts.find(e=>e.variantId===u?.id);h(e?e.quantity:0)},[b,a.selectedProducts,u]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>y(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:z,media:F,variants:D}=c,A=F.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),_=i(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,m(n),n.title&&"Default Title"!==n.title&&B(n.title.split(" / ")))},[p,d]),R=i(e=>{if(!a.bundleVariantOptions?.options)return"text";const t=a.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[a.bundleVariantOptions]),O=i(e=>{if(!a?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=a?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[a.bundleVariantOptions]),L=i((e,t)=>{const n=[...N];n[e]=t.name,B(n);const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;r&&d(r)>0&&(k.current=!0,m(r))},[N,c,d]),M=i((e,t)=>{const n=N[t];if(!n)return null;return O(e).find(e=>e.name===n)||null},[N,O]),j=i((e,t)=>{const n=[...N];n[e]=t;const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;return!!r&&d(r)>0},[N,c,d]);n(()=>{if(c&&u?.image?.url&&Array.isArray(A)){const e=A.findIndex(e=>e?.url===u?.image?.url);-1!==e&&e!==g&&x(e)}},[u,g,A]),n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(f&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[f,c]);const V=a.selectedProducts.filter(e=>e.variantId===u?.id).reduce((e,t)=>e+t.quantity,0),W=a.customVariantsQuantity?.find(e=>e.variantId===u?.id)?.quantity??a.bundleProductsCustomQuantity??1/0,H=W!==1/0&&V>=W,q=a.hideAddToBundle||!u||d(u)<=0||H||"idle"!==v||a?.disableQuantitySelector&&1===b,Q=({className:t})=>{const n=c?.rating?.averageRating??a?.rating?.averageRating??0,o=c?.rating?.ratingCount??a?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14}),n,e.createElement(he,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",o," reviews)"))},U=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(ut,{small:Np(t?.url),medium:Np(t?.url),large:Np(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(ut,{small:Np(A[g]?.url),medium:Np(A[g]?.url),large:Np(A[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.filter(e=>e?.url?.length>0).map((n,o)=>e.createElement("img",{key:o,src:Np(n?.url),alt:n.altText||`${I} - Image ${o+1}`,onClick:()=>x(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===o?`2px solid ${a.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),Y=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},u?.title)),e.createElement("select",{className:`${t}-select`,value:u?.id||"",onChange:_,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},c?.variants?.edges?.map(({node:t})=>e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t)},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(Ge,null)))),X=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,o)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},N[o]||n.values[0])),e.createElement(Nc,{options:O(n),selectedValue:M(n,o),onChange:e=>{L(o,e)},type:R(n.name),isOptionAvailable:e=>j(o,e),isMobile:t}))))),Z=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},a?.isFreebieTier&&!a.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},$p(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Sp(u?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:a.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,u?.compareAtPrice&&parseFloat(u.compareAtPrice)>parseFloat(u?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},$p(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Sp(u?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},$p(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Sp(u?.price))))),J=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:a.themeColor||"#111",borderRadius:a.cornerRadius,color:a.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:q?.5:1,cursor:q?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),u?.id&&c&&(w("check"),a.handleAddToBundle(u?.id,c,1),setTimeout(()=>{w("idle"),s(void 0)},500))},disabled:q},a.styles.byob.addToBundleCTAText??"Add to bundle")),K=e.createElement(Tc,{className:"yt-byob-modal-desktop-overlay"},e.createElement(Sc,{$isSmallScreen:f,ref:l},e.createElement($c,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},e.createElement(kc,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(G,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(U,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(Q,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===a?.styles?.byob.variantSelectorType&&e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===a?.styles?.byob.variantSelectorType&&e.createElement(X,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!1}),e.createElement(J,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:z}})))))),ee=e.createElement(Tc,{className:"yt-byob-modal-mobile-overlay"},e.createElement(Sc,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:l},e.createElement($c,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s(void 0)}},e.createElement(Ye,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(U,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(Q,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:z}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===a?.styles?.byob.variantSelectorType?e.createElement(X,{isMobile:!0}):e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!0}),e.createElement(J,{isMobile:!0})))));return P.createPortal(f?ee:K,document.body)}),zc=({coverImageUrl:t,mobileCoverImageUrl:n,alt:o="Background",styles:r})=>{const i=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],a=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality","80"),o.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?i.map(({imageWidth:t,descriptor:n})=>{const o=a(e,t);return o?`${o} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const c=t||n||"",s=a(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:o,style:{width:"100%",height:"auto",display:"block",...r},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Fc=({title:t,isOpen:n,onToggle:o,children:r})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:o,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(_e,{className:"yt-byob-icon-minus",size:20}):e.createElement(Fe,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},r)),Dc=({availableFilters:n,appliedFilters:o,toggleFilter:r,clearAllFilters:i,applyPriceFilter:a,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:u,availableProductCount:m,products:g,unavailableProductCount:x,storeCurrencyCode:f,showActions:y=!0,openSections:b,toggleSection:h})=>{const[v,w]=t(null),C=$p(u?.general?.currencySymbol,f)??"₹";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Fc,{key:t.id,title:t.label,isOpen:!!b[t.id],onToggle:()=>h(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const i=o[t.id]?.includes(n.id)||!1,a="filter.v.availability.1"===n.id?m??g.length:"filter.v.availability.0"===n.id?x??0:n.count;return e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:i,onChange:()=>r(t.id,n.id),style:{width:"18px",height:"18px",accentColor:u?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)),e.createElement("span",{className:"yt-byob-filter-item-count",style:{fontSize:"12px",background:"#f3f4f6",padding:"2px 8px",borderRadius:"4px",color:"#666",minWidth:"24px",textAlign:"center"}},a))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString(),s>=p?"+":""),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>w("min"),onTouchStart:()=>w("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===v?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>w("max"),onTouchStart:()=>w("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===v?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),y&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:i,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:a,style:{flex:1,padding:"8px",background:u?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},Pc=t=>{const{showFiltersDrawer:n,handleClose:o,isAnimating:r,isMobile:i}=t;return n?A(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:r?1:0,transition:"opacity 300ms ease-in-out"},onClick:o},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:i?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Dc,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),o()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},Ac=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Dc,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},_c=({enableSortAndFilter:o,isMobile:r,setSearchTerm:i,searchTerm:a,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:u,availableProductCount:m,unavailableProductCount:g,maxPossiblePrice:x,storeCurrencyCode:f,sharedFiltersState:b,openSections:h,toggleSection:v,sortBy:w})=>{const[C,E]=t(!1),[k,T]=t(a),{showFilters:S,setShowFilters:$,priceMax:N,setPriceMax:B,priceMin:I,setPriceMin:z}=b,[F,D]=t(!1),P=l?.byob?.productFiltersDisplay||"drawer",A=!r&&"sidebar"===P,_="none"===P;n(()=>{s["filter.v.price"]||(B(x),z(0))},[x,s]);n(()=>{const e=setTimeout(()=>{i(k)},300);return()=>clearTimeout(e)},[k,i]),n(()=>(S&&!A?(document.body.style.overflow="hidden",D(!0)):(document.body.style.overflow="",D(!1)),()=>{document.body.style.overflow=""}),[S,A]);const R=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?I>0||N<x?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:r?"column":"row",justifyContent:"space-between",alignItems:r?"flex-end":"center",marginBottom:"20px",width:"100%",gap:r?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:o?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},o&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:r?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},r&&!C?e.createElement(De,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:r?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(De,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),r&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>$(!S),style:{display:_?"none":"flex",alignItems:"center",gap:r?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Pe,{className:"yt-byob-filter-toggle-icon",size:18}),!r&&"Filters",R>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},R)),o&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!r&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),r&&e.createElement(Ae,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:w,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(y,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(Pc,{showFiltersDrawer:S,handleClose:()=>{A?$(!1):(document.body.style.overflow="",D(!1),setTimeout(()=>{$(!1)},300))},isAnimating:F,isMobile:r,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{B(x),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${I}-max:${N}`],t})},priceMin:I,setPriceMin:z,priceMax:N,setPriceMax:B,maxPossiblePrice:x,styles:l,availableProductCount:m,products:u,unavailableProductCount:g,storeCurrencyCode:f,openSections:h,toggleSection:v}))};function Rc({quantity:t,setQuantity:n,remainingQuantity:o,handleAddToBundle:r,variantId:i,product:a,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<s;return e.createElement(Il,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const o=Math.max(0,t-1);n(o),l&&i&&l(i,1)},style:d},"-"),e.createElement(zl,{className:"yt-byob-quantity-display"},t," added"),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(o,t+1,s);n(l),r&&i&&a&&r(i,a,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const Oc=({product:r,styles:i,selectedVariant:a})=>{const[l,c]=t(!1),s=o(()=>Np(a?.image?.url||r?.featuredMedia?.preview?.image?.url||r?.media?.edges?.[0]?.node?.image?.url)||"",[a?.image?.url,r?.featuredMedia?.preview?.image?.url,r?.media?.edges]),d=o(()=>r?.media?.edges?.map(e=>Np(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[r?.media?.edges]),p=o(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const u=o(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:i.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:u,alt:r.title}),u!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:r.title})))},Lc=({product:o,bundle:r,handleAddToBundle:a,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:g,currentProductTier:x,showFreebieTierProductPrices:f,tierIndex:b})=>{const h=le(Ec),v=r.customizations,w=v?.byob?.variantSelectorType,[C,E]=t(!1),k=v.general?.variantTitleSuffix?o?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const o=t[e];let r=0;for(;r<n.length&&r<o.length&&n[n.length-1-r]===o[o.length-1-r];)r++;n=n.slice(n.length-r)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),o=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:o,commonSuffix:n.join(" ")}}})})(o?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=i(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;if(r?.customProductsQuantity)return r?.customProductsQuantity;const n=k?.find(t=>t.node.id===e),i=n?.node;return i?o.tracksInventory&&i.inventoryItem?.tracked?i.inventoryQuantity>0?i.inventoryQuantity:i.inventoryQuantity<=0&&"continue"===i.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[k,g,o.tracksInventory]),S=k?.find(e=>T(e.node.id)>0)?.node?.id;if(!S&&!v.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[$,N]=t(k?.find(e=>T(e.node.id)>0)?.node?.id||k[0]?.node?.id),[B,I]=t(0),[z,F]=t(window.innerWidth<450),[D,P]=t("normal"),A=k?.find(e=>e?.node?.id===$)?.node,_=T($||"");n(()=>{const e=m.find(e=>e.variantId===$&&(void 0===b||e.tierIndex===b));I(e?e.quantity:0)},[m,$,b]),n(()=>{const e=()=>{F(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if($&&!k?.some(e=>e.node.id===$)){const e=k.find(e=>T(e.node.id)>0)?.node.id||k[0]?.node?.id;e&&N(e)}},[$,k,T]);const R=o.variants&&o.variants.edges?.length>1&&"customOptions"!==w,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,L="53933408435"===O,M="75851235630"===O,j=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(o),V=j.length>0;return e.createElement(e.Fragment,null,e.createElement(Pl,{borderRadius:v?.byob.borderRadius,borderColor:v?.byob.borderColor,shadowType:v?.byob.shadowType,backgroundColor:v?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(_<=0)return;const e={...o,variants:{...o.variants,edges:k},selectedVariant:A};h(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:v?.byob?.productCardDetailsAlignment||"left"}},e.createElement(Al,{className:"yt-byob-image-wrapper"},e.createElement(Oc,{product:o,styles:v,selectedVariant:A}),r?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:v.byob.borderRadius}},r.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(_l,{className:"yt-byob-variant-selector",isCoralHaze:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:$||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),N(e.target.value)}},k?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,o=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id},o)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(y,null)))),e.createElement("div",{className:"yt-byob-product-content"},"enabled"===r?.customizations?.byob?.productCardCategoryVisibility&&V&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},j.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"8px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),j.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",j.length-2," more"))),e.createElement(Rl,{isMobile:z,showBorder:r?.showBorder??!0,style:{...!v?.byob.productsPriceVisibility&&{padding:"8px"},...v?.byob.productTitleFontSize&&{fontSize:v?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:v?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(A?.displayName).replace("- Default Title",""):o.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&v?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:r?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},o?.rating?.averageRating," rating")),"ratingAndReviewCount"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(he,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," reviews)"),v?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:r?.showBorder?"0px 10px":"0 4px"}},x?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},$p(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Sp(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:v.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},$p(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Sp(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!x?.isFreebieTier||f)&&A?.compareAtPrice&&v?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},$p(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Sp(A.compareAtPrice))),(_>0||_===1/0)&&e.createElement(Ol,{borderRadius:v?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===B||void 0===B)&&e.createElement(Fl,{style:{...!l&&{backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),I(1),(()=>{if(!$)return;"customOptions"===w&&k.length>1?E(!0):a($,o,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},v?.byob.addToBundleCTAText),!r?.disableQuantitySelector&&B>0&&$&&e.createElement(Dl,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(Rc,{remainingQuantity:c,setQuantity:I,quantity:B,handleAddToBundle:a,variantId:$,product:o,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:_})),r?.disableQuantitySelector&&B>0&&$&&e.createElement(Fl,{style:{backgroundColor:"#747474",color:v?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(Ll,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(Ml,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,B-1);I(t),d&&$&&d($,b)}},e.createElement(Re,{style:{color:"#fff",fontSize:"20px"}})))),_<=0&&_!==1/0&&e.createElement(Fl,{style:{backgroundColor:v.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},v?.general.outOfStockLabel||"Out of Stock")),"customOptions"===w&&C&&k.length>1&&e.createElement(Bc,{product:o,isOpen:C,onClose:()=>E(!1),variantOptions:r.variantOptions,cta:{textColor:v.general.ctaTextColor,backgroundColor:v.general.primaryColor},onConfirm:e=>{N(e),a(e,o,1)}}))},Mc=({currentStep:t,setCurrentProductTier:n,totalSteps:o,tiers:r,isMobile:i,selectedProductsByTier:a,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:o}).map((c,d)=>{const p=d+1,u=r[d].minimumQuantity-(a[d]?.length??0)===0,m=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:i?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<o?i?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:i?"16px 0px":"15px 0px",fontSize:i?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},r[t]?.title)),jc=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o;return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(t.general.primaryColor,.07):"transparent",borderBottom:i?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:r===o?t?.general.primaryColor:"white",color:r===o?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{r!==o&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{r!==o&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},o.charAt(0).toUpperCase()+o.slice(1)))))},Vc=(e,t)=>{const n=[],o=e=>!t||0===t.length||t.includes(e);let r=0,i=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id)),n=t?.some(e=>e.node.availableForSale);n?r++:i++}),o("Availability")&&n.push({id:"filter.v.availability",label:"Availability",type:"LIST",values:[{id:"filter.v.availability.1",label:"In stock",count:r,input:'{"available":true}'},{id:"filter.v.availability.0",label:"Out of stock",count:i,input:'{"available":false}'}]});let a=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id));t?.forEach(e=>{const t=parseFloat(e.node.price);t>a&&(a=t)})}),o("Price")&&n.push({id:"filter.v.price",label:"Price",type:"PRICE_RANGE",values:[{id:"filter.v.price",label:"Price",count:e.length,input:JSON.stringify({price:{min:0,max:a}})}]});const l={};e.forEach(e=>{const t=e.productDetails.productType;t&&(l[t]=(l[t]||0)+1)}),Object.keys(l).length>0&&o("Product Type")&&n.push({id:"filter.p.product_type",label:"Product Type",type:"LIST",values:Object.entries(l).map(([e,t])=>({id:`filter.p.product_type.${e}`,label:e,count:t,input:JSON.stringify({productType:e})}))});const c={};e.forEach(e=>{const t=e.productDetails.vendor;t&&(c[t]=(c[t]||0)+1)}),Object.keys(c).length>0&&o("Vendor")&&n.push({id:"filter.p.vendor",label:"Vendor",type:"LIST",values:Object.entries(c).map(([e,t])=>({id:`filter.p.vendor.${e}`,label:e,count:t,input:JSON.stringify({vendor:e})}))});const s={};e.forEach(e=>{e.productDetails.tags?.forEach(e=>{e&&(s[e]=(s[e]||0)+1)})}),Object.keys(s).length>0&&o("Tags")&&n.push({id:"filter.p.tag",label:"Tag",type:"LIST",values:Object.entries(s).map(([e,t])=>({id:`filter.p.tag.${e}`,label:e,count:t,input:JSON.stringify({tag:e})}))});const d={};return e.forEach(e=>{(e.productDetails.options||[]).forEach((t,n)=>{if("Title"===t.name)return;d[t.name]||(d[t.name]={});const o=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];t.values?.forEach(e=>{void 0===d[t.name][e]&&(d[t.name][e]=0);o.some(t=>(t.node.title.split(" / ")[n]||t.node.title).toLowerCase()===e.toLowerCase())&&d[t.name][e]++})})}),o("Variant Options")&&Object.entries(d).forEach(([e,t])=>{const o=Object.entries(t).filter(([e,t])=>t>0).map(([t,n])=>({id:`${e.toLowerCase()}.${t}`,label:t,count:n,input:JSON.stringify({variantOption:{name:e,value:t}})}));o.length>0&&n.push({id:`filter.v.option.${e.toLowerCase()}`,label:e,type:"LIST",values:o})}),n},Wc=({bundle:a,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:u,handleRemoveItem:m,bundleSubtotal:g,dispatchAnalyticsEvent:x,fetchStoreDetails:f})=>{const[y,b]=t(void 0),[h,v]=t(window.innerWidth<450),[w,C]=t(0),[E,k]=t({}),T=a.builderTiers?.type,S=a.customizations,$=a.builderTiers?.productTier??[],N=a.builderTiers?.offerTier??[],[B,I]=t([]),[z,F]=t(!1),[D,P]=t("All"),[A,_]=t(0),R=r(null),[O,L]=t({}),[M,j]=t([]),[V,W]=t(!1),[H,q]=t(0),[Q,U]=t(0),[Y,G]=t({}),X=e=>{G(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{M.length>0&&G(e=>{const t={...e};return M.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[M]);const Z=a.customStoreDetails?.fixedInventoryDetails;n(()=>{const e=new Set;let t=!1;a?.products?.forEach(n=>{const o=n.productDetails;if(o.metafield&&"yourtoken_bundles_app"===o.metafield.namespace&&"categories"===o.metafield.key){let n=[];if(o.metafield.jsonValue&&Array.isArray(o.metafield.jsonValue))n=o.metafield.jsonValue;else if(o.metafield.value)try{const e=JSON.parse(o.metafield.value);Array.isArray(e)&&(n=e)}catch(e){console.error("Failed to parse categories:",e)}n.length>0&&(t=!0,n.forEach(t=>e.add(t)))}}),I(Array.from(e)),F(t);S?.byob?.productFiltersDisplay&&"none"!==S?.byob?.productFiltersDisplay&&(async()=>{const e=S?.byob?.filtersProvider??"products-data",t=S?.byob?.selectedFilterOptions;if("search-and-discovery-app-sync"===e)try{const e=await(f?.());e?.productFilters&&j(e.productFilters??[])}catch(e){j(Vc(a.products,t))}else j(Vc(a.products,t))})()},[a.products,S?.byob,f]),n(()=>{L({})},[w,D]);const J=((e,t)=>"All"===t?e:e.filter(e=>{const n=e.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(a.products.filter(e=>"active"===e.productDetails.status?.toLowerCase()||"unlisted"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status),D),K="productTier"===T?$.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===T?N.reduce((e,t)=>e+t.minimumQuantity,0):a.minimumQuantity,ee=i((e,t)=>{const n=Z?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const o=(e.variants?.edges||[]).find(e=>e.node.id===t),r=o?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[Z]),[te,ne]=t(3e3);n(()=>{let e=0;a.products.forEach(t=>{const n=Number(t.productDetails.variants?.edges?.[0]?.node?.price||0);n>e&&(e=n)}),ne(100*Math.ceil(e/100)||5e3)},[a.products]);const[oe,re]=t(""),[ae,le]=t(""),ce=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(J,oe),se=((e,t)=>[...e].sort((e,n)=>{const o=e?.productDetails?.title?.toLowerCase(),r=n?.productDetails?.title?.toLowerCase(),i=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),a=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return o.localeCompare(r);case"title-desc":return r.localeCompare(o);case"price-low-to-high":return i-a;case"price-high-to-low":return a-i;default:return 0}}))(ce,ae),de=se.filter(e=>((e,t,n,o)=>{if(0===Object.keys(t).length)return!0;for(const[r,i]of Object.entries(t)){if(0===i.length)continue;const a=n.find(e=>e.id===r);if(!a)continue;let l=!1;if("filter.v.price"===r){const n=t[r][0];if(!n)continue;const[o,i]=n.split("-"),a=parseFloat(o.replace("min:",""))||0,c="max:∞"===i?1/0:parseFloat(i.replace("max:",""))||1/0;(e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=Number(e.node.price||0);return t>=a&&t<=c})&&(l=!0)}else for(const t of i){const n=a.values.find(e=>e.id===t);if(n)try{const t=JSON.parse(n.input);if(void 0!==t.available){const n=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];if(!0===t.available){if(n.some(t=>o(e.productDetails,t.node.id)>0)){l=!0;break}}else if(!1===t.available&&n.every(t=>0===o(e.productDetails,t.node.id))){l=!0;break}}else if(t.productType){if(e.productDetails.productType===t.productType){l=!0;break}}else if(t.vendor){if(e.productDetails.vendor===t.vendor){l=!0;break}}else if(t.tag){if(e.productDetails.tags?.includes(t.tag)){l=!0;break}}else if(t.variantOption){const{name:n,value:o}=t.variantOption,r=e.productDetails.options?.findIndex(e=>e.name===n);if(void 0!==r&&-1!==r){if((e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=(e.node.title||"").split(" / ")[r]||e.node.title;return t?.toLowerCase()===o.toLowerCase()})){l=!0;break}}}}catch(e){console.warn("Bad filter input",n.input)}}if(!l)return!1}return!0})(e,O,M,ee)),pe=((e,t,n,o,r)=>(e[r]?.products.filter(e=>t.some(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))||[]).sort((e,n)=>{let r=t.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))),i=t.find(e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0])));if(!r||!i)return 0;const a=r.productDetails?.title?.toLowerCase(),l=i.productDetails?.title?.toLowerCase(),c=parseFloat(r?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(i?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(o){case"title-asc":return a.localeCompare(l);case"title-desc":return l.localeCompare(a);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}}))($,de,oe,ae,w),[ue,me]=ie(Ec),[ge,xe]=t(!1),fe="productTier"===T?pe:de,ye=fe.slice(0,20*(A+1));n(()=>{x?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a?._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder"}}),setTimeout(()=>{xe(!0)},100)},[]);const be=r(null);n(()=>{const e=()=>{v(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(a.coverImageUrl){const e=new Image;e.src=Np(a.coverImageUrl)??"",e.onload=()=>{b(e.width/e.height)}}},[a.coverImageUrl]),n(()=>{xe(!1),setTimeout(()=>xe(!0),100)},[w]);const he=(e,t)=>{if("productTier"===T){let n={...E},o=!1;if(n[t]){const r=n[t].indexOf(e);-1!==r&&(n[t]=[...n[t]],n[t].splice(r,1),o=!0)}if(!o)for(let t=$.length;t>=0;t--){const o=n[t].indexOf(e);if(-1!==o){n[t]=[...n[t]],n[t].splice(o,1);break}}k(n);const r=$.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==r&&C(r)}m(e,t)},ve=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if("productTier"===T){const e=Object.fromEntries($.map(e=>[e.tier,[]]));k(e)}},[a]),n(()=>{if("productTier"!==T||!$[w])return;if(K===u)return;const e=$.findIndex((e,t)=>{const n=E[t]||[];return t>=w&&n.length<e.minimumQuantity});if(-1!==e&&e!==w){C(e);$[w].products.length>1&&ve()}},[E,$,T]),n(()=>{re("")},[w]),n(()=>{function e(e){if(!be.current||!e.target)return;!be.current.contains(e.target)&&me(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const we=(e,t,n)=>{var o;"productTier"===T&&(o=e,k(e=>{const t={...e},n=$.findIndex((e,n)=>{const o=t[n]||[];return n>=w&&o.length<e.minimumQuantity});return-1!==n&&C(n),t[n]||(t[n]=[]),t[n].push(o),t}));const r=!0===$[w]?.isFreebieTier;x?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Bp(e,t,n,l,c,r,w)},Ce=(()=>{if(!a?.builderTiers)return a.minimumQuantity;const{type:e,offerTier:t,productTier:n}=a.builderTiers,o="offerTier"===e?t:"productTier"===e?n:null;if(!o)return a.minimumQuantity;let r=0;return o.map(e=>{r+=e.minimumQuantity}),r})(),Ee=h&&a.mobileCoverImageUrl?Np(a.mobileCoverImageUrl):Np(a.coverImageUrl??"")||null,ke=i(e=>{const t=S?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,o=n?.variants?.edges||[];if(Z){if(o.some(e=>Z.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return o.some(e=>ee(n,e.node.id)>0)},[S?.general?.showOutOfStockProducts,Z,ee]);n(()=>{if("productTier"!==T)return;const e=$[w];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;const t=e.products[0],n=a.products.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const o=n.variants?.edges?.find(e=>ee(n,e.node.id)>0)?.node;if(!o)return;const r=o.id,i=E[w]?.includes(r);if(!i&&(we(r,n,1),w<$.length-1)){C(w+1);const e=$?.[w];e?.products?.length>1&&ve()}},[T,$,w,a.products,E,ee,we]);const Te=o(()=>J.filter(e=>{const t=e.productDetails;return(t.variants?.edges||[]).some(e=>ee(t,e.node.id)>0)}).length,[J,ee]),Se=o(()=>J.length-Te,[J,Te]),$e="bundles"==a.appName?a.pageHeader?.title:a?.title,Ne="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;n(()=>{_(0)},[oe,ae,D,w,O]);const Be=i(()=>{ye.length<fe.length&&_(e=>e+1)},[ye.length,fe.length]);n(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&Be()},{threshold:.1});return R.current&&e.observe(R.current),()=>{R.current&&e.unobserve(R.current)}},[Be]);const Ie=()=>{x?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:S.byob.sectionBackgroundColor,..."transparent"!==S.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},Ee?e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...a?.coverImageVerticalMargin&&{marginBottom:a?.coverImageVerticalMargin,marginTop:a?.coverImageVerticalMargin}}},Ee&&e.createElement(zc,{coverImageUrl:Ee,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:S?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},$e),e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Ne))):($e||Ne)&&e.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},$e&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:S?.byob?.titleBackgroundColor??"transparent"}},$e),Ne&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"}},Ne)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===T&&$.length>0&&S?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(Mc,{currentStep:w,totalSteps:$.length,tiers:$,isMobile:h,primaryColor:S?.general?.primaryColor,primaryTextColorCta:S?.general?.primaryContrastColor,setCurrentProductTier:C,selectedProductsByTier:E,tierNavigation:S.byob.tierNavigation})))),e.createElement("div",{style:{display:"flex",flexDirection:"row",width:h?"100%":"90%",marginInline:"auto"}},"sidebar"===S?.byob?.productFiltersDisplay&&!h&&e.createElement(Ac,{showFiltersDrawer:V,handleClose:()=>W(!1),isAnimating:!1,isMobile:!1,availableFilters:M,appliedFilters:O,toggleFilter:(e,t)=>{L(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{L({}),U(0),q(te)},applyPriceFilter:()=>{L(e=>{const t={...e};return t["filter.v.price"]=[`min:${Q}-max:${H}`],t})},priceMin:Q,setPriceMin:U,priceMax:H,setPriceMax:q,maxPossiblePrice:te,styles:S,products:a.products,unavailableProductCount:Se,storeCurrencyCode:a?.storeCurrencyCode,openSections:Y,toggleSection:X}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},e.createElement("div",{style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(_c,{enableSortAndFilter:a?.enableSortAndFilter??!1,isMobile:h,searchTerm:oe,setSearchTerm:re,setSortBy:le,styles:S,appliedFilters:O,setAppliedFilters:L,availableFilters:M,products:a.products,availableProductCount:Te,unavailableProductCount:Se,maxPossiblePrice:te,storeCurrencyCode:a?.storeCurrencyCode,sharedFiltersState:{showFilters:V,setShowFilters:W,priceMax:H,setPriceMax:q,priceMin:Q,setPriceMin:U},openSections:Y,toggleSection:X}),a?.customizations?.byob?.enableProductCategories&&z&&e.createElement("div",null,e.createElement(jc,{styles:S,isMobile:h,categories:B,activeCategory:D,onCategoryChange:e=>{P(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:V&&"sidebar"===S?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},0===fe?.length?e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===T&&$.length>0?ye.filter(e=>ke(de.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))).map((t,n)=>{const o=($[w]?.minimumQuantity??0)>(E[w]?.length??0),r=de.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return r?e.createElement(Lc,{bundle:a,idx:n,key:t?.variantIds?.[0]??t.productId,product:r?.productDetails,handleAddToBundle:we,hideAddToBundle:!o,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>he(e,w),selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,currentProductTier:$[w],showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:w}):null}):ye.filter(ke).map((t,n)=>e.createElement(Lc,{bundle:a,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:we,hideAddToBundle:u>=Ce,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:m,selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,tierIndex:w})),ye.length<fe.length&&e.createElement("div",{ref:R,style:{height:"1px",width:"100%",display:"block"}})),!p&&e.createElement(Cc,{builderTiers:a?.builderTiers,handleAddToCart:async e=>{await s(e),Ie()},minimumQuantity:K,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,handleRemoveItem:m,handleRemoveItemProductTier:he,selectedItemsQuantity:u,percentageOff:a.percentageOff,loading:d,bundleSubtotal:g,amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:a?.dealTextColor??"#333",primaryTextColorCta:a?.primaryTextColorCta??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p}),p&&e.createElement("div",{style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(Cc,{handleAddToCart:async e=>{await s(e),Ie()},minimumQuantity:K,builderTiers:a?.builderTiers,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,loading:d,handleRemoveItem:m,handleRemoveItemProductTier:he,percentageOff:a.percentageOff,selectedItemsQuantity:u??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:S.general.primaryContrastColor??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p})))),ue&&void 0!==u&&(()=>{let t=u<a.minimumQuantity;return"productTier"==T?t=($[w]?.minimumQuantity??0)>(E[w]?.length??0):"offerTier"==T&&(t=u<N.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(Ic,{handleAddToBundle:we,ref:be,remainingQuantity:a.minimumQuantity-u,hideAddToBundle:!t,disableQuantitySelector:a?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:E,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:a?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:S?.general.primaryColor||"#000",cornerRadius:a?.customizations.byob.borderRadius,styles:a.customizations,reviewRatingType:a?.reviewRatingType??"none",customVariantsQuantity:Z,bundleProductsCustomQuantity:a?.customProductsQuantity,isFreebieTier:$?.[w]?.isFreebieTier,showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:a?.variantOptions})})()))},Hc=({product:t,selectedVariantId:n,onVariantChange:r,styles:i,originalPrice:a,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p})=>{const u=o(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),o=n?.node;return o?t.productDetails.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t.productDetails]),m=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const g=o(()=>{if(m?.title&&t.productDetails.options){const e=m.title.split(" / ");if(e.length===t.productDetails.options.length)return e}return t.productDetails.options?.map(e=>e.values[0])||[]},[m,t.productDetails.options]),x=e=>{r(e)};return s?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},i.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Np(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:i.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null)))))),(i.comboBundle.subProductsProductTitleVisibility||i.comboBundle.subProductsProductPriceVisibility)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},$p(i.general.currencySymbol,p),Sp((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),m?.compareAtPrice&&Number(m.compareAtPrice)>Number(m.price)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},$p(i.general.currencySymbol,p),m.compareAtPrice?Sp(m.compareAtPrice):Sp(m.price))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===i.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===i.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},i.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Np(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===i.comboBundle?.infoAlignment?"flex-start":"right"===i.comboBundle?.infoAlignment?"flex-end":"center"===i.comboBundle?.infoAlignment?"flex-start":void 0}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==i.comboBundle.comboVariantTypeSelector&&t.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&g&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},g.length>1?g.join(" / "):g)),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},$p(i.general.currencySymbol,p),Sp((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),m?.compareAtPrice&&Number(m.compareAtPrice)>Number(m.price)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},$p(i.general.currencySymbol,p),Sp(m?.compareAtPrice?m?.compareAtPrice:m?.price))),t.productDetails.variants.edges.length>1&&("dropdown"===i.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null))):t.productDetails.options.length>0?e.createElement(e.Fragment,null,t.productDetails.options.map((n,o)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(r=>{const a=[...g];a[o]=r;const l=t.productDetails.options.length>0?a.join(" / "):a[o],c=t.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0),p=g[o]===r,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===r)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===r)?.value}},e.createElement("span",null)):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):m&&"image"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===r)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Np(m?.values.find(e=>e.name===r)?.value||"/placeholder.svg"),alt:r,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},r)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const o=0===u(t?.node?.id);return e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${o?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>x(t?.node?.id),disabled:o,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:o?"#ccc":"#707070",cursor:o?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:o?.5:1}},t?.node?.title)}))))))},qc=({bundle:r,addToCartFunction:i,dispatchAnalyticsEvent:a})=>{const[l,c]=t(!1),[s,d]=t(window.innerWidth<786),p=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[u,m]=t(()=>{const e={};return r.products.forEach((t,n)=>{const o=t.productDetails?.variants?.edges?.find(e=>p(t.productDetails,e?.node?.id)>0)?.node;e[n]=o?o.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e});n(()=>(i&&(window.ytComboBundle={bundle:r,addToCart:i,selectedVariants:u},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[r,i,u]);const g=r.products?.every((e,t)=>{const n=u[t];return p(e.productDetails,n)>0}),x=(e,t)=>{m(n=>({...n,[e]:t}))},{originalPrice:f,dealPrice:y,offerValue:b,totalPriceSum:h}=o(()=>{const{price:e,compareAtPrice:t}=Object.entries(u).reduce((e,[t,n])=>{const o=r.products[parseInt(t)],i=o.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(i?.price??"0"),l=parseFloat(i?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);r?.percentageOff?o=e*(1-r.percentageOff/100):r?.dealAmount?o=r.dealAmount:r?.amountOff&&(o=e-r.amountOff);const i=t-o;return{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),offerValue:i.toFixed(2),totalPriceSum:e.toFixed(2)}},[u,r.products,r.percentageOff,r.dealAmount,r.amountOff]);n(()=>{a?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"combo-bundle"}});const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const v=r.customizations,w=v.comboBundle?.comboCardStyle||"auto",C="vertical"===w||"auto"===w&&!s,E=v.comboBundle?.embedContentVisibility,k="bundles"==r.appName?r.pageHeader?.title:r?.title,T="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===v.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===v.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===v.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:v.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===v.comboBundle?.infoAlignment?"flex-start":"right"===v.comboBundle?.infoAlignment?"flex-end":"center"===v.comboBundle?.infoAlignment?"center":void 0,textAlign:v.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},E&&v.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:v.comboBundle?.productTitleFontSize||"28px",color:v.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},k)),E&&v?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:v.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(v.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},$p(v.general.currencySymbol,r.storeCurrencyCode),Sp(y)),!isNaN(Number(f))&&!isNaN(Number(y))&&Number(f)>Number(y)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:v.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},$p(v.general.currencySymbol,r.storeCurrencyCode),Sp(f)),Number(b)>0&&e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},r?.percentageOff?`${r?.percentageOff}% Off`:r?.amountOff?`${$p(v.general.currencySymbol,r.storeCurrencyCode)}${Sp(r?.amountOff)} Off`:`Save ${$p(v.general.currencySymbol,r.storeCurrencyCode)}${Sp(b)}`))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:v.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:v.comboBundle.productDescriptionFontSize||"16px",color:v.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),v.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,C?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(s?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},r.products.map((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===u[n])?.node;return o?e.createElement(Hc,{key:`combo-product-${n}-${t.productId}`,product:t,styles:v,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),isVertical:C,variantOptions:r.variantOptions,storeCurrencyCode:r.storeCurrencyCode}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(s?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},v.comboBundle.subProductsSectionVisibility&&r.products.map((t,n)=>e.createElement(Hc,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:v,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),variantOptions:r.variantOptions})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${g?"":"yt-comboBundle-bundle-cta-button-disabled"} ${s?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:g?v.general?.ctaBackgroundColor||"#121212":v.general.disabledButtonColor,color:v.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:v.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:g?"pointer":"not-allowed",border:`1px solid ${g?v.general?.ctaBackgroundColor||"#121212":v.general.disabledButtonColor}`,boxShadow:v.general.ctaShadowType,padding:v.general?.ctaPadding,width:v.general?.ctaWidth,margin:"0"},disabled:!g,onMouseOver:e=>{v.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=v.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=v.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{v.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=v.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=v.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{const e=Object.entries(u).map(([e])=>({id:r.products[parseInt(e)].productId,title:r.products[parseInt(e)]?.productDetails?.title}));a?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"combo-bundle",selectedProducts:e}});try{if(c(!0),!i)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const e=Object.entries(u).map(([e,t])=>{const n=r.products[parseInt(e)],o=n.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return o?{variantId:t,price:Number(o.price)}:null}).filter(e=>null!==e),t=Object.values(u);await i(Number(f),t,Number(y),e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}c(!1)}},l?e.createElement(rt,{color:"white",loading:l,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,g?v.comboBundle?.ctaTitle??"Add Bundle to cart":v.general.outOfStockLabel||"Out of Stock"," "))),E&&v.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:v.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:v.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:v.comboBundle.productDescriptionFontSize||"16px",color:v.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:v.general.primaryColor+"08"}},e.createElement("p",null,T))))},Qc=c.div`
|
|
3149
3149
|
max-width: 800px;
|
|
3150
3150
|
container-type: inline-size;
|
|
3151
3151
|
margin-top: ${e=>e.verticalMargin||"0px"};
|
|
@@ -3231,7 +3231,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3231
3231
|
@container (max-width: 600px) {
|
|
3232
3232
|
gap: 6px;
|
|
3233
3233
|
}
|
|
3234
|
-
`,
|
|
3234
|
+
`,es=c.div`
|
|
3235
3235
|
background-color: ${e=>e.primaryBackgroundColorCta||"#000"};
|
|
3236
3236
|
color: white;
|
|
3237
3237
|
padding: 2px 8px;
|
|
@@ -3246,13 +3246,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3246
3246
|
padding: 2px 4px;
|
|
3247
3247
|
margin: 0px 5px;
|
|
3248
3248
|
}
|
|
3249
|
-
`,
|
|
3249
|
+
`,ts=c.span`
|
|
3250
3250
|
display: flex;
|
|
3251
3251
|
flex-direction: column;
|
|
3252
3252
|
justify-content: center;
|
|
3253
3253
|
align-items: flex-start;
|
|
3254
3254
|
flex: 1 0 0;
|
|
3255
|
-
`,
|
|
3255
|
+
`,ns=c.h3`
|
|
3256
3256
|
font-size: 16px;
|
|
3257
3257
|
font-weight: 600;
|
|
3258
3258
|
text-align: left;
|
|
@@ -3263,7 +3263,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3263
3263
|
@container (max-width: 600px) {
|
|
3264
3264
|
font-size: 14px;
|
|
3265
3265
|
}
|
|
3266
|
-
`,
|
|
3266
|
+
`,os=c.p`
|
|
3267
3267
|
font-size: 12px;
|
|
3268
3268
|
margin: 0;
|
|
3269
3269
|
@media (max-width: 600px) {
|
|
@@ -3272,9 +3272,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3272
3272
|
@container (max-width: 600px) {
|
|
3273
3273
|
font-size: 10px;
|
|
3274
3274
|
}
|
|
3275
|
-
`,
|
|
3275
|
+
`,rs=c.div`
|
|
3276
3276
|
text-align: right;
|
|
3277
|
-
`,
|
|
3277
|
+
`,is=c.span`
|
|
3278
3278
|
font-size: 16px;
|
|
3279
3279
|
font-weight: 600;
|
|
3280
3280
|
color: #111;
|
|
@@ -3287,7 +3287,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3287
3287
|
font-size: 12px;
|
|
3288
3288
|
margin-left: 4px;
|
|
3289
3289
|
}
|
|
3290
|
-
`,
|
|
3290
|
+
`,as=c.span`
|
|
3291
3291
|
font-size: 12px;
|
|
3292
3292
|
color: #666;
|
|
3293
3293
|
text-decoration: line-through;
|
|
@@ -3297,7 +3297,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3297
3297
|
@container (max-width: 600px) {
|
|
3298
3298
|
font-size: 10px;
|
|
3299
3299
|
}
|
|
3300
|
-
`,
|
|
3300
|
+
`,ls=c.div`
|
|
3301
3301
|
display: flex;
|
|
3302
3302
|
flex-direction: column;
|
|
3303
3303
|
@media (max-width: 768px) {
|
|
@@ -3313,7 +3313,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3313
3313
|
max-width: fit-content;
|
|
3314
3314
|
justify-content: space-between;
|
|
3315
3315
|
}
|
|
3316
|
-
`,
|
|
3316
|
+
`,cs=c.div`
|
|
3317
3317
|
margin: auto 0px;
|
|
3318
3318
|
`;c.div`
|
|
3319
3319
|
font-size: 12px;
|
|
@@ -3324,7 +3324,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3324
3324
|
gap: 6px;
|
|
3325
3325
|
justify-content: flex-start;
|
|
3326
3326
|
flex-wrap: wrap;
|
|
3327
|
-
`;const
|
|
3327
|
+
`;const ss=c.button`
|
|
3328
3328
|
padding: 4px 8px;
|
|
3329
3329
|
border: 1px solid
|
|
3330
3330
|
${e=>e.isSelected?e.primaryColor:"#e5e7eb"};
|
|
@@ -3345,7 +3345,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3345
3345
|
font-size: 10px;
|
|
3346
3346
|
padding: 4px 8px;
|
|
3347
3347
|
}
|
|
3348
|
-
`,
|
|
3348
|
+
`,ds=c.button`
|
|
3349
3349
|
width: ${e=>e.width||"100%"};
|
|
3350
3350
|
padding: ${e=>e.padding||"16px"};
|
|
3351
3351
|
background: ${e=>e.bgColor||"#121212"};
|
|
@@ -3370,13 +3370,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3370
3370
|
}
|
|
3371
3371
|
|
|
3372
3372
|
${e=>e.hoverProperties.customizeHoverState&&`\n &:hover {\n background: ${e.hoverProperties.backgroundColor||"#dc2626"};\n color: ${e.hoverProperties.textColor||"white"};\n }\n `}
|
|
3373
|
-
`,
|
|
3373
|
+
`,ps=c.label`
|
|
3374
3374
|
display: inline-flex;
|
|
3375
3375
|
align-items: center;
|
|
3376
3376
|
cursor: pointer;
|
|
3377
|
-
`,
|
|
3377
|
+
`,us=c.input.attrs({type:"radio"})`
|
|
3378
3378
|
display: none;
|
|
3379
|
-
`,
|
|
3379
|
+
`,ms=c.span`
|
|
3380
3380
|
width: 20px;
|
|
3381
3381
|
height: 20px;
|
|
3382
3382
|
border-radius: 50%;
|
|
@@ -3397,7 +3397,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3397
3397
|
transition: transform 0.2s ease-in-out;
|
|
3398
3398
|
}
|
|
3399
3399
|
|
|
3400
|
-
${
|
|
3400
|
+
${ps}[data-active="true"] & {
|
|
3401
3401
|
&::before {
|
|
3402
3402
|
transform: scale(1);
|
|
3403
3403
|
}
|
|
@@ -3418,11 +3418,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3418
3418
|
outline: none;
|
|
3419
3419
|
box-shadow: none;
|
|
3420
3420
|
}
|
|
3421
|
-
`,
|
|
3421
|
+
`,gs=c.img`
|
|
3422
3422
|
margin-right: 8px;
|
|
3423
3423
|
height: 64px;
|
|
3424
3424
|
border-radius: 8px;
|
|
3425
|
-
`,
|
|
3425
|
+
`,xs=c.li`
|
|
3426
3426
|
display: flex;
|
|
3427
3427
|
align-items: center;
|
|
3428
3428
|
padding: 8px 12px;
|
|
@@ -3435,24 +3435,24 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3435
3435
|
&:last-child {
|
|
3436
3436
|
border-bottom: none;
|
|
3437
3437
|
}
|
|
3438
|
-
`,
|
|
3438
|
+
`,fs=c.img`
|
|
3439
3439
|
width: 30px;
|
|
3440
3440
|
height: 30px;
|
|
3441
3441
|
border-radius: 4px;
|
|
3442
3442
|
margin-right: 8px;
|
|
3443
|
-
`,
|
|
3443
|
+
`,ys=c.div`
|
|
3444
3444
|
width: 20px;
|
|
3445
3445
|
height: 20px;
|
|
3446
3446
|
border-radius: 50%;
|
|
3447
3447
|
margin-right: 8px;
|
|
3448
3448
|
border: 1px solid #ccc;
|
|
3449
|
-
`,
|
|
3449
|
+
`,bs=c.div`
|
|
3450
3450
|
position: relative;
|
|
3451
3451
|
min-width: fit-content;
|
|
3452
3452
|
width: fit-content;
|
|
3453
3453
|
z-index: ${e=>e.isActive?"9999":"auto"};
|
|
3454
3454
|
outline: none;
|
|
3455
|
-
`,
|
|
3455
|
+
`,hs=c.button`
|
|
3456
3456
|
width: 100%;
|
|
3457
3457
|
display: flex;
|
|
3458
3458
|
gap: 10px;
|
|
@@ -3468,7 +3468,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3468
3468
|
background-color: #eaeaea;
|
|
3469
3469
|
}
|
|
3470
3470
|
border: 1px solid #e0e0e0;
|
|
3471
|
-
`,
|
|
3471
|
+
`,vs=c.ul`
|
|
3472
3472
|
position: absolute;
|
|
3473
3473
|
top: 100%;
|
|
3474
3474
|
left: 0;
|
|
@@ -3490,22 +3490,22 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3490
3490
|
scrollbar-width: none;
|
|
3491
3491
|
|
|
3492
3492
|
-ms-overflow-style: none;
|
|
3493
|
-
`,wd=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function Cd({bundle:a,addToCartFunction:l,currentProductId:c,dispatchAnalyticsEvent:d}){const s=o(()=>{if(c){const e="gid://shopify/Product/"+c,t=a.products?.some(t=>t.productId===e);return t?e:a.products?.[0]?.productId}return a.products?.[0]?.productId},[c,a.products]),p=o(()=>wd(s,a.products),[s,a.products]),u=r(null),m=r(null);r({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[g,x]=t(0),[f,y]=t(""),b=a.customizations??{},h=!1===b?.general?.showDecimalsInBundlePricing,v=o(()=>p?.productDetails?.tracksInventory??!0,[p?.productDetails?.tracksInventory]),w=i(e=>{if(!v)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[v]),C=(o(()=>p?.productDetails?.variants?.edges?.reduce((e,{node:t})=>w(t)>0?e+1:e,0),[p,w]),o(()=>wd(s,a.products)?.id,[s,a.products]));o(()=>C?wd(s,a.products):void 0,[s,a.products,C]),o(()=>a.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[a.products]),b.volumeBundle;const E=o(()=>a?.volumeTiers||[],[a?.volumeTiers]),k=E.findIndex(e=>e.isDefault),[T,S]=t(-1!==k?E[k].tier:E?.[0]?.tier||1),[$,B]=t(p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||""),[I,z]=t({}),[F,N]=t(E.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>p?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[D,P]=t(!1),[A,_]=t(window.innerWidth<550),[R,O]=t(null),[L,M]=t(null);r([]);const j=r([]),V=r(T);n(()=>{if(d?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{_(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{R&&j.current[R.index]&&j.current[R.index][R.optionIndex]&&!j.current[R.index][R.optionIndex]?.contains(e.target)&&O(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[R]),i(e=>{const t=E.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];for(const e of o){const t=e.node;if(w(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const r=[],i={},a=[...o].sort((e,t)=>{const n=w(e.node),o=w(t.node);return n===1/0&&o===1/0?0:n===1/0?-1:o===1/0?1:o-n});for(let e=0;e<n&&r.length<n;e++){let e=!1;for(const t of a){const n=t.node,o=i[n.id]||0;if(w(n)>o&&n.availableForSale){const t=n.title.split(" / ");r.push(t),i[n.id]=o+1,e=!0;break}}if(!e)return null}return r.length===n?r:null},[p,E,w]);const W=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];let r=0;for(const e of o){const t=w(e.node);if(t===1/0){r=1/0;break}r+=t}return r>=n},[E,p,w]);n(()=>{const e={},t=p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&E.forEach(n=>{e[n.tier]={};for(let o=0;o<n.minimumQuantity;o++)e[n.tier][o]=t}),z(e)},[p?.id,E?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),w]);const H=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,q=i((e,t,n,o,r)=>{const i=E.find(t=>t.tier===e);if(!i)return!1;const a=i.minimumQuantity,l=[...n];l[o]=r;const c=l.join(" / "),d=p?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!d||0===w(d))return!1;const s={},u=I[e]||{};for(let e=0;e<a;e++){let n;if(e===t)n=d.id;else{const t=u[e]||$,o=H(p,t);if(!o)return!1;n=o.id}s[n]=(s[n]||0)+1}for(const[e,t]of Object.entries(s)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,F,F,I,$,w]),Q=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=e-1,r={};for(let e=0;e<n;e++){const t=(F[o]?.[e]||p.productDetails.options.map(e=>e.values[0])).join(" / "),n=p?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const i=n.node.id;r[i]=(r[i]||0)+1}for(const[e,t]of Object.entries(r)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,F,w]);n(()=>{x(e=>e+1)},[I]);const U=(e,t,n)=>{z(o=>({...o,[e]:{...o[e]||{},[t]:n}}))},Y=i(()=>p?.productDetails?.variants?.edges?.find(e=>w(e.node)>0)?.node||p?.productDetails?.variants?.edges?.[0]?.node,[p,w]),G=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{V.current=T},[T]),n(()=>{L?(M(null),X()):X()},[T]),n(()=>{if(a){const e=Y();if(e)y(e.id),B(e.id);else{const e=p?.productDetails?.variants?.edges?.[0]?.node?.id||"";y(e),B(e)}}},[a,p,Y]);const X=()=>{const e=G();if(e){const t=p?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),x(e=>e+1);else{const e=Y();e&&(B(String(e.id)),n=e),x(e=>e+1)}if(n){0===w(n)?(M(null),setTimeout(()=>{M({tier:V.current,index:0,optionIndex:0,value:n.title})},0)):L&&M(null)}}};n(()=>{X();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",X),()=>{t=!1,window.removeEventListener("urlChange",X),window.history.pushState=n,window.history.replaceState=o}},[G,p?.id,Y,w]);const Z=e=>{const t=E.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,o=0,r=0;const i=I[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=i[e]||$,a=H(p,t);if(!a)continue;const l=Number.parseFloat(a.price);n+=a.compareAtPrice?Number.parseFloat(a.compareAtPrice):l,o+=l,r+=l}if("percentOff"===a?.discountType){r*=1-t.discountValue/100}else"amountOff"===a?.discountType&&(r-=t.discountValue);const l=Math.max(0,r),c=b?.volumeBundle?.discountBadgeDisplay,d=b?.volumeBundle?.discountBadgeVisibility;let s=n;"Disabled"===d?s=l:"discount-on-price"===c&&(s=o);const u=o-l,m=s-l,g=o>0?u/o*100:0,x=s>0?m/s*100:0;return{original:s,discounted:l,discountedFromPrice:l,discountedFromCompare:l,diffAmountFromPrice:u,diffAmountFromCompare:m,diffPercentFromPrice:Math.round(g),diffPercentFromCompare:Math.round(x),discountValue:t.discountValue}},J=(e,t,n,o)=>{let r=H(e,t);if(o){const i=I[o]?.[n||0]||t;r=H(e,i)}return r?.image?.url?r.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""};function K(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}n(()=>{const e=()=>{if(b.volumeBundle?.addtoCartMethod&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelector(".sr-headless-checkout");t&&t?.setAttribute("style","display: none;");const n=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let o=1;n&&n.value&&(o=parseInt(n.value,10)||1);const r=E.find(e=>e.tier===T);if(!r)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"], .t4s-quantity-wrapper').forEach(e=>e.remove());const i=r.minimumQuantity;let a={};const l=Math.max(i,o);if(o>i){const e=f||$;if(!e)return;a[e]=l}else{const e=I[r.tier]||{};for(let t=0;t<i;t++){let n=e[t];n||(n=$),n&&(a[n]=(a[n]||0)+1)}}const c=Z(r.tier),d=Object.fromEntries(Object.entries(a).map(([e,t])=>[K(e),Math.round(t)])),s=(t,n,o="bundle-input-field")=>{const r=document.createElement("input");r.type="hidden",r.name=t,r.value=n,r.className=o,e.appendChild(r)};if(o>i){const e=f||$;e&&s("id",K(e))}s("properties[_bundle_price]",String(c.original)),s("properties[_bundle_tier]",String(r.tier)),s("properties[_bundle_items]",JSON.stringify(d));let p=0;Object.entries(d).forEach(([e,t])=>{t>0&&(s(`items[${p}][id]`,e),s(`items[${p}][quantity]`,String(t)),p++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),n=e.querySelector(".noti-btn-main-wrap"),r=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const o=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");o&&(o.textContent=n)};o<=i&&(L?(r(t,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),n&&(n.style.display="block",n.classList.remove("hidden"),n.classList.add("block"))):(r(t,!1,"Add to cart"),t&&t.classList.remove("btn--sold-out","hidden"),n&&(n.style.display="none",n.classList.add("hidden"))))})};e();const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');if(t){const n=()=>{requestAnimationFrame(()=>{e()})};return t.addEventListener("input",n),t.addEventListener("change",n),()=>{t.removeEventListener("input",n),t.removeEventListener("change",n)}}return()=>{}},[T,JSON.stringify(I),$,b.volumeBundle?.cardStyle,c,f,L]);const ee=o(()=>E.find(e=>e.tier===T),[E,T]),te=o(()=>ee?Z(ee.tier):null,[ee,I,$]),ne=o(()=>{if(!ee||!te)return;const e=I[ee.tier]||{},t={};for(let n=0;n<ee.minimumQuantity;n++){const o=e[n]||$;t[o]=(t[o]||0)+1}return t},[ee?.minimumQuantity,$,I,te]),oe=o(()=>Object.entries(ne??{}).map(([e,t])=>({variantId:e,quantity:t})),[ne]);if(n(()=>{if(!ee||!te)return;const e={tier:T,items:ee.minimumQuantity,discountedPrice:te.discounted,originalPrice:te.original,variants:oe,productId:p?.id??null,tierMeta:{title:ee.title,subtitle:ee.subtitle,badgeTitle:ee.badgeTitle},productData:p,tierData:ee},t=m.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{m.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:a,addToCart:l,currentTier:ee,selectedVariants:oe},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{u.current&&clearTimeout(u.current)})},[T,ee?.tier,ee?.minimumQuantity,te?.discounted,te?.original,p?.id,JSON.stringify(oe),l,a]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!$||!p)return;const e=H(p,$);if(!e)return;const t=e.title.split(" / "),n={},o={};E.forEach(e=>{const r=e.tier-1,i={};for(let t=0;t<e.minimumQuantity;t++)i[t]=$;n[e.tier]=i,o[r]=Array(e.minimumQuantity).fill(t)}),z(e=>({...e,...n})),N(e=>({...e,...o}))},[$,p?.id,E.length]),!l)return e.createElement(e.Fragment,null);const re=b.volumeBundle?.cardStyle,ie=b.general?.primaryColor,ae=b.general?.secondaryColor,le=b.general.primaryContrastColor,ce=b.general.secondaryContrastColor,de="high"===a.cornerRadiusType?"20px":"medium"===a.cornerRadiusType?"6px":"0px",se="bundles"==a.appName?a.pageHeader?.title:a?.title,pe="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;return n(()=>{const e=Q(T);e?M(null):e||M({tier:T,index:0,optionIndex:0,value:""})},[T,oe,Q]),e.createElement(Qc,{verticalMargin:b.volumeBundle?.verticalMargin,$backgroundColor:b.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},e.createElement(Uc,{className:"yt-bundle-header"},se&&se.trim().length>0&&e.createElement(Yc,{fontSize:b.volumeBundle?.titleFontSize,$backgroundColor:b.volumeBundle?.titleBackgroundColor,textColor:b.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},se),e.createElement(Gc,{className:"yt-bundle-header-subtitle",fontSize:b.volumeBundle?.subtitleFontSize},pe)),"vertical"===re?e.createElement("div",{style:{display:"grid",gridTemplateColumns:A||4===E.length?"repeat(2, 1fr)":E.length>4?"repeat(3, 1fr)":`repeat(${E.length}, 1fr)`,justifyItems:"center",gap:A?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=T===t.tier,i=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:de||"24px",...r?{border:`2px solid ${ie}`}:{border:`1px solid ${ae}`},boxShadow:`6px 6px 0px -1px ${r?ie:ae}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:i?"#f5f5f5":"white",cursor:i?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:i?.6:1},className:"yt-volume-vertical-tier-item "+(r?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),onClick:()=>!i&&S(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:r?ie:ae,color:r?le:ce,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:r?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===b.volumeBundle?.discountBadgeVisibility&&A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=$p(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Sp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Sp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Sp(n.discountValue)}`);return i?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(ed,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i)):null})(),t.imageUrl&&e.createElement("img",{src:Bp(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:de||"24px",borderTopRightRadius:de||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(td,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(nd,{style:{fontSize:A?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&!A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=$p(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Sp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Sp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Sp(n.discountValue)}`);return i?e.createElement(ed,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i):null})(),r&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Oe,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(od,{style:{lineHeight:"normal",fontSize:A?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),W(t.tier)?e.createElement(rd,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(h?0:2)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,e.createElement(id,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(l),"unit-price"===r?"/unit":""),o>0&&e.createElement(ad,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(i),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),r&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Oe,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},t.badgeTitle&&e.createElement(Xc,{primaryTextColorCta:le,primaryBackgroundColorCta:ie,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Zc,{cornerRadiusType:a?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ie??"",isSelected:T===t.tier,onClick:()=>S(t.tier),style:{borderRadius:de,cursor:"pointer",backgroundColor:r?"#f5f5f5":"white",opacity:r?.6:1},className:"yt-volume-horizontal-tier-container "+(T===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2)},e.createElement(Jc,{cornerRadiusType:a?.cornerRadiusType??"",style:{borderRadius:de,borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},className:"yt-volume-horizontal-tier-header"},e.createElement(Kc,{className:"yt-volume-horizontal-tier-info"},e.createElement(pd,{"data-active":T===t.tier,accentColor:ie,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(ud,{name:"tier",checked:T===t.tier,onChange:()=>!r&&S(t.tier),disabled:r,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(md,{accentColor:ie,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(td,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(nd,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=$p(b.general.currencySymbol,a.storeCurrencyCode);let r="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(r="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Sp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(r="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Sp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(r="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Sp(n.discountValue)}`);return r?e.createElement(ed,{primaryBackgroundColorCta:ie,isSelected:T===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},r):null})()),e.createElement(od,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),W(t.tier)?e.createElement(rd,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(0)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,o>0?e.createElement(ad,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(i),"unit-price"===r?"/unit":""):"",e.createElement(id,{className:"yt-volume-horizontal-tier-discounted-price"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(l),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),T===t.tier&&e.createElement(ld,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,o)=>{const i=t.tier-1,l=(F[i]||[])[o]||p.productDetails.options?.map(e=>e.values[0])||[],c=p?.productDetails?.options.some(e=>e.values.length>1)||1===p?.productDetails?.variants?.edges?.length&&"Default Title"!==p?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:o,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&e.createElement(gd,{src:Bp(J(p,$,o,t.tier)),alt:p?.productDetails?.title||"Product",style:{height:"64px",width:"auto"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===b?.volumeBundle?.variantSelectorType||"dropdown"===b?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},p?.productDetails?.options?.map((n,c)=>{const d=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===d.length||1===d.length&&"Default Title"===d[0])return null;const s=R?.tier===t.tier&&R?.index===o&&R?.optionIndex===c,u=a?.variantOptions?.options?.find(e=>e.name===n.name);let m="";return"color"===u?.type&&(m=u?.values?.find(e=>e.name===l[c])?.value||""),e.createElement(bd,{key:c,ref:e=>{j.current[o]||(j.current[o]=[]),j.current[o][c]=e},style:{zIndex:s?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:s},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(hd,{onClick:e=>{e.stopPropagation(),O(s?null:{tier:t.tier,index:o,optionIndex:c})},isActive:s,disabled:r},"color"===u?.type&&m&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:m||"transparent",border:"1px solid #ddd"}}),l[c],e.createElement($e,{style:{display:"block"}})),s&&e.createElement(vd,{style:{zIndex:1001}},d.map((n,a)=>{const d=[...l];d[c]=n;const s=!q(t.tier,o,l,c,n)||r;p.productDetails.variants.edges.find(({node:e})=>e.title===d.join(" / "));const m=e=>{if(e.preventDefault(),e.stopPropagation(),N(e=>{const t={...e},n=[...t[i]||[]];return n[o]=d,t[i]=n,t}),s){M({tier:T,index:o,optionIndex:c,value:n}),O(null);const e=d.join(" / "),r=p.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||$;return void U(t.tier,o,r)}const r=d.join(" / "),a=p.productDetails.variants.edges.find(e=>e.node.title===r)?.node.id||$;U(t.tier,o,a),O(null)},g=u?.values.find(e=>e.name===n);return"image"===u?.type&&g?.value?e.createElement(xd,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(fd,{src:g.value,alt:n}),n):"color"===u?.type&&g?.value?e.createElement(xd,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(yd,{style:{backgroundColor:g.value}}),n):e.createElement(xd,{key:n,onClick:m,style:{cursor:"pointer"}},n)})))})),"swatches"===b?.volumeBundle?.variantSelectorType&&e.createElement(cd,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},p?.productDetails?.options.map((n,c)=>{const d=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===d.length||1===d.length&&"Default Title"===d[0])return null;const s=a.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},d.map(n=>{const a=l[c]===n,d=!q(t.tier,o,l,c,n)||r,u=s?.values.find(e=>e.name===n),m=e=>{if(e.preventDefault(),e.stopPropagation(),d)return;const r=[...l];r[c]=n,N(e=>{const t={...e},n=[...t[i]||[]];return n[o]=r,t[i]=n,t});const a=r.join(" / "),s=p.productDetails.variants.edges.find(e=>e.node.title===a)?.node.id||$;U(t.tier,o,s)},g={opacity:d?.5:1,cursor:d?"not-allowed":"pointer"};return"color"===s?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button",disabled:d},e.createElement("div",{style:{width:a?"24px":"20px",height:a?"24px":"20px",borderRadius:"50%",backgroundColor:u.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===s?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:a?"#F7F7F7":"transparent",padding:"0px",width:a?"20px":"18px",height:a?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button",disabled:d},e.createElement("img",{src:u.value,alt:n,style:{width:a?"26px":"24px",height:a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(dd,{key:n,isSelected:a,onClick:m,style:{...g,padding:"4px 8px",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default",disabled:d},n)})))})))})),L&&L.tier===t.tier&&e.createElement("div",{style:{color:ie,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ie}1A`,padding:"12px",borderBottomLeftRadius:de,borderBottomRightRadius:de}},"There aren’t enough items in our stock for select option, please select smaller bundle.")))})),a?.showCta&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(sd,{bgColor:Q(T)?b.general?.ctaBackgroundColor:"#ccc",textColor:Q(T)?b.general?.ctaTextColor:"#666",border:`1px solid ${Q(T)?b.general?.ctaBorderColor||"#121212":"#999"}`,shadow:b.general.ctaShadowType,padding:b.general?.ctaPadding,width:b.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Q(T)&&b.general?.customizeHoverState,backgroundColor:b.general?.ctaHoverBackgroundColor,textColor:b.general?.ctaHoverTextColor},onClick:async()=>{if(Q(T))try{P(!0);const e=E.find(e=>e.tier===T);if(!e)return;const t={},n=I[e.tier]||{};for(let o=0;o<e.minimumQuantity;o++){const e=n[o]||$;t[e]?t[e].quantity+=1:t[e]={quantity:1}}d?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"volume-bundle",selectedProducts:p?[{id:p?.productId,title:p?.productDetails?.title}]:[],selectedVariants:Object.values(n)}});const o=Z(e.tier),r=Array.from({length:e.minimumQuantity},(e,t)=>n[t]||$);l&&await l(o.original,r)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{P(!1)}else console.error("Selected tier is out of stock")},borderRadius:b.general.ctaBorderRadius??"",disabled:D||!Q(T),className:"yt-volume-add-to-cart-button"},Q(T)?e.createElement(e.Fragment,null,D?e.createElement(rt,{color:"white",loading:D,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,b.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=Z(T);return e.createElement(e.Fragment,null,$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(t.discounted.toFixed(h?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(t?.original.toFixed(h?0:2))," "))})()))):e.createElement(e.Fragment,null,"Out of Stock"))))}const Ed=c.div`
|
|
3493
|
+
`,ws=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function Cs({bundle:a,addToCartFunction:l,currentProductId:c,dispatchAnalyticsEvent:s}){const d=o(()=>{if(c){const e="gid://shopify/Product/"+c,t=a.products?.some(t=>t.productId===e);return t?e:a.products?.[0]?.productId}return a.products?.[0]?.productId},[c,a.products]),p=o(()=>ws(d,a.products),[d,a.products]),u=r(null),m=r(null);r({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[g,x]=t(0),[f,y]=t(""),b=a.customizations??{},h=!1===b?.general?.showDecimalsInBundlePricing,v=o(()=>p?.productDetails?.tracksInventory??!0,[p?.productDetails?.tracksInventory]),w=i(e=>{if(!v)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[v]),C=(o(()=>p?.productDetails?.variants?.edges?.reduce((e,{node:t})=>w(t)>0?e+1:e,0),[p,w]),o(()=>ws(d,a.products)?.id,[d,a.products]));o(()=>C?ws(d,a.products):void 0,[d,a.products,C]),o(()=>a.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[a.products]),b.volumeBundle;const E=o(()=>a?.volumeTiers||[],[a?.volumeTiers]),k=E.findIndex(e=>e.isDefault),[T,S]=t(-1!==k?E[k].tier:E?.[0]?.tier||1),[$,N]=t(p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||""),[B,I]=t({}),[z,F]=t(E.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>p?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[D,P]=t(!1),[A,_]=t(window.innerWidth<550),[R,O]=t(null),[L,M]=t(null);r([]);const j=r([]),V=r(T);n(()=>{if(s?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{_(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{R&&j.current[R.index]&&j.current[R.index][R.optionIndex]&&!j.current[R.index][R.optionIndex]?.contains(e.target)&&O(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[R]),i(e=>{const t=E.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];for(const e of o){const t=e.node;if(w(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const r=[],i={},a=[...o].sort((e,t)=>{const n=w(e.node),o=w(t.node);return n===1/0&&o===1/0?0:n===1/0?-1:o===1/0?1:o-n});for(let e=0;e<n&&r.length<n;e++){let e=!1;for(const t of a){const n=t.node,o=i[n.id]||0;if(w(n)>o&&n.availableForSale){const t=n.title.split(" / ");r.push(t),i[n.id]=o+1,e=!0;break}}if(!e)return null}return r.length===n?r:null},[p,E,w]);const W=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];let r=0;for(const e of o){const t=w(e.node);if(t===1/0){r=1/0;break}r+=t}return r>=n},[E,p,w]);n(()=>{const e={},t=p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&E.forEach(n=>{e[n.tier]={};for(let o=0;o<n.minimumQuantity;o++)e[n.tier][o]=t}),I(e)},[p?.id,E?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),w]);const H=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,q=i((e,t,n,o,r)=>{const i=E.find(t=>t.tier===e);if(!i)return!1;const a=i.minimumQuantity,l=[...n];l[o]=r;const c=l.join(" / "),s=p?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===w(s))return!1;const d={},u=B[e]||{};for(let e=0;e<a;e++){let n;if(e===t)n=s.id;else{const t=u[e]||$,o=H(p,t);if(!o)return!1;n=o.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,z,z,B,$,w]),Q=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=e-1,r={};for(let e=0;e<n;e++){const t=(z[o]?.[e]||p.productDetails.options.map(e=>e.values[0])).join(" / "),n=p?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const i=n.node.id;r[i]=(r[i]||0)+1}for(const[e,t]of Object.entries(r)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,z,w]);n(()=>{x(e=>e+1)},[B]);const U=(e,t,n)=>{I(o=>({...o,[e]:{...o[e]||{},[t]:n}}))},Y=i(()=>p?.productDetails?.variants?.edges?.find(e=>w(e.node)>0)?.node||p?.productDetails?.variants?.edges?.[0]?.node,[p,w]),G=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{V.current=T},[T]),n(()=>{L?(M(null),X()):X()},[T]),n(()=>{if(a){const e=Y();if(e)y(e.id),N(e.id);else{const e=p?.productDetails?.variants?.edges?.[0]?.node?.id||"";y(e),N(e)}}},[a,p,Y]);const X=()=>{const e=G();if(e){const t=p?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)N(String(n.id)),x(e=>e+1);else{const e=Y();e&&(N(String(e.id)),n=e),x(e=>e+1)}if(n){0===w(n)?(M(null),setTimeout(()=>{M({tier:V.current,index:0,optionIndex:0,value:n.title})},0)):L&&M(null)}}};n(()=>{X();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",X),()=>{t=!1,window.removeEventListener("urlChange",X),window.history.pushState=n,window.history.replaceState=o}},[G,p?.id,Y,w]);const Z=e=>{const t=E.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,o=0,r=0;const i=B[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=i[e]||$,a=H(p,t);if(!a)continue;const l=Number.parseFloat(a.price);n+=a.compareAtPrice?Number.parseFloat(a.compareAtPrice):l,o+=l,r+=l}if("percentOff"===a?.discountType){r*=1-t.discountValue/100}else"amountOff"===a?.discountType&&(r-=t.discountValue);const l=Math.max(0,r),c=b?.volumeBundle?.discountBadgeDisplay,s=b?.volumeBundle?.discountBadgeVisibility;let d=n;"Disabled"===s?d=l:"discount-on-price"===c&&(d=o);const u=o-l,m=d-l,g=o>0?u/o*100:0,x=d>0?m/d*100:0;return{original:d,discounted:l,discountedFromPrice:l,discountedFromCompare:l,diffAmountFromPrice:u,diffAmountFromCompare:m,diffPercentFromPrice:Math.round(g),diffPercentFromCompare:Math.round(x),discountValue:t.discountValue}},J=(e,t,n,o)=>{let r=H(e,t);if(o){const i=B[o]?.[n||0]||t;r=H(e,i)}return r?.image?.url?r.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""};function K(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}n(()=>{const e=()=>{if(b.volumeBundle?.addtoCartMethod&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelector(".sr-headless-checkout");t&&t?.setAttribute("style","display: none;");const n=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let o=1;n&&n.value&&(o=parseInt(n.value,10)||1);const r=E.find(e=>e.tier===T);if(!r)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"], .t4s-quantity-wrapper').forEach(e=>e.remove());const i=r.minimumQuantity;let a={};const l=Math.max(i,o);if(o>i){const e=f||$;if(!e)return;a[e]=l}else{const e=B[r.tier]||{};for(let t=0;t<i;t++){let n=e[t];n||(n=$),n&&(a[n]=(a[n]||0)+1)}}const c=Z(r.tier),s=Object.fromEntries(Object.entries(a).map(([e,t])=>[K(e),Math.round(t)])),d=(t,n,o="bundle-input-field")=>{const r=document.createElement("input");r.type="hidden",r.name=t,r.value=n,r.className=o,e.appendChild(r)};if(o>i){const e=f||$;e&&d("id",K(e))}d("properties[_bundle_price]",String(c.original)),d("properties[_bundle_tier]",String(r.tier)),d("properties[_bundle_items]",JSON.stringify(s));let p=0;Object.entries(s).forEach(([e,t])=>{t>0&&(d(`items[${p}][id]`,e),d(`items[${p}][quantity]`,String(t)),p++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),n=e.querySelector(".noti-btn-main-wrap"),r=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const o=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");o&&(o.textContent=n)};o<=i&&(L?(r(t,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),n&&(n.style.display="block",n.classList.remove("hidden"),n.classList.add("block"))):(r(t,!1,"Add to cart"),t&&t.classList.remove("btn--sold-out","hidden"),n&&(n.style.display="none",n.classList.add("hidden"))))})};e();const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');if(t){const n=()=>{requestAnimationFrame(()=>{e()})};return t.addEventListener("input",n),t.addEventListener("change",n),()=>{t.removeEventListener("input",n),t.removeEventListener("change",n)}}return()=>{}},[T,JSON.stringify(B),$,b.volumeBundle?.cardStyle,c,f,L]);const ee=o(()=>E.find(e=>e.tier===T),[E,T]),te=o(()=>ee?Z(ee.tier):null,[ee,B,$]),ne=o(()=>{if(!ee||!te)return;const e=B[ee.tier]||{},t={};for(let n=0;n<ee.minimumQuantity;n++){const o=e[n]||$;t[o]=(t[o]||0)+1}return t},[ee?.minimumQuantity,$,B,te]),oe=o(()=>Object.entries(ne??{}).map(([e,t])=>({variantId:e,quantity:t})),[ne]);if(n(()=>{if(!ee||!te)return;const e={tier:T,items:ee.minimumQuantity,discountedPrice:te.discounted,originalPrice:te.original,variants:oe,productId:p?.id??null,tierMeta:{title:ee.title,subtitle:ee.subtitle,badgeTitle:ee.badgeTitle},productData:p,tierData:ee},t=m.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{m.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:a,addToCart:l,currentTier:ee,selectedVariants:oe},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{u.current&&clearTimeout(u.current)})},[T,ee?.tier,ee?.minimumQuantity,te?.discounted,te?.original,p?.id,JSON.stringify(oe),l,a]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!$||!p)return;const e=H(p,$);if(!e)return;const t=e.title.split(" / "),n={},o={};E.forEach(e=>{const r=e.tier-1,i={};for(let t=0;t<e.minimumQuantity;t++)i[t]=$;n[e.tier]=i,o[r]=Array(e.minimumQuantity).fill(t)}),I(e=>({...e,...n})),F(e=>({...e,...o}))},[$,p?.id,E.length]),!l)return e.createElement(e.Fragment,null);const re=b.volumeBundle?.cardStyle,ie=b.general?.primaryColor,ae=b.general?.secondaryColor,le=b.general.primaryContrastColor,ce=b.general.secondaryContrastColor,se="high"===a.cornerRadiusType?"20px":"medium"===a.cornerRadiusType?"6px":"0px",de="bundles"==a.appName?a.pageHeader?.title:a?.title,pe="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;return n(()=>{const e=Q(T);e?M(null):e||M({tier:T,index:0,optionIndex:0,value:""})},[T,oe,Q]),e.createElement(Qc,{verticalMargin:b.volumeBundle?.verticalMargin,$backgroundColor:b.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},e.createElement(Uc,{className:"yt-bundle-header"},de&&de.trim().length>0&&e.createElement(Yc,{fontSize:b.volumeBundle?.titleFontSize,$backgroundColor:b.volumeBundle?.titleBackgroundColor,textColor:b.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},de),e.createElement(Gc,{className:"yt-bundle-header-subtitle",fontSize:b.volumeBundle?.subtitleFontSize},pe)),"vertical"===re?e.createElement("div",{style:{display:"grid",gridTemplateColumns:A||4===E.length?"repeat(2, 1fr)":E.length>4?"repeat(3, 1fr)":`repeat(${E.length}, 1fr)`,justifyItems:"center",gap:A?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=T===t.tier,i=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:se||"24px",...r?{border:`2px solid ${ie}`}:{border:`1px solid ${ae}`},boxShadow:`6px 6px 0px -1px ${r?ie:ae}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:i?"#f5f5f5":"white",cursor:i?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:i?.6:1},className:"yt-volume-vertical-tier-item "+(r?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),onClick:()=>!i&&S(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:r?ie:ae,color:r?le:ce,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:r?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===b.volumeBundle?.discountBadgeVisibility&&A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=$p(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Sp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Sp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Sp(n.discountValue)}`);return i?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(es,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i)):null})(),t.imageUrl&&e.createElement("img",{src:Np(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:se||"24px",borderTopRightRadius:se||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(ts,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(ns,{style:{fontSize:A?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&!A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=$p(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Sp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Sp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Sp(n.discountValue)}`);return i?e.createElement(es,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i):null})(),r&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Oe,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(os,{style:{lineHeight:"normal",fontSize:A?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),W(t.tier)?e.createElement(rs,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(h?0:2)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,e.createElement(is,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(l),"unit-price"===r?"/unit":""),o>0&&e.createElement(as,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(i),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),r&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Oe,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},t.badgeTitle&&e.createElement(Xc,{primaryTextColorCta:le,primaryBackgroundColorCta:ie,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Zc,{cornerRadiusType:a?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ie??"",isSelected:T===t.tier,onClick:()=>S(t.tier),style:{borderRadius:se,cursor:"pointer",backgroundColor:r?"#f5f5f5":"white",opacity:r?.6:1},className:"yt-volume-horizontal-tier-container "+(T===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2)},e.createElement(Jc,{cornerRadiusType:a?.cornerRadiusType??"",style:{borderRadius:se,borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},className:"yt-volume-horizontal-tier-header"},e.createElement(Kc,{className:"yt-volume-horizontal-tier-info"},e.createElement(ps,{"data-active":T===t.tier,accentColor:ie,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(us,{name:"tier",checked:T===t.tier,onChange:()=>!r&&S(t.tier),disabled:r,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(ms,{accentColor:ie,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(ts,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(ns,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=$p(b.general.currencySymbol,a.storeCurrencyCode);let r="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(r="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Sp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(r="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Sp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(r="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Sp(n.discountValue)}`);return r?e.createElement(es,{primaryBackgroundColorCta:ie,isSelected:T===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},r):null})()),e.createElement(os,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),W(t.tier)?e.createElement(rs,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(0)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,o>0?e.createElement(as,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(i),"unit-price"===r?"/unit":""):"",e.createElement(is,{className:"yt-volume-horizontal-tier-discounted-price"},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(l),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),T===t.tier&&e.createElement(ls,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,o)=>{const i=t.tier-1,l=(z[i]||[])[o]||p.productDetails.options?.map(e=>e.values[0])||[],c=p?.productDetails?.options.some(e=>e.values.length>1)||1===p?.productDetails?.variants?.edges?.length&&"Default Title"!==p?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:o,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&e.createElement(gs,{src:Np(J(p,$,o,t.tier)),alt:p?.productDetails?.title||"Product",style:{height:"64px",width:"auto"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===b?.volumeBundle?.variantSelectorType||"dropdown"===b?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},p?.productDetails?.options?.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=R?.tier===t.tier&&R?.index===o&&R?.optionIndex===c,u=a?.variantOptions?.options?.find(e=>e.name===n.name);let m="";return"color"===u?.type&&(m=u?.values?.find(e=>e.name===l[c])?.value||""),e.createElement(bs,{key:c,ref:e=>{j.current[o]||(j.current[o]=[]),j.current[o][c]=e},style:{zIndex:d?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:d},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(hs,{onClick:e=>{e.stopPropagation(),O(d?null:{tier:t.tier,index:o,optionIndex:c})},isActive:d,disabled:r},"color"===u?.type&&m&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:m||"transparent",border:"1px solid #ddd"}}),l[c],e.createElement($e,{style:{display:"block"}})),d&&e.createElement(vs,{style:{zIndex:1001}},s.map((n,a)=>{const s=[...l];s[c]=n;const d=!q(t.tier,o,l,c,n)||r;p.productDetails.variants.edges.find(({node:e})=>e.title===s.join(" / "));const m=e=>{if(e.preventDefault(),e.stopPropagation(),F(e=>{const t={...e},n=[...t[i]||[]];return n[o]=s,t[i]=n,t}),d){M({tier:T,index:o,optionIndex:c,value:n}),O(null);const e=s.join(" / "),r=p.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||$;return void U(t.tier,o,r)}const r=s.join(" / "),a=p.productDetails.variants.edges.find(e=>e.node.title===r)?.node.id||$;U(t.tier,o,a),O(null)},g=u?.values.find(e=>e.name===n);return"image"===u?.type&&g?.value?e.createElement(xs,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(fs,{src:g.value,alt:n}),n):"color"===u?.type&&g?.value?e.createElement(xs,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(ys,{style:{backgroundColor:g.value}}),n):e.createElement(xs,{key:n,onClick:m,style:{cursor:"pointer"}},n)})))})),"swatches"===b?.volumeBundle?.variantSelectorType&&e.createElement(cs,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},p?.productDetails?.options.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=a.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},s.map(n=>{const a=l[c]===n,s=!q(t.tier,o,l,c,n)||r,u=d?.values.find(e=>e.name===n),m=e=>{if(e.preventDefault(),e.stopPropagation(),s)return;const r=[...l];r[c]=n,F(e=>{const t={...e},n=[...t[i]||[]];return n[o]=r,t[i]=n,t});const a=r.join(" / "),d=p.productDetails.variants.edges.find(e=>e.node.title===a)?.node.id||$;U(t.tier,o,d)},g={opacity:s?.5:1,cursor:s?"not-allowed":"pointer"};return"color"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button",disabled:s},e.createElement("div",{style:{width:a?"24px":"20px",height:a?"24px":"20px",borderRadius:"50%",backgroundColor:u.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:a?"#F7F7F7":"transparent",padding:"0px",width:a?"20px":"18px",height:a?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button",disabled:s},e.createElement("img",{src:u.value,alt:n,style:{width:a?"26px":"24px",height:a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ss,{key:n,isSelected:a,onClick:m,style:{...g,padding:"4px 8px",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default",disabled:s},n)})))})))})),L&&L.tier===t.tier&&e.createElement("div",{style:{color:ie,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ie}1A`,padding:"12px",borderBottomLeftRadius:se,borderBottomRightRadius:se}},"There aren’t enough items in our stock for select option, please select smaller bundle.")))})),a?.showCta&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(ds,{bgColor:Q(T)?b.general?.ctaBackgroundColor:"#ccc",textColor:Q(T)?b.general?.ctaTextColor:"#666",border:`1px solid ${Q(T)?b.general?.ctaBorderColor||"#121212":"#999"}`,shadow:b.general.ctaShadowType,padding:b.general?.ctaPadding,width:b.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Q(T)&&b.general?.customizeHoverState,backgroundColor:b.general?.ctaHoverBackgroundColor,textColor:b.general?.ctaHoverTextColor},onClick:async()=>{if(Q(T))try{P(!0);const e=E.find(e=>e.tier===T);if(!e)return;const t={},n=B[e.tier]||{};for(let o=0;o<e.minimumQuantity;o++){const e=n[o]||$;t[e]?t[e].quantity+=1:t[e]={quantity:1}}s?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"volume-bundle",selectedProducts:p?[{id:p?.productId,title:p?.productDetails?.title}]:[],selectedVariants:Object.values(n)}});const o=Z(e.tier),r=Array.from({length:e.minimumQuantity},(e,t)=>n[t]||$);l&&await l(o.original,r)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{P(!1)}else console.error("Selected tier is out of stock")},borderRadius:b.general.ctaBorderRadius??"",disabled:D||!Q(T),className:"yt-volume-add-to-cart-button"},Q(T)?e.createElement(e.Fragment,null,D?e.createElement(rt,{color:"white",loading:D,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,b.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=Z(T);return e.createElement(e.Fragment,null,$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(t.discounted.toFixed(h?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},$p(b.general.currencySymbol,a.storeCurrencyCode),Sp(t?.original.toFixed(h?0:2))," "))})()))):e.createElement(e.Fragment,null,"Out of Stock"))))}const Es=c.div`
|
|
3494
3494
|
container-type: inline-size;
|
|
3495
3495
|
border-radius: ${e=>e.borderRadius?e.borderRadius:"8px"};
|
|
3496
3496
|
max-width: 800px;
|
|
3497
3497
|
|
|
3498
3498
|
${e=>e.verticalMargin&&`margin: ${e.verticalMargin} 0;`}
|
|
3499
|
-
`,
|
|
3499
|
+
`,ks=c.div`
|
|
3500
3500
|
margin-bottom: 16px;
|
|
3501
|
-
`,
|
|
3501
|
+
`,Ts=c.div`
|
|
3502
3502
|
display: flex;
|
|
3503
3503
|
align-items: center;
|
|
3504
3504
|
gap: 8px;
|
|
3505
3505
|
margin-bottom: 4px;
|
|
3506
3506
|
justify-content: ${e=>"left"===e.infoAlignment?"flex-start":"right"===e.infoAlignment?"flex-end":"center"};
|
|
3507
3507
|
flex-direction: row;
|
|
3508
|
-
`,
|
|
3508
|
+
`,Ss=c.span`
|
|
3509
3509
|
font-size: 20px;
|
|
3510
3510
|
font-weight: 700;
|
|
3511
3511
|
color: #000;
|
|
@@ -3513,7 +3513,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3513
3513
|
@media (max-width: 600px) {
|
|
3514
3514
|
font-size: 18px;
|
|
3515
3515
|
}
|
|
3516
|
-
`,$
|
|
3516
|
+
`,$s=c.span`
|
|
3517
3517
|
font-size: 16px;
|
|
3518
3518
|
color: #888;
|
|
3519
3519
|
text-decoration: line-through;
|
|
@@ -3521,7 +3521,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3521
3521
|
@media (max-width: 600px) {
|
|
3522
3522
|
font-size: 14px;
|
|
3523
3523
|
}
|
|
3524
|
-
`,
|
|
3524
|
+
`,Ns=c.span`
|
|
3525
3525
|
font-size: 12px;
|
|
3526
3526
|
background-color: #f3f3f3;
|
|
3527
3527
|
color: #666;
|
|
@@ -3533,7 +3533,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3533
3533
|
font-size: 10px;
|
|
3534
3534
|
padding: 2px 4px;
|
|
3535
3535
|
}
|
|
3536
|
-
`,
|
|
3536
|
+
`,Bs=c.p`
|
|
3537
3537
|
font-size: 12px;
|
|
3538
3538
|
color: #666;
|
|
3539
3539
|
margin: 0;
|
|
@@ -3541,7 +3541,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3541
3541
|
@media (max-width: 600px) {
|
|
3542
3542
|
font-size: 10px;
|
|
3543
3543
|
}
|
|
3544
|
-
`,
|
|
3544
|
+
`,Is=c.div`
|
|
3545
3545
|
display: grid;
|
|
3546
3546
|
justify-content: center;
|
|
3547
3547
|
gap: 12px;
|
|
@@ -3567,7 +3567,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3567
3567
|
grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
|
|
3568
3568
|
gap: 6px;
|
|
3569
3569
|
}
|
|
3570
|
-
`,
|
|
3570
|
+
`,zs=c.div`
|
|
3571
3571
|
position: relative;
|
|
3572
3572
|
border: 2px solid #e5e7eb;
|
|
3573
3573
|
border-radius: 12px;
|
|
@@ -3589,7 +3589,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3589
3589
|
border-radius: 10px;
|
|
3590
3590
|
min-height: 170px;
|
|
3591
3591
|
}
|
|
3592
|
-
`,
|
|
3592
|
+
`,Fs=c.div`
|
|
3593
3593
|
border: 2px dashed #d1d5db;
|
|
3594
3594
|
border-radius: 14px;
|
|
3595
3595
|
display: flex;
|
|
@@ -3612,7 +3612,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3612
3612
|
border-radius: 12px;
|
|
3613
3613
|
min-height: 170px;
|
|
3614
3614
|
}
|
|
3615
|
-
`,
|
|
3615
|
+
`,Ds=c.img`
|
|
3616
3616
|
width: 100%;
|
|
3617
3617
|
height: 80%;
|
|
3618
3618
|
object-fit: cover;
|
|
@@ -3624,7 +3624,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3624
3624
|
@media (max-width: 600px) {
|
|
3625
3625
|
height: 80%;
|
|
3626
3626
|
}
|
|
3627
|
-
`,
|
|
3627
|
+
`,Ps=c.div`
|
|
3628
3628
|
display: flex;
|
|
3629
3629
|
flex-direction: column;
|
|
3630
3630
|
gap: 2px;
|
|
@@ -3639,7 +3639,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3639
3639
|
@media (max-width: 600px) {
|
|
3640
3640
|
height: 4rem;
|
|
3641
3641
|
}
|
|
3642
|
-
`,
|
|
3642
|
+
`,As=c.div`
|
|
3643
3643
|
font-size: 11px;
|
|
3644
3644
|
font-weight: 600;
|
|
3645
3645
|
display: flex;
|
|
@@ -3683,7 +3683,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3683
3683
|
@media (max-width: 600px) {
|
|
3684
3684
|
font-size: 10px;
|
|
3685
3685
|
}
|
|
3686
|
-
`;const
|
|
3686
|
+
`;const _s=c.p`
|
|
3687
3687
|
box-sizing: border-box;
|
|
3688
3688
|
width: 100%;
|
|
3689
3689
|
height: auto;
|
|
@@ -3746,7 +3746,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3746
3746
|
animation-duration: var(--duration, 14s);
|
|
3747
3747
|
}
|
|
3748
3748
|
}
|
|
3749
|
-
`,
|
|
3749
|
+
`,Rs=c.button`
|
|
3750
3750
|
position: absolute;
|
|
3751
3751
|
top: -9px;
|
|
3752
3752
|
right: -9px;
|
|
@@ -3780,7 +3780,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3780
3780
|
top: -8px;
|
|
3781
3781
|
right: -8px;
|
|
3782
3782
|
}
|
|
3783
|
-
`,
|
|
3783
|
+
`,Os=c.div`
|
|
3784
3784
|
font-size: 42px;
|
|
3785
3785
|
color: #94a3b8;
|
|
3786
3786
|
font-weight: 300;
|
|
@@ -3791,7 +3791,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3791
3791
|
width: 100%;
|
|
3792
3792
|
transition: color 0.25s ease, transform 0.25s ease;
|
|
3793
3793
|
|
|
3794
|
-
${
|
|
3794
|
+
${Fs}:hover & {
|
|
3795
3795
|
color: #64748b;
|
|
3796
3796
|
transform: scale(1.08);
|
|
3797
3797
|
}
|
|
@@ -3799,7 +3799,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3799
3799
|
@media (max-width: 600px) {
|
|
3800
3800
|
font-size: 36px;
|
|
3801
3801
|
}
|
|
3802
|
-
`,
|
|
3802
|
+
`,Ls=c.button`
|
|
3803
3803
|
width: 100%;
|
|
3804
3804
|
background-color: ${e=>e.primaryBgColor?e.primaryBgColor:"#e75a87"};
|
|
3805
3805
|
color: ${e=>e.textColor?e.textColor:"white"};
|
|
@@ -3822,7 +3822,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3822
3822
|
}
|
|
3823
3823
|
|
|
3824
3824
|
${e=>e.hoverProperties?.customizeHoverState&&`\n &:hover {\n background: ${e.hoverProperties.backgroundColor||"#dc2626"};\n color: ${e.hoverProperties.textColor||"white"};\n }\n `}
|
|
3825
|
-
`,
|
|
3825
|
+
`,Ms=c.div`
|
|
3826
3826
|
position: fixed;
|
|
3827
3827
|
top: 0;
|
|
3828
3828
|
left: 0;
|
|
@@ -3833,7 +3833,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3833
3833
|
align-items: center;
|
|
3834
3834
|
justify-content: center;
|
|
3835
3835
|
z-index: 1000;
|
|
3836
|
-
`,
|
|
3836
|
+
`,js=c.div`
|
|
3837
3837
|
position: relative;
|
|
3838
3838
|
width: 90%;
|
|
3839
3839
|
max-height: 57vh;
|
|
@@ -3856,12 +3856,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3856
3856
|
border-bottom-left-radius: 0;
|
|
3857
3857
|
border-bottom-right-radius: 0;
|
|
3858
3858
|
}
|
|
3859
|
-
`,
|
|
3859
|
+
`,Vs=c.div`
|
|
3860
3860
|
display: flex;
|
|
3861
3861
|
flex-direction: column;
|
|
3862
3862
|
align-items: center;
|
|
3863
3863
|
padding: 10px 7px 0px 7px;
|
|
3864
|
-
`,
|
|
3864
|
+
`,Ws=c.input`
|
|
3865
3865
|
flex-grow: 1;
|
|
3866
3866
|
padding: 8px 12px;
|
|
3867
3867
|
border: 1px solid #ddd;
|
|
@@ -3876,7 +3876,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3876
3876
|
font-size: 12px;
|
|
3877
3877
|
padding: 6px 10px;
|
|
3878
3878
|
}
|
|
3879
|
-
`,
|
|
3879
|
+
`,Hs=c.button`
|
|
3880
3880
|
font-weight: 600;
|
|
3881
3881
|
font-size: 12px;
|
|
3882
3882
|
background: none;
|
|
@@ -3909,12 +3909,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3909
3909
|
border-radius: 10px;
|
|
3910
3910
|
margin-left: 4px;
|
|
3911
3911
|
}
|
|
3912
|
-
`;const
|
|
3912
|
+
`;const qs=c.div`
|
|
3913
3913
|
display: flex;
|
|
3914
3914
|
flex-direction: column;
|
|
3915
3915
|
gap: 12px;
|
|
3916
3916
|
|
|
3917
|
-
`,
|
|
3917
|
+
`,Qs=c.div`
|
|
3918
3918
|
display: flex;
|
|
3919
3919
|
align-items: center;
|
|
3920
3920
|
padding: 8px 4px;
|
|
@@ -3934,15 +3934,15 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3934
3934
|
@media (max-width: 600px) {
|
|
3935
3935
|
padding: 6px;
|
|
3936
3936
|
}
|
|
3937
|
-
`,
|
|
3937
|
+
`,Us=c.img`
|
|
3938
3938
|
width: 50px;
|
|
3939
3939
|
height: 50px;
|
|
3940
3940
|
border-radius: 4px;
|
|
3941
3941
|
object-fit: cover;
|
|
3942
3942
|
margin-right: 12px;
|
|
3943
|
-
`,
|
|
3943
|
+
`,Ys=c.div`
|
|
3944
3944
|
flex-grow: 1;
|
|
3945
|
-
`,
|
|
3945
|
+
`,Gs=c.h4`
|
|
3946
3946
|
font-size: 14px;
|
|
3947
3947
|
font-weight: 500;
|
|
3948
3948
|
margin: 0 0 4px 0;
|
|
@@ -3957,7 +3957,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3957
3957
|
text-decoration: line-through;
|
|
3958
3958
|
margin-left: 4px;
|
|
3959
3959
|
}
|
|
3960
|
-
`;const
|
|
3960
|
+
`;const Xs=c.button`
|
|
3961
3961
|
background: ${e=>e.primaryBgColor?e.primaryBgColor+"20":"#e75a87"};
|
|
3962
3962
|
color: ${e=>e.primaryBgColor?e.primaryBgColor:"#e75a87"};
|
|
3963
3963
|
border: none;
|
|
@@ -3976,11 +3976,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3976
3976
|
font-size: 11px;
|
|
3977
3977
|
padding: 5px 10px;
|
|
3978
3978
|
}
|
|
3979
|
-
`,
|
|
3979
|
+
`,Zs=c.span`
|
|
3980
3980
|
display: flex;
|
|
3981
3981
|
align-items: center;
|
|
3982
3982
|
gap: 4px;
|
|
3983
|
-
`,
|
|
3983
|
+
`,Js=c.div`
|
|
3984
3984
|
text-align: center;
|
|
3985
3985
|
padding: 20px;
|
|
3986
3986
|
color: #666;
|
|
@@ -3992,11 +3992,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
3992
3992
|
font-size: 12px;
|
|
3993
3993
|
font-weight: 500;
|
|
3994
3994
|
margin-bottom: 4px;
|
|
3995
|
-
`;const
|
|
3995
|
+
`;const Ks=c.div`
|
|
3996
3996
|
display: flex;
|
|
3997
3997
|
gap: 4px;
|
|
3998
3998
|
flex-wrap: wrap;
|
|
3999
|
-
`,
|
|
3999
|
+
`,ed=c.button`
|
|
4000
4000
|
padding: 6px 12px;
|
|
4001
4001
|
border: 1px solid
|
|
4002
4002
|
${e=>e.isSelected?e.primaryBgColor+"50":"#e5e7eb"};
|
|
@@ -4014,10 +4014,10 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4014
4014
|
font-size: 11px;
|
|
4015
4015
|
padding: 4px 8px;
|
|
4016
4016
|
}
|
|
4017
|
-
`,ts=({bundle:i,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,d]=t({}),[s,p]=t(!1),[u,m]=t(0),[g,x]=t(0),[f,y]=t(""),[b,h]=t([]),[v,w]=t({}),[C,E]=t(!1),[k,T]=t(window.innerWidth<450),S=i.builderTiers?.productTier||[],$=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),{originalPrice:B,dealPrice:I,offerValue:z}=o(()=>{const e=[];let t=0;Object.values(c).forEach(n=>{n.productId&&n.variantId&&(e.push({productId:n.productId,variantId:n.variantId}),t++)});let n=0,o=0;for(const{productId:t,variantId:r}of e){const e=i.products.find(e=>e.productId===t);if(!e)continue;const a=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===r)?.node;if(!a)continue;const l=Number.parseFloat(a?.price||"0"),c=Number.parseFloat(a?.compareAtPrice||"0");n+=l,o+=c>0?c:l}let r=n;(t===S.length||i?.dealAmount)&&(i?.percentageOff?r=n*(1-i.percentageOff/100):i?.dealAmount?r=i.dealAmount:i?.amountOff&&i.amountOff<n&&(r=n-i.amountOff));const a=o||n,l=a-r;return{originalPrice:a.toFixed(2),dealPrice:r.toFixed(2),offerValue:l.toFixed(2)}},[i,c,S.length]);n(()=>{m(S.length-Object.keys(c).length)},[c]),n(()=>{const e={};let t=!1;S.forEach((n,o)=>{if(n.isFixed&&n.products&&n.products.length>0){const r=n.products[0];if(r&&r.productId){const n=r?.variantIds?.[0]||N(r?.productId);n&&(e[o]={productId:r.productId,variantId:n},t=!0)}}}),t&&d(t=>({...t,...e}))},[S]),n(()=>{if(null===g||0===S.length)return;const e=S[g].products.map(e=>e.productId),t=new Map;i.products.forEach(n=>{e.includes(n.productId)&&!t.has(n.productId)&&t.set(n.productId,n)});let n=Array.from(t.values());if(""!==f.trim()){const e=f.toLowerCase();n=n.filter(t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some(t=>t.node.title.toLowerCase().includes(e)))}h(n)},[f,i.products,g,S]);const F=e=>{const t=i.products.find(t=>t.productId===e);return t?.productDetails},N=e=>{const t=i.products.find(t=>t.productId===e);if(!t||!t.productDetails?.variants?.edges?.length)return"";const n=t.productDetails.variants.edges.find(e=>$(t.productDetails,e.node.id)>0)?.node;return n?n.id:t.productDetails.variants.edges[0].node.id},D=(e,t)=>{if(null==g)return;const n=t||N(e),o=i.products.find(t=>t.productId===e);if(o){if(0===$(o.productDetails,n))return void console.log("Cannot select out of stock variant")}d(t=>({...t,[g]:{productId:e,variantId:n}})),p(!1),y("")},P=e=>{d(t=>{const n={...t};return delete n[e],n}),w({})},_=e=>{const t=S[e];if(t.isFixed)return;x(e),p(!0),y("");const n=t.products.map(e=>e.productId),o=i.products.filter(e=>n.includes(e.productId)),r=new Map;o.forEach(e=>{r.has(e.productId)||r.set(e.productId,e)}),h(Array.from(r.values()))};n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i._id,bundleType:"mixandmatch-bundle"}});const e=()=>{T(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const R=i.customizations,O=k,L="bundles"===i.appName?i.pageHeader?.title:i?.title,M="bundles"===i.appName?i.pageHeader?.description:i?.subtitle;return e.createElement(e.Fragment,null,e.createElement(Ed,{verticalMargin:R.comboBundle.verticalMargin,borderRadius:"20px"},R.comboBundle.embedContentVisibility&&e.createElement(kd,null,R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:R.comboBundle.infoAlignment||"left"}},e.createElement("h2",{style:{fontSize:"28px",color:R.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},L)),R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(I)>1&&e.createElement(e.Fragment,null,e.createElement(Td,{infoAlignment:R.comboBundle.infoAlignment},e.createElement(Sd,null,$p(R.general.currencySymbol,i.storeCurrencyCode),Sp(I)),Number(I)<Number(B)&&e.createElement($d,{style:{minWidth:"fit-content"}},$p(R.general.currencySymbol,i.storeCurrencyCode)," ",Sp(B)),e.createElement(Bd,{style:{minWidth:"fit-content"}},"In Stock")),e.createElement(Id,{style:{textAlign:R.comboBundle.infoAlignment||"left",fontSize:R.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),e.createElement(zd,{gridSize:S.length,isHorizontal:O},S.map((t,o)=>{const i=(e=>!!c[e]&&!!c[e].productId)(o),{product:a,variantId:l}=(e=>{const t=c?.[e];return t?{product:F(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(o),d=a?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(a,l):null,s=t.isFixed,p=r(null);return n(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,o=t.scrollWidth;if(o<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const r=-(o-n);e.style.setProperty("--scroll-end",`${r}px`);const i=2*Math.max(1,Math.abs(r)/40)+3;e.style.setProperty("--duration",`${i}s`),e.setAttribute("data-overflow","true")},[d?.displayName,d?.title]),i&&a?e.createElement(Fd,{key:`tier-${o}`,onClick:()=>!s&&_(o),style:{borderRadius:"20px",cursor:s?"default":"pointer"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},!s&&e.createElement(Rd,{onClick:e=>{e.stopPropagation(),P(o)}},"×"),e.createElement(Dd,{src:a?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:a?.title,style:{aspectRatio:R?.general.imageAspectRatio||"1/1"},isHorizontal:O}),e.createElement(Pd,{style:{color:"#1e1e1e",textAlign:"center",...O&&"right"===R.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 10px"},...O&&"center"===R.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:O},e.createElement(_d,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},e.createElement("span",null,a?.title," - ",d?.title)))):e.createElement(Nd,{key:`tier-${o}`,onClick:()=>!s&&_(o),isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment,style:{cursor:s?"default":"pointer"}},s?e.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),e.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},t.title||`Product ${o+1}`)):e.createElement(e.Fragment,null,e.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},e.createElement(Od,null,"+")),e.createElement(Ad,{style:{fontSize:"15px",fontWeight:"600",color:R.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},e.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t.title?`${t.title}`:`Select Product ${o+1}`))))})),e.createElement(Ld,{hoverProperties:{customizeHoverState:R.general.customizeHoverState,backgroundColor:R.general.ctaHoverBackgroundColor,textColor:R.general.ctaHoverTextColor},borderRadius:R.general.ctaBorderRadius,primaryBgColor:R.general.ctaBackgroundColor,onClick:async()=>{const e=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);return{id:t?.productId,title:t?.productDetails?.title}});l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"mixandmatch-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:e}}),E(!0);try{if(u>0)return console.log("Please select all products"),void E(!1);const e=Object.values(c).map(e=>e.variantId),t=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);if(!t)return null;const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e.variantId)?.node;return n?{variantId:e.variantId,price:Number(n.price)}:null}).filter(Boolean);await a(e.length,e,Number(I),t)}catch(e){console.log("Add to cart error:",e)}finally{E(!1)}},textColor:R.general.ctaTextColor,borderColor:R.general.ctaBorderColor},0===u?C?e.createElement(rt,{color:"white",loading:C,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,R.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${u} more item(s)`),R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{style:{margin:"20px 0px"}},e.createElement("h4",{style:{fontSize:"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:R.general.primaryColor+"20",textAlign:R.comboBundle.infoAlignment||"left"}},"Description"),e.createElement("div",{style:{fontSize:R.comboBundle.productDescriptionFontSize||"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:R.general.primaryColor+"08",textAlign:R.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:M}}))),s&&A(e.createElement(Md,{onClick:()=>p(!1)},e.createElement(jd,{onClick:e=>e.stopPropagation()},e.createElement(Vd,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},e.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},e.createElement(Wd,{placeholder:"Search",value:f,onChange:e=>{y(e.target.value)}}),e.createElement(Hd,{onClick:()=>p(!1)},"Cancel")),e.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),e.createElement("div",{style:{marginBottom:k?"20px":"5px",flex:1,minHeight:0,overflow:"scroll"}},e.createElement(qd,{style:{height:"auto",flex:"unset"}},b?.length>0?b?.map(t=>{const n=t?.productDetails;if(!n)return null;const o=(e=>{if(null==g)return!1;const t=c?.[g];return!!t&&t.productId===e})(t.productId),r=N(t.productId);let a=r||"";return a=o&&null!==g?c?.[g]?.variantId||a:v[t.productId]||r,e.createElement(Qd,{className:"mixAndMatch-product-item",primaryBgColor:R.general.primaryColor||"#1e1e1e",key:n.id,isSelected:o,onClick:()=>{D(t.productId,a)}},e.createElement(Ud,{className:"mixAndMatch-vendor-image",src:n.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:n.title}),e.createElement(Yd,{className:"mixAndMatch-vendor-info"},e.createElement(Gd,{className:"mixAndMatch-vendor-name"},n.title),e.createElement(Kd,{className:"mixAndMatch-variant-options"},n.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:r})=>{const i=0===$(n,r.id);return e.createElement(es,{className:"mixAndMatch-variant-button "+(a===r.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:R.general?.primaryColor,disabled:!!o||i,key:r.id,isSelected:a===r.id,tierHasProductId:!!o,onClick:e=>{var n,o;e.stopPropagation(),i||(n=t.productId,o=r.id,w(e=>({...e,[n]:o})))},style:{opacity:i?.5:1,cursor:i?"not-allowed":"pointer"}},r.title)}))),e.createElement(Xd,{cornerRadiusType:i?.cornerRadiusType??"",primaryBgColor:R.general?.primaryColor||"#1e1e1e",onClick:()=>o?P(g||0):D(t.productId,a)},o?e.createElement(Zd,null,"Added"):" + Add"))}):e.createElement(Jd,null,'No products found matching "',f,'"'))))),document.body))},ns=c.div`
|
|
4017
|
+
`,td=({bundle:i,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t({}),[d,p]=t(!1),[u,m]=t(0),[g,x]=t(0),[f,y]=t(""),[b,h]=t([]),[v,w]=t({}),[C,E]=t(!1),[k,T]=t(window.innerWidth<450),S=i.builderTiers?.productTier||[],$=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),{originalPrice:N,dealPrice:B,offerValue:I}=o(()=>{const e=[];let t=0;Object.values(c).forEach(n=>{n.productId&&n.variantId&&(e.push({productId:n.productId,variantId:n.variantId}),t++)});let n=0,o=0;for(const{productId:t,variantId:r}of e){const e=i.products.find(e=>e.productId===t);if(!e)continue;const a=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===r)?.node;if(!a)continue;const l=Number.parseFloat(a?.price||"0"),c=Number.parseFloat(a?.compareAtPrice||"0");n+=l,o+=c>0?c:l}let r=n;(t===S.length||i?.dealAmount)&&(i?.percentageOff?r=n*(1-i.percentageOff/100):i?.dealAmount?r=i.dealAmount:i?.amountOff&&i.amountOff<n&&(r=n-i.amountOff));const a=o||n,l=a-r;return{originalPrice:a.toFixed(2),dealPrice:r.toFixed(2),offerValue:l.toFixed(2)}},[i,c,S.length]);n(()=>{m(S.length-Object.keys(c).length)},[c]),n(()=>{const e={};let t=!1;S.forEach((n,o)=>{if(n.isFixed&&n.products&&n.products.length>0){const r=n.products[0];if(r&&r.productId){const n=r?.variantIds?.[0]||F(r?.productId);n&&(e[o]={productId:r.productId,variantId:n},t=!0)}}}),t&&s(t=>({...t,...e}))},[S]),n(()=>{if(null===g||0===S.length)return;const e=S[g].products.map(e=>e.productId),t=new Map;i.products.forEach(n=>{e.includes(n.productId)&&!t.has(n.productId)&&t.set(n.productId,n)});let n=Array.from(t.values());if(""!==f.trim()){const e=f.toLowerCase();n=n.filter(t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some(t=>t.node.title.toLowerCase().includes(e)))}h(n)},[f,i.products,g,S]);const z=e=>{const t=i.products.find(t=>t.productId===e);return t?.productDetails},F=e=>{const t=i.products.find(t=>t.productId===e);if(!t||!t.productDetails?.variants?.edges?.length)return"";const n=t.productDetails.variants.edges.find(e=>$(t.productDetails,e.node.id)>0)?.node;return n?n.id:t.productDetails.variants.edges[0].node.id},D=(e,t)=>{if(null==g)return;const n=t||F(e),o=i.products.find(t=>t.productId===e);if(o){if(0===$(o.productDetails,n))return void console.log("Cannot select out of stock variant")}s(t=>({...t,[g]:{productId:e,variantId:n}})),p(!1),y("")},P=e=>{s(t=>{const n={...t};return delete n[e],n}),w({})},_=e=>{const t=S[e];if(t.isFixed)return;x(e),p(!0),y("");const n=t.products.map(e=>e.productId),o=i.products.filter(e=>n.includes(e.productId)),r=new Map;o.forEach(e=>{r.has(e.productId)||r.set(e.productId,e)}),h(Array.from(r.values()))};n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i._id,bundleType:"mixandmatch-bundle"}});const e=()=>{T(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const R=i.customizations,O=k,L="bundles"===i.appName?i.pageHeader?.title:i?.title,M="bundles"===i.appName?i.pageHeader?.description:i?.subtitle;return e.createElement(e.Fragment,null,e.createElement(Es,{verticalMargin:R.comboBundle.verticalMargin,borderRadius:"20px"},R.comboBundle.embedContentVisibility&&e.createElement(ks,null,R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:R.comboBundle.infoAlignment||"left"}},e.createElement("h2",{style:{fontSize:"28px",color:R.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},L)),R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(B)>1&&e.createElement(e.Fragment,null,e.createElement(Ts,{infoAlignment:R.comboBundle.infoAlignment},e.createElement(Ss,null,$p(R.general.currencySymbol,i.storeCurrencyCode),Sp(B)),Number(B)<Number(N)&&e.createElement($s,{style:{minWidth:"fit-content"}},$p(R.general.currencySymbol,i.storeCurrencyCode)," ",Sp(N)),e.createElement(Ns,{style:{minWidth:"fit-content"}},"In Stock")),e.createElement(Bs,{style:{textAlign:R.comboBundle.infoAlignment||"left",fontSize:R.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),e.createElement(Is,{gridSize:S.length,isHorizontal:O},S.map((t,o)=>{const i=(e=>!!c[e]&&!!c[e].productId)(o),{product:a,variantId:l}=(e=>{const t=c?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(o),s=a?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(a,l):null,d=t.isFixed,p=r(null);return n(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,o=t.scrollWidth;if(o<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const r=-(o-n);e.style.setProperty("--scroll-end",`${r}px`);const i=2*Math.max(1,Math.abs(r)/40)+3;e.style.setProperty("--duration",`${i}s`),e.setAttribute("data-overflow","true")},[s?.displayName,s?.title]),i&&a?e.createElement(zs,{key:`tier-${o}`,onClick:()=>!d&&_(o),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},!d&&e.createElement(Rs,{onClick:e=>{e.stopPropagation(),P(o)}},"×"),e.createElement(Ds,{src:a?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:a?.title,style:{aspectRatio:R?.general.imageAspectRatio||"1/1"},isHorizontal:O}),e.createElement(Ps,{style:{color:"#1e1e1e",textAlign:"center",...O&&"right"===R.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 10px"},...O&&"center"===R.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:O},e.createElement(_s,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},e.createElement("span",null,a?.title," - ",s?.title)))):e.createElement(Fs,{key:`tier-${o}`,onClick:()=>!d&&_(o),isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?e.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),e.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},t.title||`Product ${o+1}`)):e.createElement(e.Fragment,null,e.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},e.createElement(Os,null,"+")),e.createElement(As,{style:{fontSize:"15px",fontWeight:"600",color:R.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},e.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t.title?`${t.title}`:`Select Product ${o+1}`))))})),e.createElement(Ls,{hoverProperties:{customizeHoverState:R.general.customizeHoverState,backgroundColor:R.general.ctaHoverBackgroundColor,textColor:R.general.ctaHoverTextColor},borderRadius:R.general.ctaBorderRadius,primaryBgColor:R.general.ctaBackgroundColor,onClick:async()=>{const e=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);return{id:t?.productId,title:t?.productDetails?.title}});l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"mixandmatch-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:e}}),E(!0);try{if(u>0)return console.log("Please select all products"),void E(!1);const e=Object.values(c).map(e=>e.variantId),t=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);if(!t)return null;const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e.variantId)?.node;return n?{variantId:e.variantId,price:Number(n.price)}:null}).filter(Boolean);await a(e.length,e,Number(B),t)}catch(e){console.log("Add to cart error:",e)}finally{E(!1)}},textColor:R.general.ctaTextColor,borderColor:R.general.ctaBorderColor},0===u?C?e.createElement(rt,{color:"white",loading:C,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,R.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${u} more item(s)`),R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{style:{margin:"20px 0px"}},e.createElement("h4",{style:{fontSize:"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:R.general.primaryColor+"20",textAlign:R.comboBundle.infoAlignment||"left"}},"Description"),e.createElement("div",{style:{fontSize:R.comboBundle.productDescriptionFontSize||"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:R.general.primaryColor+"08",textAlign:R.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:M}}))),d&&A(e.createElement(Ms,{onClick:()=>p(!1)},e.createElement(js,{onClick:e=>e.stopPropagation()},e.createElement(Vs,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},e.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},e.createElement(Ws,{placeholder:"Search",value:f,onChange:e=>{y(e.target.value)}}),e.createElement(Hs,{onClick:()=>p(!1)},"Cancel")),e.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),e.createElement("div",{style:{marginBottom:k?"20px":"5px",flex:1,minHeight:0,overflow:"scroll"}},e.createElement(qs,{style:{height:"auto",flex:"unset"}},b?.length>0?b?.map(t=>{const n=t?.productDetails;if(!n)return null;const o=(e=>{if(null==g)return!1;const t=c?.[g];return!!t&&t.productId===e})(t.productId),r=F(t.productId);let a=r||"";return a=o&&null!==g?c?.[g]?.variantId||a:v[t.productId]||r,e.createElement(Qs,{className:"mixAndMatch-product-item",primaryBgColor:R.general.primaryColor||"#1e1e1e",key:n.id,isSelected:o,onClick:()=>{D(t.productId,a)}},e.createElement(Us,{className:"mixAndMatch-vendor-image",src:n.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:n.title}),e.createElement(Ys,{className:"mixAndMatch-vendor-info"},e.createElement(Gs,{className:"mixAndMatch-vendor-name"},n.title),e.createElement(Ks,{className:"mixAndMatch-variant-options"},n.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:r})=>{const i=0===$(n,r.id);return e.createElement(ed,{className:"mixAndMatch-variant-button "+(a===r.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:R.general?.primaryColor,disabled:!!o||i,key:r.id,isSelected:a===r.id,tierHasProductId:!!o,onClick:e=>{var n,o;e.stopPropagation(),i||(n=t.productId,o=r.id,w(e=>({...e,[n]:o})))},style:{opacity:i?.5:1,cursor:i?"not-allowed":"pointer"}},r.title)}))),e.createElement(Xs,{cornerRadiusType:i?.cornerRadiusType??"",primaryBgColor:R.general?.primaryColor||"#1e1e1e",onClick:()=>o?P(g||0):D(t.productId,a)},o?e.createElement(Zs,null,"Added"):" + Add"))}):e.createElement(Js,null,'No products found matching "',f,'"'))))),document.body))},nd=c.div`
|
|
4018
4018
|
border-radius: 8px;
|
|
4019
4019
|
container-type: inline-size;
|
|
4020
|
-
`,
|
|
4020
|
+
`,od=c.div`
|
|
4021
4021
|
background-color: #ff4da6;
|
|
4022
4022
|
color: white;
|
|
4023
4023
|
padding: 10px;
|
|
@@ -4026,19 +4026,19 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4026
4026
|
border-radius: 4px;
|
|
4027
4027
|
font-size: 14px;
|
|
4028
4028
|
line-height: normal;
|
|
4029
|
-
`,
|
|
4029
|
+
`,rd=c.div`
|
|
4030
4030
|
text-align: center;
|
|
4031
4031
|
color: #777;
|
|
4032
4032
|
font-size: 16px;
|
|
4033
4033
|
margin: 8px 0;
|
|
4034
4034
|
line-height: normal;
|
|
4035
|
-
`,
|
|
4035
|
+
`,id=c.div`
|
|
4036
4036
|
display: flex;
|
|
4037
4037
|
flex-direction: column;
|
|
4038
4038
|
gap: 5px;
|
|
4039
4039
|
margin: 10px 0px;
|
|
4040
4040
|
padding: 5px
|
|
4041
|
-
`,
|
|
4041
|
+
`,ad=c.div`
|
|
4042
4042
|
display: flex;
|
|
4043
4043
|
border: 1px solid #eee;
|
|
4044
4044
|
border-radius: 8px;
|
|
@@ -4046,27 +4046,27 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4046
4046
|
align-items: center;
|
|
4047
4047
|
background-color: white;
|
|
4048
4048
|
width: 100%;
|
|
4049
|
-
`,
|
|
4049
|
+
`,ld=c.img`
|
|
4050
4050
|
width: 100px;
|
|
4051
4051
|
object-fit: cover;
|
|
4052
4052
|
border-radius: 4px;
|
|
4053
4053
|
margin-right: 12px;
|
|
4054
4054
|
aspect-ratio: 1/1;
|
|
4055
|
-
`,
|
|
4055
|
+
`,cd=c.div`
|
|
4056
4056
|
flex: 1;
|
|
4057
|
-
`,
|
|
4057
|
+
`,sd=c.div`
|
|
4058
4058
|
font-weight: 500;
|
|
4059
4059
|
font-size: 16px;
|
|
4060
4060
|
margin-bottom: 4px;
|
|
4061
4061
|
line-height: normal;
|
|
4062
|
-
`,
|
|
4062
|
+
`,dd=c.div`
|
|
4063
4063
|
font-size: 14px;
|
|
4064
4064
|
margin-bottom: 6px;
|
|
4065
4065
|
font-weight: bold;
|
|
4066
4066
|
line-height: normal;
|
|
4067
|
-
`,
|
|
4067
|
+
`,pd=c.span`
|
|
4068
4068
|
color: #000;
|
|
4069
|
-
`,
|
|
4069
|
+
`,ud=c.span`
|
|
4070
4070
|
text-decoration: line-through;
|
|
4071
4071
|
color: #999;
|
|
4072
4072
|
margin-left: 6px;
|
|
@@ -4076,7 +4076,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4076
4076
|
font-size: 10px;
|
|
4077
4077
|
margin-left: 2px;
|
|
4078
4078
|
}
|
|
4079
|
-
`,
|
|
4079
|
+
`,md=c.div`
|
|
4080
4080
|
font-size: 14px;
|
|
4081
4081
|
width: 100%;
|
|
4082
4082
|
display: flex;
|
|
@@ -4086,11 +4086,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4086
4086
|
gap: 10px;
|
|
4087
4087
|
color: #2e2e2e;
|
|
4088
4088
|
line-height: normal;
|
|
4089
|
-
`,
|
|
4089
|
+
`,gd=c.div`
|
|
4090
4090
|
margin-top: 10px;
|
|
4091
4091
|
font-size: 14px;
|
|
4092
4092
|
line-height: normal;
|
|
4093
|
-
`,
|
|
4093
|
+
`,xd=c.div`
|
|
4094
4094
|
font-size: 20px;
|
|
4095
4095
|
display: flex;
|
|
4096
4096
|
flex-direction: row;
|
|
@@ -4101,15 +4101,15 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4101
4101
|
@media (max-width: 480px) {
|
|
4102
4102
|
font-size: 18px;
|
|
4103
4103
|
}
|
|
4104
|
-
`,
|
|
4104
|
+
`,fd=c.span`
|
|
4105
4105
|
font-weight: 600;
|
|
4106
|
-
`,
|
|
4106
|
+
`,yd=c.span`
|
|
4107
4107
|
background-color: red;
|
|
4108
4108
|
color: white;
|
|
4109
4109
|
font-weight: bold;
|
|
4110
4110
|
font-size: 13px;
|
|
4111
4111
|
padding: 3px 6px;
|
|
4112
|
-
`,
|
|
4112
|
+
`,bd=c.button`
|
|
4113
4113
|
width: 100%;
|
|
4114
4114
|
margin-top: 12px;
|
|
4115
4115
|
padding: 12px;
|
|
@@ -4143,7 +4143,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4143
4143
|
`,c.span`
|
|
4144
4144
|
font-size: 14px;
|
|
4145
4145
|
margin-left: 6px;
|
|
4146
|
-
`;const
|
|
4146
|
+
`;const hd=c.div`
|
|
4147
4147
|
border-radius: 8px;
|
|
4148
4148
|
container-type: inline-size;
|
|
4149
4149
|
margin-top: 10px;
|
|
@@ -4162,7 +4162,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4162
4162
|
font-size: 14px;
|
|
4163
4163
|
margin: 6px 0 16px;
|
|
4164
4164
|
line-height: normal;
|
|
4165
|
-
`;const
|
|
4165
|
+
`;const vd=c.div`
|
|
4166
4166
|
display: flex;
|
|
4167
4167
|
flex-direction: row;
|
|
4168
4168
|
align-items: stretch;
|
|
@@ -4171,7 +4171,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4171
4171
|
padding: 0;
|
|
4172
4172
|
flex-wrap: wrap;
|
|
4173
4173
|
overflow: hidden;
|
|
4174
|
-
`,
|
|
4174
|
+
`,wd=c.div`
|
|
4175
4175
|
flex: 0 0 auto;
|
|
4176
4176
|
width: ${({productsLength:e})=>`calc((100% - ${e-1} * 37px - 8px) / ${e})`};
|
|
4177
4177
|
border: 1px solid #ccc;
|
|
@@ -4191,9 +4191,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4191
4191
|
@container (max-width: 480px) {
|
|
4192
4192
|
width: ${({productsLength:e})=>`calc((100% - ${e-1} * 20px - 8px) / ${e})`};
|
|
4193
4193
|
}
|
|
4194
|
-
`,
|
|
4194
|
+
`,Cd=c.div`
|
|
4195
4195
|
position: relative;
|
|
4196
|
-
`,
|
|
4196
|
+
`,Ed=c.img`
|
|
4197
4197
|
width: 100%;
|
|
4198
4198
|
aspect-ratio: 1/1;
|
|
4199
4199
|
object-fit: cover;
|
|
@@ -4227,7 +4227,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4227
4227
|
&:hover {
|
|
4228
4228
|
transform: scale(1.1);
|
|
4229
4229
|
}
|
|
4230
|
-
`;const
|
|
4230
|
+
`;const kd=c.div`
|
|
4231
4231
|
position: absolute;
|
|
4232
4232
|
bottom: 10px;
|
|
4233
4233
|
left: 6px;
|
|
@@ -4254,7 +4254,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4254
4254
|
cursor: pointer;
|
|
4255
4255
|
background-color: #ffffff60;
|
|
4256
4256
|
}
|
|
4257
|
-
`,
|
|
4257
|
+
`,Td=c.div`
|
|
4258
4258
|
width: 14px;
|
|
4259
4259
|
height: 14px;
|
|
4260
4260
|
border-radius: 50%;
|
|
@@ -4268,7 +4268,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4268
4268
|
width: 12px;
|
|
4269
4269
|
height: 12px;
|
|
4270
4270
|
}
|
|
4271
|
-
`,
|
|
4271
|
+
`,Sd=c.div`
|
|
4272
4272
|
width: 14px;
|
|
4273
4273
|
height: 14px;
|
|
4274
4274
|
border-radius: 50%;
|
|
@@ -4283,7 +4283,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4283
4283
|
width: 12px;
|
|
4284
4284
|
height: 12px;
|
|
4285
4285
|
}
|
|
4286
|
-
`,$
|
|
4286
|
+
`,$d=c.div`
|
|
4287
4287
|
border-radius: 20px;
|
|
4288
4288
|
font-size: 10px;
|
|
4289
4289
|
font-weight: 600;
|
|
@@ -4293,7 +4293,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4293
4293
|
color: #333;
|
|
4294
4294
|
|
|
4295
4295
|
line-height: normal;
|
|
4296
|
-
`,
|
|
4296
|
+
`,Nd=c.div`
|
|
4297
4297
|
padding: 6px;
|
|
4298
4298
|
text-align: left;
|
|
4299
4299
|
min-height: 40px;
|
|
@@ -4309,7 +4309,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4309
4309
|
@container (max-width: 480px) {
|
|
4310
4310
|
padding: 4px;
|
|
4311
4311
|
}
|
|
4312
|
-
`,
|
|
4312
|
+
`,Bd=c.div`
|
|
4313
4313
|
font-size: 14px;
|
|
4314
4314
|
font-weight: 500;
|
|
4315
4315
|
margin: 4px 0;
|
|
@@ -4323,7 +4323,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4323
4323
|
font-size: 12px;
|
|
4324
4324
|
margin: 2px 0;
|
|
4325
4325
|
}
|
|
4326
|
-
`,
|
|
4326
|
+
`,Id=c.div`
|
|
4327
4327
|
font-weight: bold;
|
|
4328
4328
|
line-height: normal;
|
|
4329
4329
|
|
|
@@ -4332,7 +4332,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4332
4332
|
@container (max-width: 480px) {
|
|
4333
4333
|
font-size: 12px;
|
|
4334
4334
|
}
|
|
4335
|
-
`,
|
|
4335
|
+
`,zd=c.div`
|
|
4336
4336
|
display: flex;
|
|
4337
4337
|
align-items: center;
|
|
4338
4338
|
font-size: 14px;
|
|
@@ -4360,9 +4360,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4360
4360
|
font-size: 16px;
|
|
4361
4361
|
font-weight: bold;
|
|
4362
4362
|
cursor: pointer;
|
|
4363
|
-
`;const
|
|
4363
|
+
`;const Fd=c.div`
|
|
4364
4364
|
position: relative;
|
|
4365
|
-
`;c(
|
|
4365
|
+
`;c(Fd)`
|
|
4366
4366
|
&:nth-child(2n) {
|
|
4367
4367
|
@media (max-width: 768px) {
|
|
4368
4368
|
display: none;
|
|
@@ -4380,7 +4380,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4380
4380
|
display: none;
|
|
4381
4381
|
}
|
|
4382
4382
|
}
|
|
4383
|
-
`;const
|
|
4383
|
+
`;const Dd=c.div`
|
|
4384
4384
|
flex: 0 0 auto;
|
|
4385
4385
|
max-width: 20px;
|
|
4386
4386
|
font-size: 32px;
|
|
@@ -4405,11 +4405,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4405
4405
|
color: #717171;
|
|
4406
4406
|
z-index: 2;
|
|
4407
4407
|
}
|
|
4408
|
-
`,
|
|
4408
|
+
`,Pd=c.div`
|
|
4409
4409
|
position: relative;
|
|
4410
4410
|
display: inline-block;
|
|
4411
4411
|
min-width: 100px;
|
|
4412
|
-
`,
|
|
4412
|
+
`,Ad=c.div`
|
|
4413
4413
|
display: flex;
|
|
4414
4414
|
align-items: center;
|
|
4415
4415
|
justify-content: space-between;
|
|
@@ -4427,7 +4427,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4427
4427
|
@container (max-width: 480px) {
|
|
4428
4428
|
padding: 4px 6px;
|
|
4429
4429
|
}
|
|
4430
|
-
`,
|
|
4430
|
+
`,_d=c.div`
|
|
4431
4431
|
display: flex;
|
|
4432
4432
|
align-items: center;
|
|
4433
4433
|
gap: 6px;
|
|
@@ -4437,11 +4437,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4437
4437
|
&:hover {
|
|
4438
4438
|
cursor: pointer;
|
|
4439
4439
|
}
|
|
4440
|
-
`,
|
|
4440
|
+
`,Rd=c(Me)`
|
|
4441
4441
|
font-size: 14px;
|
|
4442
4442
|
transition: transform 0.2s ease;
|
|
4443
4443
|
transform: ${({$isOpen:e})=>e?"rotate(180deg)":"rotate(0deg)"};
|
|
4444
|
-
`,
|
|
4444
|
+
`,Od=c.div`
|
|
4445
4445
|
position: absolute;
|
|
4446
4446
|
top: 100%;
|
|
4447
4447
|
left: 0;
|
|
@@ -4453,7 +4453,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4453
4453
|
z-index: 1000;
|
|
4454
4454
|
max-height: 200px;
|
|
4455
4455
|
overflow-y: auto;
|
|
4456
|
-
`,
|
|
4456
|
+
`,Ld=c.div`
|
|
4457
4457
|
display: flex;
|
|
4458
4458
|
align-items: center;
|
|
4459
4459
|
padding: 8px;
|
|
@@ -4466,9 +4466,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4466
4466
|
&:hover {
|
|
4467
4467
|
background-color: ${({$isSelected:e})=>e?"#F7F7F7":"#F9F9F9"};
|
|
4468
4468
|
}
|
|
4469
|
-
`,
|
|
4469
|
+
`,Md=c.span`
|
|
4470
4470
|
font-weight: 500;
|
|
4471
|
-
`,
|
|
4471
|
+
`,jd=c.div`
|
|
4472
4472
|
width: 14px;
|
|
4473
4473
|
height: 14px;
|
|
4474
4474
|
border-radius: 50%;
|
|
@@ -4476,7 +4476,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4476
4476
|
border: 1px solid #e4e4e4;
|
|
4477
4477
|
flex-shrink: 0;
|
|
4478
4478
|
line-height: normal;
|
|
4479
|
-
`,
|
|
4479
|
+
`,Vd=c.img`
|
|
4480
4480
|
width: 16px;
|
|
4481
4481
|
height: 16px;
|
|
4482
4482
|
border-radius: 50%;
|
|
@@ -4484,14 +4484,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4484
4484
|
border: 1px solid #e4e4e4;
|
|
4485
4485
|
flex-shrink: 0;
|
|
4486
4486
|
line-height: normal;
|
|
4487
|
-
`,
|
|
4487
|
+
`,Wd=c.div`
|
|
4488
4488
|
display: flex;
|
|
4489
4489
|
flex-direction: row;
|
|
4490
4490
|
gap: 5px;
|
|
4491
4491
|
align-items: center;
|
|
4492
4492
|
|
|
4493
4493
|
flex-wrap: wrap;
|
|
4494
|
-
`,
|
|
4494
|
+
`,Hd=c.div`
|
|
4495
4495
|
display: flex;
|
|
4496
4496
|
flex-direction: row;
|
|
4497
4497
|
gap: 8px;
|
|
@@ -4507,15 +4507,15 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4507
4507
|
@media (max-width: 600px) {
|
|
4508
4508
|
display: none;
|
|
4509
4509
|
}
|
|
4510
|
-
`;const
|
|
4510
|
+
`;const qd=c.div`
|
|
4511
4511
|
position: absolute;
|
|
4512
4512
|
z-index: 2;
|
|
4513
4513
|
display: flex;
|
|
4514
4514
|
align-items: center;
|
|
4515
4515
|
justify-content: center;
|
|
4516
|
-
`,
|
|
4516
|
+
`,Qd=c.input`
|
|
4517
4517
|
display: none;
|
|
4518
|
-
`,
|
|
4518
|
+
`,Ud=c.label.attrs({className:"yt-fixed-bundle-checkbox-label"})`
|
|
4519
4519
|
width: 18px;
|
|
4520
4520
|
height: 18px;
|
|
4521
4521
|
border: 1.5px solid ${({borderColor:e})=>e+"80"||"#ccc"};
|
|
@@ -4532,13 +4532,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4532
4532
|
font-size: 14px;
|
|
4533
4533
|
visibility: ${({isChecked:e})=>e?"visible":"hidden"};
|
|
4534
4534
|
}
|
|
4535
|
-
`,
|
|
4535
|
+
`,Yd=c.div`
|
|
4536
4536
|
|
|
4537
|
-
`,
|
|
4537
|
+
`,Gd=c(qd)`
|
|
4538
4538
|
top: ${({isImage:e})=>e?"0px":"10px"} !important;
|
|
4539
4539
|
left: ${({isImage:e})=>e?"0px":"10px"} !important;
|
|
4540
4540
|
position: ${({isImage:e})=>e?"relative":"absolute"} !important
|
|
4541
|
-
`,
|
|
4541
|
+
`,Xd=c.div`
|
|
4542
4542
|
position: fixed;
|
|
4543
4543
|
top: 0;
|
|
4544
4544
|
left: 0;
|
|
@@ -4551,7 +4551,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4551
4551
|
display: flex;
|
|
4552
4552
|
align-items: center;
|
|
4553
4553
|
justify-content: center;
|
|
4554
|
-
`,
|
|
4554
|
+
`,Zd=c.div`
|
|
4555
4555
|
background: white;
|
|
4556
4556
|
border-radius: 20px;
|
|
4557
4557
|
width: fit-content;
|
|
@@ -4567,7 +4567,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4567
4567
|
max-width: 80vw;
|
|
4568
4568
|
min-width: 80vw;
|
|
4569
4569
|
}
|
|
4570
|
-
`,
|
|
4570
|
+
`,Jd=c.div`
|
|
4571
4571
|
width: 100%;
|
|
4572
4572
|
padding: 8px;
|
|
4573
4573
|
font-weight: 600;
|
|
@@ -4577,7 +4577,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4577
4577
|
|
|
4578
4578
|
text-align: center;
|
|
4579
4579
|
padding: 10px 0;
|
|
4580
|
-
`,
|
|
4580
|
+
`,Kd=c.button`
|
|
4581
4581
|
width: 100%;
|
|
4582
4582
|
font-size: 14px;
|
|
4583
4583
|
font-weight: 600;
|
|
@@ -4673,7 +4673,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4673
4673
|
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
4674
4674
|
background-color: ${e=>e.disabled?"#f3f3f3bd":"#f3f3f35f"};
|
|
4675
4675
|
}
|
|
4676
|
-
`,
|
|
4676
|
+
`,sp=c.img`
|
|
4677
4677
|
width: 16px;
|
|
4678
4678
|
height: 16px;
|
|
4679
4679
|
border-radius: 50%;
|
|
@@ -4685,11 +4685,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4685
4685
|
&:hover {
|
|
4686
4686
|
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
4687
4687
|
}
|
|
4688
|
-
`,
|
|
4688
|
+
`,dp=c.span`
|
|
4689
4689
|
font-size: 12px;
|
|
4690
|
-
`,pp=({productsWithIndices:r,isOpen:i,onClose:a,cta:l,variantOptions:c,onVariantChange:d,handleAddToCart:s,primaryProductId:p,variantId:u})=>{const m=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[g,x]=t({}),[f,y]=t({});n(()=>{const e={},t={};r?.forEach(({product:n,index:o})=>{let r,i=[];if(n.productId===p&&u){const e=n?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;e&&m(n.productDetails,e.id)>0&&(i=e.title.split(" / "),r=e)}if(!i.length){const e=n.productDetails.variants.edges.find(e=>m(n.productDetails,e?.node?.id)>0)?.node||n?.productDetails?.variants?.edges?.[0]?.node;e?(i=e.title.split(" / "),r=e):i=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[o]=i,r&&(t[o]={node:r},d(o,r.id))}),x(e),y(t)},[r,p,u,d,m]),n(()=>{if(!p||!u)return;const e=r?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,o=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(t.productDetails,o.id)>0){const e=o.title.split(" / ");x(t=>({...t,[n]:e})),y(e=>({...e,[n]:{node:o}})),d(n,o.id)}},[u,p,r,d,m]);const b=(e,t,n,o)=>{const r=[...g[e]||[]];r[t]=n;const i=r.join(" / "),a=o.productDetails.variants.edges.find(e=>e.node.title===i)?.node;return!!a&&m(o.productDetails,a.id)>0},h=(e,t,n)=>{const{product:o}=r?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!b(e,n,t,o))return;const i={...g};i[e][n]=t,x(i);const a=o?.productDetails?.variants?.edges?.find(t=>t.node.title===i[e].join(" / "))?.node;a&&(d(e,a.id),y(t=>({...t,[e]:{node:a}})))};if(!i)return null;const v=e.createElement(Xs,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement(Zs,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Js,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),r?.map(({product:t,index:n},o)=>e.createElement(e.Fragment,null,e.createElement(ep,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(tp,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(np,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(op,{className:"yt-fixedBundle-variant-modal_product-name"},t.productDetails.title,t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(ip,{className:"yt-fixedBundle-variant-modal_selected-value"},g[n]?.join(" / "))),t.productDetails.options.map((o,r)=>{const i=c&&c?.options?.find(e=>e.name===o.name),a=o.values.filter(e=>t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[r]===e));return 0===a.length||1===a.length&&"Default Title"===a[0]?e.createElement(e.Fragment,null):i&&"color"===i?.type?e.createElement(ap,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(sp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i.values.find(e=>e.name===o)?.value?e.createElement(lp,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(e=>e.name===o)?.value||o,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},e.createElement("span",null)):e.createElement(cp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):i&&"image"===i?.type?e.createElement(ap,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(sp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i?.values.find(e=>e.name===o)?.value?e.createElement(dp,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)},src:i.values.find(e=>e.name===o)?.value},e.createElement("span",null)):e.createElement(cp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):e.createElement(ap,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(sp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,i)=>{const a=!b(n,r,o,t);return e.createElement(cp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:g[n]?.[r]==o,disabled:a,onClick:()=>{h(n,o,r)}},o)}))}))),o<r.length-1&&e.createElement(rp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Ks,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:s},"Add bundle to cart")));return P.createPortal(v,document.body)},up=({options:o,selectedValue:i,onChange:a,type:l="text"})=>{const[c,d]=t(!1),s=r(null);n(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=t=>"color"===l?e.createElement(js,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Vs,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(Ps,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:s},e.createElement(As,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>d(!c)},e.createElement(_s,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},i&&("color"===l||"image"===l)&&p(i),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},i&&i.name)),e.createElement(Rs,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(Os,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},o?.map(t=>e.createElement(Ls,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(i?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:i?.name===t.name,onClick:()=>{t.disabled||(a(t),d(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(Ms,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},mp=({product:o,variantOptions:r,selectedVariants:i,onVariantChange:a,variantId:l,primaryProductId:c,variantType:d="dropdown"})=>{const[s,p]=t(i||[]);n(()=>{i&&i.length>0&&p(i)},[i]),n(()=>{if(l&&o.variants.edges.some(e=>e.node.id.includes(l))){const e=o.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");p(t)}}},[l,o]);const u=e=>{if(!r?.options)return"text";const t=r.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{const n=s[t];if(!n)return null;return g(e,t).find(e=>e.name===n)||null},g=(e,t)=>{const n=r?.options?.find(t=>t.name===e.name);return e.values.filter(e=>o.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const r=n?.values?.find(t=>t.name===e),i=!((e,t,n)=>{const o=[...s||[]];o[e]=t;const r=o.join(" / "),i=n.variants.edges.find(e=>e.node.title===r)?.node;return!!i&&((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0})(n,i.id)>0})(t,e,o);return{name:e,value:r?.value||e,disabled:i}})};return e.createElement(Ws,{className:"yt-fixedBundle-variant-selector-horizontal_container"},o.options.map((t,n)=>{const r=g(t,n);return 0===r.length||1===r.length&&"Default Title"===r[0].name?null:e.createElement(Hs,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(up,{options:r,selectedValue:m(t,n),onChange:e=>{((e,t)=>{const n=[...s];n[e]=t.name,p(n);const r=o.variants.edges.find(t=>t.node.title===(o.options?.length>0?n.join(" / "):n[e]))?.node.id;a(r||"")})(n,e)},type:u(t.name)}))}))},gp=({product:r,selectedVariantId:a,isChecked:l,canCustomize:c,styles:d,onVariantChange:s,onCheckChange:p,isMobile:u,isHorizontal:m,index:g,variantOptions:x,productsLength:f,handleOpenModal:y,storeCurrencyCode:b,primaryProductId:h,variantId:v,checkedProducts:w,bundleDiscountValue:C,bundleDiscountType:E,bundleProductsCount:k,totalSelectedOriginal:T})=>{const S=o(()=>e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?r?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[r]),[$,B]=t(r?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node),I=o(()=>$?.title?.split(" / ")||[],[$]),z=r?.id===h;n(()=>{if(r.id===h){const e=r?.variants?.edges?.find(e=>e?.node?.id?.includes(a))?.node;e&&S(e.id)>0&&(B(e),s(e.id))}else{const e=r?.variants?.edges?.find(e=>e?.node?.id===a)?.node||r?.variants?.edges?.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node;B(e)}},[r,h,a,v,s,S]);const F=i(e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&s(e)},[r,s]),N=parseFloat($?.price??"0"),D=((e,t,n,o,r,i)=>{if(0===o||!n)return e;if(o!==r)return e;switch(t){case"percentOff":case"percentageOff":case"percentage":case"Percentage":return e*(1-n/100);case"amountOff":case"amount":case"Amount Off":{if(i<=0)return e;const t=e/i*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/i);default:return e}})(N,E,C??0,w?.size,k,T),P=D,A=P<N&&d?.fixedBundle?.compareAtPriceVisibility,_=P.toFixed(2),R="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,O=$?.image?.url||r.featuredMedia?.preview?.image?.url;return e.createElement(e.Fragment,null,m?e.createElement("div",{className:""+(r.id===h?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px"}},c&&e.createElement(Ys,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},e.createElement(Qs,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:z}),e.createElement(Us,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${r.id}-${g}`,isChecked:l,borderRadius:d.fixedBundle?.borderRadius,borderColor:d.fixedBundle?.borderColor,backgroundColor:d.general?.ctaBackgroundColor},e.createElement(X,null))),e.createElement(as,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:d.fixedBundle?.borderRadius,border:`1px solid ${d.fixedBundle?.borderColor}80`,backgroundColor:d.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${d.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${d.fixedBundle.borderColor}80`}[d.fixedBundle.shadowType]||"none"},canCustomize:c},"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(ls,{className:"yt-fixedBundle-product-card-horizontal_image",src:Bp(O),alt:r.title,style:{borderRadius:d.fixedBundle?.borderRadius,borderColor:d.fixedBundle?.borderColor,aspectRatio:d.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(cs,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(ds,{className:"yt-fixedBundle-product-card-horizontal_title"},r.title),d.fixedBundle.productsPriceVisibility&&e.createElement(ss,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(ps,{className:"yt-fixedBundle-product-card-horizontal_price--new"},$p(d.general.currencySymbol,b)," ",Sp(_)),A&&parseFloat($.price)>parseFloat(_)&&e.createElement(us,{className:"yt-fixedBundle-product-card-horizontal_price--old"},$p(d.general.currencySymbol,b),Sp($.price))),e.createElement(mp,{product:r,variantOptions:x,selectedVariants:I,onVariantChange:F,variantId:v,primaryProductId:h})))):e.createElement(e.Fragment,null,e.createElement(ws,{className:""+(r.id===h?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:d.fixedBundle?.borderRadius,border:`1px solid ${d.fixedBundle?.borderColor}50`,backgroundColor:d.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${d.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${d.fixedBundle.borderColor}50`}[d.fixedBundle.shadowType]||"none",...c&&{position:"relative"},...R&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:d.fixedBundle?.borderRadius,borderColor:d.fixedBundle?.borderColor,backgroundColor:d.fixedBundle?.cardBackgroundColor},c&&e.createElement(Gs,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:R},e.createElement(Qs,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:z}),e.createElement(Us,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${r.id}-${g}`,isChecked:l,borderRadius:d.fixedBundle?.borderRadius,borderColor:d.fixedBundle?.borderColor,backgroundColor:d.general?.ctaBackgroundColor},e.createElement(X,{size:10}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(Cs,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:d.general.imageAspectRatio,height:"fit-content"}},e.createElement(Es,{className:"yt-fixedBundle-product-card_image--vertical",src:Bp(O),style:{aspectRatio:d.general.imageAspectRatio},alt:r.title}),r.variants.edges.length>1&&e.createElement(ks,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(Ts,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(Ss,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement($s,{className:"yt-fixedBundle-product-card_count-badge"},r.variants.edges.length,"+"))),e.createElement(Bs,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(Is,{className:"yt-fixedBundle-product-card-vertical_title"},r.title),d.fixedBundle.productsPriceVisibility&&e.createElement(Fs,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(zs,{className:"yt-fixedBundle-product-card-vertical_price--new"},$p(d.general.currencySymbol,b),Sp(_)),d.fixedBundle.compareAtPriceVisibility&&A&&parseFloat($.price)>parseFloat(_)&&e.createElement(us,{className:"yt-fixedBundle-product-card-vertical_price--old"},$p(d.general.currencySymbol,b),Sp($.price))))),(f<=3||!u)&&g<f-1&&e.createElement(Ns,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(Ds,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},xp=({bundle:r,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,d]=t(!1),[s,p]=t(window.innerWidth<786),[u,m]=t(null),[g,x]=t(!1),f="undefined"!=typeof window?window.location.href:null,y=r?.products?.find(e=>e.productDetails?.handle===f?.split("/").pop()?.split("?")[0]),b=y?.productId,h=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[v,w]=t(Object.fromEntries(r?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>h(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),C="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain),E=r?.showIndividualProductSelector??!0,[k,T]=t(new Set(r.products.reduce((e,t,n)=>(C&&t?.productId!==b&&!E||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"fixed-bundle"}});const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");m(e)},t=e=>{const t=history[e];return function(...n){const o=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),o}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),n(()=>{u&&b&&w(e=>{const t={...e};return r?.products?.forEach((e,n)=>{e.productId===b&&(t[n.toString()]=u)}),t})},[u,b,r?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const S=i((e,t)=>{w(n=>({...n,[e.toString()]:t}))},[]),$=(e,t)=>{const n=r.products[t].productId;C&&n===b||T(n=>{const o=new Set(n);return e?o.add(t):o.delete(t),o})},B=o(()=>(e,t)=>h(e.productDetails,t)>0,[h]),I=o(()=>r.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[r.products,k]),{originalPrice:z,dealPrice:F,offerValue:N}=o(()=>{const{price:e,compareAtPrice:t}=r.products.reduce((e,t,n)=>{if(!k.has(n))return e;const o=v[n.toString()];if(!o)return e;const r=t.productDetails.variants.edges?.find(e=>e.node.id===o)?.node;if(!r)return e;const i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);k.size===r.products.length&&(r?.percentageOff?o=e*(1-r.percentageOff/100):r?.dealAmount?o=r.dealAmount:r?.amountOff&&(o=e-r.amountOff));const i=t-o;return{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),offerValue:i.toFixed(2)}},[r.products,v,k,r.percentageOff,r.dealAmount,r.amountOff]),D=o(()=>r.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[r.products,k]),P=D.every(({product:e,index:t})=>B(e,v[t.toString()])),A=o(()=>{let e=0;return r.products.forEach((t,n)=>{if(k.has(n)){const o=v[n.toString()],r=t.productDetails.variants.edges.find(e=>e.node.id===o)?.node.price??"0";e+=parseFloat(r)}}),e},[r.products,k,v]),_=async e=>{if(P){e.preventDefault(),e.stopPropagation(),d(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"fixed-bundle",selectedProducts:D?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const e=Object.entries(v).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);a&&await a(Number(z),e)}catch(e){console.error("Error adding to cart:",e)}d(!1)}};if(!a)return e.createElement(e.Fragment,null);const R=r.customizations,O=R.fixedBundle?.cardLayoutStyle||"auto",L="horizontal"===O||"auto"===O&&s,M="bundles"==r.appName?r.pageHeader?.title:r?.title,j="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement(ns,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:R.fixedBundle.sectionBackgroundColor,..."transparent"!==R.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&e.createElement(os,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:R.fixedBundle?.titleBackgroundColor||"none",color:R.fixedBundle?.titleTextColor||"black",textAlign:R.fixedBundle.infoAlignment??"center",fontSize:R.fixedBundle?.titleFontSize,..."transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),j&&e.createElement(rs,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:R.fixedBundle?.subtitleFontSize,textAlign:R.fixedBundle.infoAlignment??"center",..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},j),L?e.createElement(is,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},r?.products?.map((t,n)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(gp,{isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>S(n,e),onCheckChange:e=>{$(e,n)},isMobile:s,index:n,isHorizontal:L,variantOptions:r.variantOptions,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})))):e.createElement(hs,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(vs,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},r?.products?.map((t,n)=>e.createElement(gp,{key:`${t.productId}-${n}`,isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>{S(n,e)},onCheckChange:e=>$(e,n),isMobile:s,index:n,isHorizontal:L,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})),I&&e.createElement(pp,{productsWithIndices:D,isOpen:g,onClose:()=>x(!1),variantOptions:r.variantOptions,cta:{textColor:R.general.ctaTextColor,backgroundColor:R.general.ctaBackgroundColor},onVariantChange:S,handleAddToCart:_,primaryProductId:b,variantId:u||void 0}))),e.createElement(ms,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},Number(z)>0&&Number(N)>0&&R.fixedBundle.compareAtPriceVisibility&&e.createElement(gs,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(fs,{className:"yt-fixedBundle-summary_price"},$p(R.general.currencySymbol,r?.storeCurrencyCode),Sp(z))),0!==k.size&&e.createElement(xs,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(fs,{className:"yt-fixedBundle-summary_price"},$p(R.general.currencySymbol,r?.storeCurrencyCode),Sp(F))," ",Number(N)>0&&e.createElement(ys,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",$p(R.general.currencySymbol,r?.storeCurrencyCode),Sp(N)))),e.createElement(bs,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),L||!I?_(e):x(!0)},disabled:k.size<1||c||!P,style:{backgroundColor:R.general?.ctaBackgroundColor||"#121212",color:R.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${R.general?.ctaBackgroundColor||"#121212"}`,boxShadow:R.general.ctaShadowType,paddingTop:R.general?.ctaPadding,paddingBottom:R.general?.ctaPadding,borderRadius:R.general.ctaBorderRadius,width:R.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=R.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=R.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(rt,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):P?e.createElement(e.Fragment,null,R.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")))},fp=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),yp=({product:o,tierIdx:r,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:d,customizations:s,isMobile:p})=>{const[u,m]=t(0),[g,x]=t(o.variants[0]?.id.toString()||""),[f,y]=t(!0),b=o.variants.find(e=>e.id.toString()===g)||o.variants[0],h=o.images.filter(Boolean),v=()=>{h.length<=1||(m(e=>0===e?h.length-1:e-1),y(!0))},w=()=>{h.length<=1||(m(e=>e===h.length-1?0:e+1),y(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(b&&b?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=Bp(b?.featured_image?.src);e?.setAttribute("src",t)}},[b]),!i)return null;const C=h.length>1,E=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:s?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:s?.borderRadius||"12px",background:"#f5f5f5"}},h.length>0&&e.createElement(e.Fragment,null,f&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),f&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:s?.borderRadius||"12px"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:Bp(h[u]||o.images[0]),alt:o.title,onLoad:()=>y(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s?.borderRadius||"12px",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===u?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===u?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:u===h.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:u===h.length-1?.5:1}},e.createElement(L,{size:24}))))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},o.title),o.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},o.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(b.compare_at_price/100).toLocaleString())),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(d||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(o,r),disabled:!c||!b.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:s?.borderRadius||"8px",background:b.available?d||!c?"#28a745":s?.atcBg||"#007bff":"rgb(204, 204, 204)",color:s?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},d?"Added to Box":b.available?"Add to Box":"Out of Stock")),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),k=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},h.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},f&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:h[u]||o.images[0],alt:o.title,onLoad:()=>y(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===u?.5:1,cursor:0===u?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:u===h.length-1?.5:1,cursor:u===h.length-1?"not-allowed":"pointer"}},e.createElement(L,{size:20})))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},o.title),o.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},o.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(b.compare_at_price/100).toLocaleString())),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:1.7,color:"#444"}}))),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(d||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(o,r),disabled:!c||!b.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:s?.borderRadius||"8px",background:!d&&c&&b.available?s?.atcBg||"#007bff":"#28a745",color:s?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed"}},d?"Added to Box":b.available?"Add to Box":"Out of Stock"))));return P.createPortal(p?k:E,document.body)},bp=({title:t,uploadState:n,onUpload:o,onRemove:r,onRetry:i})=>{const a="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return e.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},e.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},t),a&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},e.createElement(fp,null)," Uploading ",n?.name,"...")),l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:i,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!a&&!l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},e.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),e.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:r,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:o,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},hp=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)||0}, ${parseInt(n.substring(2,4),16)||0}, ${parseInt(n.substring(4,6),16)||0}, ${t})`};return"tabs"===t?.categoryFilterOnPage?e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-collection-bundle-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?c:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(c,.07):"transparent",borderBottom:i?`2px solid ${c}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=c)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.slice(1)))}))):e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-collection-bundle-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>{const i=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?i:"#e0e0e0"}`,borderRadius:l,backgroundColor:r===o?i:"white",color:r===o?"white":"#333",cursor:"pointer"}},o.charAt(0).toUpperCase()+o.slice(1))})))},vp=e=>{if(e.metafields&&e.metafields.yourtoken_bundles_app&&e.metafields.yourtoken_bundles_app.categories){const t=e.metafields.yourtoken_bundles_app.categories;if(Array.isArray(t))return t;if("string"==typeof t)try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch(e){console.error("Failed to parse categories:",e)}}return[]},wp=({config:o,bundleAddToCartLoading:a,addCustomBundleToCart:l})=>{const[c,d]=t(1),[s,p]=t("All"),[u,m]=t([]),[g,x]=t(null),[f,y]=t({}),[b,h]=t(window.innerWidth<640),[v,w]=t({}),C=r(new Map),[E,k]=t(!1),T=r(null),S=r(new Map),[$,B]=t(160),I=b?8:20,{customizations:z}=o,F=o.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),N=!!o.config.form,D=F.length+(N?1:0),P=z.hideSelectedProducts,A=z.allowMultipleQty,_=z.hideOutOfStockProducts,R=i((e,t=s)=>{const n=F[e-1]?.products||[],o="All"===t?n:n.filter(e=>vp(e).includes(t));return _?o.filter(e=>e.available):o},[F,s,_]),O=i(e=>{const t=R(e).length;w(n=>{const o=n[e]||0,r=Math.min(o+8,t);return r<=o?n:{...n,[e]:r}})},[8,R]);n(()=>(T.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===c&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{T.current?.disconnect()}),[O,c]),n(()=>{p("All")},[c]),n(()=>{if(N&&c===D)return;const e=c,t=R(e).length;w(n=>{const o=n[`${e}_category`]!==s;return 0===(n[e]||0)||o?{...n,[e]:Math.min(I,t),[`${e}_category`]:s}:n})},[c,I,s,R]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>h(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const L=i(e=>{B(e+10)},[]),M=u.reduce((e,t)=>e+t.quantity,0),j=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,V=u.reduce((e,t)=>{const n=F.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),o=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(o?.compare_at_price??t.price)*t.quantity},0)/100,W=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const o=document.querySelector(`[data-product-id="${e.id}"]`);o&&(o.dataset.selectedVariant=t,o.dataset.currentPrice=n.price.toString())},H=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const o=n.dataset.selectedVariant||e.variants[0].id.toString(),r=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());m(n=>{const i=`${e.id}-${o}-${t}`,a=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(a)return n.filter(e=>e!==a);const l=U[t],c=q(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:o,price:r,quantity:1,tierIndex:t}]})},q=e=>{const t=F[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},Q=(e,t)=>{const n=q(t);if(n===1/0)return!0;const o=U[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||o<n},U=F.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),Y=(e,t,n)=>{const o=q(n);if(o===1/0)return!0;return U[n]<o},G=e=>{if(!C.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");y(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),k(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",o=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!o.ok)throw new Error("Upload failed");return(await o.json()).url}catch(e){throw k(!1),alert("Upload failed. Try again."),e}finally{k(!1)}})(n);y(o=>({...o,[e]:{url:t,name:n.name}}))}catch{y(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),C.current.set(e,t)}return C.current.get(e)},X=N&&c===D,Z=(X?null:F[c-1])?q(c-1):0,J=F.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,o=e.find(e=>`${e.productId}-${e.variantId}`===n);return o?o.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:U[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},z.headerImage&&!z.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:z.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),z.showTierSteps&&e.createElement("div",{style:{paddingTop:z.headerImage&&!z.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(Cp,{totalSteps:D,isFormStep:X,currentStep:c,getStepTitle:e=>N&&e===D?"Customize Gift Details":F[e-1]?.title||`Step ${e}`,isMobile:b,formTitle:o?.config?.form?.title,hasForm:N,onStepClick:e=>{if(e>1&&!u.length)return alert("Add at least one product first");d(e),window.scrollTo(0,0)}})),Array.from({length:D},(e,t)=>t+1).map(t=>{const n=N&&t===D,r=n?[]:(e=>F[e-1]?.products||[])(t);let i=[];if(!n&&z.enableProductCategories){const e=new Set;r.forEach(t=>vp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const a=n?[]:R(t),l=t-1,d=a.slice(0,v[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(c===t?"yt-collection-bundle-step-content-active":""),style:{display:c===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&o.config.form?e.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${$}px`}},o?.config?.form?.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},e.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement("textarea",{key:o,className:"yt-collection-bundle-textarea",placeholder:t?.title,rows:3,maxLength:500,onChange:e=>y(t=>({...t,[o]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===t.type&&e.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},e.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n,r=f[o];return e.createElement(bp,{key:o,title:t?.title,uploadState:r,onUpload:()=>G(o).click(),onRemove:()=>y(e=>{const{[o]:t,...n}=e;return n}),onRetry:()=>G(o).click()})})))))):e.createElement(e.Fragment,null,z.enableProductCategories&&i.length>0&&e.createElement(hp,{styles:z,isMobile:b,categories:i,activeCategory:s,onCategoryChange:p}),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:b?"grid":"flex",gridTemplateColumns:b?"repeat(2,1fr)":"",flexWrap:b?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${$}px`}},d.map(t=>e.createElement(Ep,{key:t.id,product:t,tierIdx:l,customizations:z,isMobile:b,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:H,canAddProduct:Q,allowMultipleQty:A,handleVariantChange:W,canIncrement:Y,setSelectedProducts:m})),c===t&&(v[t]||0)<a.length&&e.createElement("div",{ref:e=>{const n=S.current.get(t);n&&T.current?.unobserve(n),e?(S.current.set(t,e),T.current?.observe(e)):S.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))))}),e.createElement(kp,{config:o,selectedProducts:u,selectedByTier:J,totalItems:M,totalPrice:j,totalCompareAtPrice:V,currentStep:c,totalSteps:D,currentTierMax:Z,tierSelectedCounts:U,isMobile:b,bundleAddToCartLoading:a,isUploading:E,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:P,getProductStep:e=>{for(let t=0;t<F.length;t++)if(F[t].products.some(t=>t.id.toString()===e))return t+1;return N?D:F.length},setCurrentStep:d,handleRemoveItem:(e,t,n)=>{m(o=>o.filter(o=>!(o.productId===e&&o.variantId===t&&o.tierIndex===n)))},handleCheckout:async()=>{if(c!==D||!u.length)return;const e={};N&&Object.entries(f).forEach(([t,n])=>{const o=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[o]=n:n&&"object"==typeof n&&"url"in n&&(e[o]=n.url)});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},hasForm:N,onHeightChange:L}))},Cp=({totalSteps:t,isFormStep:o,currentStep:r,getStepTitle:i,isMobile:a,formTitle:l,hasForm:c,onStepClick:d})=>{const s=e.useRef(null);return n(()=>{if(!a||!s.current)return;const e=s.current.querySelector(".yt-collection-bundle-step-item-active");e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[r,a]),e.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:a?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:a?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},e.createElement("div",{ref:s,className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:a?"flex-start":"center",gap:a?"1rem":"2rem",minWidth:a?100*t+"px":"auto",paddingInline:a?"calc(50% - 60px)":"0",scrollPaddingInline:a?"calc(50% - 60px)":"0",scrollBehavior:"smooth",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:t},(e,t)=>t+1).map(n=>e.createElement("div",{key:n,className:"yt-collection-bundle-step-item "+(r===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:a?"100px":"120px",flexShrink:0,cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>d(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},c&&n===t?e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},e.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},e.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),e.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},i(n))))),l&&c&&o&&e.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},l))},Ep=({product:n,tierIdx:o,customizations:r,isMobile:i,hoveredCard:a,setHoveredCard:l,selectedProducts:c,handleAddToBundle:d,canAddProduct:s,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:g})=>{const[x,f]=t(!1),y=document.querySelector(`[data-product-id="${n.id}"]`),b=y?.dataset.selectedVariant||n.variants[0].id.toString(),h=n.variants.find(e=>e.id.toString()===b)||n.variants[0],v=c.some(e=>e.productId===n.id.toString()&&e.variantId===b&&e.tierIndex===o),w=a===n.id,C=c.filter(e=>e.productId===n.id.toString()&&e.variantId===h.id.toString()&&e.tierIndex===o).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:n.id,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":h.id,"data-current-price":h.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:i?0:"250px",maxWidth:i?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:i?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>f(!0),onMouseEnter:()=>l(n.id),onMouseLeave:()=>l(null)},e.createElement("img",{src:Bp(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:Bp(n.images[1]||n.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?1:0,transform:"scale(1.05)"},alt:n.title}),n.variants.length>1&&e.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:e=>u(n,e.target.value),defaultValue:h.id,onClick:e=>{e.stopPropagation()}},n.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},r.productCardCategoryVisibility&&vp(n).length>0&&e.createElement("div",{className:"yt-collection-bundle-product-categories-wrapper",style:{paddingBottom:"8px"}},e.createElement("div",{className:"yt-collection-bundle-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},vp(n).slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-collection-bundle-category-tag",key:n,style:{fontSize:i?"10px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),vp(n).length>2&&e.createElement("span",{className:"yt-collection-bundle-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",vp(n).length-2," more"))),e.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:i?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:1}},n.title),e.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},e.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:i?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(h.price/100).toLocaleString()),h.compare_at_price&&h.compare_at_price>h.price&&e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(h.compare_at_price/100).toLocaleString()))),p&&C>0?e.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:h.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${h.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r&&r.quantity>1?e.map(e=>e===r?{...e,quantity:e.quantity-1}:e):r?e.filter(e=>e!==r):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},C),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:h.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{h.available&&m(n,h.id.toString(),o)&&g(e=>{const t=`${n.id}-${h.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r?e.map(e=>e===r?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:h.id.toString(),price:h.price,quantity:1,tierIndex:o}]})},disabled:!h.available||!m(n,h.id.toString(),o)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":s(n,o)&&h.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:i?"6px":"12px",fontSize:i?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:h.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{h.available&&s(n,o)&&d(n,o)},disabled:!h.available||!s(n,o)},v?"Added":h.available?"ADD TO BOX":"Out of Stock")),x&&e.createElement(yp,{product:n,tierIdx:o,isOpen:x,onClose:()=>f(!1),onAddToBundle:(e,t)=>{d(e,t),f(!1)},canAdd:s(n,o),isSelected:v,customizations:r,isMobile:i}))},kp=o=>{const{config:i,selectedProducts:a,selectedByTier:l,totalItems:c,totalPrice:d,totalCompareAtPrice:s,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:g,isMobile:x,bundleAddToCartLoading:f,isUploading:y,hoveredCard:b,setHoveredCard:h,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:E,hasForm:k,onHeightChange:T}=o,{customizations:S}=i,[$,B]=t(!1),I=r(null),z=r(null),{totalOriginal:F,hasSavings:N,formattedSavings:D,totalAfterDiscount:P}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:o})=>{const r=o?.discountData;let i=0;e.forEach(e=>{const t=(e.price||0)/100,n=e.quantity||1;i+=t*n}),t+=i;let a=i;if("mov_percentage"===r?.type&&r.tiers?.length){const e=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity).filter(e=>i>=e.minimumQuantity);if(e.length>0){const t=e.reduce((e,t)=>t.discountValue>e.discountValue?t:e).discountValue/100;a=i*(1-t)}}n+=a});const o=Math.round(t-n),r=o>0;return{savings:o,totalOriginal:t,totalAfterDiscount:n,hasSavings:r,formattedSavings:r?`₹${o.toLocaleString()}`:"",calculatedDiscountedTotal:Math.round(n)}})(l),A=l.filter(({count:e})=>e>0).map(({tier:e,items:t})=>{const n=t.reduce((e,t)=>{if(!t)return e;return e+(t.price||0)*(t.quantity||1)},0)/100;return((e,t,n)=>{const o=e.discountData;if(!o||!o.tiers?.length)return null;const r=[...o.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),i=[];if("mov_percentage"===o.type){if("number"!=typeof n)return null;const e=r.filter(e=>n>=e.minimumQuantity).pop();e&&i.push(`${e.discountValue}% OFF`);const t=r.find(e=>n<e.minimumQuantity);if(t){const e=t.minimumQuantity-n;i.push(`Add ₹${e} more to get ${t.discountValue}% OFF`)}return i.length?i.join(" + "):null}const a=r.filter(e=>t>=e.minimumQuantity);if(a.length>0){const e=a.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t);let t=null;switch(o.type){case"percentage_discount_coupon":t=`${e.discountValue}% OFF`;break;case"amount_discount_coupon":t=`₹${e.discountValue} OFF`;break;case"fixed_price_collection":t=`Fixed ₹${e.discountValue}`;break;case"dummy_coupon":t="Discount Applied"}t&&i.push(t)}const l=r.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(o.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`₹${l.discountValue} OFF`;break;case"fixed_price_collection":n=`Fixed ₹${l.discountValue}`;break;case"dummy_coupon":n="Discount"}n&&i.push(`Add ${e} more item${1!==e?"s":""} to get ${n}`)}return i.length?i.join(" + "):null})(e,t.length,n)}).filter(Boolean);return n(()=>{const e=m!==1/0&&g[p-1]===m-2&&m>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,g,p]),n(()=>{if(I.current&&T){const e=I.current.offsetHeight;T(e)}},[x,T,a]),n(()=>{const e=Math.max(...l.map(({tier:e,items:t})=>{if("mov_percentage"!==e?.discountData?.type)return 0;const n=t.reduce((e,t)=>e+(t.price||0)*(t.quantity||1),0)/100,o=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return o?.discountValue??0}));if(e<(z.current??0)&&(z.current=e),e>(z.current??0)){z.current=e;const t=document.querySelector(".yt-collection-bundle-next-btn");if(!t)return;const n=t.getBoundingClientRect(),o=(n.left+n.width/2)/window.innerWidth,r=(n.top+n.height/2)/window.innerHeight;ve({particleCount:100,spread:70,origin:{x:o,y:r},zIndex:9999})}},[l]),e.createElement("div",{ref:I,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},A.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},A.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&e.createElement(e.Fragment,null,e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),e.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",e.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),a.length>0&&e.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},e.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},l.filter(({count:e})=>e>0).map(({items:t},n,o)=>e.createElement(e.Fragment,{key:n},e.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},e.createElement("div",{style:{display:"flex",gap:"4px"}},t.map((t,o)=>{const r=i.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!r)return null;const a=v(t.productId),l=p===a;return e.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},e.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&w(a)},e.createElement("img",{src:Bp(r.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),t.quantity>1&&e.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",t.quantity),e.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:e=>{e.stopPropagation(),C(t.productId,t.variantId,n)}},"×")))}))),n<o.length-1&&o[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(U,null)))))),x?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||i?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:c>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",alignItems:"center",borderRadius:S?.borderRadius||"8px"}},e.createElement(e.Fragment,null,0===c&&e.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===c&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px",width:"100%",justifyContent:"center",flexWrap:"wrap"}},e.createElement("div",{style:{fontSize:"14px",color:"#000",fontWeight:600}},"₹",(P??d).toLocaleString()),N?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",F.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):e.createElement(e.Fragment,null,s>d&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",s.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===c||y?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(fp,null)):p===u?"Checkout":"Next"))):e.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===b&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===c&&{padding:"12px 24px"}}},0===c&&e.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",justifyContent:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#000",fontWeight:600}},"₹",(P??d).toLocaleString()),N?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",F.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):e.createElement(e.Fragment,null,s>d&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",s.toLocaleString())),e.createElement("span",{style:{fontSize:"16px",color:"#000",fontWeight:500}},"(",c," items)"))),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===c||y?.6:1,...-2===b&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y,onMouseEnter:()=>h(-2),onMouseLeave:()=>h(null)},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(fp,null)):p===u?"Checkout":"Next")))},Tp=window?.Shopify?.currency||{rate:1,active:"INR"},Sp=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Tp.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},$p=(e,t)=>t==Tp.active?e:de(Tp.active)||Tp.active,Bp=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality",t?.toString()||"70"),o.has("width")||o.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},Ip=(e,t,n,o,r,i,a)=>{const l=o.findIndex(t=>t.variantId===e&&(void 0===a||t.tierIndex===a));r(0===n?e=>e.filter((e,t)=>t!==l):-1===l?o=>[...o,{product:t,variantId:e,quantity:n,isFree:i,tierIndex:a}]:e=>e.map((e,t)=>t===l?{...e,quantity:e.quantity+n,isFree:i,tierIndex:a}:e))},zp=({bundle:t,currentProductId:n,addToCartFunction:o,addCustomBundleToCart:r,selectedItems:i,setSelectedItems:a,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:d,renderingOnPage:s,bundleSubtotal:p,dispatchAnalyticsEvent:u,fetchStoreDetails:m})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Wc,{bundleAddToCartLoading:l,bundle:t,selectedItems:i,setSelectedItems:a,handleAddToCart:r,handleRemoveItem:c,renderingOnPage:s,selectedItemsQuantity:d??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:u,fetchStoreDetails:m}):"combo"===t.type?e.createElement(qc,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(ts,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(wp,{config:t,addCustomBundleToCart:r,bundleAddToCartLoading:l}):e.createElement(Cd,{bundle:t,currentProductId:n,addToCartFunction:o,dispatchAnalyticsEvent:u}):e.createElement(xp,{addToCartFunction:o,bundle:t,dispatchAnalyticsEvent:u}),Fp=c.div`
|
|
4690
|
+
`,pp=({productsWithIndices:r,isOpen:i,onClose:a,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[g,x]=t({}),[f,y]=t({});n(()=>{const e={},t={};r?.forEach(({product:n,index:o})=>{let r,i=[];if(n.productId===p&&u){const e=n?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;e&&m(n.productDetails,e.id)>0&&(i=e.title.split(" / "),r=e)}if(!i.length){const e=n.productDetails.variants.edges.find(e=>m(n.productDetails,e?.node?.id)>0)?.node||n?.productDetails?.variants?.edges?.[0]?.node;e?(i=e.title.split(" / "),r=e):i=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[o]=i,r&&(t[o]={node:r},s(o,r.id))}),x(e),y(t)},[r,p,u,s,m]),n(()=>{if(!p||!u)return;const e=r?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,o=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(t.productDetails,o.id)>0){const e=o.title.split(" / ");x(t=>({...t,[n]:e})),y(e=>({...e,[n]:{node:o}})),s(n,o.id)}},[u,p,r,s,m]);const b=(e,t,n,o)=>{const r=[...g[e]||[]];r[t]=n;const i=r.join(" / "),a=o.productDetails.variants.edges.find(e=>e.node.title===i)?.node;return!!a&&m(o.productDetails,a.id)>0},h=(e,t,n)=>{const{product:o}=r?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!b(e,n,t,o))return;const i={...g};i[e][n]=t,x(i);const a=o?.productDetails?.variants?.edges?.find(t=>t.node.title===i[e].join(" / "))?.node;a&&(s(e,a.id),y(t=>({...t,[e]:{node:a}})))};if(!i)return null;const v=e.createElement(Xd,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement(Zd,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Jd,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),r?.map(({product:t,index:n},o)=>e.createElement(e.Fragment,null,e.createElement(ep,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(tp,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(np,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(op,{className:"yt-fixedBundle-variant-modal_product-name"},t.productDetails.title,t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(ip,{className:"yt-fixedBundle-variant-modal_selected-value"},g[n]?.join(" / "))),t.productDetails.options.map((o,r)=>{const i=c&&c?.options?.find(e=>e.name===o.name),a=o.values.filter(e=>t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[r]===e));return 0===a.length||1===a.length&&"Default Title"===a[0]?e.createElement(e.Fragment,null):i&&"color"===i?.type?e.createElement(ap,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(dp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i.values.find(e=>e.name===o)?.value?e.createElement(lp,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(e=>e.name===o)?.value||o,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},e.createElement("span",null)):e.createElement(cp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):i&&"image"===i?.type?e.createElement(ap,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(dp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,a)=>{const l=!b(n,r,o,t);return e.createElement(e.Fragment,null,i?.values.find(e=>e.name===o)?.value?e.createElement(sp,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)},src:i.values.find(e=>e.name===o)?.value},e.createElement("span",null)):e.createElement(cp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):e.createElement(ap,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(dp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,i)=>{const a=!b(n,r,o,t);return e.createElement(cp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:g[n]?.[r]==o,disabled:a,onClick:()=>{h(n,o,r)}},o)}))}))),o<r.length-1&&e.createElement(rp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Kd,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return P.createPortal(v,document.body)},up=({options:o,selectedValue:i,onChange:a,type:l="text"})=>{const[c,s]=t(!1),d=r(null);n(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=t=>"color"===l?e.createElement(jd,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Vd,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(Pd,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(Ad,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(_d,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},i&&("color"===l||"image"===l)&&p(i),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},i&&i.name)),e.createElement(Rd,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(Od,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},o?.map(t=>e.createElement(Ld,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(i?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:i?.name===t.name,onClick:()=>{t.disabled||(a(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(Md,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},mp=({product:o,variantOptions:r,selectedVariants:i,onVariantChange:a,variantId:l,primaryProductId:c,variantType:s="dropdown"})=>{const[d,p]=t(i||[]);n(()=>{i&&i.length>0&&p(i)},[i]),n(()=>{if(l&&o.variants.edges.some(e=>e.node.id.includes(l))){const e=o.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");p(t)}}},[l,o]);const u=e=>{if(!r?.options)return"text";const t=r.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{const n=d[t];if(!n)return null;return g(e,t).find(e=>e.name===n)||null},g=(e,t)=>{const n=r?.options?.find(t=>t.name===e.name);return e.values.filter(e=>o.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const r=n?.values?.find(t=>t.name===e),i=!((e,t,n)=>{const o=[...d||[]];o[e]=t;const r=o.join(" / "),i=n.variants.edges.find(e=>e.node.title===r)?.node;return!!i&&((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0})(n,i.id)>0})(t,e,o);return{name:e,value:r?.value||e,disabled:i}})};return e.createElement(Wd,{className:"yt-fixedBundle-variant-selector-horizontal_container"},o.options.map((t,n)=>{const r=g(t,n);return 0===r.length||1===r.length&&"Default Title"===r[0].name?null:e.createElement(Hd,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(up,{options:r,selectedValue:m(t,n),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(n);const r=o.variants.edges.find(t=>t.node.title===(o.options?.length>0?n.join(" / "):n[e]))?.node.id;a(r||"")})(n,e)},type:u(t.name)}))}))},gp=({product:r,selectedVariantId:a,isChecked:l,canCustomize:c,styles:s,onVariantChange:d,onCheckChange:p,isMobile:u,isHorizontal:m,index:g,variantOptions:x,productsLength:f,handleOpenModal:y,storeCurrencyCode:b,primaryProductId:h,variantId:v,checkedProducts:w,bundleDiscountValue:C,bundleDiscountType:E,bundleProductsCount:k,totalSelectedOriginal:T})=>{const S=o(()=>e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?r?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[r]),[$,N]=t(r?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node),B=o(()=>$?.title?.split(" / ")||[],[$]),I=r?.id===h;n(()=>{if(r.id===h){const e=r?.variants?.edges?.find(e=>e?.node?.id?.includes(a))?.node;e&&S(e.id)>0&&(N(e),d(e.id))}else{const e=r?.variants?.edges?.find(e=>e?.node?.id===a)?.node||r?.variants?.edges?.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node;N(e)}},[r,h,a,v,d,S]);const z=i(e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[r,d]),F=parseFloat($?.price??"0"),D=((e,t,n,o,r,i)=>{if(0===o||!n)return e;if(o!==r)return e;switch(t){case"percentOff":case"percentageOff":case"percentage":case"Percentage":return e*(1-n/100);case"amountOff":case"amount":case"Amount Off":{if(i<=0)return e;const t=e/i*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/i);default:return e}})(F,E,C??0,w?.size,k,T),P=D,A=P<F&&s?.fixedBundle?.compareAtPriceVisibility,_=P.toFixed(2),R="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,O=$?.image?.url||r.featuredMedia?.preview?.image?.url;return e.createElement(e.Fragment,null,m?e.createElement("div",{className:""+(r.id===h?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px"}},c&&e.createElement(Yd,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},e.createElement(Qd,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:I}),e.createElement(Ud,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${r.id}-${g}`,isChecked:l,borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.general?.ctaBackgroundColor},e.createElement(X,null))),e.createElement(ad,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}80`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${s.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}80`}[s.fixedBundle.shadowType]||"none"},canCustomize:c},"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(ld,{className:"yt-fixedBundle-product-card-horizontal_image",src:Np(O),alt:r.title,style:{borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(cd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(sd,{className:"yt-fixedBundle-product-card-horizontal_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(dd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(pd,{className:"yt-fixedBundle-product-card-horizontal_price--new"},$p(s.general.currencySymbol,b)," ",Sp(_)),A&&parseFloat($.price)>parseFloat(_)&&e.createElement(ud,{className:"yt-fixedBundle-product-card-horizontal_price--old"},$p(s.general.currencySymbol,b),Sp($.price))),e.createElement(mp,{product:r,variantOptions:x,selectedVariants:B,onVariantChange:z,variantId:v,primaryProductId:h})))):e.createElement(e.Fragment,null,e.createElement(wd,{className:""+(r.id===h?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}50`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${s.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}50`}[s.fixedBundle.shadowType]||"none",...c&&{position:"relative"},...R&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.fixedBundle?.cardBackgroundColor},c&&e.createElement(Gd,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:R},e.createElement(Qd,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${r.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:I}),e.createElement(Ud,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${r.id}-${g}`,isChecked:l,borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.general?.ctaBackgroundColor},e.createElement(X,{size:10}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(Cd,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(Ed,{className:"yt-fixedBundle-product-card_image--vertical",src:Np(O),style:{aspectRatio:s.general.imageAspectRatio},alt:r.title}),r.variants.edges.length>1&&e.createElement(kd,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(Td,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(Sd,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement($d,{className:"yt-fixedBundle-product-card_count-badge"},r.variants.edges.length,"+"))),e.createElement(Nd,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(Bd,{className:"yt-fixedBundle-product-card-vertical_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(zd,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(Id,{className:"yt-fixedBundle-product-card-vertical_price--new"},$p(s.general.currencySymbol,b),Sp(_)),s.fixedBundle.compareAtPriceVisibility&&A&&parseFloat($.price)>parseFloat(_)&&e.createElement(ud,{className:"yt-fixedBundle-product-card-vertical_price--old"},$p(s.general.currencySymbol,b),Sp($.price))))),(f<=3||!u)&&g<f-1&&e.createElement(Fd,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(Dd,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},xp=({bundle:r,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[u,m]=t(null),[g,x]=t(!1),f="undefined"!=typeof window?window.location.href:null,y=r?.products?.find(e=>e.productDetails?.handle===f?.split("/").pop()?.split("?")[0]),b=y?.productId,h=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e?.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[v,w]=t(Object.fromEntries(r?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>h(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),C="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain),E=r?.showIndividualProductSelector??!0,[k,T]=t(new Set(r.products.reduce((e,t,n)=>(C&&t?.productId!==b&&!E||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"fixed-bundle"}});const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");m(e)},t=e=>{const t=history[e];return function(...n){const o=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),o}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),n(()=>{u&&b&&w(e=>{const t={...e};return r?.products?.forEach((e,n)=>{e.productId===b&&(t[n.toString()]=u)}),t})},[u,b,r?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const S=i((e,t)=>{w(n=>({...n,[e.toString()]:t}))},[]),$=(e,t)=>{const n=r.products[t].productId;C&&n===b||T(n=>{const o=new Set(n);return e?o.add(t):o.delete(t),o})},N=o(()=>(e,t)=>h(e.productDetails,t)>0,[h]),B=o(()=>r.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[r.products,k]),{originalPrice:I,dealPrice:z,offerValue:F}=o(()=>{const{price:e,compareAtPrice:t}=r.products.reduce((e,t,n)=>{if(!k.has(n))return e;const o=v[n.toString()];if(!o)return e;const r=t.productDetails.variants.edges?.find(e=>e.node.id===o)?.node;if(!r)return e;const i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);k.size===r.products.length&&(r?.percentageOff?o=e*(1-r.percentageOff/100):r?.dealAmount?o=r.dealAmount:r?.amountOff&&(o=e-r.amountOff));const i=t-o;return{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),offerValue:i.toFixed(2)}},[r.products,v,k,r.percentageOff,r.dealAmount,r.amountOff]),D=o(()=>r.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[r.products,k]),P=D.every(({product:e,index:t})=>N(e,v[t.toString()])),A=o(()=>{let e=0;return r.products.forEach((t,n)=>{if(k.has(n)){const o=v[n.toString()],r=t.productDetails.variants.edges.find(e=>e.node.id===o)?.node.price??"0";e+=parseFloat(r)}}),e},[r.products,k,v]),_=async e=>{if(P){e.preventDefault(),e.stopPropagation(),s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"fixed-bundle",selectedProducts:D?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const e=Object.entries(v).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);a&&await a(Number(I),e)}catch(e){console.error("Error adding to cart:",e)}s(!1)}};if(!a)return e.createElement(e.Fragment,null);const R=r.customizations,O=R.fixedBundle?.cardLayoutStyle||"auto",L="horizontal"===O||"auto"===O&&d,M="bundles"==r.appName?r.pageHeader?.title:r?.title,j="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement(nd,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:R.fixedBundle.sectionBackgroundColor,..."transparent"!==R.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&e.createElement(od,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:R.fixedBundle?.titleBackgroundColor||"none",color:R.fixedBundle?.titleTextColor||"black",textAlign:R.fixedBundle.infoAlignment??"center",fontSize:R.fixedBundle?.titleFontSize,..."transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),j&&e.createElement(rd,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:R.fixedBundle?.subtitleFontSize,textAlign:R.fixedBundle.infoAlignment??"center",..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},j),L?e.createElement(id,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},r?.products?.map((t,n)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(gp,{isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>S(n,e),onCheckChange:e=>{$(e,n)},isMobile:d,index:n,isHorizontal:L,variantOptions:r.variantOptions,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})))):e.createElement(hd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(vd,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},r?.products?.map((t,n)=>e.createElement(gp,{key:`${t.productId}-${n}`,isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>{S(n,e)},onCheckChange:e=>$(e,n),isMobile:d,index:n,isHorizontal:L,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})),B&&e.createElement(pp,{productsWithIndices:D,isOpen:g,onClose:()=>x(!1),variantOptions:r.variantOptions,cta:{textColor:R.general.ctaTextColor,backgroundColor:R.general.ctaBackgroundColor},onVariantChange:S,handleAddToCart:_,primaryProductId:b,variantId:u||void 0}))),e.createElement(md,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},Number(I)>0&&Number(F)>0&&R.fixedBundle.compareAtPriceVisibility&&e.createElement(gd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(fd,{className:"yt-fixedBundle-summary_price"},$p(R.general.currencySymbol,r?.storeCurrencyCode),Sp(I))),0!==k.size&&e.createElement(xd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(fd,{className:"yt-fixedBundle-summary_price"},$p(R.general.currencySymbol,r?.storeCurrencyCode),Sp(z))," ",Number(F)>0&&e.createElement(yd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",$p(R.general.currencySymbol,r?.storeCurrencyCode),Sp(F)))),e.createElement(bd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),L||!B?_(e):x(!0)},disabled:k.size<1||c||!P,style:{backgroundColor:R.general?.ctaBackgroundColor||"#121212",color:R.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${R.general?.ctaBackgroundColor||"#121212"}`,boxShadow:R.general.ctaShadowType,paddingTop:R.general?.ctaPadding,paddingBottom:R.general?.ctaPadding,borderRadius:R.general.ctaBorderRadius,width:R.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=R.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=R.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(rt,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):P?e.createElement(e.Fragment,null,R.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")))},fp=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),yp=({product:o,tierIdx:r,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=t(0),[g,x]=t(o.variants[0]?.id.toString()||""),[f,y]=t(!0),b=o.variants.find(e=>e.id.toString()===g)||o.variants[0],h=o.images.filter(Boolean),v=()=>{h.length<=1||(m(e=>0===e?h.length-1:e-1),y(!0))},w=()=>{h.length<=1||(m(e=>e===h.length-1?0:e+1),y(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(b&&b?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=Np(b?.featured_image?.src);e?.setAttribute("src",t)}},[b]),!i)return null;const C=h.length>1,E=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px",background:"#f5f5f5"}},h.length>0&&e.createElement(e.Fragment,null,f&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),f&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:d?.borderRadius||"12px"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:Np(h[u]||o.images[0]),alt:o.title,onLoad:()=>y(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===u?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===u?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:u===h.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:u===h.length-1?.5:1}},e.createElement(L,{size:24}))))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},o.title),o.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},o.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(b.compare_at_price/100).toLocaleString()):null),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(o,r),disabled:!c||!b.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:b.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock")),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),k=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},h.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},f&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:h[u]||o.images[0],alt:o.title,onLoad:()=>y(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===u?.5:1,cursor:0===u?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:u===h.length-1?.5:1,cursor:u===h.length-1?"not-allowed":"pointer"}},e.createElement(L,{size:20})))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},o.title),o.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},o?.options?.join(" & "),":"," ",e.createElement("strong",null,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},o.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price?b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(b.compare_at_price/100).toLocaleString()):null),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:1.7,color:"#444"}}))),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(o,r),disabled:!c||!b.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&b.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock"))));return P.createPortal(p?k:E,document.body)},bp=({title:t,uploadState:n,onUpload:o,onRemove:r,onRetry:i})=>{const a="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return e.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},e.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},t),a&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},e.createElement(fp,null)," Uploading ",n?.name,"...")),l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:i,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!a&&!l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},e.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),e.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:r,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:o,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},hp=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)||0}, ${parseInt(n.substring(2,4),16)||0}, ${parseInt(n.substring(4,6),16)||0}, ${t})`};return"tabs"===t?.categoryFilterOnPage?e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-collection-bundle-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?c:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(c,.07):"transparent",borderBottom:i?`2px solid ${c}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=c)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.slice(1)))}))):e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-collection-bundle-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>{const i=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?i:"#e0e0e0"}`,borderRadius:l,backgroundColor:r===o?i:"white",color:r===o?"white":"#333",cursor:"pointer"}},o.charAt(0).toUpperCase()+o.slice(1))})))},vp=e=>{if(e.metafields&&e.metafields.yourtoken_bundles_app&&e.metafields.yourtoken_bundles_app.categories){const t=e.metafields.yourtoken_bundles_app.categories;if(Array.isArray(t))return t;if("string"==typeof t)try{const e=JSON.parse(t);if(Array.isArray(e))return e}catch(e){console.error("Failed to parse categories:",e)}}return[]},wp=({config:o,bundleAddToCartLoading:a,addCustomBundleToCart:l})=>{const[c,s]=t(1),[d,p]=t("All"),[u,m]=t([]),[g,x]=t(null),[f,y]=t({}),[b,h]=t(window.innerWidth<640),[v,w]=t({}),C=r(new Map),[E,k]=t(!1),T=r(null),S=r(new Map),[$,N]=t(160),B=b?8:20,{customizations:I}=o,z=o.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),F=!!o.config.form,D=z.length+(F?1:0),P=I.hideSelectedProducts,A=I.allowMultipleQty,_=I.hideOutOfStockProducts,R=i((e,t=d)=>{const n=z[e-1]?.products||[],o="All"===t?n:n.filter(e=>vp(e).includes(t));return _?o.filter(e=>e.available):o},[z,d,_]),O=i(e=>{const t=R(e).length;w(n=>{const o=n[e]||0,r=Math.min(o+8,t);return r<=o?n:{...n,[e]:r}})},[8,R]);n(()=>(T.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===c&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{T.current?.disconnect()}),[O,c]),n(()=>{p("All")},[c]),n(()=>{if(F&&c===D)return;const e=c,t=R(e).length;w(n=>{const o=n[`${e}_category`]!==d;return 0===(n[e]||0)||o?{...n,[e]:Math.min(B,t),[`${e}_category`]:d}:n})},[c,B,d,R]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>h(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const L=i(e=>{N(e+10)},[]),M=u.reduce((e,t)=>e+t.quantity,0),j=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,V=u.reduce((e,t)=>{const n=z.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),o=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(o?.compare_at_price??t.price)*t.quantity},0)/100,W=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const o=document.querySelector(`[data-product-id="${e.id}"]`);o&&(o.dataset.selectedVariant=t,o.dataset.currentPrice=n.price.toString())},H=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const o=n.dataset.selectedVariant||e.variants[0].id.toString(),r=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());m(n=>{const i=`${e.id}-${o}-${t}`,a=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(a)return n.filter(e=>e!==a);const l=U[t],c=q(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:o,price:r,quantity:1,tierIndex:t}]})},q=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},Q=(e,t)=>{const n=q(t);if(n===1/0)return!0;const o=U[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||o<n},U=z.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),Y=(e,t,n)=>{const o=q(n);if(o===1/0)return!0;return U[n]<o},G=e=>{if(!C.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");y(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),k(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",o=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!o.ok)throw new Error("Upload failed");return(await o.json()).url}catch(e){throw k(!1),alert("Upload failed. Try again."),e}finally{k(!1)}})(n);y(o=>({...o,[e]:{url:t,name:n.name}}))}catch{y(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),C.current.set(e,t)}return C.current.get(e)},X=F&&c===D,Z=(X?null:z[c-1])?q(c-1):0,J=z.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,o=e.find(e=>`${e.productId}-${e.variantId}`===n);return o?o.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:U[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},I.headerImage&&!I.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:I.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),I.showTierSteps&&e.createElement("div",{style:{paddingTop:I.headerImage&&!I.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(Cp,{totalSteps:D,isFormStep:X,currentStep:c,getStepTitle:e=>F&&e===D?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:b,formTitle:o?.config?.form?.title,hasForm:F,onStepClick:e=>{if(e>1&&!u.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:D},(e,t)=>t+1).map(t=>{const n=F&&t===D,r=n?[]:(e=>z[e-1]?.products||[])(t);let i=[];if(!n&&I.enableProductCategories){const e=new Set;r.forEach(t=>vp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const a=n?[]:R(t),l=t-1,s=a.slice(0,v[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(c===t?"yt-collection-bundle-step-content-active":""),style:{display:c===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&o.config.form?e.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${$}px`}},o?.config?.form?.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},e.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement("textarea",{key:o,className:"yt-collection-bundle-textarea",placeholder:t?.title,rows:3,maxLength:500,onChange:e=>y(t=>({...t,[o]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===t.type&&e.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},e.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n,r=f[o];return e.createElement(bp,{key:o,title:t?.title,uploadState:r,onUpload:()=>G(o).click(),onRemove:()=>y(e=>{const{[o]:t,...n}=e;return n}),onRetry:()=>G(o).click()})})))))):e.createElement(e.Fragment,null,I.enableProductCategories&&i.length>0&&e.createElement(hp,{styles:I,isMobile:b,categories:i,activeCategory:d,onCategoryChange:p}),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:b?"grid":"flex",gridTemplateColumns:b?"repeat(2,1fr)":"",flexWrap:b?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${$}px`}},s.map(t=>e.createElement(Ep,{key:t.id,product:t,tierIdx:l,customizations:I,isMobile:b,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:H,canAddProduct:Q,allowMultipleQty:A,handleVariantChange:W,canIncrement:Y,setSelectedProducts:m})),c===t&&(v[t]||0)<a.length&&e.createElement("div",{ref:e=>{const n=S.current.get(t);n&&T.current?.unobserve(n),e?(S.current.set(t,e),T.current?.observe(e)):S.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))))}),e.createElement(kp,{config:o,selectedProducts:u,selectedByTier:J,totalItems:M,totalPrice:j,totalCompareAtPrice:V,currentStep:c,totalSteps:D,currentTierMax:Z,tierSelectedCounts:U,isMobile:b,bundleAddToCartLoading:a,isUploading:E,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:P,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return F?D:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{m(o=>o.filter(o=>!(o.productId===e&&o.variantId===t&&o.tierIndex===n)))},handleCheckout:async()=>{if(c!==D||!u.length)return;const e={};F&&Object.entries(f).forEach(([t,n])=>{const o=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[o]=n:n&&"object"==typeof n&&"url"in n&&(e[o]=n.url)});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},hasForm:F,onHeightChange:L}))},Cp=({totalSteps:t,isFormStep:o,currentStep:r,getStepTitle:i,isMobile:a,formTitle:l,hasForm:c,onStepClick:s})=>{const d=e.useRef(null);return n(()=>{if(!a||!d.current)return;const e=d.current.querySelector(".yt-collection-bundle-step-item-active");e&&e.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[r,a]),e.createElement("div",{className:"yt-collection-bundle-steps-nav-container",style:{display:"flex",justifyContent:"center",flexDirection:"column",gap:a?"0":"1rem",overflowX:"auto",scrollbarWidth:"none",borderBottom:"1px solid #878787",marginInline:a?"0":"2%",paddingBottom:"1rem",textAlign:"center"}},e.createElement("div",{ref:d,className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:a?"flex-start":"center",gap:a?"1rem":"2rem",minWidth:a?100*t+"px":"auto",paddingInline:a?"calc(50% - 60px)":"0",scrollPaddingInline:a?"calc(50% - 60px)":"0",scrollBehavior:"smooth",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:t},(e,t)=>t+1).map(n=>e.createElement("div",{key:n,className:"yt-collection-bundle-step-item "+(r===n?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:a?"100px":"120px",flexShrink:0,cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},c&&n===t?e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},e.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},e.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),e.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},i(n))))),l&&c&&o&&e.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},l))},Ep=({product:n,tierIdx:o,customizations:r,isMobile:i,hoveredCard:a,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:g})=>{const[x,f]=t(!1),y=document.querySelector(`[data-product-id="${n.id}"]`),b=y?.dataset.selectedVariant||n.variants[0].id.toString(),h=n.variants.find(e=>e.id.toString()===b)||n.variants[0],v=c.some(e=>e.productId===n.id.toString()&&e.variantId===b&&e.tierIndex===o),w=a===n.id,C=c.filter(e=>e.productId===n.id.toString()&&e.variantId===h.id.toString()&&e.tierIndex===o).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:n.id,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":h.id,"data-current-price":h.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:i?0:"250px",maxWidth:i?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:i?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>f(!0),onMouseEnter:()=>l(n.id),onMouseLeave:()=>l(null)},e.createElement("img",{src:Np(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:Np(n.images[1]||n.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?1:0,transform:"scale(1.05)"},alt:n.title}),n.variants.length>1&&e.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:e=>u(n,e.target.value),defaultValue:h.id,onClick:e=>{e.stopPropagation()}},n.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},r.productCardCategoryVisibility&&vp(n).length>0&&e.createElement("div",{className:"yt-collection-bundle-product-categories-wrapper",style:{paddingBottom:"8px"}},e.createElement("div",{className:"yt-collection-bundle-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},vp(n).slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-collection-bundle-category-tag",key:n,style:{fontSize:i?"10px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),vp(n).length>2&&e.createElement("span",{className:"yt-collection-bundle-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",vp(n).length-2," more"))),e.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:i?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:1}},n.title),e.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},e.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:i?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(h.price/100).toLocaleString()),h.compare_at_price&&0!==h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(h.compare_at_price/100).toLocaleString()):null)),p&&C>0?e.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:h.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${h.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r&&r.quantity>1?e.map(e=>e===r?{...e,quantity:e.quantity-1}:e):r?e.filter(e=>e!==r):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},C),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:h.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{h.available&&m(n,h.id.toString(),o)&&g(e=>{const t=`${n.id}-${h.id}-${o}`,r=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return r?e.map(e=>e===r?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:h.id.toString(),price:h.price,quantity:1,tierIndex:o}]})},disabled:!h.available||!m(n,h.id.toString(),o)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(n,o)&&h.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:i?"6px":"12px",fontSize:i?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:h.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{h.available&&d(n,o)&&s(n,o)},disabled:!h.available||!d(n,o)},v?"Added":h.available?"ADD TO BOX":"Out of Stock")),x&&e.createElement(yp,{product:n,tierIdx:o,isOpen:x,onClose:()=>f(!1),onAddToBundle:(e,t)=>{s(e,t),f(!1)},canAdd:d(n,o),isSelected:v,customizations:r,isMobile:i}))},kp=o=>{const{config:i,selectedProducts:a,selectedByTier:l,totalItems:c,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:g,isMobile:x,bundleAddToCartLoading:f,isUploading:y,hoveredCard:b,setHoveredCard:h,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:E,hasForm:k,onHeightChange:T}=o,{customizations:S}=i,[$,N]=t(!1),B=r(null),I=r(null),{totalOriginal:z,hasSavings:F,formattedSavings:D,totalAfterDiscount:P}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:o})=>{const r=o?.discountData;let i=0;e.forEach(e=>{const t=(e.price||0)/100,n=e.quantity||1;i+=t*n}),t+=i;let a=i;if("mov_percentage"===r?.type&&r.tiers?.length){const e=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity).filter(e=>i>=e.minimumQuantity);if(e.length>0){const t=e.reduce((e,t)=>t.discountValue>e.discountValue?t:e).discountValue/100;a=i*(1-t)}}n+=a});const o=Math.round(t-n),r=o>0;return{savings:o,totalOriginal:t,totalAfterDiscount:n,hasSavings:r,formattedSavings:r?`₹${o.toLocaleString()}`:"",calculatedDiscountedTotal:Math.round(n)}})(l),A=l.filter(({count:e})=>e>0).map(({tier:e,items:t})=>{const n=t.reduce((e,t)=>{if(!t)return e;return e+(t.price||0)*(t.quantity||1)},0)/100;return((e,t,n)=>{const o=e.discountData;if(!o||!o.tiers?.length)return null;const r=[...o.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),i=[];if("mov_percentage"===o.type){if("number"!=typeof n)return null;const e=r.filter(e=>n>=e.minimumQuantity).pop();e&&i.push(`${e.discountValue}% OFF`);const t=r.find(e=>n<e.minimumQuantity);if(t){const e=t.minimumQuantity-n;i.push(`Add ₹${e} more to get ${t.discountValue}% OFF`)}return i.length?i.join(" + "):null}const a=r.filter(e=>t>=e.minimumQuantity);if(a.length>0){const e=a.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t);let t=null;switch(o.type){case"percentage_discount_coupon":t=`${e.discountValue}% OFF`;break;case"amount_discount_coupon":t=`₹${e.discountValue} OFF`;break;case"fixed_price_collection":t=`Fixed ₹${e.discountValue}`;break;case"dummy_coupon":t="Discount Applied"}t&&i.push(t)}const l=r.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(o.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`₹${l.discountValue} OFF`;break;case"fixed_price_collection":n=`Fixed ₹${l.discountValue}`;break;case"dummy_coupon":n="Discount"}n&&i.push(`Add ${e} more item${1!==e?"s":""} to get ${n}`)}return i.length?i.join(" + "):null})(e,t.length,n)}).filter(Boolean);return n(()=>{const e=m!==1/0&&g[p-1]===m-2&&m>1;let t=null;return e?(N(!0),t=setTimeout(()=>{N(!1)},3e3)):N(!1),()=>{t&&clearTimeout(t)}},[m,g,p]),n(()=>{if(B.current&&T){const e=B.current.offsetHeight;T(e)}},[x,T,a]),n(()=>{const e=Math.max(...l.map(({tier:e,items:t})=>{if("mov_percentage"!==e?.discountData?.type)return 0;const n=t.reduce((e,t)=>e+(t.price||0)*(t.quantity||1),0)/100,o=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return o?.discountValue??0}));if(e<(I.current??0)&&(I.current=e),e>(I.current??0)){I.current=e;const t=document.querySelector(".yt-collection-bundle-next-btn");if(!t)return;const n=t.getBoundingClientRect(),o=(n.left+n.width/2)/window.innerWidth,r=(n.top+n.height/2)/window.innerHeight;ve({particleCount:100,spread:70,origin:{x:o,y:r},zIndex:9999})}},[l]),e.createElement("div",{ref:B,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},A.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},A.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&e.createElement(e.Fragment,null,e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),e.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",e.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),a.length>0&&e.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},e.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},l.filter(({count:e})=>e>0).map(({items:t},n,o)=>e.createElement(e.Fragment,{key:n},e.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},e.createElement("div",{style:{display:"flex",gap:"4px"}},t.map((t,o)=>{const r=i.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!r)return null;const a=v(t.productId),l=p===a;return e.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},e.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&w(a)},e.createElement("img",{src:Np(r.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),t.quantity>1&&e.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",t.quantity),e.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:e=>{e.stopPropagation(),C(t.productId,t.variantId,n)}},"×")))}))),n<o.length-1&&o[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(U,null)))))),x?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||i?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:c>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",alignItems:"center",borderRadius:S?.borderRadius||"8px"}},e.createElement(e.Fragment,null,0===c&&e.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===c&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px",width:"100%",justifyContent:"center",flexWrap:"wrap"}},e.createElement("div",{style:{fontSize:"14px",color:"#000",fontWeight:600}},"₹",(P??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",z.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===c||y?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(fp,null)):p===u?"Checkout":"Next"))):e.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===b&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===c&&{padding:"12px 24px"}}},0===c&&e.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",justifyContent:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#000",fontWeight:600}},"₹",(P??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",z.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"16px",color:"#000",fontWeight:500}},"(",c," items)"))),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===c||y?.6:1,...-2===b&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y,onMouseEnter:()=>h(-2),onMouseLeave:()=>h(null)},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(fp,null)):p===u?"Checkout":"Next")))},Tp=window?.Shopify?.currency||{rate:1,active:"INR"},Sp=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Tp.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},$p=(e,t)=>t==Tp.active?e:se(Tp.active)||Tp.active,Np=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality",t?.toString()||"70"),o.has("width")||o.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},Bp=(e,t,n,o,r,i,a)=>{const l=o.findIndex(t=>t.variantId===e&&(void 0===a||t.tierIndex===a));r(0===n?e=>e.filter((e,t)=>t!==l):-1===l?o=>[...o,{product:t,variantId:e,quantity:n,isFree:i,tierIndex:a}]:e=>e.map((e,t)=>t===l?{...e,quantity:e.quantity+n,isFree:i,tierIndex:a}:e))},Ip=({bundle:t,currentProductId:n,addToCartFunction:o,addCustomBundleToCart:r,selectedItems:i,setSelectedItems:a,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:u,fetchStoreDetails:m})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Wc,{bundleAddToCartLoading:l,bundle:t,selectedItems:i,setSelectedItems:a,handleAddToCart:r,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:u,fetchStoreDetails:m}):"combo"===t.type?e.createElement(qc,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(td,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(wp,{config:t,addCustomBundleToCart:r,bundleAddToCartLoading:l}):e.createElement(Cs,{bundle:t,currentProductId:n,addToCartFunction:o,dispatchAnalyticsEvent:u}):e.createElement(xp,{addToCartFunction:o,bundle:t,dispatchAnalyticsEvent:u}),zp=c.div`
|
|
4691
4691
|
position: relative;
|
|
4692
|
-
`,
|
|
4692
|
+
`,Fp=c.button`
|
|
4693
4693
|
border: 1px solid #ccc;
|
|
4694
4694
|
border-radius: 4px;
|
|
4695
4695
|
padding: 2px 8px;
|
|
@@ -4888,7 +4888,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
4888
4888
|
transform: scale(1.01);
|
|
4889
4889
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
|
|
4890
4890
|
}
|
|
4891
|
-
`,Yp={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400,alwaysPersistent:!1},Gp=({showStickyCart:o,product:a,addCartItem:l,onSetLoading:c,themeColor:d,cartData:s,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:g,addToStickyCart:x,cartComponentsCornerType:f,cartComponentsCornerRadius:y,themeTextColor:b,stickyCartCustomizationData:h,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:E,comboBundleAddToCartFunction:k,volumeBundleCurrentTier:T,volumeBundleData:S,volumeBundleAddToCartFunction:$})=>{const[B,I]=t(""),[z,F]=t(null),[N,D]=t({}),P=ir(),[A,_]=t(null),R=r(null);n(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const O=i((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),L=i(()=>E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>O(E.products[0].productDetails,e?.node?.id)>0)?.node:a?.variants?.find(e=>e?.available),[E,a,O]),[M,j]=t(()=>{if(!E||"combo"!==E.type)return{};const e={};return E?.products?.forEach((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>O(t.productDetails,e?.node?.id)>0)?.node;o?e[n]=o.id:t?.productDetails?.variants?.edges?.length>0&&(e[n]=t.productDetails.variants.edges[0].node.id)}),e}),V=i(e=>{if(!E||"combo"!==E.type)return;const t={};E?.products?.forEach((n,o)=>{const r=n?.productDetails?.variants?.edges?.find(t=>{const o=t?.node;return n?.productDetails?.options?.every((t,n)=>{const r=e?.[t?.name],i=o?.title?.split(" / ")?.at(n);return!(!r||!i)&&r.trim().toLowerCase()===i.trim().toLowerCase()})});r?.node?.id&&(t[o]=r.node.id)}),Object.keys(t).length>0&&j(e=>({...e,...t}))},[E]);n(()=>{const e=L();if(e){I(String(e.id)),F(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}else if(a?.variants?.length>0){const e=a.variants[0];I(String(e.id)),F(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}},[a,L]);const W=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),H=()=>{const e=W();if(e){const t=a?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){I(String(t.id)),F(t);const e={};a?.options?.forEach((n,o)=>{const r=`option${o+1}`;t?.[r]&&(e[n?.name]=t[r])}),D(e)}else{const e=L();e?(I(String(e.id)),F(e)):a?.variants?.length>0&&(I(String(a.variants[0].id)),F(a.variants[0]))}}};n(()=>{H();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",H),()=>{t=!1,window.removeEventListener("urlChange",H),window.history.pushState=n,window.history.replaceState=o}},[W,a,L]);const q=r(null),[Q,U]=t(1),Y=on(s,s?.currency),G=e.useMemo(()=>{if(!E||"combo"!==E.type)return null;const{price:e,compareAtPrice:t}=Object.entries(M).reduce((e,[t,n])=>{const o=E.products?.[Number(t)],r=o?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node,i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);return E?.percentageOff?o=e*(1-E.percentageOff/100):E?.dealAmount?o=E.dealAmount:E?.amountOff&&(o=e-E.amountOff),{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),savings:(n-o).toFixed(2),hasSavings:n>o}},[E,M]),X=e.useMemo(()=>{if(!T||!z)return null;const e=parseFloat(z.price??"0"),t=parseFloat(z.compare_at_price||e.toString()),n=tn(e,s?.currency),o=tn(t,s?.currency),r=T.minimumQuantity,i=Math.max(n,o)*r;let a=n*r;const l=S?.discountType||T.discountType;"percentOff"===l?a*=1-T.discountValue/100:"amountOff"===l&&(a-=T.discountValue);const c=Math.max(0,a);return{originalPrice:i.toFixed(2),dealPrice:c.toFixed(2),savings:(i-c).toFixed(2),hasSavings:i>c&&void 0!==l}},[T,S,z,s]);n(()=>{(async()=>{try{if(E&&"combo"===E.type)return;a&&B&&F(a?.variants?.filter(e=>String(e?.id)===String(B))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[a,B,E]),n(()=>{const e=e=>{const t=e;t.detail?.selectedVariants&&j(t.detail.selectedVariants)};return window.addEventListener("yt-combo-bundle-updated",e),()=>{window.removeEventListener("yt-combo-bundle-updated",e)}},[]);const{cartLoading:Z}=Kt(),J=r(null),[K,ee]=t(0);n(()=>{J.current&&ee(J.current.offsetWidth)},[]);const te=a?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,ne=te?N?.[te]:null,oe=h&&(re=h,0!==Object.keys(re).length||re.constructor!==Object)?h:Yp;var re;const{showProductName:ie,showPrice:ae,showVariantSelector:le,showBuyNowButton:ce,showAddToCartButton:de,desktopBarType:se,showProductImage:pe,buyNowCtaTitle:ue,addToCartCtaTitle:me,productInfoVisibility:ge,showBarOnDesktop:xe,ctaButtonFontSize:fe,startsAppearingAtHeight:ye,fullyAppearsAtHeight:be,topRibbonText:he,alwaysPersistent:ve}=oe,[we,Ce]=t(ve?1:0),[Ee,ke]=t(ve?0:100),[Te,Se]=t(!1);if(n(()=>{if(ve)return Ce(1),void ke(0);const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=ye||200,n=be||400;if(e>t){const o=Math.min((e-t)/(n-t),1);Ce(o),ke(100-100*o)}else Ce(0),ke(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[ve,ye,be]),n(()=>{const e=()=>{const e=window.innerWidth<768;Se(e||!1!==xe)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[xe]),a?.variants?.length<1)return null;const $e=a?.available??!0,Be=L(),Ie=E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===M?.[0])?.node?.price:z?.price??Be?.price??a?.variants?.[0]?.price;if(0===Number(Ie)&&(!E||"combo"!==E.type))return null;if(!o||!Te)return null;if(h?.excludeProducts?.includes(a?.handle))return null;const ze=E&&"combo"===E.type?E.products?.every((e,t)=>{const n=M[t];return!!n&&O(e.productDetails,n)>0})??!1:z?.available??!0;return e.createElement(Mp,{className:"yt-sticky-bar-container",$opacity:we,$translateY:Ee,$desktopBarType:se||"stretch"},e.createElement(jp,{className:"yt-sticky-bar-inner-container",$desktopBarType:se||"stretch",$themeColor:d,$cornerType:f??"sharp",$cornerRadius:y??20,$themeTextColor:b,$productInfoVisibility:ge,$topRibbonText:he,$backgroundColor:w},ge&&e.createElement(Vp,null,pe&&e.createElement(Wp,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(z,a),alt:z?.name}),e.createElement(Hp,{ref:J,className:"yt-sticky-bar-product-details"},ie&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${a?.title}`),ne&&e.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},ne)),a?.variants?.length>1&&le&&e.createElement(Op,{className:"yt-sticky-bar-option-container",ref:R},a?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=N[t.name],r=A===t.name,i=e=>{((e,t)=>{const n={...N,[e]:t};D(n);const o=a?.variants?.find(e=>a?.options?.every((t,o)=>{const r=n?.[t?.name],i=e?.[`option${o+1}`];return"string"==typeof r&&"string"==typeof i?r.trim().toLowerCase()===i.trim().toLowerCase():r===i}));o&&(I(String(o.id)),F(o)),E&&"combo"===E?.type&&V(n)})(t.name,e),_(null)},l=rr(n,o);return e.createElement("div",{key:t.name,style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement(Lp,null,t.name),e.createElement(Fp,null,e.createElement(Np,{onClick:()=>{_(r?null:t.name)},className:"yt-sticky-bar-dropdown-button"},"color"===n?.type&&l?.value?e.createElement(Ap,{$colorValue:l.value}):"image"===n?.type&&l?.value?e.createElement(_p,{src:l.value}):null,o,e.createElement(Rp,{size:8,$isOpen:r})),r&&e.createElement(Dp,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},t.values.map(t=>{const o=rr(n,t);return e.createElement(Pp,{className:"yt-sticky-bar-dropdown-item",key:t,onClick:()=>i(t)},"color"===n?.type&&o?.value?e.createElement(Ap,{$colorValue:o.value}):"image"===n?.type&&o?.value?e.createElement(_p,{src:o.value}):null,t)}))))})),ae&&e.createElement(e.Fragment,null,G?G.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(G.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Sp(G.originalPrice)),e.createElement("span",{style:{backgroundColor:d??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Sp(G.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(G.dealPrice)):X?X.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(X.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Sp(X.originalPrice)),e.createElement("span",{style:{backgroundColor:d??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Sp(X.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(X.dealPrice)):z?.compare_at_price&&z?.compare_at_price>z?.price?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(z?.price,s?.currency)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,tn(z?.compare_at_price,s?.currency)),e.createElement("span",{style:{backgroundColor:d??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,tn(z?.compare_at_price-z?.price,s?.currency))):e.createElement(e.Fragment,null,e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(z?.price,s?.currency)))),e.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),$e&&e.createElement(qp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:ge?"row":"column"},de&&e.createElement(Up,{ref:q,onClick:async()=>{if(E&&"combo"===E.type){if(!k)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(M);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=E?.products?.[Number(e)],o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return o?{variantId:t,price:Number(o?.price),compareAtPrice:Number(o?.compareAtPrice||o?.price)}:null}).filter(e=>null!==e),o=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),r=n.reduce((e,t)=>e+t.price,0);let i=Math.min(o,r);E?.percentageOff?i=r*(1-E.percentageOff/100):E?.dealAmount?i=E.dealAmount:E?.amountOff&&(i=r-E.amountOff);const a=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));try{await k(Number(o.toFixed(2)),t,Number(i.toFixed(2)),a)}catch(e){console.error("[StickyCart.tsx] Error adding combo bundle to cart:",e)}return}if(T&&T.minimumQuantity>1){if(!$)return void console.error("[StickyCart.tsx] volumeBundleAddToCartFunction is undefined");const e=String(B)??String(a?.variants[0]?.id),t=Array(T.minimumQuantity).fill(e),n=X?Number(X.originalPrice):0;try{await $(n,t)}catch(e){console.error("[StickyCart.tsx] Error adding volume bundle to cart:",e)}return}x&&await x(String(B)??String(a?.variants[0]?.id),Q)},disabled:Z.cartLoading||!ze,$bgColor:ze?m:"#d1d5db",$textColor:ze?g:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:fe,style:{cursor:ze?"pointer":"not-allowed",opacity:ze?1:.6}},Z.cartLoading?e.createElement(rt,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,ze?me??"Add to Cart":"Out of Stock")),ce&&e.createElement(Qp,{onClick:async()=>{try{v&&await v(String(B)??String(a?.variants[0]?.id),Q)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:Z.cartLoading||!ze,$bgColor:ze?d:"#d1d5db",$textColor:ze?b:"#6b7280",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:fe,style:{cursor:ze?"pointer":"not-allowed",opacity:ze?1:.6}},Z.cartLoading?e.createElement(rt,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,ze?ue??"Buy Now":"Out of Stock")))))},Xp=c.div`
|
|
4891
|
+
`,Yp={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400,alwaysPersistent:!1},Gp=({showStickyCart:o,product:a,addCartItem:l,onSetLoading:c,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:g,addToStickyCart:x,cartComponentsCornerType:f,cartComponentsCornerRadius:y,themeTextColor:b,stickyCartCustomizationData:h,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:E,comboBundleAddToCartFunction:k,volumeBundleCurrentTier:T,volumeBundleData:S,volumeBundleAddToCartFunction:$})=>{const[N,B]=t(""),[I,z]=t(null),[F,D]=t({}),P=ir(),[A,_]=t(null),R=r(null);n(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const O=i((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),L=i(()=>E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>O(E.products[0].productDetails,e?.node?.id)>0)?.node:a?.variants?.find(e=>e?.available),[E,a,O]),[M,j]=t(()=>{if(!E||"combo"!==E.type)return{};const e={};return E?.products?.forEach((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>O(t.productDetails,e?.node?.id)>0)?.node;o?e[n]=o.id:t?.productDetails?.variants?.edges?.length>0&&(e[n]=t.productDetails.variants.edges[0].node.id)}),e}),V=i(e=>{if(!E||"combo"!==E.type)return;const t={};E?.products?.forEach((n,o)=>{const r=n?.productDetails?.variants?.edges?.find(t=>{const o=t?.node;return n?.productDetails?.options?.every((t,n)=>{const r=e?.[t?.name],i=o?.title?.split(" / ")?.at(n);return!(!r||!i)&&r.trim().toLowerCase()===i.trim().toLowerCase()})});r?.node?.id&&(t[o]=r.node.id)}),Object.keys(t).length>0&&j(e=>({...e,...t}))},[E]);n(()=>{const e=L();if(e){B(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}else if(a?.variants?.length>0){const e=a.variants[0];B(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}},[a,L]);const W=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),H=()=>{const e=W();if(e){const t=a?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){B(String(t.id)),z(t);const e={};a?.options?.forEach((n,o)=>{const r=`option${o+1}`;t?.[r]&&(e[n?.name]=t[r])}),D(e)}else{const e=L();e?(B(String(e.id)),z(e)):a?.variants?.length>0&&(B(String(a.variants[0].id)),z(a.variants[0]))}}};n(()=>{H();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",H),()=>{t=!1,window.removeEventListener("urlChange",H),window.history.pushState=n,window.history.replaceState=o}},[W,a,L]);const q=r(null),[Q,U]=t(1),Y=on(d,d?.currency),G=e.useMemo(()=>{if(!E||"combo"!==E.type)return null;const{price:e,compareAtPrice:t}=Object.entries(M).reduce((e,[t,n])=>{const o=E.products?.[Number(t)],r=o?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node,i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);return E?.percentageOff?o=e*(1-E.percentageOff/100):E?.dealAmount?o=E.dealAmount:E?.amountOff&&(o=e-E.amountOff),{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),savings:(n-o).toFixed(2),hasSavings:n>o}},[E,M]),X=e.useMemo(()=>{if(!T||!I)return null;const e=parseFloat(I.price??"0"),t=parseFloat(I.compare_at_price||e.toString()),n=tn(e,d?.currency),o=tn(t,d?.currency),r=T.minimumQuantity,i=Math.max(n,o)*r;let a=n*r;const l=S?.discountType||T.discountType;"percentOff"===l?a*=1-T.discountValue/100:"amountOff"===l&&(a-=T.discountValue);const c=Math.max(0,a);return{originalPrice:i.toFixed(2),dealPrice:c.toFixed(2),savings:(i-c).toFixed(2),hasSavings:i>c&&void 0!==l}},[T,S,I,d]);n(()=>{(async()=>{try{if(E&&"combo"===E.type)return;a&&N&&z(a?.variants?.filter(e=>String(e?.id)===String(N))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[a,N,E]),n(()=>{const e=e=>{const t=e;t.detail?.selectedVariants&&j(t.detail.selectedVariants)};return window.addEventListener("yt-combo-bundle-updated",e),()=>{window.removeEventListener("yt-combo-bundle-updated",e)}},[]);const{cartLoading:Z}=Kt(),J=r(null),[K,ee]=t(0);n(()=>{J.current&&ee(J.current.offsetWidth)},[]);const te=a?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,ne=te?F?.[te]:null,oe=h&&(re=h,0!==Object.keys(re).length||re.constructor!==Object)?h:Yp;var re;const{showProductName:ie,showPrice:ae,showVariantSelector:le,showBuyNowButton:ce,showAddToCartButton:se,desktopBarType:de,showProductImage:pe,buyNowCtaTitle:ue,addToCartCtaTitle:me,productInfoVisibility:ge,showBarOnDesktop:xe,ctaButtonFontSize:fe,startsAppearingAtHeight:ye,fullyAppearsAtHeight:be,topRibbonText:he,alwaysPersistent:ve}=oe,[we,Ce]=t(ve?1:0),[Ee,ke]=t(ve?0:100),[Te,Se]=t(!1);if(n(()=>{if(ve)return Ce(1),void ke(0);const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=ye||200,n=be||400;if(e>t){const o=Math.min((e-t)/(n-t),1);Ce(o),ke(100-100*o)}else Ce(0),ke(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[ve,ye,be]),n(()=>{const e=()=>{const e=window.innerWidth<768;Se(e||!1!==xe)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[xe]),a?.variants?.length<1)return null;const $e=a?.available??!0,Ne=L(),Be=E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===M?.[0])?.node?.price:I?.price??Ne?.price??a?.variants?.[0]?.price;if(0===Number(Be)&&(!E||"combo"!==E.type))return null;if(!o||!Te)return null;if(h?.excludeProducts?.includes(a?.handle))return null;const Ie=E&&"combo"===E.type?E.products?.every((e,t)=>{const n=M[t];return!!n&&O(e.productDetails,n)>0})??!1:I?.available??!0;return e.createElement(Mp,{className:"yt-sticky-bar-container",$opacity:we,$translateY:Ee,$desktopBarType:de||"stretch"},e.createElement(jp,{className:"yt-sticky-bar-inner-container",$desktopBarType:de||"stretch",$themeColor:s,$cornerType:f??"sharp",$cornerRadius:y??20,$themeTextColor:b,$productInfoVisibility:ge,$topRibbonText:he,$backgroundColor:w},ge&&e.createElement(Vp,null,pe&&e.createElement(Wp,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(I,a),alt:I?.name}),e.createElement(Hp,{ref:J,className:"yt-sticky-bar-product-details"},ie&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${a?.title}`),ne&&e.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},ne)),a?.variants?.length>1&&le&&e.createElement(Op,{className:"yt-sticky-bar-option-container",ref:R},a?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=F[t.name],r=A===t.name,i=e=>{((e,t)=>{const n={...F,[e]:t};D(n);const o=a?.variants?.find(e=>a?.options?.every((t,o)=>{const r=n?.[t?.name],i=e?.[`option${o+1}`];return"string"==typeof r&&"string"==typeof i?r.trim().toLowerCase()===i.trim().toLowerCase():r===i}));o&&(B(String(o.id)),z(o)),E&&"combo"===E?.type&&V(n)})(t.name,e),_(null)},l=rr(n,o);return e.createElement("div",{key:t.name,style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement(Lp,null,t.name),e.createElement(zp,null,e.createElement(Fp,{onClick:()=>{_(r?null:t.name)},className:"yt-sticky-bar-dropdown-button"},"color"===n?.type&&l?.value?e.createElement(Ap,{$colorValue:l.value}):"image"===n?.type&&l?.value?e.createElement(_p,{src:l.value}):null,o,e.createElement(Rp,{size:8,$isOpen:r})),r&&e.createElement(Dp,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},t.values.map(t=>{const o=rr(n,t);return e.createElement(Pp,{className:"yt-sticky-bar-dropdown-item",key:t,onClick:()=>i(t)},"color"===n?.type&&o?.value?e.createElement(Ap,{$colorValue:o.value}):"image"===n?.type&&o?.value?e.createElement(_p,{src:o.value}):null,t)}))))})),ae&&e.createElement(e.Fragment,null,G?G.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(G.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Sp(G.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Sp(G.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(G.dealPrice)):X?X.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(X.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Sp(X.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Sp(X.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Sp(X.dealPrice)):I?.compare_at_price&&I?.compare_at_price>I?.price?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(I?.price,d?.currency)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,tn(I?.compare_at_price,d?.currency)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,tn(I?.compare_at_price-I?.price,d?.currency))):e.createElement(e.Fragment,null,e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(I?.price,d?.currency)))),e.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),$e&&e.createElement(qp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:ge?"row":"column"},se&&e.createElement(Up,{ref:q,onClick:async()=>{if(E&&"combo"===E.type){if(!k)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(M);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=E?.products?.[Number(e)],o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return o?{variantId:t,price:Number(o?.price),compareAtPrice:Number(o?.compareAtPrice||o?.price)}:null}).filter(e=>null!==e),o=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),r=n.reduce((e,t)=>e+t.price,0);let i=Math.min(o,r);E?.percentageOff?i=r*(1-E.percentageOff/100):E?.dealAmount?i=E.dealAmount:E?.amountOff&&(i=r-E.amountOff);const a=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));try{await k(Number(o.toFixed(2)),t,Number(i.toFixed(2)),a)}catch(e){console.error("[StickyCart.tsx] Error adding combo bundle to cart:",e)}return}if(T&&T.minimumQuantity>1){if(!$)return void console.error("[StickyCart.tsx] volumeBundleAddToCartFunction is undefined");const e=String(N)??String(a?.variants[0]?.id),t=Array(T.minimumQuantity).fill(e),n=X?Number(X.originalPrice):0;try{await $(n,t)}catch(e){console.error("[StickyCart.tsx] Error adding volume bundle to cart:",e)}return}x&&await x(String(N)??String(a?.variants[0]?.id),Q)},disabled:Z.cartLoading||!Ie,$bgColor:Ie?m:"#d1d5db",$textColor:Ie?g:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:fe,style:{cursor:Ie?"pointer":"not-allowed",opacity:Ie?1:.6}},Z.cartLoading?e.createElement(rt,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,Ie?me??"Add to Cart":"Out of Stock")),ce&&e.createElement(Qp,{onClick:async()=>{try{v&&await v(String(N)??String(a?.variants[0]?.id),Q)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:Z.cartLoading||!Ie,$bgColor:Ie?s:"#d1d5db",$textColor:Ie?b:"#6b7280",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:fe,style:{cursor:Ie?"pointer":"not-allowed",opacity:Ie?1:.6}},Z.cartLoading?e.createElement(rt,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,Ie?ue??"Buy Now":"Out of Stock")))))},Xp=c.div`
|
|
4892
4892
|
width: 100%;
|
|
4893
4893
|
height: 100%;
|
|
4894
4894
|
display: flex;
|
|
@@ -5123,7 +5123,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
5123
5123
|
justify-content: space-between;
|
|
5124
5124
|
align-items: center;
|
|
5125
5125
|
margin-top: 15px;
|
|
5126
|
-
`;const
|
|
5126
|
+
`;const su=c.button`
|
|
5127
5127
|
width: 100%;
|
|
5128
5128
|
padding: 16px;
|
|
5129
5129
|
background: ${e=>e.$themeColor||"#C33"};
|
|
@@ -5165,7 +5165,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
5165
5165
|
align-items: flex-start;
|
|
5166
5166
|
gap: 24px;
|
|
5167
5167
|
width: 100%;
|
|
5168
|
-
`;const
|
|
5168
|
+
`;const du=c.div`
|
|
5169
5169
|
display: flex;
|
|
5170
5170
|
flex-direction: column;
|
|
5171
5171
|
align-items: flex-start;
|
|
@@ -5319,4 +5319,4 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
|
|
|
5319
5319
|
&:hover {
|
|
5320
5320
|
border-color: ${({$themeColor:e})=>e||"#000"};
|
|
5321
5321
|
}
|
|
5322
|
-
`,bu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),C=r(null),[E,k]=t(null),[T,S]=t(!1),[$,B]=t({}),[I,z]=t(h?.variantId),[F,N]=t(h?.quantity||1),[D,P]=t(!1),A=ir();n(()=>{h?.open?setTimeout(()=>{P(!0)},10):P(!1)},[h?.open]);n(()=>{(async()=>{if(!E&&l&&h?.variantId&&h?.handle){const e=await l(h.handle,h.variantId);if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),B(n)}else z(void 0),B({})}k(e)}})()},[E,l,h]);const _=(e,t)=>{const n={...$,[e]:t};B(n);const o=E?.variants?.find(e=>E.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&z(String(o.id))}},R=E?.variants?.find(e=>String(e.id)===String(I)),O=on(w,w?.currency),L=o(()=>{const e={};if(!E)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return E.options.forEach(n=>{e[n.name]=n.values.filter(e=>E.variants.filter(o=>{const r=E.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!E.options.every((e,t)=>{if(e.name===n.name)return!0;const r=$[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[E,$,h]);return E?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Jp,{ref:C,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??E?.featured_image,alt:R?.featured_image?.alt??E?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${E?.url}?variant=${R?.id}`},E?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Jo,{value:F,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{F>1&&N(e=>e-1)},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:f})))),E?.options?.map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(su,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name),$[t.name]&&e.createElement(mu,null,$[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=$[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(du,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(I&&a){S(!0);try{await a(I,F,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!I)return;const e=!!h?.lineItemKey,t=String(I)!==String(h?.variantId);if(!e||t){S(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(I,h.allowedVariantIds):e&&m?await m(I,h.allowedVariantIds):a&&I&&await a(I,F,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!I||T},T?e.createElement(rt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Jp,{style:{backgroundColor:p||"white"}},e.createElement(Kp,null,e.createElement(it,{color:c||"#868E96"}))))});bu.displayName="DesktopVariantPopup";const hu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),[C,E]=t(null),[k,T]=t(!1),[S,$]=t({}),[B,I]=t(h?.variantId),[z,F]=t(h?.quantity||1),N=r(null),D=ir(),[P,A]=t(!1);n(()=>{h?.open?setTimeout(()=>{A(!0)},10):A(!1)},[h?.open]);n(()=>{(async()=>{if(!C&&l&&h?.variantId&&h?.handle)try{const e=await l(h.handle,h.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){I(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),$(n)}else I(void 0),$({})}E(e)}catch(e){}})()},[C,l,h]),n(()=>{},[p,i,a,l]);const _=(e,t)=>{const n={...S,[e]:t};$(n);const o=C?.variants?.find(e=>C.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&I(String(o.id))}},R=C?.variants?.find(e=>String(e.id)===String(B)),O=on(w,w?.currency),L=o(()=>{const e={};if(!C)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(o=>{const r=C.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const r=S[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,h]);return C?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{A(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Jp,{ref:N,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??C?.featured_image,alt:R?.featured_image?.alt??C?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${C?.url}?variant=${R?.id}`},C?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Jo,{value:z,handleItemQuantityIncrement:async()=>{F(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&F(e=>e-1)},cartComponentsCornerRadius:d,cartComponentsCornerType:s,backgroundSubdued:f})))),C?.options?.map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(su,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name,":"),S[t.name]&&e.createElement(mu,null,S[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=S[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(du,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(B&&a){T(!0);try{await a(B,z,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const e=!!h?.lineItemKey,t=String(B)!==String(h?.variantId);if(!e||t){T(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(B,h.allowedVariantIds):e&&m?await m(B,h.allowedVariantIds):a&&B&&await a(B,z,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?e.createElement(rt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Jp,{style:{backgroundColor:p||"white"}},e.createElement(Kp,null,e.createElement(it,{color:c||"#868E96"}))))});const vu=({setIsCartOpen:t,isCartOpen:n,cartCheckpoints:o,customCartProgressBarCriteria:r,floatingCartData:i,effectiveQuantityForProgressBar:a,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const d=ae(Ut),s=i?.bannerFooterText,p="string"==typeof s&&s.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const o=t.toLowerCase(),r=o.endsWith("/")?o:`${o}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return r.includes(n)})}catch{return!1}})(i),m=d?.item_count??0,g=tn(d?.items_subtotal_price??0,d?.currency??"INR"),x=on(d),f=function(e,t,n,o,r){if(!e||0===e.length)return{deltaValue:0,show:!1};const i=(t??"minimum_order_value").toLowerCase(),a="quantity_threshold"===i?"number"==typeof r?r:o:n,l=[...e].sort((e,t)=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===i?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)>a);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===i?l.quantityThreshold:l.minimumOrderValue,d=Math.max(0,c-a);return{deltaValue:d,show:d>0,isQuantity:"quantity_threshold"===i}}(o,r,g,m,a),y="sharp"===l?0:c??12,h=i?.textColor??"#111",v=i?.backgroundColor??"#FF7E6E",w=i?.bannerBackgroundColor??"#FFE0DC",C=i?.buttonColor??"#E8513F",E=e.useRef(null);e.useEffect(()=>{pn(E.current)},[C]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},T={background:"#FFFFFF",color:"#111",padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:h,borderRadius:y,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},$={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:w,color:h,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},B={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:v,cursor:"pointer"},I={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:h},z={fontSize:12,color:h,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},F={padding:"5px 10px",background:C,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!f.show)return null;const t=f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} to get freebie`;return e.createElement("div",{style:k},e.createElement("div",{style:T},e.createElement(b,{"aria-hidden":!0}),e.createElement("span",null,t)))}const N=1===m?"1 item":`${m} items`,D=i?.lastTierUnlockedText||"Best tier unlocked",P=f.show?f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} more to get freebie`:D;return e.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},e.createElement("div",{style:{position:"relative"}},(f.show||o&&o.length>0)&&e.createElement("div",{style:$},e.createElement(b,{"aria-hidden":!0,style:{marginBottom:7}}),e.createElement("span",{style:{display:"inline-block",marginBottom:7}},P)),e.createElement("div",{style:S},e.createElement("div",{style:B,onClick:()=>t(!0)},e.createElement(_,{width:24,height:24,color:h}),e.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},e.createElement("div",{style:I},e.createElement("span",null,x,un(g.toFixed(0))),e.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?e.createElement("span",{style:z,title:s},s):null),e.createElement("button",{ref:E,style:F,onClick:()=>t(!0),"aria-label":"View Cart"},"View Cart")))))},wu=({exploreCTAColor:o,checkoutFontSize:i,handleDecrement:l,handleIncrement:c,removeCartItem:d,addCartItem:s,cartTitle:p,emptyCartTitle:u,emptyCartDescription:m,emptyCartButtons:g,backgroundColor:x,backgroundSubdued:f,tertiaryColor:y,tertiaryTextColor:b,backdrop:h=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:I,applyDiscount:z,discountApplied:F,checkoutFunction:N,joinNowFunction:D,guestLoyaltyPercentage:P,showToggleButton:A,isOpen:_,setIsOpen:R,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:J,checkoutButtonColor:K,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,showNoteOption:Ee,applyNoteToCart:ke,note:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,getProductDetailsByVariantId:ze,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,showStickyAddToCart:Ge,stickyCartLineItem:Xe,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Je,deliveryHeaderTitle:Ke,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,enableCustomCartOnCartPage:rt,isCartPage:it,progressBarFreeProductIconType:at,addToStickyCart:lt,productRecsCardLayout:ct,productRecsCardListVariant:dt,showCartTimer:st,showFreebieMilestone:pt,showFloatingCart:ut,floatingCartData:mt,freebieMilestoneData:gt,cartTimerInMinutes:xt,cartTimerCustomText:ft,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:vt,cartOffersCarousalData:wt,stickyBarBuyNowFunction:Ct,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:It,brandTokenName:zt,showDiscountOnMRP:Ft,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:jt,showApplyCoupon:Vt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht=!0,showCouponOptions:qt,rewardCoupons:Qt,comboBundleData:Yt,comboBundleAddToCartFunction:Gt,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Jt,useCartShell:Kt,showTrustedBadge:tn,trustedBadgeData:nn})=>{const on=le(Ut),[rn,an]=ie(en),[ln,cn]=ie(ji),dn=()=>R(!_),[sn,pn]=t(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});n(()=>{const e=e=>{const t=e.detail;pn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const un=sn.comboBundleData??Yt,mn=sn.comboBundleAddToCartFunction??Gt,[gn,xn]=t(()=>{const e=window.ytVolumeBundle;return{bundle:e?.bundle??void 0,currentTier:e?.currentTier??void 0,volumeBundleAddToCartFunction:e?.addToCart??void 0}});n(()=>{const e=e=>{const t=e.detail;xn({bundle:t?.bundle??void 0,currentTier:t?.tierData??void 0,volumeBundleAddToCartFunction:t?.addToCart??void 0})};return window.addEventListener("yt-volume-bundle-updated",e),()=>window.removeEventListener("yt-volume-bundle-updated",e)},[]);const fn=r(null),yn=r(0);a(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==fn.current&&(fn.current=e,yn.current=t??0);const n=yn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(yn.current=t),on(v)}},[v]);const bn=r(null);n(()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&(an({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),cn({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[hn,vn]=t(!1);return n(()=>{const e=()=>{vn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{if(!Kt)return;const e=window.ytCartShell;if(!e)return;const t=e.getDrawerElement?.(),n=e.getOverlayElement?.();t&&(!_||rt&&it?(t.style.setProperty("transform","translateX(100%)","important"),t.style.boxShadow="none",n&&(n.style.display="none"),document.body.classList.remove("drawer-open")):(t.style.setProperty("transform","translateX(0)","important"),t.style.boxShadow="-14px 8px 14.4px 0px rgba(0, 0, 0, 0.35)",h&&n&&(n.style.display="block"),document.body.classList.add("drawer-open")))},[_,Kt,rt,it,h]),n(()=>{if(!Kt)return;const e=window.ytCartShell,t=e?.getOverlayElement?.();if(!t)return;const n=()=>R(!1);return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},[Kt,R]),e.createElement(e.Fragment,null,e.createElement("div",{style:{position:rt&&it?"relative":"absolute",width:"100%",display:rt&&it?"flex":"block",alignItems:"center",justifyContent:"center"}},A&&!(rt&&it)&&e.createElement("button",{style:{margin:"16px"},onClick:dn},_?"Close Drawer":"Open Drawer"),!Kt&&_&&h&&!(rt&&it)&&e.createElement("div",{onClick:dn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),e.createElement(Il,{useCartShell:Kt,isCartPage:it,enableCustomCartOnCartPage:rt,isOpen:_,setIsOpen:R,backgroundColor:x,backgroundSubdued:f??"#F5F5F5",tertiaryColor:y,tertiaryTextColor:b,exploreCTAColor:o,checkoutFontSize:i,cartTitle:p,handleDecrement:l,handleIncrement:c,removeCartItem:d,addCartItem:s,emptyCartTitle:u,emptyCartButtons:g,emptyCartDescription:m,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:I,applyDiscount:z,discountApplied:F,checkoutFunction:N,joinNowFunction:D,guestLoyaltyPercentage:P,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:J??"minimum_order_value",checkoutButtonColor:K,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:de,themeColor:se,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:ke,note:Te,showNoteOption:Ee,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ie,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,cartOffersCarousalData:wt,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Je,deliveryHeaderTitle:Ke,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,progressBarFreeProductIconType:at,productRecsCardLayout:ct,productRecsCardListVariant:dt,showCartTimer:st,showFreebieMilestone:pt,freebieMilestoneData:gt,cartTimerCustomText:ft,cartTimerInMinutes:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:It,getProductDetailsByVariantId:ze,brandTokenName:zt,showDiscountOnMRP:Ft??!0,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:jt,showApplyCoupon:Vt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Jt,showCouponOptions:qt,rewardCoupons:Qt,showTrustedBadge:tn,trustedBadgeData:nn}),Ge&&Xe&&s&&e.createElement(Gp,{showStickyCart:Ge,stickyCartCustomizationData:vt,product:Xe,addCartItem:s,onSetLoading:Fe,themeColor:se,themeTextColor:pe,cartData:v,isCartOpen:_,setIsCartOpen:R,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:lt,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,checkoutFunction:Ct,backgroundColor:x,primaryTextColor:ne,comboBundleData:un,comboBundleAddToCartFunction:mn,volumeBundleCurrentTier:gn.currentTier,volumeBundleData:gn.bundle,volumeBundleAddToCartFunction:gn.volumeBundleAddToCartFunction}),hn&&rn.open&&e.createElement(bu,{backgroundColor:x,ref:bn,isDev:O,removeCartItem:d,addCartItem:s,getProductDetailsByVariantId:ze,themeColor:se,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:Jt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne}),!hn&&rn.open&&e.createElement(hu,{ref:bn,isDev:O,removeCartItem:d,addCartItem:s,getProductDetailsByVariantId:ze,themeColor:se,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,backgroundColor:x,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:Jt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne})),!hn&&ut&&e.createElement(vu,{isCartOpen:_,setIsCartOpen:R,cartCheckpoints:V,customCartProgressBarCriteria:J,floatingCartData:mt,effectiveQuantityForProgressBar:Le,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt}))};gt(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Cu=()=>e.createElement("div",{className:"scene"},e.createElement("div",{className:"floating"},e.createElement("div",{className:"cube"},e.createElement("div",{className:"side front"},""),e.createElement("div",{className:"side back"},""),e.createElement("div",{className:"side left"},""),e.createElement("div",{className:"side right"},""),e.createElement("div",{className:"side bottom"},""),e.createElement("div",{className:"lid"},e.createElement("div",{className:"flap north"},""),e.createElement("div",{className:"flap south"},""),e.createElement("div",{className:"flap east"},""),e.createElement("div",{className:"flap west"},""))))),Eu=({config:t,brandConfig:n})=>{const{heroDesktopImage:o,heroMobileImage:r,heroTitle:i="ZERO WASTE PREMIUM PET CARE",heroSubtitle:a="Earn Doglycoins for exclusive rewards every time you shop.",heroTextAlignment:l="left",heroSubtitleFontSize:c="18px",heroSubtitleColor:d="#000000",heroSubtitleFontWeight:s="400",heroTitleFontSize:p="48px",heroTitleColor:u="#000000",heroRegistrationCTAVisibility:m=!0,primaryColor:g="#1C1C1D",primaryContrastColor:x="#FFFFFF",secondaryColor:f="#FFFFFF",secondaryContrastColor:y="#000000",accentColor:b="#FFFFFF",borderColor:I="#E5E5E5",themeRoundness:z="0px",heroBannerVisibility:F="show",stepsVisibility:N="show",waysToEarnVisibility:D="show",waysToEarnCustomText:P="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",customSectionVisibility:A="show",footerSignupVisibility:_="show",customSectionImagePosition:R="left",customSectionTitle:O="Earn Doglycoins every time you shop",customSectionSubtitle:L="Collect more Doglycoins by entering your birthday, following us on social or referring a friend (details below)\n\nRedeem your Doglycoins for cash off at checkout by signing in or creating an account. Did you shop without registering? No worries, your Credits have been saved for you",customSectionTitleFontSize:M="36px",customSectionSubtitleFontSize:j="18px",customSectionImage:V,customSectionTextAlignment:W="left",customSectionTitleColor:H="#000000",customSectionSubtitleColor:q="#000000",stepsTitle:Q="Getting started is easy",stepsSubtitle:U="Earn Stars and get rewarded in a few easy steps.",step1Title:Y="CREATE AN ACCOUNT",step1Description:G="To get started, Join Now. You can also register on the mobile app to get access to the full range of reward benefits",step2Title:X="ORDER AND EARN REWARDS POINTS",step2Description:Z="Use cash, credit/debit card or save some time and pay right through the app. You'll collect Stars all ways.",step3Title:J="UNLOCK REWARDS AND OFFERS",step3Description:K="As you earn Stars, you can redeem them for Rewards—like free food, drinks, and more. Start redeeming with as little as 25 Stars!",footerCustomText:ee="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",footerSignupSubtext:te="Use your points to redeem samples and more."}=t||{},ne="undefined"!=typeof window&&window.innerWidth<=768,oe=e=>e&&e.startsWith("//")?`https:${e}`:e,re={padding:"12px 32px",borderRadius:"30px",fontSize:"14px",fontWeight:600,cursor:"pointer",textTransform:"uppercase",border:`1px solid ${g}`,transition:"all 0.3s ease"},ie={...re,backgroundColor:g,color:x,borderColor:g},ae={...re,backgroundColor:f,color:y,borderColor:I},{newSignupTokens:le,firstOrderTokens:ce,instagramFollowPoints:de,twitterFollowPoints:se,facebookFollowPoints:pe,youtubeSubscriptionPoints:ue,rewardToLeaveReview:me,birthdayPoints:ge,referralPointsForReferrer:xe,tokenCreditPercentage:fe,brandTokenName:ye}=n||{},be=[...le?[{icon:e.createElement(h,null),title:`${le} ${ye}`,subtitle:"Create an account"}]:[],...ce?[{icon:e.createElement(v,null),title:`${ce} ${ye}`,subtitle:"Place your first order"}]:[],...fe?[{icon:e.createElement(v,null),title:`${fe}% ${ye}`,subtitle:`Earn ${fe}% back on every order`}]:[],...xe?[{icon:e.createElement(w,null),title:`${xe} ${ye}`,subtitle:"Refer a friend and get"}]:[],...ge?[{icon:e.createElement(C,null),title:`${ge} ${ye}`,subtitle:"Get on your birthday to spend"}]:[],...me?[{icon:e.createElement(E,null),title:`${me} ${ye}`,subtitle:"Write a Review"}]:[],...pe?[{icon:e.createElement(k,null),title:`${pe} ${ye}`,subtitle:"Like on Facebook"}]:[],...de?[{icon:e.createElement(T,null),title:`${de} ${ye}`,subtitle:"Follow on Instagram"}]:[],...se?[{icon:e.createElement(S,null),title:`${se} ${ye}`,subtitle:"Follow on Twitter"}]:[],...ue?[{icon:e.createElement($,null),title:`${ue} ${ye}`,subtitle:"Subscribe on YouTube"}]:[]];return e.createElement("div",{className:"yt-loyalty-page-container",style:{fontFamily:"'Poppins', sans-serif",width:"100%",overflow:"hidden"}},"show"===F&&e.createElement("div",{className:"yt-loyalty-page-hero",style:{position:"relative",minHeight:"500px",display:"flex",alignItems:"center",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start",backgroundImage:`url(${oe(ne&&r?r:o)})`,backgroundSize:"cover",backgroundPosition:"center",padding:ne?"40px 20px":"60px 80px"}},e.createElement("div",{className:"yt-loyalty-page-hero-content",style:{maxWidth:"600px",zIndex:2,textAlign:l}},e.createElement("h1",{className:"yt-loyalty-page-hero-title",style:{fontSize:ne?"32px":p,color:u,marginBottom:"16px",lineHeight:1.1,fontWeight:800,textTransform:"uppercase"}},i),e.createElement("p",{className:"yt-loyalty-page-hero-subtitle",style:{fontSize:c,color:d,fontWeight:Number(s)||400,marginBottom:"32px"}},a),m&&e.createElement("div",{className:"yt-loyalty-page-hero-button-wrapper",style:{display:"flex",gap:"16px",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start"}},e.createElement("button",{className:"yt-loyalty-page-hero-button",style:ie,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"Join Now")))),"show"===N&&e.createElement("div",{className:"yt-loyalty-page-steps",style:{padding:"40px 20px",position:"relative",textAlign:"center"}},e.createElement("div",{className:"yt-loyalty-page-steps-background-text",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"GETTING STARTED"),e.createElement("div",{className:"yt-loyalty-page-steps-content",style:{position:"relative",zIndex:1}},e.createElement("h2",{className:"yt-loyalty-page-steps-title",style:{fontSize:"32px",fontWeight:700,marginBottom:"8px",color:"#000"}},Q),e.createElement("p",{className:"yt-loyalty-page-steps-subtitle",style:{color:g,marginBottom:"24px"}},U),e.createElement("div",{className:"yt-loyalty-page-steps-grid",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"center",gap:"40px",maxWidth:"1200px",margin:"0 auto"}},[{icon:e.createElement(v,null),title:Y,desc:G},{icon:e.createElement(B,null),title:X,desc:Z},{icon:e.createElement(C,null),title:J,desc:K}].map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-step-item",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{className:"yt-loyalty-page-step-icon",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"32px",color:"#666",marginBottom:"12px"}},t.icon),e.createElement("div",{className:"yt-loyalty-page-step-title",style:{fontSize:"16px",fontWeight:700,color:g,textTransform:"uppercase",lineHeight:"normal"}},t.title),e.createElement("p",{className:"yt-loyalty-page-step-description",style:{fontSize:"13px",color:g,lineHeight:1.2,maxWidth:"300px"}},t.desc)))))),"show"===D&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn",style:{padding:"40px 20px",position:"relative",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-background-text",style:{position:"absolute",top:ne?"10%":"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"WAYS TO EARN"),e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-grid",style:{position:"relative",zIndex:1,maxWidth:"1000px",margin:"0 auto",display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"12px"}},be.map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-ways-to-earn-item",style:{width:ne?"100%":"220px",border:"2px solid #ddd",padding:"12px 8px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",borderRadius:z,boxShadow:"-1px 2px 3px rgba(0,0,0,0.1)"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-icon",style:{fontSize:"32px",marginBottom:"4px",color:"#1a1a2e"}},t.icon),e.createElement("h3",{className:"yt-loyalty-page-ways-to-earn-title",style:{fontSize:"13px",fontWeight:700,marginBottom:"2px",textTransform:"uppercase",color:"#000"}},t.title),e.createElement("p",{className:"yt-loyalty-page-ways-to-earn-subtitle",style:{fontSize:"11px",color:"#666"}},t.subtitle)))),P&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-custom-text",style:{maxWidth:"1000px",margin:"24px auto 0",backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},P)),"show"===A&&e.createElement("div",{className:"yt-loyalty-page-custom-section",style:{padding:ne?"40px 0px":"40px 20px",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-container",style:{maxWidth:"1200px",margin:"0 auto",display:"flex",flexDirection:ne?"column":"row",alignItems:"center",gap:"40px",borderRadius:z,overflow:"hidden",backgroundColor:"#F9F9F9"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image-wrapper",style:{flex:1,width:"100%",order:ne||"left"===R?0:1}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image",style:{display:"flex",width:"100%",height:"300px",backgroundColor:"#ddd",backgroundImage:V?`url(${oe(V)})`:o?`url(${oe(o)})`:void 0,backgroundSize:"cover",backgroundPosition:"center"}})),e.createElement("div",{className:"yt-loyalty-page-custom-section-content",style:{flex:1,paddingInline:ne?"20px":"10px",textAlign:ne?"center":W,order:ne||"left"===R?1:0,marginBottom:ne?"20px":"0px"}},e.createElement("h2",{className:"yt-loyalty-page-custom-section-title",style:{fontSize:M,fontWeight:700,marginBottom:"16px",color:H}},O),e.createElement("p",{className:"yt-loyalty-page-custom-section-subtitle",style:{fontSize:j,color:q,marginBottom:"24px",lineHeight:1.6,whiteSpace:"pre-line"}},L)))),"show"===_&&e.createElement("div",{className:"yt-loyalty-page-footer",style:{marginBottom:"20px"}},e.createElement("div",{className:"yt-loyalty-page-footer-container",style:{maxWidth:"1200px",margin:"0 auto"}},e.createElement("div",{className:"yt-loyalty-page-footer-custom-text",style:{backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},ee),e.createElement("div",{className:"yt-loyalty-page-footer-signup",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"space-between",alignItems:"center",marginTop:"40px",padding:"20px",border:"1px solid #eee",borderRadius:"4px",gap:"20px",textAlign:ne?"center":"left"}},e.createElement("div",{className:"yt-loyalty-page-footer-signup-content"},e.createElement("h3",{style:{fontSize:"20px",fontWeight:700,marginBottom:"4px",color:"#000",textAlign:ne?"center":"left"}},"Rewards Program"),e.createElement("p",{style:{fontSize:"14px",color:"#666"}},te)),e.createElement("button",{className:"yt-loyalty-page-footer-signup-button",style:ae,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"JOIN NOW")))))},ku=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const d=o._customOffer,s=d?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:i},e.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"16px",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},o.name),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),s&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"16px",padding:"12px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"clamp(16px, 4vw, 18px)",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},s),e.createElement("button",{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"20px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(I,null):e.createElement(z,null))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),e.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},e.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),e.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return A(p,document.body)},Tu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const d=o._customOffer,s=d?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:i},e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),e.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),e.createElement("div",{style:{overflowY:"auto",flex:1}},e.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},e.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},o.name),e.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),s&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"20px",padding:"14px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"18px",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},s),e.createElement("button",{onClick:async()=>{if(s)try{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"22px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(I,null):e.createElement(z,null)))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),e.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},e.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t)))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return A(p,document.body)},Su=({offersToShow:o,offersConfig:i,getOfferCardMessage:a,setSelectedOffer:l,setShowPopup:c})=>{const d=r(null),[s,p]=t(!1),[u,m]=t(!0),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=768),f=()=>{if(d.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=d.current;p(e>0),m(e<t-n-10)}};n(()=>{f();const e=d.current;if(e)return e.addEventListener("scroll",f),()=>e.removeEventListener("scroll",f)},[o]),n(()=>{const e=()=>{x(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const y=e=>{if(d.current){const t=g?280:365,n=16,o="right"===e?t+n:-(t+n);d.current.scrollBy({left:o,behavior:"smooth"})}};return e.createElement("div",{style:{position:"relative"}},e.createElement("svg",{style:{position:"absolute",width:0,height:0}},e.createElement("defs",null,e.createElement("mask",{id:"coupon-cut-mask-desktop"},e.createElement("rect",{width:"365",height:"138",fill:"white"}),e.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),e.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),e.createElement("mask",{id:"coupon-cut-mask-mobile"},e.createElement("rect",{width:"280",height:"120",fill:"white"}),e.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),e.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),s&&e.createElement("button",{onClick:()=>y("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(F,{size:20})),u&&e.createElement("button",{onClick:()=>y("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(N,{size:20})),e.createElement("div",{ref:d,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:g?"110px":"128px"}},o?.map(t=>e.createElement("div",{key:t.discountId,style:{flexShrink:0,width:g?"280px":"365px",minWidth:g?"280px":"365px",minHeight:g?"110px":"128px",backgroundColor:"transparent",borderRadius:`${i?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},e.createElement("div",{style:{width:g?"60px":"80px",minHeight:g?"110px":"128px",backgroundColor:i?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:g?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${i?.roundness||0}px`,borderBottomLeftRadius:`${i?.roundness||0}px`}},e.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),i?.iconVisibility&&e.createElement("div",{style:{position:"absolute",left:g?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:g?"32px":"40px",height:g?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:g?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{flex:1,padding:g?"12px 12px":"15px 15px",paddingLeft:g?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${i?.roundness||0}px`,borderBottomRightRadius:`${i?.roundness||0}px`,overflow:"hidden",backgroundColor:i?.cardBackgroundColor||"#ffffff",minWidth:0}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:g?"4px":"6px",lineHeight:"normal"}},e.createElement("div",{style:{fontSize:g?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===t.couponType?"Free Gift":t._customOffer?.code?"Coupon":"Special Deal"),e.createElement("div",{style:{fontSize:g?"13px":"15px",fontWeight:"600",color:i?.textColor||"#2c3e50"}},t.name),e.createElement("div",{style:{fontSize:g?"11px":"12px",color:i?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:g?"28px":"32px"}},a(t))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),l(t),c(!0)},style:{fontSize:g?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},i?.viewDetailsTitle||"View Details")))))),e.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},$u=({offersToShow:o,offersConfig:r,getOfferCardMessage:i,setSelectedOffer:a,setShowPopup:l})=>{const[c,d]=t("undefined"!=typeof window&&window.innerWidth<=768);return n(()=>{const e=()=>{d(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement("div",{style:{borderRadius:`${r?.roundness||8}px`}},o?.map((t,n)=>e.createElement("div",{key:t.discountId,style:{display:"flex",alignItems:"flex-start",gap:c?"8px":"12px",padding:c?"12px 0":"16px 0",paddingLeft:c?"10px":"20px",backgroundColor:!0===r?.cardBackgroundTransparent||"true"===String(r?.cardBackgroundTransparent)?"transparent":r?.cardBackgroundColor||"#ffffff",borderBottom:n<(o?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${r?.roundness||0}px`}},r?.iconVisibility&&e.createElement("div",{style:{width:c?"40px":"50px",height:c?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:c?"20px":"25px",marginTop:c?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:c?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},t.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",e.createElement("span",{style:{fontWeight:600,color:r?.textColor||"#34495e"}},t.name)),e.createElement("div",{style:{fontSize:c?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},i(t)),e.createElement("div",{style:{fontSize:c?"11px":"12px",color:"#000000"}},"offer auto applied",e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),a(t),l(!0)},style:{color:r?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},r?.viewDetailsTitle||"T&C"))))))},Bu=({offersConfig:o,offers:i})=>{const[a,l]=t(!1),[c,d]=t(null),[s,p]=t(null),[u,m]=t("undefined"!=typeof window&&window.innerWidth<=768),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=450),f=r(null);n(()=>{const e=()=>{m(window.innerWidth<=768),x(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{f.current&&pn(f.current)},[o?.sectionBgContrastColor]);const y=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",o=-1;Object.keys(t).forEach(e=>{t[e]>o&&(o=t[e],n=e)});const r=e.map((e,t)=>({o:e,idx:t})),i=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return r.sort((e,t)=>{const o=e.o.customCartProgressBarCriteria===n,r=t.o.customCartProgressBarCriteria===n;if(o&&r){const n=i(e.o),o=i(t.o);return n!==o?n-o:e.idx-t.idx}return o&&!r?-1:!o&&r?1:e.idx-t.idx}),r.map(e=>e.o)})((!1===o?.showBackendOffers&&o?.customOffers&&o.customOffers.length>0?o.customOffers.map((e,t)=>{return{discountId:-(t+1),name:(n=e).title,couponType:n.code?"discount_code":"special_deal",customCartProgressBarCriteria:null,discountPercentage:null,couponTemplateId:0,minimumOrderValue:0,quantityThreshold:0,_allVariantIds:[],description:n.description,_customOffer:n};var n}):i)||[]),b=e=>{if(d(e),e){const t=e._customOffer;p(t?(e=>({offerMessage:e.description||"Special offer available",terms:e.terms?e.terms.split("\n").filter(e=>""!==e.trim()):[]}))(t):(e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const o=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?o.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&o.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&o.push("Combines with other order discounts"),t||o.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:o}})(e))}},h=e=>{const t=e._customOffer;return t?t.description||"Special offer available":(e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available")(e)};return e.createElement("div",null,e.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===o?.sectionType?`${o?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:o?.sectionBackgroundColor||"#fff"}},e.createElement("div",{style:{border:"coupon"===o?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=o?.cardPadding?`${o.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===o?.sectionType?`${o?.roundness||8}px`:"0px"}},e.createElement("span",{ref:f,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"right"===o?.alignment?"auto":"50%",right:"right"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===o?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:o?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},o?.sectionTitle||"Available Deals and Offers"),(()=>{const t=o?.sectionType;return"list"===t?e.createElement($u,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):"coupon"===t?e.createElement(Su,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):null})(),g?e.createElement(Tu,{selectedOffer:c,selectedOfferTerms:s,showPopup:a,offersConfig:o,onClose:()=>{l(!1),d(null),p(null)}}):e.createElement(ku,{selectedOffer:c,selectedOfferTerms:s,showPopup:a,offersConfig:o,onClose:()=>{l(!1),d(null),p(null)}}))))};export{zp as Bundle,Cu as BundleLoader,wu as Cart,Eu as LoyaltyPageBlock,Lt as Nudge,Bu as ProductOffers,Qt as SpinnerWheel};
|
|
5322
|
+
`,bu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),C=r(null),[E,k]=t(null),[T,S]=t(!1),[$,N]=t({}),[B,I]=t(h?.variantId),[z,F]=t(h?.quantity||1),[D,P]=t(!1),A=ir();n(()=>{h?.open?setTimeout(()=>{P(!0)},10):P(!1)},[h?.open]);n(()=>{(async()=>{if(!E&&l&&h?.variantId&&h?.handle){const e=await l(h.handle,h.variantId);if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){I(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),N(n)}else I(void 0),N({})}k(e)}})()},[E,l,h]);const _=(e,t)=>{const n={...$,[e]:t};N(n);const o=E?.variants?.find(e=>E.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&I(String(o.id))}},R=E?.variants?.find(e=>String(e.id)===String(B)),O=on(w,w?.currency),L=o(()=>{const e={};if(!E)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return E.options.forEach(n=>{e[n.name]=n.values.filter(e=>E.variants.filter(o=>{const r=E.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!E.options.every((e,t)=>{if(e.name===n.name)return!0;const r=$[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[E,$,h]);return E?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Jp,{ref:C,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??E?.featured_image,alt:R?.featured_image?.alt??E?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${E?.url}?variant=${R?.id}`},E?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Jo,{value:z,handleItemQuantityIncrement:async()=>{F(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&F(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:f})))),E?.options?.map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(du,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name),$[t.name]&&e.createElement(mu,null,$[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=$[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(su,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(B&&a){S(!0);try{await a(B,z,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!B)return;const e=!!h?.lineItemKey,t=String(B)!==String(h?.variantId);if(!e||t){S(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(B,h.allowedVariantIds):e&&m?await m(B,h.allowedVariantIds):a&&B&&await a(B,z,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||T},T?e.createElement(rt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Jp,{style:{backgroundColor:p||"white"}},e.createElement(Kp,null,e.createElement(it,{color:c||"#868E96"}))))});bu.displayName="DesktopVariantPopup";const hu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),[C,E]=t(null),[k,T]=t(!1),[S,$]=t({}),[N,B]=t(h?.variantId),[I,z]=t(h?.quantity||1),F=r(null),D=ir(),[P,A]=t(!1);n(()=>{h?.open?setTimeout(()=>{A(!0)},10):A(!1)},[h?.open]);n(()=>{(async()=>{if(!C&&l&&h?.variantId&&h?.handle)try{const e=await l(h.handle,h.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){B(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),$(n)}else B(void 0),$({})}E(e)}catch(e){}})()},[C,l,h]),n(()=>{},[p,i,a,l]);const _=(e,t)=>{const n={...S,[e]:t};$(n);const o=C?.variants?.find(e=>C.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&B(String(o.id))}},R=C?.variants?.find(e=>String(e.id)===String(N)),O=on(w,w?.currency),L=o(()=>{const e={};if(!C)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(o=>{const r=C.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const r=S[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,h]);return C?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{A(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Xp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Jp,{ref:F,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Zp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(eu,null,e.createElement(tu,null,e.createElement(nu,null,e.createElement(ou,{src:R?.featured_image?.src??C?.featured_image,alt:R?.featured_image?.alt??C?.title})),e.createElement(ru,null,e.createElement(iu,{$themeColor:c,$primaryTextColor:y,href:`${C?.url}?variant=${R?.id}`},C?.title),e.createElement(xu,null,e.createElement(au,null,e.createElement(lu,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(cu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Jo,{value:I,handleItemQuantityIncrement:async()=>{z(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&z(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:f})))),C?.options?.map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(du,{key:t.name},e.createElement(uu,null,e.createElement("span",null,"Select ",t.name,":"),S[t.name]&&e.createElement(mu,null,S[t.name])),e.createElement(gu,null,L[t.name]?.map(o=>{const r=S[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(fu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(yu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(pu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(su,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(N&&a){T(!0);try{await a(N,I,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!N)return;const e=!!h?.lineItemKey,t=String(N)!==String(h?.variantId);if(!e||t){T(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(N,h.allowedVariantIds):e&&m?await m(N,h.allowedVariantIds):a&&N&&await a(N,I,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!N||k},k?e.createElement(rt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Xp,{ref:b},e.createElement(Jp,{style:{backgroundColor:p||"white"}},e.createElement(Kp,null,e.createElement(it,{color:c||"#868E96"}))))});const vu=({setIsCartOpen:t,isCartOpen:n,cartCheckpoints:o,customCartProgressBarCriteria:r,floatingCartData:i,effectiveQuantityForProgressBar:a,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=ae(Ut),d=i?.bannerFooterText,p="string"==typeof d&&d.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const o=t.toLowerCase(),r=o.endsWith("/")?o:`${o}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return r.includes(n)})}catch{return!1}})(i),m=s?.item_count??0,g=tn(s?.items_subtotal_price??0,s?.currency??"INR"),x=on(s),f=function(e,t,n,o,r){if(!e||0===e.length)return{deltaValue:0,show:!1};const i=(t??"minimum_order_value").toLowerCase(),a="quantity_threshold"===i?"number"==typeof r?r:o:n,l=[...e].sort((e,t)=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===i?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)>a);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===i?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-a);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===i}}(o,r,g,m,a),y="sharp"===l?0:c??12,h=i?.textColor??"#111",v=i?.backgroundColor??"#FF7E6E",w=i?.bannerBackgroundColor??"#FFE0DC",C=i?.buttonColor??"#E8513F",E=e.useRef(null);e.useEffect(()=>{pn(E.current)},[C]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},T={background:"#FFFFFF",color:"#111",padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:h,borderRadius:y,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},$={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:w,color:h,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},N={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:v,cursor:"pointer"},B={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:h},I={fontSize:12,color:h,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},z={padding:"5px 10px",background:C,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!f.show)return null;const t=f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} to get freebie`;return e.createElement("div",{style:k},e.createElement("div",{className:"yt-cart-floating-ribbon",style:T},e.createElement(b,{"aria-hidden":!0}),e.createElement("span",null,t)))}const F=1===m?"1 item":`${m} items`,D=i?.lastTierUnlockedText||"Best tier unlocked",P=f.show?f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} more to get freebie`:D;return e.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},e.createElement("div",{style:{position:"relative"}},(f.show||o&&o.length>0)&&e.createElement("div",{className:"yt-cart-floating-banner",style:$},e.createElement(b,{"aria-hidden":!0,style:{marginBottom:7}}),e.createElement("span",{style:{display:"inline-block",marginBottom:7}},P)),e.createElement("div",{style:S},e.createElement("div",{className:"yt-cart-floating-body",style:N,onClick:()=>t(!0)},e.createElement(_,{width:24,height:24,color:h}),e.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},e.createElement("div",{style:B},e.createElement("span",null,x,un(g.toFixed(0))),e.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},F)),p?e.createElement("span",{style:I,title:d},d):null),e.createElement("button",{ref:E,style:z,onClick:()=>t(!0),"aria-label":"View Cart"},"View Cart")))))},wu=({exploreCTAColor:o,checkoutFontSize:i,handleDecrement:l,handleIncrement:c,removeCartItem:s,addCartItem:d,cartTitle:p,emptyCartTitle:u,emptyCartDescription:m,emptyCartButtons:g,backgroundColor:x,backgroundSubdued:f,tertiaryColor:y,tertiaryTextColor:b,backdrop:h=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:N,removeDiscount:B,applyDiscount:I,discountApplied:z,checkoutFunction:F,joinNowFunction:D,guestLoyaltyPercentage:P,showToggleButton:A,isOpen:_,setIsOpen:R,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:J,checkoutButtonColor:K,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:se,themeColor:de,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,showNoteOption:Ee,applyNoteToCart:ke,note:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:Be,getProductDetailsByVariantId:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,showStickyAddToCart:Ge,stickyCartLineItem:Xe,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Je,deliveryHeaderTitle:Ke,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,enableCustomCartOnCartPage:rt,isCartPage:it,progressBarFreeProductIconType:at,addToStickyCart:lt,productRecsCardLayout:ct,productRecsCardListVariant:st,showCartTimer:dt,showFreebieMilestone:pt,showFloatingCart:ut,floatingCartData:mt,freebieMilestoneData:gt,cartTimerInMinutes:xt,cartTimerCustomText:ft,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:vt,cartOffersCarousalData:wt,stickyBarBuyNowFunction:Ct,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Nt,loyaltyDiscount:Bt,brandTokenName:It,showDiscountOnMRP:zt,prefixMessageText:Ft,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:jt,showApplyCoupon:Vt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht=!0,showCouponOptions:qt,rewardCoupons:Qt,comboBundleData:Yt,comboBundleAddToCartFunction:Gt,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Jt,useCartShell:Kt,showTrustedBadge:tn,trustedBadgeData:nn})=>{const on=le(Ut),[rn,an]=ie(en),[ln,cn]=ie(ji),sn=()=>R(!_),[dn,pn]=t(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});n(()=>{const e=e=>{const t=e.detail;pn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const un=dn.comboBundleData??Yt,mn=dn.comboBundleAddToCartFunction??Gt,[gn,xn]=t(()=>{const e=window.ytVolumeBundle;return{bundle:e?.bundle??void 0,currentTier:e?.currentTier??void 0,volumeBundleAddToCartFunction:e?.addToCart??void 0}});n(()=>{const e=e=>{const t=e.detail;xn({bundle:t?.bundle??void 0,currentTier:t?.tierData??void 0,volumeBundleAddToCartFunction:t?.addToCart??void 0})};return window.addEventListener("yt-volume-bundle-updated",e),()=>window.removeEventListener("yt-volume-bundle-updated",e)},[]);const fn=r(null),yn=r(0);a(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==fn.current&&(fn.current=e,yn.current=t??0);const n=yn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(yn.current=t),on(v)}},[v]);const bn=r(null);n(()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&(an({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),cn({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[hn,vn]=t(!1);return n(()=>{const e=()=>{vn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{if(!Kt)return;const e=window.ytCartShell;if(!e)return;const t=e.getDrawerElement?.(),n=e.getOverlayElement?.();t&&(!_||rt&&it?(t.style.setProperty("transform","translateX(100%)","important"),t.style.boxShadow="none",n&&(n.style.display="none"),document.body.classList.remove("drawer-open")):(t.style.setProperty("transform","translateX(0)","important"),t.style.boxShadow="-14px 8px 14.4px 0px rgba(0, 0, 0, 0.35)",h&&n&&(n.style.display="block"),document.body.classList.add("drawer-open")))},[_,Kt,rt,it,h]),n(()=>{if(!Kt)return;const e=window.ytCartShell,t=e?.getOverlayElement?.();if(!t)return;const n=()=>R(!1);return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},[Kt,R]),e.createElement(e.Fragment,null,e.createElement("div",{style:{position:rt&&it?"relative":"absolute",width:"100%",display:rt&&it?"flex":"block",alignItems:"center",justifyContent:"center"}},A&&!(rt&&it)&&e.createElement("button",{style:{margin:"16px"},onClick:sn},_?"Close Drawer":"Open Drawer"),!Kt&&_&&h&&!(rt&&it)&&e.createElement("div",{onClick:sn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),e.createElement(Bl,{useCartShell:Kt,isCartPage:it,enableCustomCartOnCartPage:rt,isOpen:_,setIsOpen:R,backgroundColor:x,backgroundSubdued:f??"#F5F5F5",tertiaryColor:y,tertiaryTextColor:b,exploreCTAColor:o,checkoutFontSize:i,cartTitle:p,handleDecrement:l,handleIncrement:c,removeCartItem:s,addCartItem:d,emptyCartTitle:u,emptyCartButtons:g,emptyCartDescription:m,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:N,removeDiscount:B,applyDiscount:I,discountApplied:z,checkoutFunction:F,joinNowFunction:D,guestLoyaltyPercentage:P,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:J??"minimum_order_value",checkoutButtonColor:K,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:se,themeColor:de,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:ke,note:Te,showNoteOption:Ee,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:Be,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,cartOffersCarousalData:wt,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:je,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Je,deliveryHeaderTitle:Ke,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,progressBarFreeProductIconType:at,productRecsCardLayout:ct,productRecsCardListVariant:st,showCartTimer:dt,showFreebieMilestone:pt,freebieMilestoneData:gt,cartTimerCustomText:ft,cartTimerInMinutes:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Nt,loyaltyDiscount:Bt,getProductDetailsByVariantId:Ie,brandTokenName:It,showDiscountOnMRP:zt??!0,prefixMessageText:Ft,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:jt,showApplyCoupon:Vt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Jt,showCouponOptions:qt,rewardCoupons:Qt,showTrustedBadge:tn,trustedBadgeData:nn}),Ge&&Xe&&d&&e.createElement(Gp,{showStickyCart:Ge,stickyCartCustomizationData:vt,product:Xe,addCartItem:d,onSetLoading:ze,themeColor:de,themeTextColor:pe,cartData:v,isCartOpen:_,setIsCartOpen:R,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:lt,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,checkoutFunction:Ct,backgroundColor:x,primaryTextColor:ne,comboBundleData:un,comboBundleAddToCartFunction:mn,volumeBundleCurrentTier:gn.currentTier,volumeBundleData:gn.bundle,volumeBundleAddToCartFunction:gn.volumeBundleAddToCartFunction}),hn&&rn.open&&e.createElement(bu,{backgroundColor:x,ref:bn,isDev:O,removeCartItem:s,addCartItem:d,getProductDetailsByVariantId:Ie,themeColor:de,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:Jt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne}),!hn&&rn.open&&e.createElement(hu,{ref:bn,isDev:O,removeCartItem:s,addCartItem:d,getProductDetailsByVariantId:Ie,themeColor:de,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,backgroundColor:x,removeFreebieFromCart:je,freebieClaimAddToCart:Re,stealDealAddToCart:Jt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne})),!hn&&ut&&e.createElement(vu,{isCartOpen:_,setIsCartOpen:R,cartCheckpoints:V,customCartProgressBarCriteria:J,floatingCartData:mt,effectiveQuantityForProgressBar:Le,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt}))};gt(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Cu=()=>e.createElement("div",{className:"scene"},e.createElement("div",{className:"floating"},e.createElement("div",{className:"cube"},e.createElement("div",{className:"side front"},""),e.createElement("div",{className:"side back"},""),e.createElement("div",{className:"side left"},""),e.createElement("div",{className:"side right"},""),e.createElement("div",{className:"side bottom"},""),e.createElement("div",{className:"lid"},e.createElement("div",{className:"flap north"},""),e.createElement("div",{className:"flap south"},""),e.createElement("div",{className:"flap east"},""),e.createElement("div",{className:"flap west"},""))))),Eu=({config:t,brandConfig:n})=>{const{heroDesktopImage:o,heroMobileImage:r,heroTitle:i="ZERO WASTE PREMIUM PET CARE",heroSubtitle:a="Earn Doglycoins for exclusive rewards every time you shop.",heroTextAlignment:l="left",heroSubtitleFontSize:c="18px",heroSubtitleColor:s="#000000",heroSubtitleFontWeight:d="400",heroTitleFontSize:p="48px",heroTitleColor:u="#000000",heroRegistrationCTAVisibility:m=!0,primaryColor:g="#1C1C1D",primaryContrastColor:x="#FFFFFF",secondaryColor:f="#FFFFFF",secondaryContrastColor:y="#000000",accentColor:b="#FFFFFF",borderColor:B="#E5E5E5",themeRoundness:I="0px",heroBannerVisibility:z="show",stepsVisibility:F="show",waysToEarnVisibility:D="show",waysToEarnCustomText:P="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",customSectionVisibility:A="show",footerSignupVisibility:_="show",customSectionImagePosition:R="left",customSectionTitle:O="Earn Doglycoins every time you shop",customSectionSubtitle:L="Collect more Doglycoins by entering your birthday, following us on social or referring a friend (details below)\n\nRedeem your Doglycoins for cash off at checkout by signing in or creating an account. Did you shop without registering? No worries, your Credits have been saved for you",customSectionTitleFontSize:M="36px",customSectionSubtitleFontSize:j="18px",customSectionImage:V,customSectionTextAlignment:W="left",customSectionTitleColor:H="#000000",customSectionSubtitleColor:q="#000000",stepsTitle:Q="Getting started is easy",stepsSubtitle:U="Earn Stars and get rewarded in a few easy steps.",step1Title:Y="CREATE AN ACCOUNT",step1Description:G="To get started, Join Now. You can also register on the mobile app to get access to the full range of reward benefits",step2Title:X="ORDER AND EARN REWARDS POINTS",step2Description:Z="Use cash, credit/debit card or save some time and pay right through the app. You'll collect Stars all ways.",step3Title:J="UNLOCK REWARDS AND OFFERS",step3Description:K="As you earn Stars, you can redeem them for Rewards—like free food, drinks, and more. Start redeeming with as little as 25 Stars!",footerCustomText:ee="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",footerSignupSubtext:te="Use your points to redeem samples and more."}=t||{},ne="undefined"!=typeof window&&window.innerWidth<=768,oe=e=>e&&e.startsWith("//")?`https:${e}`:e,re={padding:"12px 32px",borderRadius:"30px",fontSize:"14px",fontWeight:600,cursor:"pointer",textTransform:"uppercase",border:`1px solid ${g}`,transition:"all 0.3s ease"},ie={...re,backgroundColor:g,color:x,borderColor:g},ae={...re,backgroundColor:f,color:y,borderColor:B},{newSignupTokens:le,firstOrderTokens:ce,instagramFollowPoints:se,twitterFollowPoints:de,facebookFollowPoints:pe,youtubeSubscriptionPoints:ue,rewardToLeaveReview:me,birthdayPoints:ge,referralPointsForReferrer:xe,tokenCreditPercentage:fe,brandTokenName:ye}=n||{},be=[...le?[{icon:e.createElement(h,null),title:`${le} ${ye}`,subtitle:"Create an account"}]:[],...ce?[{icon:e.createElement(v,null),title:`${ce} ${ye}`,subtitle:"Place your first order"}]:[],...fe?[{icon:e.createElement(v,null),title:`${fe}% ${ye}`,subtitle:`Earn ${fe}% back on every order`}]:[],...xe?[{icon:e.createElement(w,null),title:`${xe} ${ye}`,subtitle:"Refer a friend and get"}]:[],...ge?[{icon:e.createElement(C,null),title:`${ge} ${ye}`,subtitle:"Get on your birthday to spend"}]:[],...me?[{icon:e.createElement(E,null),title:`${me} ${ye}`,subtitle:"Write a Review"}]:[],...pe?[{icon:e.createElement(k,null),title:`${pe} ${ye}`,subtitle:"Like on Facebook"}]:[],...se?[{icon:e.createElement(T,null),title:`${se} ${ye}`,subtitle:"Follow on Instagram"}]:[],...de?[{icon:e.createElement(S,null),title:`${de} ${ye}`,subtitle:"Follow on Twitter"}]:[],...ue?[{icon:e.createElement($,null),title:`${ue} ${ye}`,subtitle:"Subscribe on YouTube"}]:[]];return e.createElement("div",{className:"yt-loyalty-page-container",style:{fontFamily:"'Poppins', sans-serif",width:"100%",overflow:"hidden"}},"show"===z&&e.createElement("div",{className:"yt-loyalty-page-hero",style:{position:"relative",minHeight:"500px",display:"flex",alignItems:"center",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start",backgroundImage:`url(${oe(ne&&r?r:o)})`,backgroundSize:"cover",backgroundPosition:"center",padding:ne?"40px 20px":"60px 80px"}},e.createElement("div",{className:"yt-loyalty-page-hero-content",style:{maxWidth:"600px",zIndex:2,textAlign:l}},e.createElement("h1",{className:"yt-loyalty-page-hero-title",style:{fontSize:ne?"32px":p,color:u,marginBottom:"16px",lineHeight:1.1,fontWeight:800,textTransform:"uppercase"}},i),e.createElement("p",{className:"yt-loyalty-page-hero-subtitle",style:{fontSize:c,color:s,fontWeight:Number(d)||400,marginBottom:"32px"}},a),m&&e.createElement("div",{className:"yt-loyalty-page-hero-button-wrapper",style:{display:"flex",gap:"16px",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start"}},e.createElement("button",{className:"yt-loyalty-page-hero-button",style:ie,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"Join Now")))),"show"===F&&e.createElement("div",{className:"yt-loyalty-page-steps",style:{padding:"40px 20px",position:"relative",textAlign:"center"}},e.createElement("div",{className:"yt-loyalty-page-steps-background-text",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"GETTING STARTED"),e.createElement("div",{className:"yt-loyalty-page-steps-content",style:{position:"relative",zIndex:1}},e.createElement("h2",{className:"yt-loyalty-page-steps-title",style:{fontSize:"32px",fontWeight:700,marginBottom:"8px",color:"#000"}},Q),e.createElement("p",{className:"yt-loyalty-page-steps-subtitle",style:{color:g,marginBottom:"24px"}},U),e.createElement("div",{className:"yt-loyalty-page-steps-grid",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"center",gap:"40px",maxWidth:"1200px",margin:"0 auto"}},[{icon:e.createElement(v,null),title:Y,desc:G},{icon:e.createElement(N,null),title:X,desc:Z},{icon:e.createElement(C,null),title:J,desc:K}].map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-step-item",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{className:"yt-loyalty-page-step-icon",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"32px",color:"#666",marginBottom:"12px"}},t.icon),e.createElement("div",{className:"yt-loyalty-page-step-title",style:{fontSize:"16px",fontWeight:700,color:g,textTransform:"uppercase",lineHeight:"normal"}},t.title),e.createElement("p",{className:"yt-loyalty-page-step-description",style:{fontSize:"13px",color:g,lineHeight:1.2,maxWidth:"300px"}},t.desc)))))),"show"===D&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn",style:{padding:"40px 20px",position:"relative",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-background-text",style:{position:"absolute",top:ne?"10%":"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"WAYS TO EARN"),e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-grid",style:{position:"relative",zIndex:1,maxWidth:"1000px",margin:"0 auto",display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"12px"}},be.map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-ways-to-earn-item",style:{width:ne?"100%":"220px",border:"2px solid #ddd",padding:"12px 8px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",borderRadius:I,boxShadow:"-1px 2px 3px rgba(0,0,0,0.1)"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-icon",style:{fontSize:"32px",marginBottom:"4px",color:"#1a1a2e"}},t.icon),e.createElement("h3",{className:"yt-loyalty-page-ways-to-earn-title",style:{fontSize:"13px",fontWeight:700,marginBottom:"2px",textTransform:"uppercase",color:"#000"}},t.title),e.createElement("p",{className:"yt-loyalty-page-ways-to-earn-subtitle",style:{fontSize:"11px",color:"#666"}},t.subtitle)))),P&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-custom-text",style:{maxWidth:"1000px",margin:"24px auto 0",backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},P)),"show"===A&&e.createElement("div",{className:"yt-loyalty-page-custom-section",style:{padding:ne?"40px 0px":"40px 20px",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-container",style:{maxWidth:"1200px",margin:"0 auto",display:"flex",flexDirection:ne?"column":"row",alignItems:"center",gap:"40px",borderRadius:I,overflow:"hidden",backgroundColor:"#F9F9F9"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image-wrapper",style:{flex:1,width:"100%",order:ne||"left"===R?0:1}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image",style:{display:"flex",width:"100%",height:"300px",backgroundColor:"#ddd",backgroundImage:V?`url(${oe(V)})`:o?`url(${oe(o)})`:void 0,backgroundSize:"cover",backgroundPosition:"center"}})),e.createElement("div",{className:"yt-loyalty-page-custom-section-content",style:{flex:1,paddingInline:ne?"20px":"10px",textAlign:ne?"center":W,order:ne||"left"===R?1:0,marginBottom:ne?"20px":"0px"}},e.createElement("h2",{className:"yt-loyalty-page-custom-section-title",style:{fontSize:M,fontWeight:700,marginBottom:"16px",color:H}},O),e.createElement("p",{className:"yt-loyalty-page-custom-section-subtitle",style:{fontSize:j,color:q,marginBottom:"24px",lineHeight:1.6,whiteSpace:"pre-line"}},L)))),"show"===_&&e.createElement("div",{className:"yt-loyalty-page-footer",style:{marginBottom:"20px"}},e.createElement("div",{className:"yt-loyalty-page-footer-container",style:{maxWidth:"1200px",margin:"0 auto"}},e.createElement("div",{className:"yt-loyalty-page-footer-custom-text",style:{backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},ee),e.createElement("div",{className:"yt-loyalty-page-footer-signup",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"space-between",alignItems:"center",marginTop:"40px",padding:"20px",border:"1px solid #eee",borderRadius:"4px",gap:"20px",textAlign:ne?"center":"left"}},e.createElement("div",{className:"yt-loyalty-page-footer-signup-content"},e.createElement("h3",{style:{fontSize:"20px",fontWeight:700,marginBottom:"4px",color:"#000",textAlign:ne?"center":"left"}},"Rewards Program"),e.createElement("p",{style:{fontSize:"14px",color:"#666"}},te)),e.createElement("button",{className:"yt-loyalty-page-footer-signup-button",style:ae,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"JOIN NOW")))))},ku=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const s=o._customOffer,d=s?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:i},e.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"16px",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},o.name),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),d&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"16px",padding:"12px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"clamp(16px, 4vw, 18px)",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},d),e.createElement("button",{onClick:async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"20px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(B,null):e.createElement(I,null))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),e.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},e.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),e.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return A(p,document.body)},Tu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const s=o._customOffer,d=s?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:i},e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),e.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),e.createElement("div",{style:{overflowY:"auto",flex:1}},e.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},e.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},o.name),e.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),d&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"20px",padding:"14px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"18px",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},d),e.createElement("button",{onClick:async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"22px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(B,null):e.createElement(I,null)))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),e.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},e.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t)))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return A(p,document.body)},Su=({offersToShow:o,offersConfig:i,getOfferCardMessage:a,setSelectedOffer:l,setShowPopup:c})=>{const s=r(null),[d,p]=t(!1),[u,m]=t(!0),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=768),f=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};n(()=>{f();const e=s.current;if(e)return e.addEventListener("scroll",f),()=>e.removeEventListener("scroll",f)},[o]),n(()=>{const e=()=>{x(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const y=e=>{if(s.current){const t=g?280:365,n=16,o="right"===e?t+n:-(t+n);s.current.scrollBy({left:o,behavior:"smooth"})}};return e.createElement("div",{style:{position:"relative"}},e.createElement("svg",{style:{position:"absolute",width:0,height:0}},e.createElement("defs",null,e.createElement("mask",{id:"coupon-cut-mask-desktop"},e.createElement("rect",{width:"365",height:"138",fill:"white"}),e.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),e.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),e.createElement("mask",{id:"coupon-cut-mask-mobile"},e.createElement("rect",{width:"280",height:"120",fill:"white"}),e.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),e.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&e.createElement("button",{onClick:()=>y("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(z,{size:20})),u&&e.createElement("button",{onClick:()=>y("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(F,{size:20})),e.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:g?"110px":"128px"}},o?.map(t=>e.createElement("div",{key:t.discountId,style:{flexShrink:0,width:g?"280px":"365px",minWidth:g?"280px":"365px",minHeight:g?"110px":"128px",backgroundColor:"transparent",borderRadius:`${i?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},e.createElement("div",{style:{width:g?"60px":"80px",minHeight:g?"110px":"128px",backgroundColor:i?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:g?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${i?.roundness||0}px`,borderBottomLeftRadius:`${i?.roundness||0}px`}},e.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),i?.iconVisibility&&e.createElement("div",{style:{position:"absolute",left:g?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:g?"32px":"40px",height:g?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:g?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{flex:1,padding:g?"12px 12px":"15px 15px",paddingLeft:g?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${i?.roundness||0}px`,borderBottomRightRadius:`${i?.roundness||0}px`,overflow:"hidden",backgroundColor:i?.cardBackgroundColor||"#ffffff",minWidth:0}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:g?"4px":"6px",lineHeight:"normal"}},e.createElement("div",{style:{fontSize:g?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===t.couponType?"Free Gift":t._customOffer?.code?"Coupon":"Special Deal"),e.createElement("div",{style:{fontSize:g?"13px":"15px",fontWeight:"600",color:i?.textColor||"#2c3e50"}},t.name),e.createElement("div",{style:{fontSize:g?"11px":"12px",color:i?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:g?"28px":"32px"}},a(t))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),l(t),c(!0)},style:{fontSize:g?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},i?.viewDetailsTitle||"View Details")))))),e.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},$u=({offersToShow:o,offersConfig:r,getOfferCardMessage:i,setSelectedOffer:a,setShowPopup:l})=>{const[c,s]=t("undefined"!=typeof window&&window.innerWidth<=768);return n(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement("div",{style:{borderRadius:`${r?.roundness||8}px`}},o?.map((t,n)=>e.createElement("div",{key:t.discountId,style:{display:"flex",alignItems:"flex-start",gap:c?"8px":"12px",padding:c?"12px 0":"16px 0",paddingLeft:c?"10px":"20px",backgroundColor:!0===r?.cardBackgroundTransparent||"true"===String(r?.cardBackgroundTransparent)?"transparent":r?.cardBackgroundColor||"#ffffff",borderBottom:n<(o?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${r?.roundness||0}px`}},r?.iconVisibility&&e.createElement("div",{style:{width:c?"40px":"50px",height:c?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:c?"20px":"25px",marginTop:c?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(je,null)),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:c?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},t.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",e.createElement("span",{style:{fontWeight:600,color:r?.textColor||"#34495e"}},t.name)),e.createElement("div",{style:{fontSize:c?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},i(t)),e.createElement("div",{style:{fontSize:c?"11px":"12px",color:"#000000"}},"offer auto applied",e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),a(t),l(!0)},style:{color:r?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},r?.viewDetailsTitle||"T&C"))))))},Nu=({offersConfig:o,offers:i})=>{const[a,l]=t(!1),[c,s]=t(null),[d,p]=t(null),[u,m]=t("undefined"!=typeof window&&window.innerWidth<=768),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=450),f=r(null);n(()=>{const e=()=>{m(window.innerWidth<=768),x(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{f.current&&pn(f.current)},[o?.sectionBgContrastColor]);const y=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",o=-1;Object.keys(t).forEach(e=>{t[e]>o&&(o=t[e],n=e)});const r=e.map((e,t)=>({o:e,idx:t})),i=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return r.sort((e,t)=>{const o=e.o.customCartProgressBarCriteria===n,r=t.o.customCartProgressBarCriteria===n;if(o&&r){const n=i(e.o),o=i(t.o);return n!==o?n-o:e.idx-t.idx}return o&&!r?-1:!o&&r?1:e.idx-t.idx}),r.map(e=>e.o)})((!1===o?.showBackendOffers&&o?.customOffers&&o.customOffers.length>0?o.customOffers.map((e,t)=>{return{discountId:-(t+1),name:(n=e).title,couponType:n.code?"discount_code":"special_deal",customCartProgressBarCriteria:null,discountPercentage:null,couponTemplateId:0,minimumOrderValue:0,quantityThreshold:0,_allVariantIds:[],description:n.description,_customOffer:n};var n}):i)||[]),b=e=>{if(s(e),e){const t=e._customOffer;p(t?(e=>({offerMessage:e.description||"Special offer available",terms:e.terms?e.terms.split("\n").filter(e=>""!==e.trim()):[]}))(t):(e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const o=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?o.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&o.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&o.push("Combines with other order discounts"),t||o.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:o}})(e))}},h=e=>{const t=e._customOffer;return t?t.description||"Special offer available":(e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available")(e)};return e.createElement("div",null,e.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===o?.sectionType?`${o?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:o?.sectionBackgroundColor||"#fff"}},e.createElement("div",{style:{border:"coupon"===o?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=o?.cardPadding?`${o.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===o?.sectionType?`${o?.roundness||8}px`:"0px"}},e.createElement("span",{ref:f,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"right"===o?.alignment?"auto":"50%",right:"right"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===o?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:o?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},o?.sectionTitle||"Available Deals and Offers"),(()=>{const t=o?.sectionType;return"list"===t?e.createElement($u,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):"coupon"===t?e.createElement(Su,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):null})(),g?e.createElement(Tu,{selectedOffer:c,selectedOfferTerms:d,showPopup:a,offersConfig:o,onClose:()=>{l(!1),s(null),p(null)}}):e.createElement(ku,{selectedOffer:c,selectedOfferTerms:d,showPopup:a,offersConfig:o,onClose:()=>{l(!1),s(null),p(null)}}))))};export{Ip as Bundle,Cu as BundleLoader,wu as Cart,Eu as LoyaltyPageBlock,Lt as Nudge,Nu as ProductOffers,Qt as SpinnerWheel};
|