yt-uikit 0.8.18-freebie-milestone.3 → 0.8.18-freebie-milestone.4
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 +45 -45
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRef as o,useCallback as a,useMemo as i,useEffect as l,useState as c,createContext as s,useReducer as d,useDebugValue as p,useContext as u,useLayoutEffect as m,Children as f,cloneElement as g,Component as x}from"react";import h,{keyframes as y,css as b}from"styled-components";import v,{createPortal as w}from"react-dom";var C='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\r\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\r\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"/>\r\n</svg>',k=function(e){return"object"==typeof e&&null!==e},E={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},S=t.createContext&&t.createContext(E),T=["attr","size","title"];function $(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){var r;return r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==typeof r?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){return e&&e.map((e,n)=>t.createElement(e.tag,I({key:n},e.attr),D(e.child)))}function _(e){return n=>t.createElement(P,B({attr:I({},e.attr)},n),D(e.child))}function P(e){var n=n=>{var r,{attr:o,size:a,title:i}=e,l=$(e,T),c=a||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",B({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,o,l,{className:r,style:I(I({color:e.color||n.color},n.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),i&&t.createElement("title",null,i),e.children)};return void 0!==S?t.createElement(S.Consumer,null,e=>n(e)):n(E)}function O(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M48 256c0 114.87 93.13 208 208 208s208-93.13 208-208S370.87 48 256 48 48 141.13 48 256zm212.65-91.36a16 16 0 0 1 .09 22.63L208.42 240H342a16 16 0 0 1 0 32H208.42l52.32 52.73A16 16 0 1 1 238 347.27l-79.39-80a16 16 0 0 1 0-22.54l79.39-80a16 16 0 0 1 22.65-.09z"},child:[]}]})(e)}function F(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 256c0-114.87-93.13-208-208-208S48 141.13 48 256s93.13 208 208 208 208-93.13 208-208zm-212.65 91.36a16 16 0 0 1-.09-22.63L303.58 272H170a16 16 0 0 1 0-32h133.58l-52.32-52.73A16 16 0 1 1 274 164.73l79.39 80a16 16 0 0 1 0 22.54l-79.39 80a16 16 0 0 1-22.65.09z"},child:[]}]})(e)}function A(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 128a64 64 0 0 0-64-64h-16V48.45c0-8.61-6.62-16-15.23-16.43A16 16 0 0 0 368 48v16H144V48.45c0-8.61-6.62-16-15.23-16.43A16 16 0 0 0 112 48v16H96a64 64 0 0 0-64 64v12a4 4 0 0 0 4 4h440a4 4 0 0 0 4-4zM32 416a64 64 0 0 0 64 64h320a64 64 0 0 0 64-64V179a3 3 0 0 0-3-3H35a3 3 0 0 0-3 3zm344-208a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm-80-80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm-80-80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm-80-80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24z"},child:[]}]})(e)}function M(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M328 112 184 256l144 144"},child:[]}]})(e)}function R(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function L(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function j(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m184 112 144 144-144 144"},child:[]}]})(e)}function V(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function W(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M346 110a34 34 0 0 0-68 0v34h34a34 34 0 0 0 34-34zm-112 0a34 34 0 1 0-34 34h34z"},child:[]},{tag:"path",attr:{d:"M234 144h44v112h164a22 22 0 0 0 22-22v-68a22 22 0 0 0-22-22h-59.82A77.95 77.95 0 0 0 256 55.79 78 78 0 0 0 129.81 144H70a22 22 0 0 0-22 22v68a22 22 0 0 0 22 22h164zm44-34a34 34 0 1 1 34 34h-34zm-112 0a34 34 0 1 1 68 0v34h-34a34 34 0 0 1-34-34zm112 370h132a22 22 0 0 0 22-22V288H278zM80 458a22 22 0 0 0 22 22h132V288H80z"},child:[]}]})(e)}function H(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M200 144h40v-40a40 40 0 1 0-40 40zm152-40a40 40 0 0 0-80 0v40h40a40 40 0 0 0 40-40z"},child:[]},{tag:"path",attr:{d:"M80 416a64 64 0 0 0 64 64h92a4 4 0 0 0 4-4V292a4 4 0 0 0-4-4H88a8 8 0 0 0-8 8zm160-164V144h32v108a4 4 0 0 0 4 4h140a47.93 47.93 0 0 0 16-2.75A48.09 48.09 0 0 0 464 208v-16a48 48 0 0 0-48-48h-40.54a2 2 0 0 1-1.7-3A72 72 0 0 0 256 58.82 72 72 0 0 0 138.24 141a2 2 0 0 1-1.7 3H96a48 48 0 0 0-48 48v16a48.09 48.09 0 0 0 32 45.25A47.93 47.93 0 0 0 96 256h140a4 4 0 0 0 4-4zm32-148a40 40 0 1 1 40 40h-40zm-74.86-39.9A40 40 0 0 1 240 104v40h-40a40 40 0 0 1-2.86-79.89zM276 480h92a64 64 0 0 0 64-64V296a8 8 0 0 0-8-8H276a4 4 0 0 0-4 4v184a4 4 0 0 0 4 4z"},child:[]}]})(e)}function q(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}q('@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");');var U=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["Andorra","ad","376"],["Angola","ao","244"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54","(..) ........",0],["Armenia","am","374",".. ......"],["Aruba","aw","297"],["Australia","au","61",{default:". .... ....","/^4/":"... ... ...","/^5(?!50)/":"... ... ...","/^1(3|8)00/":".... ... ...","/^13/":".. .. ..","/^180/":"... ...."},0,[]],["Austria","at","43"],["Azerbaijan","az","994","(..) ... .. .."],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375","(..) ... .. .."],["Belgium","be","32","... .. .. .."],["Belize","bz","501"],["Benin","bj","229"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55","(..) .....-...."],["British Indian Ocean Territory","io","246"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599","",1],["Cayman Islands","ky","1","... ... ....",4,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86","... .... ...."],["Colombia","co","57","... ... ...."],["Comoros","km","269"],["Congo","cd","243"],["Congo","cg","242"],["Costa Rica","cr","506","....-...."],["Côte d'Ivoire","ci","225",".. .. .. .. .."],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599","",0],["Cyprus","cy","357",".. ......"],["Czech Republic","cz","420","... ... ..."],["Denmark","dk","45",".. .. .. .."],["Djibouti","dj","253",".. .. ...."],["Dominica","dm","1767"],["Dominican Republic","do","1","(...) ...-....",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503","....-...."],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372",".... ......"],["Ethiopia","et","251",".. ... ...."],["Faroe Islands","fo","298",".. .. .."],["Fiji","fj","679"],["Finland","fi","358",".. ... .. .."],["France","fr","33",". .. .. .. .."],["French Guiana","gf","594","... .. .. .."],["French Polynesia","pf","689",{"/^44/":".. .. ..","/^80[0-5]/":"... .. .. ..",default:".. .. .. .."}],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49","... ........."],["Ghana","gh","233"],["Greece","gr","30"],["Greenland","gl","299",".. .. .."],["Grenada","gd","1473"],["Guadeloupe","gp","590","... .. .. ..",0],["Guam","gu","1671"],["Guatemala","gt","502","....-...."],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509","....-...."],["Honduras","hn","504"],["Hong Kong","hk","852",".... ...."],["Hungary","hu","36"],["Iceland","is","354","... ...."],["India","in","91",".....-....."],["Indonesia","id","62"],["Iran","ir","98","... ... ...."],["Iraq","iq","964"],["Ireland","ie","353",".. ......."],["Israel","il","972","... ... ...."],["Italy","it","39","... .......",0],["Jamaica","jm","1876"],["Japan","jp","81",".. .... ...."],["Jordan","jo","962"],["Kazakhstan","kz","7","... ...-..-..",0],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996","... ... ..."],["Laos","la","856"],["Latvia","lv","371",".. ... ..."],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60","..-....-...."],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596","... .. .. .."],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262","... .. .. ..",1,["269","639"]],["Mexico","mx","52","... ... ....",0],["Micronesia","fm","691"],["Moldova","md","373","(..) ..-..-.."],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Morocco","ma","212"],["Mozambique","mz","258"],["Myanmar","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31",{"/^06/":"(.). .........","/^6/":". .........","/^0(10|13|14|15|20|23|24|26|30|33|35|36|38|40|43|44|45|46|50|53|55|58|70|71|72|73|74|75|76|77|78|79|82|84|85|87|88|91)/":"(.).. ........","/^(10|13|14|15|20|23|24|26|30|33|35|36|38|40|43|44|45|46|50|53|55|58|70|71|72|73|74|75|76|77|78|79|82|84|85|87|88|91)/":".. ........","/^0/":"(.)... .......",default:"... ......."}],["New Caledonia","nc","687"],["New Zealand","nz","64","...-...-...."],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["North Korea","kp","850"],["Norway","no","47","... .. ..."],["Oman","om","968"],["Pakistan","pk","92","...-......."],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63","... ... ...."],["Poland","pl","48","...-...-..."],["Portugal","pt","351"],["Puerto Rico","pr","1","(...) ...-....",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262","... .. .. ..",0],["Romania","ro","40"],["Russia","ru","7","(...) ...-..-..",1],["Rwanda","rw","250"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Pierre & Miquelon","pm","508",{"/^708/":"... ... ...","/^8/":"... .. .. ..",default:".. .. .."}],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65","....-...."],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82","... .... ...."],["South Sudan","ss","211"],["Spain","es","34","... ... ..."],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Swaziland","sz","268"],["Sweden","se","46","... ... ..."],["Switzerland","ch","41",".. ... .. .."],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90","... ... .. .."],["Turkmenistan","tm","993"],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380","(..) ... .. .."],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",".... ......"],["United States","us","1","(...) ...-....",0],["Uruguay","uy","598"],["Uzbekistan","uz","998",".. ... .. .."],["Vanuatu","vu","678"],["Vatican City","va","39",".. .... ....",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681",".. .. .."],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"]],Q=(...e)=>e.filter(e=>!!e).join(" ").trim(),Y=({addPrefix:e,rawClassNames:t})=>Q(((...e)=>Q(...e).split(" ").map(e=>`react-international-phone-${e}`).join(" "))(...e),...t),G=e=>!!e&&/^\d+$/.test(e),Z=e=>e.replace(/\D/g,""),X=({phone:e,prefix:t})=>e?`${t}${Z(e)}`:"";function K({value:e,country:t,insertDialCodeOnEmpty:n,trimNonDigitsEnd:r,countries:o,prefix:a,charAfterDialCode:i,forceDialCode:l,disableDialCodeAndPrefix:c,defaultMask:s,countryGuessingEnabled:d,disableFormatting:p}){let u=e;c&&(u=u.startsWith(`${a}`)?u:`${a}${t.dialCode}${u}`);let m=d?be({phone:u,countries:o,currentCountryIso2:t?.iso2}):void 0,f=m?.country??t,g=((e,t)=>{let n=!t.disableDialCodeAndPrefix&&t.forceDialCode,r=!t.disableDialCodeAndPrefix&&t.insertDialCodeOnEmpty,o=e,a=e=>t.trimNonDigitsEnd?e.trim():e;if(!o)return r&&!o.length||n?a(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`):a(o);if(o=Z(o),o===t.dialCode&&!t.disableDialCodeAndPrefix)return a(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`);if(t.dialCode.startsWith(o)&&!t.disableDialCodeAndPrefix)return a(n?`${t.prefix}${t.dialCode}${t.charAfterDialCode}`:`${t.prefix}${o}`);if(!o.startsWith(t.dialCode)&&!t.disableDialCodeAndPrefix){if(n)return a(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`);if(o.length<t.dialCode.length)return a(`${t.prefix}${o}`)}let{phoneLeftSide:i,phoneRightSide:l}=(()=>{let e=t.dialCode.length;return{phoneLeftSide:o.slice(0,e),phoneRightSide:o.slice(e)}})();return i=`${t.prefix}${i}${t.charAfterDialCode}`,l=(({value:e,mask:t,maskSymbol:n,offset:r=0,trimNonMaskCharsLeftover:o=!1})=>{if(e.length<r)return e;let a=e.slice(0,r),i=e.slice(r),l=a,c=0;for(let e of t.split("")){if(c>=i.length){if(!o&&e!==n){l+=e;continue}break}e===n?(l+=i[c],c+=1):l+=e}return l})({value:l,mask:t.mask,maskSymbol:t.maskChar,trimNonMaskCharsLeftover:t.trimNonDigitsEnd||t.disableDialCodeAndPrefix&&0===l.length}),t.disableDialCodeAndPrefix&&(i=""),a(`${i}${l}`)})(u,{prefix:a,mask:xe({phone:u,country:f,defaultMask:s,disableFormatting:p}),maskChar:ne,dialCode:f.dialCode,trimNonDigitsEnd:r,charAfterDialCode:i,forceDialCode:l,insertDialCodeOnEmpty:n,disableDialCodeAndPrefix:c}),x=d&&!m?.fullDialCodeMatch?t:f;return{phone:X({phone:c?`${x.dialCode}${g}`:g,prefix:a}),inputValue:g,country:x}}var J=(e,{country:t,insertDialCodeOnEmpty:n,phoneBeforeInput:r,prefix:o,charAfterDialCode:a,forceDialCode:i,disableDialCodeAndPrefix:l,countryGuessingEnabled:c,defaultMask:s,disableFormatting:d,countries:p})=>{let u=e.nativeEvent,m=u.inputType,f=(e=>{if(e?.toLocaleLowerCase().includes("delete"))return e?.toLocaleLowerCase().includes("forward")?"forward":"backward"})(m),g=!!m?.startsWith("insertFrom"),x="insertText"===m,h=u?.data||void 0,y=e.target.value,b=e.target.selectionStart??0;if(m?.includes("history"))return{inputValue:r,phone:X({phone:r,prefix:o}),cursorPosition:r.length,country:t};if(x&&!G(h)&&y!==o)return{inputValue:r,phone:X({phone:l?`${t.dialCode}${r}`:r,prefix:o}),cursorPosition:b-(h?.length??0),country:t};if(i&&!y.startsWith(`${o}${t.dialCode}`)&&!g){let e=y?r:`${o}${t.dialCode}${a}`;return{inputValue:e,phone:X({phone:e,prefix:o}),cursorPosition:o.length+t.dialCode.length+a.length,country:t}}let{phone:v,inputValue:w,country:C}=K({value:y,country:t,trimNonDigitsEnd:"backward"===f,insertDialCodeOnEmpty:n,countryGuessingEnabled:c,countries:p,prefix:o,charAfterDialCode:a,forceDialCode:i,disableDialCodeAndPrefix:l,disableFormatting:d,defaultMask:s}),k=(({phoneBeforeInput:e,phoneAfterInput:t,phoneAfterFormatted:n,cursorPositionAfterInput:r,leftOffset:o=0,deletion:a})=>{if(r<o)return o;if(!e)return n.length;let i=null;for(let e=r-1;e>=0;e-=1)if(G(t[e])){i=e;break}if(null===i){for(let e=0;e<t.length;e+=1)if(G(n[e]))return e;return t.length}let l=0;for(let e=0;e<i;e+=1)G(t[e])&&(l+=1);let c=0,s=0;for(let e=0;e<n.length&&(c+=1,G(n[e])&&(s+=1),!(s>=l+1));e+=1);if("backward"!==a)for(;!G(n[c])&&c<n.length;)c+=1;return c})({cursorPositionAfterInput:b,phoneBeforeInput:r,phoneAfterInput:y,phoneAfterFormatted:w,leftOffset:i?o.length+t.dialCode.length+a.length:0,deletion:f});return{phone:v,inputValue:w,cursorPosition:k,country:C}},ee={size:20,overrideLastItemDebounceMS:-1};function te(e,t){let{size:n,overrideLastItemDebounceMS:r,onChange:a}={...ee,...t},[i,l]=c(e),[s,d]=c([i]),[p,u]=c(0),m=(()=>{let e=o(),t=o(Date.now());return{check:()=>{let n=Date.now(),r=e.current?n-t.current:void 0;return e.current=t.current,t.current=n,r}}})();return[i,(e,t)=>{if("object"==typeof e&&"object"==typeof i&&((e,t)=>{let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0})(e,i)||e===i)return;let o=r>0,c=m.check(),f=!o||void 0===c||c>r;if(void 0!==t?.overrideLastItem?t.overrideLastItem:!f)d(t=>[...t.slice(0,p),e]);else{let t=s.length>=n;d(n=>[...n.slice(t?1:0,p+1),e]),t||u(e=>e+1)}l(e),a?.(e)},()=>{if(p<=0)return{success:!1};let e=s[p-1];return l(e),u(e=>e-1),a?.(e),{success:!0,value:e}},()=>{if(p+1>=s.length)return{success:!1};let e=s[p+1];return l(e),u(e=>e+1),a?.(e),{success:!0,value:e}}]}var ne=".",re="us",oe="",ae="+",ie="............",le=" ",ce=200,se=!1,de=!1,pe=!1,ue=!1,me=!1,fe=U,ge=({defaultCountry:e=re,value:t=oe,countries:n=fe,prefix:r=ae,defaultMask:s=ie,charAfterDialCode:d=le,historySaveDebounceMS:p=ce,disableCountryGuess:u=se,disableDialCodePrefill:m=de,forceDialCode:f=pe,disableDialCodeAndPrefix:g=ue,disableFormatting:x=me,onChange:h,inputRef:y})=>{let b={countries:n,prefix:r,charAfterDialCode:d,forceDialCode:!g&&f,disableDialCodeAndPrefix:g,defaultMask:s,countryGuessingEnabled:!u,disableFormatting:x},v=o(null),w=y||v,C=e=>{Promise.resolve().then(()=>{typeof window>"u"||w.current!==document?.activeElement||w.current?.setSelectionRange(e,e)})},[{phone:k,inputValue:E,country:S},T,$,B]=te(()=>{let r=ye({value:e,field:"iso2",countries:n});r||console.error(`[react-international-phone]: can not find a country with "${e}" iso2 code`);let o=r||ye({value:"us",field:"iso2",countries:n}),{phone:a,inputValue:i,country:l}=K({value:t,country:o,insertDialCodeOnEmpty:!m,...b});return C(i.length),{phone:a,inputValue:i,country:l.iso2}},{overrideLastItemDebounceMS:p,onChange:({inputValue:e,phone:t,country:n})=>{if(!h)return;let r=z(n);h({phone:t,inputValue:e,country:r})}}),z=a(e=>ye({value:e,field:"iso2",countries:n}),[n]),I=i(()=>z(S),[S,z]);l(()=>{let e=w.current;if(!e)return;let t=e=>{if(!e.key)return;let t=e.ctrlKey,n=e.metaKey,r=e.shiftKey;if("z"===e.key.toLowerCase()){if(typeof window>"u"||!window.navigator.userAgent.toLowerCase().includes("macintosh")){if(!t)return}else if(!n)return;r?B():$()}};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[w,$,B]);let[N,D]=c(!1);return l(()=>{if(!N)return D(!0),void(t!==k&&h?.({inputValue:E,phone:k,country:I}));if(t===k)return;let{phone:e,inputValue:n,country:r}=K({value:t,country:I,insertDialCodeOnEmpty:!m,...b});T({phone:e,inputValue:n,country:r.iso2})},[t]),{phone:k,inputValue:E,country:I,setCountry:(e,t={focusOnInput:!1})=>{let o=ye({value:e,field:"iso2",countries:n});if(!o)return void console.error(`[react-international-phone]: can not find a country with "${e}" iso2 code`);let a=g?"":`${r}${o.dialCode}${d}`;T({inputValue:a,phone:`${r}${o.dialCode}`,country:o.iso2}),t.focusOnInput&&Promise.resolve().then(()=>{w.current?.focus()})},handlePhoneValueChange:e=>{e.preventDefault();let{phone:n,inputValue:r,country:o,cursorPosition:a}=J(e,{country:I,phoneBeforeInput:E,insertDialCodeOnEmpty:!1,...b});return T({inputValue:r,phone:n,country:o.iso2}),C(a),t},inputRef:w}},xe=({phone:e,country:t,defaultMask:n="............",disableFormatting:r=!1})=>{let o=t.format,a=e=>r?e.replace(new RegExp(`[^${ne}]`,"g"),""):e;if(!o)return a(n);if("string"==typeof o)return a(o);if(!o.default)return console.error(`[react-international-phone]: default mask for ${t.iso2} is not provided`),a(n);let i=Object.keys(o).find(n=>{if("default"===n)return!1;if("/"!==n.charAt(0)||"/"!==n.charAt(n.length-1))return console.error(`[react-international-phone]: format regex "${n}" for ${t.iso2} is not valid`),!1;let r=new RegExp(n.substring(1,n.length-1)),o=e.replace(t.dialCode,"");return r.test(Z(o))});return a(i?o[i]:o.default)},he=e=>{let[t,n,r,o,a,i]=e;return{name:t,iso2:n,dialCode:r,format:o,priority:a,areaCodes:i}},ye=({field:e,value:t,countries:n=U})=>{if(["priority"].includes(e))throw new Error((e=>`Field "${e}" is not supported`)(e));let r=n.find(n=>{let r=he(n);return t===r[e]});if(r)return he(r)},be=({phone:e,countries:t=U,currentCountryIso2:n})=>{let r={country:void 0,fullDialCodeMatch:!1};if(!e)return r;let o=Z(e);if(!o)return r;let a=r,i=({country:e,fullDialCodeMatch:t})=>{let n=e.dialCode===a.country?.dialCode,r=(e.priority??0)<(a.country?.priority??0);(!n||r)&&(a={country:e,fullDialCodeMatch:t})};for(let e of t){let t=he(e),{dialCode:n,areaCodes:r}=t;if(o.startsWith(n)){let e=!a.country||Number(n)>=Number(a.country.dialCode);if(r){let e=o.substring(n.length);for(let n of r)if(e.startsWith(n))return{country:t,fullDialCodeMatch:!0}}(e||n===o||!a.fullDialCodeMatch)&&i({country:t,fullDialCodeMatch:!0})}a.fullDialCodeMatch||o.length<n.length&&n.startsWith(o)&&(!a.country||Number(n)<=Number(a.country.dialCode))&&i({country:t,fullDialCodeMatch:!1})}if(n){let e=ye({value:n,field:"iso2",countries:t});if(!e)return a;let r=!!e&&(e=>{if(!e?.areaCodes)return!1;let t=o.substring(e.dialCode.length);return e.areaCodes.some(e=>e.startsWith(t))})(e);a&&a.country?.dialCode===e.dialCode&&a.country!==e&&a.fullDialCodeMatch&&(!e.areaCodes||r)&&(a={country:e,fullDialCodeMatch:!0})}return a},ve=(e,t)=>{let n=parseInt(e,16);return Number(n+t).toString(16)},we="abcdefghijklmnopqrstuvwxyz".split("").reduce((e,t,n)=>({...e,[t]:ve("1f1e6",n)}),{}),Ce=({iso2:e,size:n,src:r,protocol:o="https",disableLazyLoading:a,className:i,style:l,...c})=>{if(!e)return t.createElement("img",{className:Y({addPrefix:["flag-emoji"],rawClassNames:[i]}),width:n,height:n,...c});return t.createElement("img",{className:Y({addPrefix:["flag-emoji"],rawClassNames:[i]}),src:(()=>{if(r)return r;let t=(e=>[we[e[0]],we[e[1]]].join("-"))(e);return`${o}://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${t}.svg`})(),width:n,height:n,draggable:!1,"data-country":e,loading:a?void 0:"lazy",style:{width:n,height:n,...l},alt:"",...c})},ke=({show:e,dialCodePrefix:n="+",selectedCountry:r,countries:s=U,preferredCountries:d=[],flags:p,onSelect:u,onClose:m,...f})=>{let g=o(null),x=o(),h=i(()=>{if(!d||!d.length)return s;let e=[],t=[...s];for(let n of d){let r=t.findIndex(e=>he(e).iso2===n);if(-1!==r){let n=t.splice(r,1)[0];e.push(n)}}return e.concat(t)},[s,d]),y=o({updatedAt:void 0,value:""}),b=a(e=>h.findIndex(t=>he(t).iso2===e),[h]),[v,w]=c(b(r)),C=()=>{x.current!==r&&w(b(r))},k=a(e=>{w(b(e.iso2)),u?.(e)},[u,b]),E=e=>{let t=h.length-1;w(n=>{let r=(n=>"prev"===e?n-1:"next"===e?n+1:"last"===e?t:0)(n);return r<0?0:r>t?t:r})},S=a(()=>{if(!g.current||void 0===v)return;let e=he(h[v]).iso2;if(e===x.current)return;let t=g.current.querySelector(`[data-country="${e}"]`);t&&(((e,t)=>{let n=e.style.display;"block"!==n&&(e.style.display="block");let r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),a=o.top-r.top,i=r.bottom-o.bottom;a>=0&&i>=0||(Math.abs(a)<Math.abs(i)?e.scrollTop+=a:e.scrollTop-=i),e.style.display=n})(g.current,t),x.current=e)},[v,h]);return l(()=>{S()},[v,S]),l(()=>{g.current&&(e?g.current.focus():C())},[e]),l(()=>{C()},[r]),t.createElement("ul",{ref:g,role:"listbox",className:Y({addPrefix:["country-selector-dropdown"],rawClassNames:[f.className]}),style:{display:e?"block":"none",...f.style},onKeyDown:e=>{if(e.stopPropagation(),"Enter"===e.key){e.preventDefault();let t=he(h[v]);return void k(t)}if("Escape"!==e.key)return"ArrowUp"===e.key?(e.preventDefault(),void E("prev")):"ArrowDown"===e.key?(e.preventDefault(),void E("next")):"PageUp"===e.key?(e.preventDefault(),void E("first")):"PageDown"===e.key?(e.preventDefault(),void E("last")):(" "===e.key&&e.preventDefault(),void(1===e.key.length&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&(e=>{let t=y.current.updatedAt&&(new Date).getTime()-y.current.updatedAt.getTime()>1e3;y.current={value:t?e:`${y.current.value}${e}`,updatedAt:new Date};let n=h.findIndex(e=>he(e).name.toLowerCase().startsWith(y.current.value));-1!==n&&w(n)})(e.key.toLocaleLowerCase())));m?.()},onBlur:m,tabIndex:-1,"aria-activedescendant":`react-international-phone__${he(h[v]).iso2}-option`},h.map((e,o)=>{let a=he(e),i=a.iso2===r,l=o===v,c=d.includes(a.iso2),s=o===d.length-1,u=p?.find(e=>e.iso2===a.iso2);return t.createElement(t.Fragment,{key:a.iso2},t.createElement("li",{"data-country":a.iso2,role:"option","aria-selected":i,"aria-label":`${a.name} ${n}${a.dialCode}`,id:`react-international-phone__${a.iso2}-option`,className:Y({addPrefix:["country-selector-dropdown__list-item",c&&"country-selector-dropdown__list-item--preferred",i&&"country-selector-dropdown__list-item--selected",l&&"country-selector-dropdown__list-item--focused"],rawClassNames:[f.listItemClassName,c&&f.listItemPreferredClassName,i&&f.listItemSelectedClassName,l&&f.listItemFocusedClassName]}),onClick:()=>k(a),style:f.listItemStyle,title:a.name},t.createElement(Ce,{iso2:a.iso2,src:u?.src,className:Y({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[f.listItemFlagClassName]}),style:f.listItemFlagStyle}),t.createElement("span",{className:Y({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[f.listItemCountryNameClassName]}),style:f.listItemCountryNameStyle},a.name),t.createElement("span",{className:Y({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[f.listItemDialCodeClassName]}),style:f.listItemDialCodeStyle},n,a.dialCode)),s?t.createElement("hr",{className:Y({addPrefix:["country-selector-dropdown__preferred-list-divider"],rawClassNames:[f.preferredListDividerClassName]}),style:f.preferredListDividerStyle}):null)}))},Ee=({selectedCountry:e,onSelect:n,disabled:r,hideDropdown:a,countries:l=U,preferredCountries:s=[],flags:d,renderButtonWrapper:p,...u})=>{let[m,f]=c(!1),g=i(()=>{if(e)return ye({value:e,field:"iso2",countries:l})},[l,e]),x=o(null),h=e=>{e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),f(!0))};return t.createElement("div",{className:Y({addPrefix:["country-selector"],rawClassNames:[u.className]}),style:u.style,ref:x},(()=>{let n={title:g?.name,onClick:()=>f(e=>!e),onMouseDown:e=>e.preventDefault(),onKeyDown:h,disabled:a||r,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":m},o=t.createElement("div",{className:Y({addPrefix:["country-selector-button__button-content"],rawClassNames:[u.buttonContentWrapperClassName]}),style:u.buttonContentWrapperStyle},t.createElement(Ce,{iso2:e,src:d?.find(t=>t.iso2===e)?.src,className:Y({addPrefix:["country-selector-button__flag-emoji",r&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[u.flagClassName]}),style:{visibility:e?"visible":"hidden",...u.flagStyle}}),!a&&t.createElement("div",{className:Y({addPrefix:["country-selector-button__dropdown-arrow",r&&"country-selector-button__dropdown-arrow--disabled",m&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[u.dropdownArrowClassName]}),style:u.dropdownArrowStyle}));return p?p({children:o,rootProps:n}):t.createElement("button",{...n,type:"button",className:Y({addPrefix:["country-selector-button",m&&"country-selector-button--active",r&&"country-selector-button--disabled",a&&"country-selector-button--hide-dropdown"],rawClassNames:[u.buttonClassName]}),"data-country":e,style:u.buttonStyle},o)})(),t.createElement(ke,{show:m,countries:l,preferredCountries:s,flags:d,onSelect:e=>{f(!1),n?.(e)},selectedCountry:e,onClose:()=>{f(!1)},...u.dropdownStyleProps}))},Se=({dialCode:e,prefix:n,disabled:r,style:o,className:a})=>t.createElement("div",{className:Y({addPrefix:["dial-code-preview",r&&"dial-code-preview--disabled"],rawClassNames:[a]}),style:o},`${n}${e}`),Te=n(({value:e,onChange:n,countries:o=U,preferredCountries:a=[],hideDropdown:i,showDisabledDialCodeAndPrefix:l,disableFocusAfterCountrySelect:c,flags:s,style:d,className:p,inputStyle:u,inputClassName:m,countrySelectorStyleProps:f,dialCodePreviewStyleProps:g,inputProps:x,placeholder:h,disabled:y,name:b,onFocus:v,onBlur:w,required:C,autoFocus:k,...E},S)=>{let{phone:T,inputValue:$,inputRef:B,country:z,setCountry:I,handlePhoneValueChange:N}=ge({value:e,countries:o,...E,onChange:e=>{n?.(e.phone,{country:e.country,inputValue:e.inputValue})}}),D=E.disableDialCodeAndPrefix&&l&&z?.dialCode;return r(S,()=>B.current?Object.assign(B.current,{setCountry:I,state:{phone:T,inputValue:$,country:z}}):null,[B,I,T,$,z]),t.createElement("div",{ref:S,className:Y({addPrefix:["input-container"],rawClassNames:[p]}),style:d},t.createElement(Ee,{onSelect:e=>I(e.iso2,{focusOnInput:!c}),flags:s,selectedCountry:z.iso2,countries:o,preferredCountries:a,disabled:y,hideDropdown:i,...f}),D&&t.createElement(Se,{dialCode:z.dialCode,prefix:E.prefix??"+",disabled:y,...g}),t.createElement("input",{onChange:N,value:$,type:"tel",ref:B,className:Y({addPrefix:["input",y&&"input--disabled"],rawClassNames:[m]}),placeholder:h,disabled:y,style:u,name:b,onFocus:v,onBlur:w,autoFocus:k,required:C,...x}))});q(".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 $e=h.div`
|
|
1
|
+
import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRef as o,useCallback as a,useMemo as i,useEffect as l,useState as c,createContext as s,useReducer as d,useDebugValue as p,useContext as u,useLayoutEffect as m,Children as f,cloneElement as g,Component as x}from"react";import h,{keyframes as y,css as b}from"styled-components";import v,{createPortal as w}from"react-dom";var C='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\r\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\r\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"/>\r\n</svg>',k=function(e){return"object"==typeof e&&null!==e},E={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},S=t.createContext&&t.createContext(E),T=["attr","size","title"];function $(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){var r;return r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==typeof r?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){return e&&e.map((e,n)=>t.createElement(e.tag,I({key:n},e.attr),D(e.child)))}function _(e){return n=>t.createElement(P,B({attr:I({},e.attr)},n),D(e.child))}function P(e){var n=n=>{var r,{attr:o,size:a,title:i}=e,l=$(e,T),c=a||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.createElement("svg",B({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,o,l,{className:r,style:I(I({color:e.color||n.color},n.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),i&&t.createElement("title",null,i),e.children)};return void 0!==S?t.createElement(S.Consumer,null,e=>n(e)):n(E)}function F(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M48 256c0 114.87 93.13 208 208 208s208-93.13 208-208S370.87 48 256 48 48 141.13 48 256zm212.65-91.36a16 16 0 0 1 .09 22.63L208.42 240H342a16 16 0 0 1 0 32H208.42l52.32 52.73A16 16 0 1 1 238 347.27l-79.39-80a16 16 0 0 1 0-22.54l79.39-80a16 16 0 0 1 22.65-.09z"},child:[]}]})(e)}function O(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 256c0-114.87-93.13-208-208-208S48 141.13 48 256s93.13 208 208 208 208-93.13 208-208zm-212.65 91.36a16 16 0 0 1-.09-22.63L303.58 272H170a16 16 0 0 1 0-32h133.58l-52.32-52.73A16 16 0 1 1 274 164.73l79.39 80a16 16 0 0 1 0 22.54l-79.39 80a16 16 0 0 1-22.65.09z"},child:[]}]})(e)}function A(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 128a64 64 0 0 0-64-64h-16V48.45c0-8.61-6.62-16-15.23-16.43A16 16 0 0 0 368 48v16H144V48.45c0-8.61-6.62-16-15.23-16.43A16 16 0 0 0 112 48v16H96a64 64 0 0 0-64 64v12a4 4 0 0 0 4 4h440a4 4 0 0 0 4-4zM32 416a64 64 0 0 0 64 64h320a64 64 0 0 0 64-64V179a3 3 0 0 0-3-3H35a3 3 0 0 0-3 3zm344-208a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm-80-80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm-80-80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm-80-80a24 24 0 1 1-24 24 24 24 0 0 1 24-24zm0 80a24 24 0 1 1-24 24 24 24 0 0 1 24-24z"},child:[]}]})(e)}function M(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M328 112 184 256l144 144"},child:[]}]})(e)}function R(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function L(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 184 144 144 144-144"},child:[]}]})(e)}function j(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m184 112 144 144-144 144"},child:[]}]})(e)}function V(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(e)}function W(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M346 110a34 34 0 0 0-68 0v34h34a34 34 0 0 0 34-34zm-112 0a34 34 0 1 0-34 34h34z"},child:[]},{tag:"path",attr:{d:"M234 144h44v112h164a22 22 0 0 0 22-22v-68a22 22 0 0 0-22-22h-59.82A77.95 77.95 0 0 0 256 55.79 78 78 0 0 0 129.81 144H70a22 22 0 0 0-22 22v68a22 22 0 0 0 22 22h164zm44-34a34 34 0 1 1 34 34h-34zm-112 0a34 34 0 1 1 68 0v34h-34a34 34 0 0 1-34-34zm112 370h132a22 22 0 0 0 22-22V288H278zM80 458a22 22 0 0 0 22 22h132V288H80z"},child:[]}]})(e)}function H(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M200 144h40v-40a40 40 0 1 0-40 40zm152-40a40 40 0 0 0-80 0v40h40a40 40 0 0 0 40-40z"},child:[]},{tag:"path",attr:{d:"M80 416a64 64 0 0 0 64 64h92a4 4 0 0 0 4-4V292a4 4 0 0 0-4-4H88a8 8 0 0 0-8 8zm160-164V144h32v108a4 4 0 0 0 4 4h140a47.93 47.93 0 0 0 16-2.75A48.09 48.09 0 0 0 464 208v-16a48 48 0 0 0-48-48h-40.54a2 2 0 0 1-1.7-3A72 72 0 0 0 256 58.82 72 72 0 0 0 138.24 141a2 2 0 0 1-1.7 3H96a48 48 0 0 0-48 48v16a48.09 48.09 0 0 0 32 45.25A47.93 47.93 0 0 0 96 256h140a4 4 0 0 0 4-4zm32-148a40 40 0 1 1 40 40h-40zm-74.86-39.9A40 40 0 0 1 240 104v40h-40a40 40 0 0 1-2.86-79.89zM276 480h92a64 64 0 0 0 64-64V296a8 8 0 0 0-8-8H276a4 4 0 0 0-4 4v184a4 4 0 0 0 4 4z"},child:[]}]})(e)}function q(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}q('@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");');var U=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["Andorra","ad","376"],["Angola","ao","244"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54","(..) ........",0],["Armenia","am","374",".. ......"],["Aruba","aw","297"],["Australia","au","61",{default:". .... ....","/^4/":"... ... ...","/^5(?!50)/":"... ... ...","/^1(3|8)00/":".... ... ...","/^13/":".. .. ..","/^180/":"... ...."},0,[]],["Austria","at","43"],["Azerbaijan","az","994","(..) ... .. .."],["Bahamas","bs","1242"],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1246"],["Belarus","by","375","(..) ... .. .."],["Belgium","be","32","... .. .. .."],["Belize","bz","501"],["Benin","bj","229"],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55","(..) .....-...."],["British Indian Ocean Territory","io","246"],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1","(...) ...-....",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599","",1],["Cayman Islands","ky","1","... ... ....",4,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86","... .... ...."],["Colombia","co","57","... ... ...."],["Comoros","km","269"],["Congo","cd","243"],["Congo","cg","242"],["Costa Rica","cr","506","....-...."],["Côte d'Ivoire","ci","225",".. .. .. .. .."],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599","",0],["Cyprus","cy","357",".. ......"],["Czech Republic","cz","420","... ... ..."],["Denmark","dk","45",".. .. .. .."],["Djibouti","dj","253",".. .. ...."],["Dominica","dm","1767"],["Dominican Republic","do","1","(...) ...-....",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503","....-...."],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372",".... ......"],["Ethiopia","et","251",".. ... ...."],["Faroe Islands","fo","298",".. .. .."],["Fiji","fj","679"],["Finland","fi","358",".. ... .. .."],["France","fr","33",". .. .. .. .."],["French Guiana","gf","594","... .. .. .."],["French Polynesia","pf","689",{"/^44/":".. .. ..","/^80[0-5]/":"... .. .. ..",default:".. .. .. .."}],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49","... ........."],["Ghana","gh","233"],["Greece","gr","30"],["Greenland","gl","299",".. .. .."],["Grenada","gd","1473"],["Guadeloupe","gp","590","... .. .. ..",0],["Guam","gu","1671"],["Guatemala","gt","502","....-...."],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509","....-...."],["Honduras","hn","504"],["Hong Kong","hk","852",".... ...."],["Hungary","hu","36"],["Iceland","is","354","... ...."],["India","in","91",".....-....."],["Indonesia","id","62"],["Iran","ir","98","... ... ...."],["Iraq","iq","964"],["Ireland","ie","353",".. ......."],["Israel","il","972","... ... ...."],["Italy","it","39","... .......",0],["Jamaica","jm","1876"],["Japan","jp","81",".. .... ...."],["Jordan","jo","962"],["Kazakhstan","kz","7","... ...-..-..",0],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996","... ... ..."],["Laos","la","856"],["Latvia","lv","371",".. ... ..."],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Macedonia","mk","389"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60","..-....-...."],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596","... .. .. .."],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262","... .. .. ..",1,["269","639"]],["Mexico","mx","52","... ... ....",0],["Micronesia","fm","691"],["Moldova","md","373","(..) ..-..-.."],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Morocco","ma","212"],["Mozambique","mz","258"],["Myanmar","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31",{"/^06/":"(.). .........","/^6/":". .........","/^0(10|13|14|15|20|23|24|26|30|33|35|36|38|40|43|44|45|46|50|53|55|58|70|71|72|73|74|75|76|77|78|79|82|84|85|87|88|91)/":"(.).. ........","/^(10|13|14|15|20|23|24|26|30|33|35|36|38|40|43|44|45|46|50|53|55|58|70|71|72|73|74|75|76|77|78|79|82|84|85|87|88|91)/":".. ........","/^0/":"(.)... .......",default:"... ......."}],["New Caledonia","nc","687"],["New Zealand","nz","64","...-...-...."],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["North Korea","kp","850"],["Norway","no","47","... .. ..."],["Oman","om","968"],["Pakistan","pk","92","...-......."],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63","... ... ...."],["Poland","pl","48","...-...-..."],["Portugal","pt","351"],["Puerto Rico","pr","1","(...) ...-....",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262","... .. .. ..",0],["Romania","ro","40"],["Russia","ru","7","(...) ...-..-..",1],["Rwanda","rw","250"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Pierre & Miquelon","pm","508",{"/^708/":"... ... ...","/^8/":"... .. .. ..",default:".. .. .."}],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65","....-...."],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82","... .... ...."],["South Sudan","ss","211"],["Spain","es","34","... ... ..."],["Sri Lanka","lk","94"],["Sudan","sd","249"],["Suriname","sr","597"],["Swaziland","sz","268"],["Sweden","se","46","... ... ..."],["Switzerland","ch","41",".. ... .. .."],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia","tn","216"],["Turkey","tr","90","... ... .. .."],["Turkmenistan","tm","993"],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380","(..) ... .. .."],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",".... ......"],["United States","us","1","(...) ...-....",0],["Uruguay","uy","598"],["Uzbekistan","uz","998",".. ... .. .."],["Vanuatu","vu","678"],["Vatican City","va","39",".. .... ....",1],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681",".. .. .."],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"]],Q=(...e)=>e.filter(e=>!!e).join(" ").trim(),Y=({addPrefix:e,rawClassNames:t})=>Q(((...e)=>Q(...e).split(" ").map(e=>`react-international-phone-${e}`).join(" "))(...e),...t),G=e=>!!e&&/^\d+$/.test(e),Z=e=>e.replace(/\D/g,""),X=({phone:e,prefix:t})=>e?`${t}${Z(e)}`:"";function K({value:e,country:t,insertDialCodeOnEmpty:n,trimNonDigitsEnd:r,countries:o,prefix:a,charAfterDialCode:i,forceDialCode:l,disableDialCodeAndPrefix:c,defaultMask:s,countryGuessingEnabled:d,disableFormatting:p}){let u=e;c&&(u=u.startsWith(`${a}`)?u:`${a}${t.dialCode}${u}`);let m=d?be({phone:u,countries:o,currentCountryIso2:t?.iso2}):void 0,f=m?.country??t,g=((e,t)=>{let n=!t.disableDialCodeAndPrefix&&t.forceDialCode,r=!t.disableDialCodeAndPrefix&&t.insertDialCodeOnEmpty,o=e,a=e=>t.trimNonDigitsEnd?e.trim():e;if(!o)return r&&!o.length||n?a(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`):a(o);if(o=Z(o),o===t.dialCode&&!t.disableDialCodeAndPrefix)return a(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`);if(t.dialCode.startsWith(o)&&!t.disableDialCodeAndPrefix)return a(n?`${t.prefix}${t.dialCode}${t.charAfterDialCode}`:`${t.prefix}${o}`);if(!o.startsWith(t.dialCode)&&!t.disableDialCodeAndPrefix){if(n)return a(`${t.prefix}${t.dialCode}${t.charAfterDialCode}`);if(o.length<t.dialCode.length)return a(`${t.prefix}${o}`)}let{phoneLeftSide:i,phoneRightSide:l}=(()=>{let e=t.dialCode.length;return{phoneLeftSide:o.slice(0,e),phoneRightSide:o.slice(e)}})();return i=`${t.prefix}${i}${t.charAfterDialCode}`,l=(({value:e,mask:t,maskSymbol:n,offset:r=0,trimNonMaskCharsLeftover:o=!1})=>{if(e.length<r)return e;let a=e.slice(0,r),i=e.slice(r),l=a,c=0;for(let e of t.split("")){if(c>=i.length){if(!o&&e!==n){l+=e;continue}break}e===n?(l+=i[c],c+=1):l+=e}return l})({value:l,mask:t.mask,maskSymbol:t.maskChar,trimNonMaskCharsLeftover:t.trimNonDigitsEnd||t.disableDialCodeAndPrefix&&0===l.length}),t.disableDialCodeAndPrefix&&(i=""),a(`${i}${l}`)})(u,{prefix:a,mask:xe({phone:u,country:f,defaultMask:s,disableFormatting:p}),maskChar:ne,dialCode:f.dialCode,trimNonDigitsEnd:r,charAfterDialCode:i,forceDialCode:l,insertDialCodeOnEmpty:n,disableDialCodeAndPrefix:c}),x=d&&!m?.fullDialCodeMatch?t:f;return{phone:X({phone:c?`${x.dialCode}${g}`:g,prefix:a}),inputValue:g,country:x}}var J=(e,{country:t,insertDialCodeOnEmpty:n,phoneBeforeInput:r,prefix:o,charAfterDialCode:a,forceDialCode:i,disableDialCodeAndPrefix:l,countryGuessingEnabled:c,defaultMask:s,disableFormatting:d,countries:p})=>{let u=e.nativeEvent,m=u.inputType,f=(e=>{if(e?.toLocaleLowerCase().includes("delete"))return e?.toLocaleLowerCase().includes("forward")?"forward":"backward"})(m),g=!!m?.startsWith("insertFrom"),x="insertText"===m,h=u?.data||void 0,y=e.target.value,b=e.target.selectionStart??0;if(m?.includes("history"))return{inputValue:r,phone:X({phone:r,prefix:o}),cursorPosition:r.length,country:t};if(x&&!G(h)&&y!==o)return{inputValue:r,phone:X({phone:l?`${t.dialCode}${r}`:r,prefix:o}),cursorPosition:b-(h?.length??0),country:t};if(i&&!y.startsWith(`${o}${t.dialCode}`)&&!g){let e=y?r:`${o}${t.dialCode}${a}`;return{inputValue:e,phone:X({phone:e,prefix:o}),cursorPosition:o.length+t.dialCode.length+a.length,country:t}}let{phone:v,inputValue:w,country:C}=K({value:y,country:t,trimNonDigitsEnd:"backward"===f,insertDialCodeOnEmpty:n,countryGuessingEnabled:c,countries:p,prefix:o,charAfterDialCode:a,forceDialCode:i,disableDialCodeAndPrefix:l,disableFormatting:d,defaultMask:s}),k=(({phoneBeforeInput:e,phoneAfterInput:t,phoneAfterFormatted:n,cursorPositionAfterInput:r,leftOffset:o=0,deletion:a})=>{if(r<o)return o;if(!e)return n.length;let i=null;for(let e=r-1;e>=0;e-=1)if(G(t[e])){i=e;break}if(null===i){for(let e=0;e<t.length;e+=1)if(G(n[e]))return e;return t.length}let l=0;for(let e=0;e<i;e+=1)G(t[e])&&(l+=1);let c=0,s=0;for(let e=0;e<n.length&&(c+=1,G(n[e])&&(s+=1),!(s>=l+1));e+=1);if("backward"!==a)for(;!G(n[c])&&c<n.length;)c+=1;return c})({cursorPositionAfterInput:b,phoneBeforeInput:r,phoneAfterInput:y,phoneAfterFormatted:w,leftOffset:i?o.length+t.dialCode.length+a.length:0,deletion:f});return{phone:v,inputValue:w,cursorPosition:k,country:C}},ee={size:20,overrideLastItemDebounceMS:-1};function te(e,t){let{size:n,overrideLastItemDebounceMS:r,onChange:a}={...ee,...t},[i,l]=c(e),[s,d]=c([i]),[p,u]=c(0),m=(()=>{let e=o(),t=o(Date.now());return{check:()=>{let n=Date.now(),r=e.current?n-t.current:void 0;return e.current=t.current,t.current=n,r}}})();return[i,(e,t)=>{if("object"==typeof e&&"object"==typeof i&&((e,t)=>{let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0})(e,i)||e===i)return;let o=r>0,c=m.check(),f=!o||void 0===c||c>r;if(void 0!==t?.overrideLastItem?t.overrideLastItem:!f)d(t=>[...t.slice(0,p),e]);else{let t=s.length>=n;d(n=>[...n.slice(t?1:0,p+1),e]),t||u(e=>e+1)}l(e),a?.(e)},()=>{if(p<=0)return{success:!1};let e=s[p-1];return l(e),u(e=>e-1),a?.(e),{success:!0,value:e}},()=>{if(p+1>=s.length)return{success:!1};let e=s[p+1];return l(e),u(e=>e+1),a?.(e),{success:!0,value:e}}]}var ne=".",re="us",oe="",ae="+",ie="............",le=" ",ce=200,se=!1,de=!1,pe=!1,ue=!1,me=!1,fe=U,ge=({defaultCountry:e=re,value:t=oe,countries:n=fe,prefix:r=ae,defaultMask:s=ie,charAfterDialCode:d=le,historySaveDebounceMS:p=ce,disableCountryGuess:u=se,disableDialCodePrefill:m=de,forceDialCode:f=pe,disableDialCodeAndPrefix:g=ue,disableFormatting:x=me,onChange:h,inputRef:y})=>{let b={countries:n,prefix:r,charAfterDialCode:d,forceDialCode:!g&&f,disableDialCodeAndPrefix:g,defaultMask:s,countryGuessingEnabled:!u,disableFormatting:x},v=o(null),w=y||v,C=e=>{Promise.resolve().then(()=>{typeof window>"u"||w.current!==document?.activeElement||w.current?.setSelectionRange(e,e)})},[{phone:k,inputValue:E,country:S},T,$,B]=te(()=>{let r=ye({value:e,field:"iso2",countries:n});r||console.error(`[react-international-phone]: can not find a country with "${e}" iso2 code`);let o=r||ye({value:"us",field:"iso2",countries:n}),{phone:a,inputValue:i,country:l}=K({value:t,country:o,insertDialCodeOnEmpty:!m,...b});return C(i.length),{phone:a,inputValue:i,country:l.iso2}},{overrideLastItemDebounceMS:p,onChange:({inputValue:e,phone:t,country:n})=>{if(!h)return;let r=z(n);h({phone:t,inputValue:e,country:r})}}),z=a(e=>ye({value:e,field:"iso2",countries:n}),[n]),I=i(()=>z(S),[S,z]);l(()=>{let e=w.current;if(!e)return;let t=e=>{if(!e.key)return;let t=e.ctrlKey,n=e.metaKey,r=e.shiftKey;if("z"===e.key.toLowerCase()){if(typeof window>"u"||!window.navigator.userAgent.toLowerCase().includes("macintosh")){if(!t)return}else if(!n)return;r?B():$()}};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[w,$,B]);let[N,D]=c(!1);return l(()=>{if(!N)return D(!0),void(t!==k&&h?.({inputValue:E,phone:k,country:I}));if(t===k)return;let{phone:e,inputValue:n,country:r}=K({value:t,country:I,insertDialCodeOnEmpty:!m,...b});T({phone:e,inputValue:n,country:r.iso2})},[t]),{phone:k,inputValue:E,country:I,setCountry:(e,t={focusOnInput:!1})=>{let o=ye({value:e,field:"iso2",countries:n});if(!o)return void console.error(`[react-international-phone]: can not find a country with "${e}" iso2 code`);let a=g?"":`${r}${o.dialCode}${d}`;T({inputValue:a,phone:`${r}${o.dialCode}`,country:o.iso2}),t.focusOnInput&&Promise.resolve().then(()=>{w.current?.focus()})},handlePhoneValueChange:e=>{e.preventDefault();let{phone:n,inputValue:r,country:o,cursorPosition:a}=J(e,{country:I,phoneBeforeInput:E,insertDialCodeOnEmpty:!1,...b});return T({inputValue:r,phone:n,country:o.iso2}),C(a),t},inputRef:w}},xe=({phone:e,country:t,defaultMask:n="............",disableFormatting:r=!1})=>{let o=t.format,a=e=>r?e.replace(new RegExp(`[^${ne}]`,"g"),""):e;if(!o)return a(n);if("string"==typeof o)return a(o);if(!o.default)return console.error(`[react-international-phone]: default mask for ${t.iso2} is not provided`),a(n);let i=Object.keys(o).find(n=>{if("default"===n)return!1;if("/"!==n.charAt(0)||"/"!==n.charAt(n.length-1))return console.error(`[react-international-phone]: format regex "${n}" for ${t.iso2} is not valid`),!1;let r=new RegExp(n.substring(1,n.length-1)),o=e.replace(t.dialCode,"");return r.test(Z(o))});return a(i?o[i]:o.default)},he=e=>{let[t,n,r,o,a,i]=e;return{name:t,iso2:n,dialCode:r,format:o,priority:a,areaCodes:i}},ye=({field:e,value:t,countries:n=U})=>{if(["priority"].includes(e))throw new Error((e=>`Field "${e}" is not supported`)(e));let r=n.find(n=>{let r=he(n);return t===r[e]});if(r)return he(r)},be=({phone:e,countries:t=U,currentCountryIso2:n})=>{let r={country:void 0,fullDialCodeMatch:!1};if(!e)return r;let o=Z(e);if(!o)return r;let a=r,i=({country:e,fullDialCodeMatch:t})=>{let n=e.dialCode===a.country?.dialCode,r=(e.priority??0)<(a.country?.priority??0);(!n||r)&&(a={country:e,fullDialCodeMatch:t})};for(let e of t){let t=he(e),{dialCode:n,areaCodes:r}=t;if(o.startsWith(n)){let e=!a.country||Number(n)>=Number(a.country.dialCode);if(r){let e=o.substring(n.length);for(let n of r)if(e.startsWith(n))return{country:t,fullDialCodeMatch:!0}}(e||n===o||!a.fullDialCodeMatch)&&i({country:t,fullDialCodeMatch:!0})}a.fullDialCodeMatch||o.length<n.length&&n.startsWith(o)&&(!a.country||Number(n)<=Number(a.country.dialCode))&&i({country:t,fullDialCodeMatch:!1})}if(n){let e=ye({value:n,field:"iso2",countries:t});if(!e)return a;let r=!!e&&(e=>{if(!e?.areaCodes)return!1;let t=o.substring(e.dialCode.length);return e.areaCodes.some(e=>e.startsWith(t))})(e);a&&a.country?.dialCode===e.dialCode&&a.country!==e&&a.fullDialCodeMatch&&(!e.areaCodes||r)&&(a={country:e,fullDialCodeMatch:!0})}return a},ve=(e,t)=>{let n=parseInt(e,16);return Number(n+t).toString(16)},we="abcdefghijklmnopqrstuvwxyz".split("").reduce((e,t,n)=>({...e,[t]:ve("1f1e6",n)}),{}),Ce=({iso2:e,size:n,src:r,protocol:o="https",disableLazyLoading:a,className:i,style:l,...c})=>{if(!e)return t.createElement("img",{className:Y({addPrefix:["flag-emoji"],rawClassNames:[i]}),width:n,height:n,...c});return t.createElement("img",{className:Y({addPrefix:["flag-emoji"],rawClassNames:[i]}),src:(()=>{if(r)return r;let t=(e=>[we[e[0]],we[e[1]]].join("-"))(e);return`${o}://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${t}.svg`})(),width:n,height:n,draggable:!1,"data-country":e,loading:a?void 0:"lazy",style:{width:n,height:n,...l},alt:"",...c})},ke=({show:e,dialCodePrefix:n="+",selectedCountry:r,countries:s=U,preferredCountries:d=[],flags:p,onSelect:u,onClose:m,...f})=>{let g=o(null),x=o(),h=i(()=>{if(!d||!d.length)return s;let e=[],t=[...s];for(let n of d){let r=t.findIndex(e=>he(e).iso2===n);if(-1!==r){let n=t.splice(r,1)[0];e.push(n)}}return e.concat(t)},[s,d]),y=o({updatedAt:void 0,value:""}),b=a(e=>h.findIndex(t=>he(t).iso2===e),[h]),[v,w]=c(b(r)),C=()=>{x.current!==r&&w(b(r))},k=a(e=>{w(b(e.iso2)),u?.(e)},[u,b]),E=e=>{let t=h.length-1;w(n=>{let r=(n=>"prev"===e?n-1:"next"===e?n+1:"last"===e?t:0)(n);return r<0?0:r>t?t:r})},S=a(()=>{if(!g.current||void 0===v)return;let e=he(h[v]).iso2;if(e===x.current)return;let t=g.current.querySelector(`[data-country="${e}"]`);t&&(((e,t)=>{let n=e.style.display;"block"!==n&&(e.style.display="block");let r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),a=o.top-r.top,i=r.bottom-o.bottom;a>=0&&i>=0||(Math.abs(a)<Math.abs(i)?e.scrollTop+=a:e.scrollTop-=i),e.style.display=n})(g.current,t),x.current=e)},[v,h]);return l(()=>{S()},[v,S]),l(()=>{g.current&&(e?g.current.focus():C())},[e]),l(()=>{C()},[r]),t.createElement("ul",{ref:g,role:"listbox",className:Y({addPrefix:["country-selector-dropdown"],rawClassNames:[f.className]}),style:{display:e?"block":"none",...f.style},onKeyDown:e=>{if(e.stopPropagation(),"Enter"===e.key){e.preventDefault();let t=he(h[v]);return void k(t)}if("Escape"!==e.key)return"ArrowUp"===e.key?(e.preventDefault(),void E("prev")):"ArrowDown"===e.key?(e.preventDefault(),void E("next")):"PageUp"===e.key?(e.preventDefault(),void E("first")):"PageDown"===e.key?(e.preventDefault(),void E("last")):(" "===e.key&&e.preventDefault(),void(1===e.key.length&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&(e=>{let t=y.current.updatedAt&&(new Date).getTime()-y.current.updatedAt.getTime()>1e3;y.current={value:t?e:`${y.current.value}${e}`,updatedAt:new Date};let n=h.findIndex(e=>he(e).name.toLowerCase().startsWith(y.current.value));-1!==n&&w(n)})(e.key.toLocaleLowerCase())));m?.()},onBlur:m,tabIndex:-1,"aria-activedescendant":`react-international-phone__${he(h[v]).iso2}-option`},h.map((e,o)=>{let a=he(e),i=a.iso2===r,l=o===v,c=d.includes(a.iso2),s=o===d.length-1,u=p?.find(e=>e.iso2===a.iso2);return t.createElement(t.Fragment,{key:a.iso2},t.createElement("li",{"data-country":a.iso2,role:"option","aria-selected":i,"aria-label":`${a.name} ${n}${a.dialCode}`,id:`react-international-phone__${a.iso2}-option`,className:Y({addPrefix:["country-selector-dropdown__list-item",c&&"country-selector-dropdown__list-item--preferred",i&&"country-selector-dropdown__list-item--selected",l&&"country-selector-dropdown__list-item--focused"],rawClassNames:[f.listItemClassName,c&&f.listItemPreferredClassName,i&&f.listItemSelectedClassName,l&&f.listItemFocusedClassName]}),onClick:()=>k(a),style:f.listItemStyle,title:a.name},t.createElement(Ce,{iso2:a.iso2,src:u?.src,className:Y({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[f.listItemFlagClassName]}),style:f.listItemFlagStyle}),t.createElement("span",{className:Y({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[f.listItemCountryNameClassName]}),style:f.listItemCountryNameStyle},a.name),t.createElement("span",{className:Y({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[f.listItemDialCodeClassName]}),style:f.listItemDialCodeStyle},n,a.dialCode)),s?t.createElement("hr",{className:Y({addPrefix:["country-selector-dropdown__preferred-list-divider"],rawClassNames:[f.preferredListDividerClassName]}),style:f.preferredListDividerStyle}):null)}))},Ee=({selectedCountry:e,onSelect:n,disabled:r,hideDropdown:a,countries:l=U,preferredCountries:s=[],flags:d,renderButtonWrapper:p,...u})=>{let[m,f]=c(!1),g=i(()=>{if(e)return ye({value:e,field:"iso2",countries:l})},[l,e]),x=o(null),h=e=>{e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),f(!0))};return t.createElement("div",{className:Y({addPrefix:["country-selector"],rawClassNames:[u.className]}),style:u.style,ref:x},(()=>{let n={title:g?.name,onClick:()=>f(e=>!e),onMouseDown:e=>e.preventDefault(),onKeyDown:h,disabled:a||r,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":m},o=t.createElement("div",{className:Y({addPrefix:["country-selector-button__button-content"],rawClassNames:[u.buttonContentWrapperClassName]}),style:u.buttonContentWrapperStyle},t.createElement(Ce,{iso2:e,src:d?.find(t=>t.iso2===e)?.src,className:Y({addPrefix:["country-selector-button__flag-emoji",r&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[u.flagClassName]}),style:{visibility:e?"visible":"hidden",...u.flagStyle}}),!a&&t.createElement("div",{className:Y({addPrefix:["country-selector-button__dropdown-arrow",r&&"country-selector-button__dropdown-arrow--disabled",m&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[u.dropdownArrowClassName]}),style:u.dropdownArrowStyle}));return p?p({children:o,rootProps:n}):t.createElement("button",{...n,type:"button",className:Y({addPrefix:["country-selector-button",m&&"country-selector-button--active",r&&"country-selector-button--disabled",a&&"country-selector-button--hide-dropdown"],rawClassNames:[u.buttonClassName]}),"data-country":e,style:u.buttonStyle},o)})(),t.createElement(ke,{show:m,countries:l,preferredCountries:s,flags:d,onSelect:e=>{f(!1),n?.(e)},selectedCountry:e,onClose:()=>{f(!1)},...u.dropdownStyleProps}))},Se=({dialCode:e,prefix:n,disabled:r,style:o,className:a})=>t.createElement("div",{className:Y({addPrefix:["dial-code-preview",r&&"dial-code-preview--disabled"],rawClassNames:[a]}),style:o},`${n}${e}`),Te=n(({value:e,onChange:n,countries:o=U,preferredCountries:a=[],hideDropdown:i,showDisabledDialCodeAndPrefix:l,disableFocusAfterCountrySelect:c,flags:s,style:d,className:p,inputStyle:u,inputClassName:m,countrySelectorStyleProps:f,dialCodePreviewStyleProps:g,inputProps:x,placeholder:h,disabled:y,name:b,onFocus:v,onBlur:w,required:C,autoFocus:k,...E},S)=>{let{phone:T,inputValue:$,inputRef:B,country:z,setCountry:I,handlePhoneValueChange:N}=ge({value:e,countries:o,...E,onChange:e=>{n?.(e.phone,{country:e.country,inputValue:e.inputValue})}}),D=E.disableDialCodeAndPrefix&&l&&z?.dialCode;return r(S,()=>B.current?Object.assign(B.current,{setCountry:I,state:{phone:T,inputValue:$,country:z}}):null,[B,I,T,$,z]),t.createElement("div",{ref:S,className:Y({addPrefix:["input-container"],rawClassNames:[p]}),style:d},t.createElement(Ee,{onSelect:e=>I(e.iso2,{focusOnInput:!c}),flags:s,selectedCountry:z.iso2,countries:o,preferredCountries:a,disabled:y,hideDropdown:i,...f}),D&&t.createElement(Se,{dialCode:z.dialCode,prefix:E.prefix??"+",disabled:y,...g}),t.createElement("input",{onChange:N,value:$,type:"tel",ref:B,className:Y({addPrefix:["input",y&&"input--disabled"],rawClassNames:[m]}),placeholder:h,disabled:y,style:u,name:b,onFocus:v,onBlur:w,autoFocus:k,required:C,...x}))});q(".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 $e=h.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 10px;
|
|
4
4
|
right: 10px;
|
|
@@ -95,7 +95,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
95
95
|
display: flex;
|
|
96
96
|
flex-direction: column;
|
|
97
97
|
}
|
|
98
|
-
`,
|
|
98
|
+
`,Fe=h.input`
|
|
99
99
|
width: 100%;
|
|
100
100
|
padding: 10px;
|
|
101
101
|
margin-bottom: 10px;
|
|
@@ -104,7 +104,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
104
104
|
box-sizing: border-box;
|
|
105
105
|
outline: none;
|
|
106
106
|
box-shadow: none !important;
|
|
107
|
-
`,
|
|
107
|
+
`,Oe=h.div`
|
|
108
108
|
margin-bottom: 10px;
|
|
109
109
|
width: 100%;
|
|
110
110
|
|
|
@@ -139,14 +139,14 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
139
139
|
`,Me=h.p`
|
|
140
140
|
color: #ff0000;
|
|
141
141
|
font-size: 14px;
|
|
142
|
-
`,Re=h(function(e){var n=e.value,r=void 0===n?"":n,o=e.numInputs,a=void 0===o?4:o,i=e.onChange,l=e.onPaste,c=e.renderInput,s=e.shouldAutoFocus,d=void 0!==s&&s,p=e.inputType,u=void 0===p?"text":p,m=e.renderSeparator,f=e.placeholder,g=e.containerStyle,x=e.inputStyle,h=e.skipDefaultStyles,y=void 0!==h&&h,b=t.useState(0),v=b[0],w=b[1],C=t.useRef([]),E=function(){return r?r.toString().split(""):[]},S="number"===u||"tel"===u;t.useEffect(function(){C.current=C.current.slice(0,a)},[a]),t.useEffect(function(){var e;d&&(null===(e=C.current[0])||void 0===e||e.focus())},[d]);var T=function(){if("string"==typeof f){if(f.length===a)return f;f.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},$=function(e){return(S?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},B=function(e){var t=e.target.value;$(t)&&(_(t),D(v+1))},z=function(e){var t=e.nativeEvent,n=e.target.value;if(!$(n)){if(n.length===a)n.split("").some(function(e){return!$(e)})||(P(n.split("")),D(a-1));null===t.data&&"deleteContentBackward"===t.inputType&&(e.preventDefault(),_(""),D(v-1)),e.target.value=""}},I=function(){w(v-1)},N=function(e){var t=E();[e.code,e.key].includes("Backspace")?(e.preventDefault(),_(""),D(v-1)):"Delete"===e.code?(e.preventDefault(),_("")):"ArrowLeft"===e.code?(e.preventDefault(),D(v-1)):"ArrowRight"===e.code||e.key===t[v]?(e.preventDefault(),D(v+1)):"Spacebar"!==e.code&&"Space"!==e.code&&"ArrowUp"!==e.code&&"ArrowDown"!==e.code||e.preventDefault()},D=function(e){var t,n,r=Math.max(Math.min(a-1,e),0);C.current[r]&&(null===(t=C.current[r])||void 0===t||t.focus(),null===(n=C.current[r])||void 0===n||n.select(),w(r))},_=function(e){var t=E();t[v]=e[0],P(t)},P=function(e){var t=e.join("");i(t)},
|
|
142
|
+
`,Re=h(function(e){var n=e.value,r=void 0===n?"":n,o=e.numInputs,a=void 0===o?4:o,i=e.onChange,l=e.onPaste,c=e.renderInput,s=e.shouldAutoFocus,d=void 0!==s&&s,p=e.inputType,u=void 0===p?"text":p,m=e.renderSeparator,f=e.placeholder,g=e.containerStyle,x=e.inputStyle,h=e.skipDefaultStyles,y=void 0!==h&&h,b=t.useState(0),v=b[0],w=b[1],C=t.useRef([]),E=function(){return r?r.toString().split(""):[]},S="number"===u||"tel"===u;t.useEffect(function(){C.current=C.current.slice(0,a)},[a]),t.useEffect(function(){var e;d&&(null===(e=C.current[0])||void 0===e||e.focus())},[d]);var T=function(){if("string"==typeof f){if(f.length===a)return f;f.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},$=function(e){return(S?!isNaN(Number(e)):"string"==typeof e)&&1===e.trim().length},B=function(e){var t=e.target.value;$(t)&&(_(t),D(v+1))},z=function(e){var t=e.nativeEvent,n=e.target.value;if(!$(n)){if(n.length===a)n.split("").some(function(e){return!$(e)})||(P(n.split("")),D(a-1));null===t.data&&"deleteContentBackward"===t.inputType&&(e.preventDefault(),_(""),D(v-1)),e.target.value=""}},I=function(){w(v-1)},N=function(e){var t=E();[e.code,e.key].includes("Backspace")?(e.preventDefault(),_(""),D(v-1)):"Delete"===e.code?(e.preventDefault(),_("")):"ArrowLeft"===e.code?(e.preventDefault(),D(v-1)):"ArrowRight"===e.code||e.key===t[v]?(e.preventDefault(),D(v+1)):"Spacebar"!==e.code&&"Space"!==e.code&&"ArrowUp"!==e.code&&"ArrowDown"!==e.code||e.preventDefault()},D=function(e){var t,n,r=Math.max(Math.min(a-1,e),0);C.current[r]&&(null===(t=C.current[r])||void 0===t||t.focus(),null===(n=C.current[r])||void 0===n||n.select(),w(r))},_=function(e){var t=E();t[v]=e[0],P(t)},P=function(e){var t=e.join("");i(t)},F=function(e){var t;e.preventDefault();var n=E(),r=v,o=e.clipboardData.getData("text/plain").slice(0,a-v).split("");if(!S||!o.some(function(e){return isNaN(Number(e))})){for(var i=0;i<a;++i)i>=v&&o.length>0&&(n[i]=null!==(t=o.shift())&&void 0!==t?t:"",r++);D(r),P(n)}};return t.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},k(g)&&g),className:"string"==typeof g?g:void 0,onPaste:l},Array.from({length:a},function(e,t){return t}).map(function(e){var n,r,o;return t.createElement(t.Fragment,{key:e},c({value:null!==(n=E()[e])&&void 0!==n?n:"",placeholder:null!==(o=null===(r=T())||void 0===r?void 0:r[e])&&void 0!==o?o:void 0,ref:function(t){return C.current[e]=t},onChange:B,onFocus:function(t){return function(e){return function(t){w(t),e.target.select()}}(t)(e)},onBlur:I,onKeyDown:N,onPaste:F,autoComplete:"off","aria-label":"Please enter OTP character ".concat(e+1),style:Object.assign(y?{}:{width:"1em",textAlign:"center"},k(x)?x:{}),className:"string"==typeof x?x:void 0,type:u,inputMode:S?"numeric":"text",onInput:z},e),e<a-1&&("function"==typeof m?m(e):m))}))})``,Le=h.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
|
-
`,je=({ctaButtonColor:e="black",headerColor:n="black",handleLoginOrSignup:r,handleSubmit:o,title:a="Everything here to give you the Best Value!",subtitle:i="Sign up to avail upto 20% extra discount on all products and unlock exclusive offers",onClose:s,closeIconColor:d="white"})=>{const[p,u]=c(""),[m,f]=c(""),[g,x]=c(""),[h,y]=c(""),[b,v]=c(!1),[w,C]=c(!1),[k,E]=c(!1),[S,T]=c(30),[$,B]=c(!1);l(()=>{let e;return w&&S>0?e=setInterval(()=>{T(e=>e-1)},1e3):0===S&&B(!0),()=>clearInterval(e)},[w,S]),l(()=>{const e=()=>{E(window.innerWidth<540)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const z=async e=>{if(e.preventDefault(),v(!0),y(""),!(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 y("Please enter a valid phone number with country code"),void v(!1);if(!(e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))(m))return y("Please enter a valid email address"),void v(!1);try{r&&await r(p,m),C(!0),T(30),B(!1)}catch(e){y(e?.message||"An error occurred. Please try again.")}finally{v(!1)}};return t.createElement(t.Fragment,null,t.createElement(Be,{onClick:e=>{e.stopPropagation(),s&&s()}},t.createElement(ze,{onClick:e=>e.stopPropagation()},t.createElement($e,{onClick:e=>{e.stopPropagation(),s&&s()}},t.createElement(V,{size:k?20:24,color:d})),t.createElement(Ie,null,t.createElement(Ne,{$headerColor:n},t.createElement(De,{className:"yt-lead-generation-nudge-title"},a),t.createElement(_e,{className:"yt-lead-generation-nudge-subtitle"},i)),t.createElement(Pe,null,w?t.createElement("form",{onSubmit:async e=>{if(e.preventDefault(),v(!0),y(""),4!==g.length||!/^\d+$/.test(g))return y("Please enter a valid 4-digit OTP"),void v(!1);try{o&&await o(p,g)}catch(e){y(e?.message||"Invalid OTP. Please try again.")}finally{v(!1),h||s&&s()}}},t.createElement(Re,{value:g,onChange:x,numInputs:4,containerStyle:{display:"flex",justifyContent:"center"},renderSeparator:()=>t.createElement("span",{style:{margin:"0 8px"}}),renderInput:e=>t.createElement("input",{...e,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"}})}),h&&t.createElement(Me,null,h),t.createElement(Ae,{type:"submit",$ctaButtonColor:e,disabled:b},b?"Verifying...":"Verify OTP"),S>0?t.createElement(Le,null,"Resend OTP in 00:",S.toString().padStart(2,"0")):t.createElement(Le,{$clickable:$,onClick:()=>{$&&z(new Event("submit"))}},"Resend OTP")):t.createElement("form",{onSubmit:z},t.createElement(
|
|
149
|
+
`,je=({ctaButtonColor:e="black",headerColor:n="black",handleLoginOrSignup:r,handleSubmit:o,title:a="Everything here to give you the Best Value!",subtitle:i="Sign up to avail upto 20% extra discount on all products and unlock exclusive offers",onClose:s,closeIconColor:d="white"})=>{const[p,u]=c(""),[m,f]=c(""),[g,x]=c(""),[h,y]=c(""),[b,v]=c(!1),[w,C]=c(!1),[k,E]=c(!1),[S,T]=c(30),[$,B]=c(!1);l(()=>{let e;return w&&S>0?e=setInterval(()=>{T(e=>e-1)},1e3):0===S&&B(!0),()=>clearInterval(e)},[w,S]),l(()=>{const e=()=>{E(window.innerWidth<540)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const z=async e=>{if(e.preventDefault(),v(!0),y(""),!(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 y("Please enter a valid phone number with country code"),void v(!1);if(!(e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))(m))return y("Please enter a valid email address"),void v(!1);try{r&&await r(p,m),C(!0),T(30),B(!1)}catch(e){y(e?.message||"An error occurred. Please try again.")}finally{v(!1)}};return t.createElement(t.Fragment,null,t.createElement(Be,{onClick:e=>{e.stopPropagation(),s&&s()}},t.createElement(ze,{onClick:e=>e.stopPropagation()},t.createElement($e,{onClick:e=>{e.stopPropagation(),s&&s()}},t.createElement(V,{size:k?20:24,color:d})),t.createElement(Ie,null,t.createElement(Ne,{$headerColor:n},t.createElement(De,{className:"yt-lead-generation-nudge-title"},a),t.createElement(_e,{className:"yt-lead-generation-nudge-subtitle"},i)),t.createElement(Pe,null,w?t.createElement("form",{onSubmit:async e=>{if(e.preventDefault(),v(!0),y(""),4!==g.length||!/^\d+$/.test(g))return y("Please enter a valid 4-digit OTP"),void v(!1);try{o&&await o(p,g)}catch(e){y(e?.message||"Invalid OTP. Please try again.")}finally{v(!1),h||s&&s()}}},t.createElement(Re,{value:g,onChange:x,numInputs:4,containerStyle:{display:"flex",justifyContent:"center"},renderSeparator:()=>t.createElement("span",{style:{margin:"0 8px"}}),renderInput:e=>t.createElement("input",{...e,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"}})}),h&&t.createElement(Me,null,h),t.createElement(Ae,{type:"submit",$ctaButtonColor:e,disabled:b},b?"Verifying...":"Verify OTP"),S>0?t.createElement(Le,null,"Resend OTP in 00:",S.toString().padStart(2,"0")):t.createElement(Le,{$clickable:$,onClick:()=>{$&&z(new Event("submit"))}},"Resend OTP")):t.createElement("form",{onSubmit:z},t.createElement(Oe,null,t.createElement(Te,{defaultCountry:"in",value:p,onChange:e=>u(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"}}})),t.createElement(Fe,{type:"email",value:m,onChange:e=>f(e.target.value),placeholder:"Email Address",required:!0}),h&&t.createElement(Me,null,h),t.createElement(Ae,{type:"submit",$ctaButtonColor:e,disabled:b},b?"Loading...":"Submit")))))))},Ve=h.div`
|
|
150
150
|
font-family: sans-serif;
|
|
151
151
|
z-index: 12345;
|
|
152
152
|
position: fixed;
|
|
@@ -289,7 +289,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
289
289
|
width: 250px;
|
|
290
290
|
background-color: ${e=>e.$backgroundColor};
|
|
291
291
|
}
|
|
292
|
-
`,Ze=({onClose:e})=>t.createElement("div",{onClick:e},t.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"},t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18",stroke:"#000000"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18",stroke:"#000000"}))),Xe=e=>{const{variant:n,title:r,text:o,highlightColor:a,backgroundColor:i,cartValue:s,freeDeliveryValue:d,onClickCheckout:p,onClose:u,isDev:m,onGotoCartClick:f,bannerCtaAction:g,bannerCtaText:x,postPurchaseCtaAction:h,postPurchaseCredits:y,ctaButtonBackgroundColor:b,ctaTextColor:v,ctaButtonPosition:w,ctaButtonLink:k,largeScreenImageUrl:E,smallScreenImageUrl:S,autoCloseTimeout:T,isCTAButtonEnabled:$,isCTARedirectionEnabled:B,borderRadius:z,padding:I,ctaButtonText:N,onClickCtaButton:D,position:_,nudgeImageUrl:P,closeIconColor:
|
|
292
|
+
`,Ze=({onClose:e})=>t.createElement("div",{onClick:e},t.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"},t.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18",stroke:"#000000"}),t.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18",stroke:"#000000"}))),Xe=e=>{const{variant:n,title:r,text:o,highlightColor:a,backgroundColor:i,cartValue:s,freeDeliveryValue:d,onClickCheckout:p,onClose:u,isDev:m,onGotoCartClick:f,bannerCtaAction:g,bannerCtaText:x,postPurchaseCtaAction:h,postPurchaseCredits:y,ctaButtonBackgroundColor:b,ctaTextColor:v,ctaButtonPosition:w,ctaButtonLink:k,largeScreenImageUrl:E,smallScreenImageUrl:S,autoCloseTimeout:T,isCTAButtonEnabled:$,isCTARedirectionEnabled:B,borderRadius:z,padding:I,ctaButtonText:N,onClickCtaButton:D,position:_,nudgeImageUrl:P,closeIconColor:F,handleLoginOrSignup:O,handleSubmit:A}=e,[M,R]=c(!0),[L,j]=c(void 0),[V,W]=c("");l(()=>{let e;const t=async()=>{let t;window.innerWidth>=768&&E?(e=E,t=await We(E)):window.innerWidth<768&&S&&(e=S,t=await We(S)),j(t),W(e)};return t(),R(!1),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const[H,q]=c(!1);switch(l(()=>{const e=setTimeout(()=>{q(!0)},1e3);return()=>clearTimeout(e)},[]),n){case"leadGeneration":return t.createElement(je,{ctaButtonColor:b,headerColor:i,title:r,subtitle:o,handleLoginOrSignup:O,handleSubmit:A,onClose:u});case"campaign":return t.createElement(t.Fragment,null,t.createElement(qe,{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")}}),t.createElement(He,{onClick:B?g:void 0,style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},$width:`${L?.width}px`,$height:`${L?.height}px`,$largeScreenImageUrl:E??"",$smallScreenImageUrl:S??""},t.createElement("div",{onClick:e=>{e.stopPropagation(),u?.()},style:{position:"absolute",top:"10px",right:"10px",zIndex:12346}},t.createElement(Qe,{margin:"0",color:`${F??"black"}`,onClose:void 0})),!M&&B&&$&&H&&t.createElement(Ye,{$ctaButtonPosition:w},t.createElement(Ge,{onClick:e=>{e.stopPropagation(),g?.()},$backgroundColor:b??"rgb(203, 242, 51)",$textColor:v},x))));case"delivery":return s&&d?t.createElement(Ve,{$minHeight:"none",$backgroundColor:i??"white"},t.createElement(Qe,{onClose:u}),t.createElement("div",{style:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-between"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"5px"}},s<d?t.createElement("div",{style:{fontWeight:"lighter",fontSize:"13px",color:"#808080"}},"You are"," ",t.createElement("span",{style:{fontWeight:"bold",color:a}},"only $",d-s," away")," ","from"):t.createElement("div",{style:{fontWeight:"bold",color:a,fontSize:"13px"}},"Congrats!"," ",t.createElement("span",{style:{fontWeight:"lighter",color:"#808080"}},"you are eligible for")),t.createElement("div",{style:{fontWeight:"bolder",fontSize:"25px",color:a}},"FREE Delivery")),t.createElement("div",{style:{color:"#999989",fontWeight:"lighter",fontSize:"11px"}},"Verified by"," ",t.createElement("span",{style:{fontWeight:"bold"}}," YourToken"))," "),t.createElement("img",{src:m?C:`data:image/svg+xml;utf8,${encodeURIComponent(C)}`,alt:"Delivery Truck",height:"80px",width:"80px"}))):t.createElement(t.Fragment,null);case"postPurchase":return t.createElement(Ve,{$minHeight:"200px",$backgroundColor:i??"white",$borderRadius:"50px",$padding:"0"},t.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"}},t.createElement("img",{src:"https://i.imgur.com/mZgp8n4.png",alt:"Donut",style:{width:"100%",marginBottom:"20px"}}),t.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}}),t.createElement("div",{style:{marginTop:"20%",textAlign:"center",display:"flex",flexDirection:"column",rowGap:"10px",marginBottom:"13px"}},t.createElement("h1",{style:{fontSize:"24px",margin:"0",color:"#333",fontFamily:"fantasy"}},"Congrats!"),t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("p",{style:{fontSize:"11px",margin:"0",color:"#989898",fontWeight:"bold"}},"CREDITS"),t.createElement("p",{style:{margin:"0",fontWeight:"bold",fontSize:"16px"}},"+",y," Points"))),t.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:h},"Check Balance"),t.createElement("button",{style:{background:"transparent",color:"#666",borderRadius:"5px",border:"none",cursor:"pointer",fontSize:"13px",marginTop:"10px"},onClick:u},"Continue Shopping")));case"registration":return t.createElement(Ve,{$minHeight:"80px",$minWidth:"450px",$backgroundColor:i??"white",$borderRadius:z??"10px",$padding:I??"0 20px 20px 20px",$position:_},t.createElement("div",{style:{display:"flex",gap:"10px",justifyContent:"space-between",minHeight:"80px"}},t.createElement("img",{src:P||"https://r2.yourtoken.io/ribbon.svg",alt:"register-on-yourtoken",height:"90",width:"90",style:{alignSelf:"center"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"15px",justifyContent:"space-between",fontFamily:"Montserrat"}},t.createElement("div",null,t.createElement("div",{style:{color:"#101828",fontSize:"18px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"space-between"}},r,t.createElement(Ze,{onClose:u})),t.createElement("div",{style:{fontSize:"13px",marginTop:"5px",lineHeight:"16px"}},o)),t.createElement(Ue,{onClick:D,color:"white",$bgColor:b??"#5F5478",$borderRadius:"0px",$fontFamily:"Montserrat"},N??"Unlock Rewards!"))));default:return t.createElement(Ve,{$minHeight:"120px",$backgroundColor:i??"white"},t.createElement(Qe,{onClose:u}),t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"10px",justifyContent:"space-between",minHeight:"110px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"5px"}},t.createElement("div",{style:{fontWeight:"bolder",fontSize:"20px"}},r),t.createElement("div",{style:{color:"#718096",fontSize:"15px",lineHeight:"21px"}},o)),t.createElement("div",{style:{display:"flex",columnGap:"5px"}},t.createElement(Ue,{onClick:p,color:"white",$bgColor:"black"},"Checkout Now"),t.createElement(Ue,{color:a??"white",onClick:f},"Go to cart"))))}},Ke=y`
|
|
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
|
`,Je=h.button`
|
|
@@ -381,7 +381,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
381
381
|
width: 50px;
|
|
382
382
|
height: 50px;
|
|
383
383
|
}
|
|
384
|
-
`,rt=({buttonColor:e,children:n,onClick:r})=>t.createElement(Je,{onClick:r,buttonColor:e},n),ot=({segments:e,setWinningSegment:n,brandGameDefaultThemeColor:r,brandThemeColor:o,ctaButtonText:a,wheelSectionColor1:i,wheelSectionColor2:l,wheelCenterLogo:s,isStatic:d})=>{const[p,u]=c(!1),[m,f]=c(0),[g,x]=c(!1),[h,y]=c(!1);return t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"15px",height:"100%",overflow:"hidden"}},t.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{borderRadius:"full",transform:"rotate(180deg)"}}),t.createElement(tt,null),t.createElement(et,null,t.createElement(nt,{$isDisabled:g,$brandThemeColor:o,$brandGameDefaultThemeColor:r},t.createElement("img",{src:s??"https://i.imgur.com/nZIyqNu.png",style:{height:"45px",width:"55px"},alt:"YourToken LOGO"})))),t.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}},!d&&t.createElement(rt,{buttonColor:o??r??"black",onClick:()=>!(d&&!0===d)&&(()=>{if(!g&&!h){y(!0),u(!p),x(!0);let t=0,n=[];if(e.forEach(e=>{e?.probability&&e.probability>0&&(t+=e.probability)}),0===t)n=Array.from({length:e.length},()=>0);else{let r=0;e.forEach(e=>{e?.probability&&e.probability>0?(r+=e.probability/t*100,n.push(r)):n.push(r)})}const r=100*Math.random();let o;for(let e=0;e<n.length;e++)if(r<=n[e]){o=e;break}const a=360/e.length;if(void 0===o){let t=0,n=0;e.forEach((e,r)=>{e?.probability&&e.probability>n&&(n=e.probability,t=r)}),o=t}const i=(o+.5)*a,l=360*Math.floor(5*Math.random()+5);f(l-i)}})()},a??"Spin Now!")))};function at(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function it(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}function lt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},child:[]}]})(e)}function ct(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(e)}function st(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(e)}function dt(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(e)}function pt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 448c0 17.7 14.3 32 32 32h160V320H32v128zm256 32h160c17.7 0 32-14.3 32-32V320H288v160zm192-320h-42.1c6.2-12.1 10.1-25.5 10.1-40 0-48.5-39.5-88-88-88-41.6 0-68.5 21.3-103 68.3-34.5-47-61.4-68.3-103-68.3-48.5 0-88 39.5-88 88 0 14.5 3.8 27.9 10.1 40H32c-17.7 0-32 14.3-32 32v80c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-80c0-17.7-14.3-32-32-32zm-326.1 0c-22.1 0-40-17.9-40-40s17.9-40 40-40c19.9 0 34.6 3.3 86.1 80h-86.1zm206.1 0h-86.1c51.4-76.5 65.7-80 86.1-80 22.1 0 40 17.9 40 40s-17.9 40-40 40z"},child:[]}]})(e)}function ut(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function mt(e){return _({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z"},child:[]}]})(e)}function ft(e){return _({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function gt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"},child:[]}]})(e)}function xt(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor"},child:[]}]})(e)}function ht(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:"currentColor"},child:[]}]})(e)}function yt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(e)}function bt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z"},child:[]}]})(e)}function vt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"},child:[]}]})(e)}function wt(e){return"init"in e}function Ct(e){return!!e.write}function kt(e){return"v"in e||"e"in e}function Et(e){if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}const St=new WeakMap;function Tt(e){var t;return Bt(e)&&!!(null==(t=St.get(e))?void 0:t[0])}function $t(e,t){let n=St.get(e);if(!n){n=[!0,new Set],St.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Bt(e){return"function"==typeof(null==e?void 0:e.then)}function zt(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function It(e,t,n){var r;const o=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&o.add(t);for(const e of t.p)o.add(e);return o}const Nt=(e,t,...n)=>t.read(...n),Dt=(e,t,...n)=>t.write(...n),_t=(e,t)=>{var n;return null==(n=t.unstable_onInit)?void 0:n.call(t,e)},Pt=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},Ot=(e,t)=>{const n=Gt(e),r=n[0],o=n[9];if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let a=r.get(t);return a||(a={d:new Map,p:new Set,n:0},r.set(t,a),null==o||o(e,t)),a},Ft=e=>{const t=Gt(e),n=t[1],r=t[3],o=t[4],a=t[5],i=t[6],l=t[13],c=[],s=e=>{try{e()}catch(e){c.push(e)}};do{i.f&&s(i.f);const t=new Set,c=t.add.bind(t);r.forEach(e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(c)}),r.clear(),a.forEach(c),a.clear(),o.forEach(c),o.clear(),t.forEach(s),r.size&&l(e)}while(r.size||a.size||o.size);if(c.length)throw new AggregateError(c)},At=e=>{const t=Gt(e),n=t[1],r=t[2],o=t[3],a=t[11],i=t[14],l=t[17],c=[],s=new WeakSet,d=new WeakSet,p=Array.from(o);for(;p.length;){const t=p[p.length-1],o=a(e,t);if(d.has(t))p.pop();else if(s.has(t)){if(r.get(t)===o.n)c.push([t,o]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&r.has(t))throw new Error("[Bug] invalidated atom exists");d.add(t),p.pop()}else{s.add(t);for(const e of It(t,o,n))s.has(e)||p.push(e)}}for(let t=c.length-1;t>=0;--t){const[n,a]=c[t];let s=!1;for(const e of a.d.keys())if(e!==n&&o.has(e)){s=!0;break}s&&(i(e,n),l(e,n)),r.delete(n)}},Mt=(e,t)=>{var n,r;const o=Gt(e),a=o[1],i=o[2],l=o[3],c=o[6],s=o[7],d=o[11],p=o[12],u=o[13],m=o[14],f=o[16],g=o[17],x=d(e,t);if(kt(x)){if(a.has(t)&&i.get(t)!==x.n)return x;if(Array.from(x.d).every(([t,n])=>m(e,t).n===n))return x}x.d.clear();let h,y,b=!0;function v(){a.has(t)&&(g(e,t),u(e),p(e))}const w={get signal(){return h||(h=new AbortController),h.signal},get setSelf(){return"production"===(import.meta.env?import.meta.env.MODE:void 0)||Ct(t)||console.warn("setSelf function cannot be used with read-only atom"),!y&&Ct(t)&&(y=(...n)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&b&&console.warn("setSelf function cannot be called in sync"),!b)try{return f(e,t,...n)}finally{u(e),p(e)}}),y}},C=x.n;try{const r=s(e,t,function(n){var r;if(n===t){const t=d(e,n);if(!kt(t)){if(!wt(n))throw new Error("no atom init");Ht(e,n,n.init)}return Et(t)}const o=m(e,n);try{return Et(o)}finally{x.d.set(n,o.n),Tt(x.v)&&zt(t,x.v,o),null==(r=a.get(n))||r.t.add(t),b||v()}},w);return Ht(e,t,r),Bt(r)&&($t(r,()=>null==h?void 0:h.abort()),r.then(v,v)),null==(n=c.r)||n.call(c,t),x}catch(e){return delete x.v,x.e=e,++x.n,x}finally{b=!1,C!==x.n&&i.get(t)===C&&(i.set(t,x.n),l.add(t),null==(r=c.c)||r.call(c,t))}},Rt=(e,t)=>{const n=Gt(e),r=n[1],o=n[2],a=n[11],i=[t];for(;i.length;){const t=i.pop(),n=a(e,t);for(const l of It(t,n,r)){const t=a(e,l);o.set(l,t.n),i.push(l)}}},Lt=(e,t,...n)=>{const r=Gt(e),o=r[3],a=r[6],i=r[8],l=r[11],c=r[12],s=r[13],d=r[14],p=r[15],u=r[17];let m=!0;const f=t=>Et(d(e,t)),g=(n,...r)=>{var i;const d=l(e,n);try{if(n===t){if(!wt(n))throw new Error("atom not writable");const t=d.n,l=r[0];return Ht(e,n,l),u(e,n),void(t!==d.n&&(o.add(n),null==(i=a.c)||i.call(a,n),p(e,n)))}return Lt(e,n,...r)}finally{m||(s(e),c(e))}};try{return i(e,t,f,g,...n)}finally{m=!1}},jt=(e,t)=>{var n;const r=Gt(e),o=r[1],a=r[3],i=r[6],l=r[11],c=r[15],s=r[18],d=r[19],p=l(e,t),u=o.get(t);if(u&&!Tt(p.v)){for(const[r,o]of p.d)if(!u.d.has(r)){const d=l(e,r);s(e,r).t.add(t),u.d.add(r),o!==d.n&&(a.add(r),null==(n=i.c)||n.call(i,r),c(e,r))}for(const n of u.d||[])if(!p.d.has(n)){u.d.delete(n);const r=d(e,n);null==r||r.t.delete(t)}}},Vt=(e,t)=>{var n;const r=Gt(e),o=r[1],a=r[4],i=r[6],l=r[10],c=r[11],s=r[12],d=r[13],p=r[14],u=r[16],m=c(e,t);let f=o.get(t);if(!f){p(e,t);for(const n of m.d.keys()){Vt(e,n).t.add(t)}if(f={l:new Set,d:new Set(m.d.keys()),t:new Set},o.set(t,f),null==(n=i.m)||n.call(i,t),Ct(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return u(e,t,...r)}finally{n||(d(e),s(e))}};try{const o=l(e,t,r);o&&(f.u=()=>{n=!0;try{o()}finally{n=!1}})}finally{n=!1}};a.add(n)}}return f},Wt=(e,t)=>{var n;const r=Gt(e),o=r[1],a=r[5],i=r[6],l=r[11],c=r[19],s=l(e,t);let d=o.get(t);if(!d||d.l.size||Array.from(d.t).some(e=>{var n;return null==(n=o.get(e))?void 0:n.d.has(t)}))return d;d.u&&a.add(d.u),d=void 0,o.delete(t),null==(n=i.u)||n.call(i,t);for(const n of s.d.keys()){const r=c(e,n);null==r||r.t.delete(t)}},Ht=(e,t,n)=>{const r=Gt(e)[11],o=r(e,t),a="v"in o,i=o.v;if(Bt(n))for(const a of o.d.keys())zt(t,n,r(e,a));o.v=n,delete o.e,a&&Object.is(i,o.v)||(++o.n,Bt(i)&&function(e){const t=St.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach(e=>e()))}(i))},qt=(e,t)=>Et((0,Gt(e)[14])(e,t)),Ut=(e,t,...n)=>{const r=Gt(e),o=r[12],a=r[13],i=r[16];try{return i(e,t,...n)}finally{a(e),o(e)}},Qt=(e,t,n)=>{const r=Gt(e),o=r[12],a=r[18],i=r[19],l=a(e,t).l;return l.add(n),o(e),()=>{l.delete(n),i(e,t),o(e)}},Yt=new WeakMap,Gt=e=>{const t=Yt.get(e);if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};let Zt,Xt=0;function Kt(e,t){const n="atom"+ ++Xt,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=Jt,r.write=en),t&&(r.write=t),r}function Jt(e){return e(this)}function en(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function tn(){return function(...e){const t={get:e=>(0,Gt(t)[21])(t,e),set:(e,...n)=>(0,Gt(t)[22])(t,e,...n),sub:(e,n)=>(0,Gt(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Nt,Dt,_t,Pt,Ot,Ft,At,Mt,Rt,Lt,jt,Vt,Wt,Ht,qt,Ut,Qt,void 0].map((t,n)=>e[n]||t);return Yt.set(t,Object.freeze(n)),t}()}const nn=s(void 0);function rn(e){const t=u(nn);return(null==e?void 0:e.store)||t||(Zt||(Zt=tn(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Zt),globalThis.__JOTAI_DEFAULT_STORE__!==Zt&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Zt)}const on=e=>"function"==typeof(null==e?void 0:e.then),an=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},ln=t.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(an(e),e)}),cn=new WeakMap,sn=(e,t)=>{let n=cn.get(e);return n||(n=new Promise((r,o)=>{let a=e;const i=e=>t=>{a===e&&r(t)},l=e=>t=>{a===e&&o(t)},c=()=>{try{const e=t();on(e)?(cn.set(e,n),a=e,e.then(i(e),l(e)),$t(e,c)):r(e)}catch(e){o(e)}};e.then(i(e),l(e)),$t(e,c)}),cn.set(e,n)),n};function dn(e,n){const{delay:r,unstable_promiseStatus:o=!t.use}=n||{},a=rn(n),[[i,c,s],u]=d(t=>{const n=a.get(e);return Object.is(t[0],n)&&t[1]===a&&t[2]===e?t:[n,a,e]},void 0,()=>[a.get(e),a,e]);let m=i;if(c===a&&s===e||(u(),m=a.get(e)),l(()=>{const t=a.sub(e,()=>{if(o)try{const t=a.get(e);on(t)&&an(sn(t,()=>a.get(e)))}catch(e){}"number"!=typeof r?u():setTimeout(u,r)});return u(),t},[a,e,r,o]),p(m),on(m)){const t=sn(m,()=>a.get(e));return o&&an(t),ln(t)}return m}function pn(e,t){const n=rn(t);return a((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)},[n,e])}function un(e,t){return[dn(e,t),pn(e,t)]}const mn=Kt(void 0),fn=Symbol("production"!==(import.meta.env?import.meta.env.MODE:void 0)?"RESET":""),gn=e=>"function"==typeof(null==e?void 0:e.then);const xn=function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,o;const a={getItem:(n,a)=>{var i,l;const c=e=>{if(r!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return a}r=e}return o},s=null!=(l=null==(i=e())?void 0:i.getItem(n))?l:null;return gn(s)?s.then(c):c(s)},setItem:(n,r)=>{var o;return null==(o=e())?void 0:o.setItem(n,JSON.stringify(r,null==t?void 0:t.replacer))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let i;try{i=null==(n=e())?void 0:n.subscribe}catch(e){}var l;return!i&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(i=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),i&&(a.subscribe=(l=i,(e,t,n)=>l(e,e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)}))),a}();function hn(e,t,n=xn,r){const o=Kt((null==r?void 0:r.getOnInit)?n.getItem(e,t):t);"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(o.debugPrivate=!0),o.onMount=r=>{let o;return r(n.getItem(e,t)),n.subscribe&&(o=n.subscribe(e,r,t)),o};return Kt(e=>e(o),(r,a,i)=>{const l="function"==typeof i?i(r(o)):i;return l===fn?(a(o,t),n.removeItem(e)):gn(l)?l.then(t=>(a(o,t),n.setItem(e,t))):(a(o,l),n.setItem(e,l))})}const yn=hn("deliveryOptionStateValidity",{isPostalCodeValid:!1,isDateValid:!1}),bn=Kt(e=>{const t=e(yn);return t.isPostalCodeValid&&t.isDateValid}),vn=hn("deliveryType","standard"),wn=hn("deliverySlotDate",null),Cn=Kt({cartLoading:!1,showLoader:!1,showSkeletonLoader:!1,showLoyaltyCtaLoading:!1});function kn(){const[e,t]=un(Cn);return{cartLoading:e,setLoading:(e,n,r,o)=>{t({cartLoading:e,showLoader:n,showSkeletonLoader:void 0!==r&&r,showLoyaltyCtaLoading:void 0!==o&&o})}}}const En=Kt({open:!1,variantId:void 0,quantity:void 0,handle:void 0,freebieSelection:!1,lineItemKey:void 0,productId:void 0,allowedVariantIds:void 0,productRec:!1});var Sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Tn={exports:{}};const $n={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};Tn.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call($n,t)?$n[t]:void 0},Tn.exports.currencySymbolMap=$n;var Bn=Tn.exports;const zn=(e,t)=>"INR"===t||"₹"===t||"Rs"===t||"Rs."===t||"rs"===t||"rs."===t||"RS."===t?Number((e/100).toFixed(2)):e,In={79:"Rs. "},Nn=(e,t)=>{const n=t??e?.currency??"INR";return"undefined"!=typeof window&&window.ytapp?.brandId?In[window.ytapp.brandId]??Bn(n)??"₹":Bn(n)??"₹"};function Dn(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"},child:[]}]})(e)}function _n(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"},child:[]}]})(e)}const Pn=(e,t=15)=>e.length>t?e.substring(0,t)+"...":e,On=(e,t,n,r="",o="16px")=>{const a=document.createElement("canvas").getContext("2d"),i=e.replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&");if(a){const e=r?`${o} ${r}`:o;a.font=e;const l=t/100*n;if(a.measureText(i).width>l){let e=i;for(let t=e.length-1;t>=0;t--){const n=e.slice(0,t)+"...";if(a.measureText(n).width<l)return n}return"..."}}return i};function Fn(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 An(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 Mn=e=>e?.split("/")?.pop();const Rn=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Ln(e,t="#FFFFFF",n="#000000",r=.5){if(!e)return;const o=window.getComputedStyle(e).backgroundColor;let a=0,i=0,l=0;if("transparent"===o||"rgba(0, 0, 0, 0)"===o)return void(e.style.color=n);const c=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(c)a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10);else{const t=document.createElement("div");t.style.color=o,document.body.appendChild(t);const r=window.getComputedStyle(t).color;document.body.removeChild(t);const c=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(!c)return console.warn("setContrastTextColor: Could not parse background color:",o,"Resolved to:",r),void(e.style.color=n);a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10)}const s=[a/255,i/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>r?n:t}const jn=e=>{if(null==e)return"";const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},Vn=()=>{const e=window.ytapp?.storeDomain;return!!e&&["veeba-sauces.myshopify.com"].includes(e)},Wn=(e,t=150,n=85,r="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 o=e.split("?")[0];const a=o.lastIndexOf(".");if(-1===a)return e;const i=o.substring(a),l=o.substring(0,a).replace(/_\d+x\d*$|_x\d+$|_\d+x$/,""),c=`${l}${`_${t}x${t}`}${i}`,s=new URLSearchParams;"auto"!==r&&s.append("format",r),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}},Hn=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 r=e.match(/^(YTA-|YTP-|YT-)(.+)$/);return r&&r[2]?r[2].trim():e};function qn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16zm-9.489 5.14a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z"},child:[]},{tag:"path",attr:{d:"M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z"},child:[]}]})(e)}function Un(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M11 21h-2.426a3 3 0 0 1 -2.965 -2.544l-1.255 -8.152a2 2 0 0 1 1.977 -2.304h11.339a2 2 0 0 1 1.977 2.304l-.109 .707"},child:[]},{tag:"path",attr:{d:"M9 11v-5a3 3 0 0 1 6 0v5"},child:[]},{tag:"path",attr:{d:"M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39z"},child:[]}]})(e)}function Qn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7h16"},child:[]},{tag:"path",attr:{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"},child:[]},{tag:"path",attr:{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"},child:[]},{tag:"path",attr:{d:"M10 12l4 4m0 -4l-4 4"},child:[]}]})(e)}const Yn=h.div`
|
|
384
|
+
`,rt=({buttonColor:e,children:n,onClick:r})=>t.createElement(Je,{onClick:r,buttonColor:e},n),ot=({segments:e,setWinningSegment:n,brandGameDefaultThemeColor:r,brandThemeColor:o,ctaButtonText:a,wheelSectionColor1:i,wheelSectionColor2:l,wheelCenterLogo:s,isStatic:d})=>{const[p,u]=c(!1),[m,f]=c(0),[g,x]=c(!1),[h,y]=c(!1);return t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"15px",height:"100%",overflow:"hidden"}},t.createElement("div",{style:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{borderRadius:"full",transform:"rotate(180deg)"}}),t.createElement(tt,null),t.createElement(et,null,t.createElement(nt,{$isDisabled:g,$brandThemeColor:o,$brandGameDefaultThemeColor:r},t.createElement("img",{src:s??"https://i.imgur.com/nZIyqNu.png",style:{height:"45px",width:"55px"},alt:"YourToken LOGO"})))),t.createElement("div",{style:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}},!d&&t.createElement(rt,{buttonColor:o??r??"black",onClick:()=>!(d&&!0===d)&&(()=>{if(!g&&!h){y(!0),u(!p),x(!0);let t=0,n=[];if(e.forEach(e=>{e?.probability&&e.probability>0&&(t+=e.probability)}),0===t)n=Array.from({length:e.length},()=>0);else{let r=0;e.forEach(e=>{e?.probability&&e.probability>0?(r+=e.probability/t*100,n.push(r)):n.push(r)})}const r=100*Math.random();let o;for(let e=0;e<n.length;e++)if(r<=n[e]){o=e;break}const a=360/e.length;if(void 0===o){let t=0,n=0;e.forEach((e,r)=>{e?.probability&&e.probability>n&&(n=e.probability,t=r)}),o=t}const i=(o+.5)*a,l=360*Math.floor(5*Math.random()+5);f(l-i)}})()},a??"Spin Now!")))};function at(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"},child:[]}]})(e)}function it(e){return _({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"},child:[]}]})(e)}function lt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},child:[]}]})(e)}function ct(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(e)}function st(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(e)}function dt(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(e)}function pt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M32 448c0 17.7 14.3 32 32 32h160V320H32v128zm256 32h160c17.7 0 32-14.3 32-32V320H288v160zm192-320h-42.1c6.2-12.1 10.1-25.5 10.1-40 0-48.5-39.5-88-88-88-41.6 0-68.5 21.3-103 68.3-34.5-47-61.4-68.3-103-68.3-48.5 0-88 39.5-88 88 0 14.5 3.8 27.9 10.1 40H32c-17.7 0-32 14.3-32 32v80c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-80c0-17.7-14.3-32-32-32zm-326.1 0c-22.1 0-40-17.9-40-40s17.9-40 40-40c19.9 0 34.6 3.3 86.1 80h-86.1zm206.1 0h-86.1c51.4-76.5 65.7-80 86.1-80 22.1 0 40 17.9 40 40s-17.9 40-40 40z"},child:[]}]})(e)}function ut(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function mt(e){return _({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z"},child:[]}]})(e)}function ft(e){return _({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function gt(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z"},child:[]}]})(e)}function xt(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:"currentColor"},child:[]}]})(e)}function ht(e){return _({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z",fill:"currentColor"},child:[]}]})(e)}function yt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(e)}function bt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z"},child:[]}]})(e)}function vt(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"},child:[]}]})(e)}function wt(e){return"init"in e}function Ct(e){return!!e.write}function kt(e){return"v"in e||"e"in e}function Et(e){if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}const St=new WeakMap;function Tt(e){var t;return Bt(e)&&!!(null==(t=St.get(e))?void 0:t[0])}function $t(e,t){let n=St.get(e);if(!n){n=[!0,new Set],St.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Bt(e){return"function"==typeof(null==e?void 0:e.then)}function zt(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function It(e,t,n){var r;const o=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&o.add(t);for(const e of t.p)o.add(e);return o}const Nt=(e,t,...n)=>t.read(...n),Dt=(e,t,...n)=>t.write(...n),_t=(e,t)=>{var n;return null==(n=t.unstable_onInit)?void 0:n.call(t,e)},Pt=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},Ft=(e,t)=>{const n=Gt(e),r=n[0],o=n[9];if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let a=r.get(t);return a||(a={d:new Map,p:new Set,n:0},r.set(t,a),null==o||o(e,t)),a},Ot=e=>{const t=Gt(e),n=t[1],r=t[3],o=t[4],a=t[5],i=t[6],l=t[13],c=[],s=e=>{try{e()}catch(e){c.push(e)}};do{i.f&&s(i.f);const t=new Set,c=t.add.bind(t);r.forEach(e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(c)}),r.clear(),a.forEach(c),a.clear(),o.forEach(c),o.clear(),t.forEach(s),r.size&&l(e)}while(r.size||a.size||o.size);if(c.length)throw new AggregateError(c)},At=e=>{const t=Gt(e),n=t[1],r=t[2],o=t[3],a=t[11],i=t[14],l=t[17],c=[],s=new WeakSet,d=new WeakSet,p=Array.from(o);for(;p.length;){const t=p[p.length-1],o=a(e,t);if(d.has(t))p.pop();else if(s.has(t)){if(r.get(t)===o.n)c.push([t,o]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&r.has(t))throw new Error("[Bug] invalidated atom exists");d.add(t),p.pop()}else{s.add(t);for(const e of It(t,o,n))s.has(e)||p.push(e)}}for(let t=c.length-1;t>=0;--t){const[n,a]=c[t];let s=!1;for(const e of a.d.keys())if(e!==n&&o.has(e)){s=!0;break}s&&(i(e,n),l(e,n)),r.delete(n)}},Mt=(e,t)=>{var n,r;const o=Gt(e),a=o[1],i=o[2],l=o[3],c=o[6],s=o[7],d=o[11],p=o[12],u=o[13],m=o[14],f=o[16],g=o[17],x=d(e,t);if(kt(x)){if(a.has(t)&&i.get(t)!==x.n)return x;if(Array.from(x.d).every(([t,n])=>m(e,t).n===n))return x}x.d.clear();let h,y,b=!0;function v(){a.has(t)&&(g(e,t),u(e),p(e))}const w={get signal(){return h||(h=new AbortController),h.signal},get setSelf(){return"production"===(import.meta.env?import.meta.env.MODE:void 0)||Ct(t)||console.warn("setSelf function cannot be used with read-only atom"),!y&&Ct(t)&&(y=(...n)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&b&&console.warn("setSelf function cannot be called in sync"),!b)try{return f(e,t,...n)}finally{u(e),p(e)}}),y}},C=x.n;try{const r=s(e,t,function(n){var r;if(n===t){const t=d(e,n);if(!kt(t)){if(!wt(n))throw new Error("no atom init");Ht(e,n,n.init)}return Et(t)}const o=m(e,n);try{return Et(o)}finally{x.d.set(n,o.n),Tt(x.v)&&zt(t,x.v,o),null==(r=a.get(n))||r.t.add(t),b||v()}},w);return Ht(e,t,r),Bt(r)&&($t(r,()=>null==h?void 0:h.abort()),r.then(v,v)),null==(n=c.r)||n.call(c,t),x}catch(e){return delete x.v,x.e=e,++x.n,x}finally{b=!1,C!==x.n&&i.get(t)===C&&(i.set(t,x.n),l.add(t),null==(r=c.c)||r.call(c,t))}},Rt=(e,t)=>{const n=Gt(e),r=n[1],o=n[2],a=n[11],i=[t];for(;i.length;){const t=i.pop(),n=a(e,t);for(const l of It(t,n,r)){const t=a(e,l);o.set(l,t.n),i.push(l)}}},Lt=(e,t,...n)=>{const r=Gt(e),o=r[3],a=r[6],i=r[8],l=r[11],c=r[12],s=r[13],d=r[14],p=r[15],u=r[17];let m=!0;const f=t=>Et(d(e,t)),g=(n,...r)=>{var i;const d=l(e,n);try{if(n===t){if(!wt(n))throw new Error("atom not writable");const t=d.n,l=r[0];return Ht(e,n,l),u(e,n),void(t!==d.n&&(o.add(n),null==(i=a.c)||i.call(a,n),p(e,n)))}return Lt(e,n,...r)}finally{m||(s(e),c(e))}};try{return i(e,t,f,g,...n)}finally{m=!1}},jt=(e,t)=>{var n;const r=Gt(e),o=r[1],a=r[3],i=r[6],l=r[11],c=r[15],s=r[18],d=r[19],p=l(e,t),u=o.get(t);if(u&&!Tt(p.v)){for(const[r,o]of p.d)if(!u.d.has(r)){const d=l(e,r);s(e,r).t.add(t),u.d.add(r),o!==d.n&&(a.add(r),null==(n=i.c)||n.call(i,r),c(e,r))}for(const n of u.d||[])if(!p.d.has(n)){u.d.delete(n);const r=d(e,n);null==r||r.t.delete(t)}}},Vt=(e,t)=>{var n;const r=Gt(e),o=r[1],a=r[4],i=r[6],l=r[10],c=r[11],s=r[12],d=r[13],p=r[14],u=r[16],m=c(e,t);let f=o.get(t);if(!f){p(e,t);for(const n of m.d.keys()){Vt(e,n).t.add(t)}if(f={l:new Set,d:new Set(m.d.keys()),t:new Set},o.set(t,f),null==(n=i.m)||n.call(i,t),Ct(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return u(e,t,...r)}finally{n||(d(e),s(e))}};try{const o=l(e,t,r);o&&(f.u=()=>{n=!0;try{o()}finally{n=!1}})}finally{n=!1}};a.add(n)}}return f},Wt=(e,t)=>{var n;const r=Gt(e),o=r[1],a=r[5],i=r[6],l=r[11],c=r[19],s=l(e,t);let d=o.get(t);if(!d||d.l.size||Array.from(d.t).some(e=>{var n;return null==(n=o.get(e))?void 0:n.d.has(t)}))return d;d.u&&a.add(d.u),d=void 0,o.delete(t),null==(n=i.u)||n.call(i,t);for(const n of s.d.keys()){const r=c(e,n);null==r||r.t.delete(t)}},Ht=(e,t,n)=>{const r=Gt(e)[11],o=r(e,t),a="v"in o,i=o.v;if(Bt(n))for(const a of o.d.keys())zt(t,n,r(e,a));o.v=n,delete o.e,a&&Object.is(i,o.v)||(++o.n,Bt(i)&&function(e){const t=St.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach(e=>e()))}(i))},qt=(e,t)=>Et((0,Gt(e)[14])(e,t)),Ut=(e,t,...n)=>{const r=Gt(e),o=r[12],a=r[13],i=r[16];try{return i(e,t,...n)}finally{a(e),o(e)}},Qt=(e,t,n)=>{const r=Gt(e),o=r[12],a=r[18],i=r[19],l=a(e,t).l;return l.add(n),o(e),()=>{l.delete(n),i(e,t),o(e)}},Yt=new WeakMap,Gt=e=>{const t=Yt.get(e);if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};let Zt,Xt=0;function Kt(e,t){const n="atom"+ ++Xt,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=Jt,r.write=en),t&&(r.write=t),r}function Jt(e){return e(this)}function en(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function tn(){return function(...e){const t={get:e=>(0,Gt(t)[21])(t,e),set:(e,...n)=>(0,Gt(t)[22])(t,e,...n),sub:(e,n)=>(0,Gt(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Nt,Dt,_t,Pt,Ft,Ot,At,Mt,Rt,Lt,jt,Vt,Wt,Ht,qt,Ut,Qt,void 0].map((t,n)=>e[n]||t);return Yt.set(t,Object.freeze(n)),t}()}const nn=s(void 0);function rn(e){const t=u(nn);return(null==e?void 0:e.store)||t||(Zt||(Zt=tn(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Zt),globalThis.__JOTAI_DEFAULT_STORE__!==Zt&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Zt)}const on=e=>"function"==typeof(null==e?void 0:e.then),an=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},ln=t.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(an(e),e)}),cn=new WeakMap,sn=(e,t)=>{let n=cn.get(e);return n||(n=new Promise((r,o)=>{let a=e;const i=e=>t=>{a===e&&r(t)},l=e=>t=>{a===e&&o(t)},c=()=>{try{const e=t();on(e)?(cn.set(e,n),a=e,e.then(i(e),l(e)),$t(e,c)):r(e)}catch(e){o(e)}};e.then(i(e),l(e)),$t(e,c)}),cn.set(e,n)),n};function dn(e,n){const{delay:r,unstable_promiseStatus:o=!t.use}=n||{},a=rn(n),[[i,c,s],u]=d(t=>{const n=a.get(e);return Object.is(t[0],n)&&t[1]===a&&t[2]===e?t:[n,a,e]},void 0,()=>[a.get(e),a,e]);let m=i;if(c===a&&s===e||(u(),m=a.get(e)),l(()=>{const t=a.sub(e,()=>{if(o)try{const t=a.get(e);on(t)&&an(sn(t,()=>a.get(e)))}catch(e){}"number"!=typeof r?u():setTimeout(u,r)});return u(),t},[a,e,r,o]),p(m),on(m)){const t=sn(m,()=>a.get(e));return o&&an(t),ln(t)}return m}function pn(e,t){const n=rn(t);return a((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)},[n,e])}function un(e,t){return[dn(e,t),pn(e,t)]}const mn=Kt(void 0),fn=Symbol("production"!==(import.meta.env?import.meta.env.MODE:void 0)?"RESET":""),gn=e=>"function"==typeof(null==e?void 0:e.then);const xn=function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,o;const a={getItem:(n,a)=>{var i,l;const c=e=>{if(r!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return a}r=e}return o},s=null!=(l=null==(i=e())?void 0:i.getItem(n))?l:null;return gn(s)?s.then(c):c(s)},setItem:(n,r)=>{var o;return null==(o=e())?void 0:o.setItem(n,JSON.stringify(r,null==t?void 0:t.replacer))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let i;try{i=null==(n=e())?void 0:n.subscribe}catch(e){}var l;return!i&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(i=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),i&&(a.subscribe=(l=i,(e,t,n)=>l(e,e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)}))),a}();function hn(e,t,n=xn,r){const o=Kt((null==r?void 0:r.getOnInit)?n.getItem(e,t):t);"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(o.debugPrivate=!0),o.onMount=r=>{let o;return r(n.getItem(e,t)),n.subscribe&&(o=n.subscribe(e,r,t)),o};return Kt(e=>e(o),(r,a,i)=>{const l="function"==typeof i?i(r(o)):i;return l===fn?(a(o,t),n.removeItem(e)):gn(l)?l.then(t=>(a(o,t),n.setItem(e,t))):(a(o,l),n.setItem(e,l))})}const yn=hn("deliveryOptionStateValidity",{isPostalCodeValid:!1,isDateValid:!1}),bn=Kt(e=>{const t=e(yn);return t.isPostalCodeValid&&t.isDateValid}),vn=hn("deliveryType","standard"),wn=hn("deliverySlotDate",null),Cn=Kt({cartLoading:!1,showLoader:!1,showSkeletonLoader:!1,showLoyaltyCtaLoading:!1});function kn(){const[e,t]=un(Cn);return{cartLoading:e,setLoading:(e,n,r,o)=>{t({cartLoading:e,showLoader:n,showSkeletonLoader:void 0!==r&&r,showLoyaltyCtaLoading:void 0!==o&&o})}}}const En=Kt({open:!1,variantId:void 0,quantity:void 0,handle:void 0,freebieSelection:!1,lineItemKey:void 0,productId:void 0,allowedVariantIds:void 0,productRec:!1});var Sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Tn={exports:{}};const $n={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};Tn.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call($n,t)?$n[t]:void 0},Tn.exports.currencySymbolMap=$n;var Bn=Tn.exports;const zn=(e,t)=>"INR"===t||"₹"===t||"Rs"===t||"Rs."===t||"rs"===t||"rs."===t||"RS."===t?Number((e/100).toFixed(2)):e,In={79:"Rs. "},Nn=(e,t)=>{const n=t??e?.currency??"INR";return"undefined"!=typeof window&&window.ytapp?.brandId?In[window.ytapp.brandId]??Bn(n)??"₹":Bn(n)??"₹"};function Dn(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M160 112c0-35.3 28.7-64 64-64s64 28.7 64 64l0 48-128 0 0-48zm-48 48l-64 0c-26.5 0-48 21.5-48 48L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-208c0-26.5-21.5-48-48-48l-64 0 0-48C336 50.1 285.9 0 224 0S112 50.1 112 112l0 48zm24 48a24 24 0 1 1 0 48 24 24 0 1 1 0-48zm152 24a24 24 0 1 1 48 0 24 24 0 1 1 -48 0z"},child:[]}]})(e)}function _n(e){return _({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z"},child:[]}]})(e)}const Pn=(e,t=15)=>e.length>t?e.substring(0,t)+"...":e,Fn=(e,t,n,r="",o="16px")=>{const a=document.createElement("canvas").getContext("2d"),i=e.replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&");if(a){const e=r?`${o} ${r}`:o;a.font=e;const l=t/100*n;if(a.measureText(i).width>l){let e=i;for(let t=e.length-1;t>=0;t--){const n=e.slice(0,t)+"...";if(a.measureText(n).width<l)return n}return"..."}}return i};function On(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 An(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 Mn=e=>e?.split("/")?.pop();const Rn=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function Ln(e,t="#FFFFFF",n="#000000",r=.5){if(!e)return;const o=window.getComputedStyle(e).backgroundColor;let a=0,i=0,l=0;if("transparent"===o||"rgba(0, 0, 0, 0)"===o)return void(e.style.color=n);const c=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(c)a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10);else{const t=document.createElement("div");t.style.color=o,document.body.appendChild(t);const r=window.getComputedStyle(t).color;document.body.removeChild(t);const c=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(!c)return console.warn("setContrastTextColor: Could not parse background color:",o,"Resolved to:",r),void(e.style.color=n);a=parseInt(c[1],10),i=parseInt(c[2],10),l=parseInt(c[3],10)}const s=[a/255,i/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>r?n:t}const jn=e=>{if(null==e)return"";const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},Vn=()=>{const e=window.ytapp?.storeDomain;return!!e&&["veeba-sauces.myshopify.com"].includes(e)},Wn=(e,t=150,n=85,r="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 o=e.split("?")[0];const a=o.lastIndexOf(".");if(-1===a)return e;const i=o.substring(a),l=o.substring(0,a).replace(/_\d+x\d*$|_x\d+$|_\d+x$/,""),c=`${l}${`_${t}x${t}`}${i}`,s=new URLSearchParams;"auto"!==r&&s.append("format",r),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}},Hn=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 r=e.match(/^(YTA-|YTP-|YT-)(.+)$/);return r&&r[2]?r[2].trim():e};function qn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16zm-9.489 5.14a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z"},child:[]},{tag:"path",attr:{d:"M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z"},child:[]}]})(e)}function Un(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M11 21h-2.426a3 3 0 0 1 -2.965 -2.544l-1.255 -8.152a2 2 0 0 1 1.977 -2.304h11.339a2 2 0 0 1 1.977 2.304l-.109 .707"},child:[]},{tag:"path",attr:{d:"M9 11v-5a3 3 0 0 1 6 0v5"},child:[]},{tag:"path",attr:{d:"M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39z"},child:[]}]})(e)}function Qn(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 7h16"},child:[]},{tag:"path",attr:{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"},child:[]},{tag:"path",attr:{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"},child:[]},{tag:"path",attr:{d:"M10 12l4 4m0 -4l-4 4"},child:[]}]})(e)}const Yn=h.div`
|
|
385
385
|
min-width: 145px !important;
|
|
386
386
|
padding: ${e=>"vertical"===e.$variant?"3px":"10px 30px"};
|
|
387
387
|
background-color: ${e=>e.$backgroundColor};
|
|
@@ -624,7 +624,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
624
624
|
font-size: 10px;
|
|
625
625
|
line-height: normal;
|
|
626
626
|
display: flex;
|
|
627
|
-
`,ur=({product:e,addCartItem:n,productRecsCtaButtonText:r,ctaButtonBackgroundColor:s,ctaButtonTextColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:f,cartComponentsCornerRadius:g,cartComponentsCornerType:x,isVerticalList:h,backgroundColor:y,tertiaryColor:b,tertiaryTextColor:v})=>{const w=dn(mn),{setLoading:C}=kn(),k=pn(En),E=i(()=>{const t=e?._ytAllowedVariantIds??e?.ytAllowedVariantIds;if(!Array.isArray(t)||0===t.length)return;const n=t.map(e=>ar(e)).filter(e=>Boolean(e));return n.length>0?n:void 0},[e]),S=i(()=>Array.isArray(e?.variants)?e.variants.filter(e=>{if(!E?.length)return!0;const t=ar(e?.id);return!!t&&E.includes(t)}):[],[e,E]),[T,$]=c(!1),[B,z]=c(()=>{const e=S?.[0];return e?ar(e.id):void 0}),[I,N]=c(S?.[0]),D=o(null),[_,P]=c(0),
|
|
627
|
+
`,ur=({product:e,addCartItem:n,productRecsCtaButtonText:r,ctaButtonBackgroundColor:s,ctaButtonTextColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:f,cartComponentsCornerRadius:g,cartComponentsCornerType:x,isVerticalList:h,backgroundColor:y,tertiaryColor:b,tertiaryTextColor:v})=>{const w=dn(mn),{setLoading:C}=kn(),k=pn(En),E=i(()=>{const t=e?._ytAllowedVariantIds??e?.ytAllowedVariantIds;if(!Array.isArray(t)||0===t.length)return;const n=t.map(e=>ar(e)).filter(e=>Boolean(e));return n.length>0?n:void 0},[e]),S=i(()=>Array.isArray(e?.variants)?e.variants.filter(e=>{if(!E?.length)return!0;const t=ar(e?.id);return!!t&&E.includes(t)}):[],[e,E]),[T,$]=c(!1),[B,z]=c(()=>{const e=S?.[0];return e?ar(e.id):void 0}),[I,N]=c(S?.[0]),D=o(null),[_,P]=c(0),F=o(null),[O,A]=c(0),M=a(()=>S.find(e=>e.available)??S[0],[S]);l(()=>{if(!S.length)return z(void 0),void N(void 0);if(!(B&&S.some(e=>ar(e?.id)===B))){const e=M();if(e){const t=ar(e.id);z(t),N(e)}}},[S,B,M]),l(()=>{(async()=>{try{if(B){const e=S.find(e=>ar(e?.id)===B);e&&N(e)}}catch(e){console.error("Error getting selected product variant id")}})()},[S,B]);const R=async()=>{C&&C(!0,!0);try{await n(B??ar(S?.[0]?.id)??e?.variants?.[0]?.id,void 0,"productSuggestion",void 0,e?.handle)}catch(e){console.error("yt::error adding recommended item to cart",e)}C&&C(!1,!1)},L=()=>{const t=ar(e?.id),n=E&&E.length>0?E:e?.variants?.map(e=>ar(e.id)).filter(e=>Boolean(e));k({open:!0,variantId:B??ar(S?.[0]?.id)??void 0,handle:e?.handle,freebieSelection:!1,productId:t,allowedVariantIds:n,productRec:!0})};l(()=>{!h&&D.current&&P(D.current.offsetWidth)},[h]),l(()=>{if(h&&F.current){const e=new ResizeObserver(e=>{for(let t of e)A(t.contentRect.width)});return e.observe(F.current),A(F.current.offsetWidth),()=>e.disconnect()}},[h]);const j=m&&S.length>1,V=Fn(I?.name??I?.title,50,_,"","16px"),W=Fn(I?.name??I?.title??e?.title,120,O,"","14px"),H=(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 Wn(n,"vertical"===f?300:200,85,"webp")},q={flexDirection:"horizontal"===f?"row":"column",width:"horizontal"===f?"325px":"145px",transform:T?"scale(1.025)":"scale(1)",justifyContent:"flex-start",gap:"horizontal"===f?"10px":""},U={width:"horizontal"===f?"100px":"auto",opacity:T?.8:1},Q={color:u??"#212529",marginTop:"vertical"===f?"":"0"},Y=(()=>{const t=Number(I?.compare_at_price??e?.compare_at_price),n=Number(I?.price??e?.price);if(!t||!n||t<=n)return null;const r=Math.round((t-n)/t*100);return!isFinite(r)||r<=0?null:`${r}% OFF`})();return h?t.createElement(tr,null,t.createElement(nr,{src:H(I,e),onClick:()=>{window.location.href=`${window.location.origin}${e?.url}`}}),t.createElement(rr,{ref:F},t.createElement(or,{href:`${window.location.origin}${e?.url}`,$primaryTextColor:p},W),t.createElement(ir,null,t.createElement(lr,{$secondaryTextColor:u},Nn(w?.currency),jn(zn(I?.price,w?.currency))),I?.compare_at_price&&t.createElement(cr,null,Nn(w?.currency),jn(zn(I?.compare_at_price,w?.currency))),Y&&t.createElement(pr,{$background:b,$color:v},Y))),t.createElement(sr,{onClick:j?L:R,$ctaButtonBackgroundColor:s,$ctaButtonTextColor:d,$cartComponentsCornerType:x,$cartComponentsCornerRadius:g,style:{width:j?"auto":"36px",padding:j?"0 8px":"0"}},j?t.createElement(Un,null):t.createElement(Dn,null))):t.createElement(Yn,{className:"yt-cart-product-rec-card-container",ref:D,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),style:q,$variant:f??"horizontal",$cartComponentsCornerType:x,$cartComponentsCornerRadius:g,$backgroundColor:y},Y&&t.createElement(dr,{$background:b,$color:v},Y),t.createElement(Gn,{className:"yt-cart-product-rec-image",src:H(I,e),style:U,$variant:f??"horizontal",$cartComponentsCornerType:x,$cartComponentsCornerRadius:g,onClick:()=>{window.location.href=`${window.location.origin}${e?.url}`}}),t.createElement(Zn,null,t.createElement("div",null,t.createElement(Xn,{href:`${window.location.origin}${e?.url}`,style:{color:p??"black"}},V),t.createElement("div",{style:{display:"flex"}},t.createElement(Kn,{style:Q},Nn(w,w?.currency),jn(zn(I?.price??e?.price,w?.currency))),t.createElement(er,null,Number(I?.compare_at_price)>Number(I?.price)&&t.createElement(t.Fragment,null," ",Nn(w,w?.currency),jn(zn(Number(I?.compare_at_price)??Number(e?.compare_at_price),w?.currency)))))),t.createElement(Jn,{onClick:j?L:R,id:"yourtoken-product-rec-atc",style:{backgroundColor:s??"#3A4980",color:d??"white",height:"fit-content",marginTop:"auto",marginBottom:"0px"},$variant:f??"horizontal",$cartComponentsCornerType:x,$cartComponentsCornerRadius:g},j?"Select Options":r??"Add to Cart")))};function mr(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m23 12-2.44-2.79.34-3.69-3.61-.82-1.89-3.2L12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 12l2.44 2.79-.34 3.7 3.61.82L8.6 22.5l3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69L23 12zm-12.91 4.72-3.8-3.81 1.48-1.48 2.32 2.33 5.85-5.87 1.48 1.48-7.33 7.35z"},child:[]}]})(e)}function fr(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12.79 21 3 11.21v2c0 .53.21 1.04.59 1.41l7.79 7.79c.78.78 2.05.78 2.83 0l6.21-6.21c.78-.78.78-2.05 0-2.83L12.79 21z"},child:[]},{tag:"path",attr:{d:"M11.38 17.41c.78.78 2.05.78 2.83 0l6.21-6.21c.78-.78.78-2.05 0-2.83L12.63.58A2.04 2.04 0 0 0 11.21 0H5C3.9 0 3 .9 3 2v6.21c0 .53.21 1.04.59 1.41l7.79 7.79zM7.25 3a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"},child:[]}]})(e)}function gr(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(e)}function xr(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(e)}function hr(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(e)}const yr=h.div`
|
|
628
628
|
display: flex;
|
|
629
629
|
flex-direction: column;
|
|
630
630
|
row-gap: 8px;
|
|
@@ -755,17 +755,17 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
755
755
|
justify-content: space-between;
|
|
756
756
|
align-self: center;
|
|
757
757
|
width: 90%;
|
|
758
|
-
`,
|
|
758
|
+
`,Fr=h.div`
|
|
759
759
|
position: relative;
|
|
760
760
|
display: flex;
|
|
761
761
|
flex-direction: column;
|
|
762
762
|
align-items: center;
|
|
763
763
|
// visibility: ${e=>e?.$isDummy?"hidden":"visible"};
|
|
764
764
|
/* width: ${e=>e?.$isDummy?"1px":"initial"}; */
|
|
765
|
-
`,
|
|
765
|
+
`,Or=h.div`
|
|
766
766
|
display: flex;
|
|
767
767
|
height: 12.5px;
|
|
768
|
-
background-color: ${e=>e?.$isCompleted?e?.$ctaButtonBackgroundColor??"#000000":
|
|
768
|
+
background-color: ${e=>e?.$isCompleted?e?.$ctaButtonBackgroundColor??"#000000":On(e?.$ctaButtonBackgroundColor??"#000000",.2)};
|
|
769
769
|
background-image: linear-gradient(
|
|
770
770
|
45deg,
|
|
771
771
|
rgba(255, 255, 255, 0.5) 25%,
|
|
@@ -804,7 +804,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
804
804
|
position: absolute;
|
|
805
805
|
top: auto;
|
|
806
806
|
bottom: calc(100% + 6px);
|
|
807
|
-
background-color: ${e=>e?.$isCompleted?e?.$ctaButtonBackgroundColor??"#000000":
|
|
807
|
+
background-color: ${e=>e?.$isCompleted?e?.$ctaButtonBackgroundColor??"#000000":On(e?.$ctaButtonBackgroundColor??"#000000",.2)};
|
|
808
808
|
color: ${e=>e?.$isCompleted?`${e?.$ctaButtonTextColor} !important`:`${e.$primaryTextColor} !important`};
|
|
809
809
|
padding: 2px 4px;
|
|
810
810
|
font-size: 9px;
|
|
@@ -895,7 +895,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
895
895
|
`;const Hr=h.div`
|
|
896
896
|
display: flex;
|
|
897
897
|
height: 12.5px;
|
|
898
|
-
background-color: ${e=>e?.$isCompleted?e?.$ctaButtonBackgroundColor??"#000000":
|
|
898
|
+
background-color: ${e=>e?.$isCompleted?e?.$ctaButtonBackgroundColor??"#000000":On(e?.$ctaButtonBackgroundColor??"#000000",.2)};
|
|
899
899
|
flex-grow: 1;
|
|
900
900
|
position: relative;
|
|
901
901
|
border-radius: ${e=>1===e?.$numberOfCheckpoints?"9999px":e?.$isFirstCheckpoint?"9999px 0px 0px 9999px":"0px"};
|
|
@@ -982,7 +982,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
982
982
|
flex-wrap: wrap;
|
|
983
983
|
text-align: center;
|
|
984
984
|
}
|
|
985
|
-
`,eo=({prefixMessageText:e="You are",suffixMessageText:n="away from",successMessageText:r="Best reward unlocked",...o})=>{const a=(r,o)=>t.createElement(Jr,null,e&&t.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},e," "),t.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},r)," ",n&&t.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),t.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let i=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,c=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,s=Nn(o.cartData,o.cartData?.currency)??"Rs .";if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(l<o.checkpoints?.[e]?.minimumOrderValue){i=e;break}if(-1===i)return t.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const e=o.checkpoints?.[i];return a(`${s}${jn((e?.minimumOrderValue-l).toFixed(0))}`,e?.name)}if(0===c&&o.cartData?.item_count>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(c<o.checkpoints?.[e]?.quantityThreshold){i=e;break}if(-1===i)return t.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const d=o.checkpoints?.[i];return a(`${d?.quantityThreshold-c}`,d?.name)},to=e=>t.createElement(Ur,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:e.ctaButtonTextColor,$ctaButtonBackgroundColor:e.ctaButtonBackgroundColor},t.createElement(eo,{...e}));var no={};!function e(t,n,r,o){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix;function l(){}function c(e){var r=n.exports.Promise,o=void 0!==r?r:t.Promise;return"function"==typeof o?new o(e):(e(l,l),null)}var s,d,p,u,m,f,g,x,h,y=function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext("2d").drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}}(function(){if(!t.OffscreenCanvas)return!1;var e=new OffscreenCanvas(1,1),n=e.getContext("2d");n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();try{n.createPattern(r,"no-repeat")}catch(e){return!1}return!0}(),new Map),b=(p=Math.floor(1e3/60),u={},m=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(s=function(e){var t=Math.random();return u[t]=requestAnimationFrame(function n(r){m===r||m+p-1<r?(m=r,delete u[t],e()):u[t]=requestAnimationFrame(n)}),t},d=function(e){u[e]&&cancelAnimationFrame(u[e])}):(s=function(e){return setTimeout(e,p)},d=function(e){return clearTimeout(e)}),{frame:s,cancel:d}),v=(x={},function(){if(f)return f;if(!r&&a){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{f=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return void 0!==typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(n,r,o){if(g)return t(n,null),g;var a=Math.random().toString(36).slice(2);return g=c(function(r){function i(t){t.data.callback===a&&(delete x[a],e.removeEventListener("message",i),g=null,y.clear(),o(),r())}e.addEventListener("message",i),t(n,a),x[a]=i.bind(null,{data:{callback:a}})})},e.reset=function(){for(var t in e.postMessage({reset:!0}),x)x[t](),delete x[t]}}(f)}return f}),w={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function C(e,t,n){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:w[t],n)}function k(e){return e<0?0:Math.floor(e)}function E(e,t){return Math.floor(Math.random()*(t-e))+e}function S(e){return parseInt(e,16)}function T(e){return e.map($)}function $(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:S(t.substring(0,2)),g:S(t.substring(2,4)),b:S(t.substring(4,6))}}function B(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function z(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function I(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function N(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,o=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,l=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-n)+")",e.beginPath(),i&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,n,r,o,a,i){var l=new Path2D(e),c=new Path2D;c.addPath(l,new DOMMatrix(t));var s=new Path2D;return s.addPath(c,new DOMMatrix([Math.cos(i)*o,Math.sin(i)*o,-Math.sin(i)*a,Math.cos(i)*a,n,r])),s}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(a-r),.1*Math.abs(l-o),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var c=Math.PI/10*t.wobble,s=.1*Math.abs(a-r),d=.1*Math.abs(l-o),p=t.shape.bitmap.width*t.scalar,u=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*s,Math.sin(c)*s,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var f=e.createPattern(y.transform(t.shape.bitmap),"no-repeat");f.setTransform(m),e.globalAlpha=1-n,e.fillStyle=f,e.fillRect(t.x-p/2,t.y-u/2,p,u),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(l-o)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,n,r,o,a,i,l,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,o),e.arc(0,0,1,i,l,c),e.restore()}(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(l-o)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var g=Math.PI/2*3,x=4*t.scalar,h=8*t.scalar,b=t.x,v=t.y,w=5,C=Math.PI/w;w--;)b=t.x+Math.cos(g)*h,v=t.y+Math.sin(g)*h,e.lineTo(b,v),g+=C,b=t.x+Math.cos(g)*x,v=t.y+Math.sin(g)*x,e.lineTo(b,v),g+=C;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(o)),e.lineTo(Math.floor(a),Math.floor(l)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function D(e,n){var i,l=!e,s=!!C(n||{},"resize"),d=!1,p=C(n,"disableForReducedMotion",Boolean),u=a&&!!C(n||{},"useWorker")?v():null,m=l?B:z,f=!(!e||!u)&&!!e.__confetti_initialized,g="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function x(t,n,a){for(var l=C(t,"particleCount",k),s=C(t,"angle",Number),d=C(t,"spread",Number),p=C(t,"startVelocity",Number),u=C(t,"decay",Number),f=C(t,"gravity",Number),g=C(t,"drift",Number),x=C(t,"colors",T),h=C(t,"ticks",Number),v=C(t,"shapes"),w=C(t,"scalar"),S=!!C(t,"flat"),$=function(e){var t=C(e,"origin",Object);return t.x=C(t,"x",Number),t.y=C(t,"y",Number),t}(t),B=l,z=[],D=e.width*$.x,_=e.height*$.y;B--;)z.push(I({x:D,y:_,angle:s,spread:d,startVelocity:p,color:x[B%x.length],shape:v[E(0,v.length)],ticks:h,decay:u,gravity:f,drift:g,scalar:w,flat:S}));return i?i.addFettis(z):(i=function(e,t,n,a,i){var l,s,d=t.slice(),p=e.getContext("2d"),u=c(function(t){function c(){l=s=null,p.clearRect(0,0,a.width,a.height),y.clear(),i(),t()}l=b.frame(function t(){!r||a.width===o.width&&a.height===o.height||(a.width=e.width=o.width,a.height=e.height=o.height),a.width||a.height||(n(e),a.width=e.width,a.height=e.height),p.clearRect(0,0,a.width,a.height),(d=d.filter(function(e){return N(p,e)})).length?l=b.frame(t):c()}),s=c});return{addFettis:function(e){return d=d.concat(e),u},canvas:e,promise:u,reset:function(){l&&b.cancel(l),s&&s()}}}(e,z,m,n,a),i.promise)}function h(n){var r=p||C(n,"disableForReducedMotion",Boolean),o=C(n,"zIndex",Number);if(r&&g)return c(function(e){e()});l&&i?e=i.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(o),document.body.appendChild(e)),s&&!f&&m(e);var a={width:e.width,height:e.height};function h(){if(u){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return m(t),void u.postMessage({resize:{width:t.width,height:t.height}})}a.width=a.height=null}function y(){i=null,s&&(d=!1,t.removeEventListener("resize",h)),l&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,f=!1)}return u&&!f&&u.init(e),f=!0,u&&(e.__confetti_initialized=!0),s&&!d&&(d=!0,t.addEventListener("resize",h,!1)),u?u.fire(n,a,y):x(n,a,y)}return h.reset=function(){u&&u.reset(),i&&i.reset()},h}function _(){return h||(h=D(null,{useWorker:!0,resize:!0})),h}n.exports=function(){return _().apply(this,arguments)},n.exports.reset=function(){_().reset()},n.exports.create=D,n.exports.shapeFromPath=function(e){if(!i)throw new Error("path confetti are not supported in this browser");var t,n;"string"==typeof e?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),o=document.createElement("canvas").getContext("2d");if(!n){for(var a,l,c=1e3,s=c,d=c,p=0,u=0,m=0;m<c;m+=2)for(var f=0;f<c;f+=2)o.isPointInPath(r,m,f,"nonzero")&&(s=Math.min(s,m),d=Math.min(d,f),p=Math.max(p,m),u=Math.max(u,f));a=p-s,l=u-d;var g=Math.min(10/a,10/l);n=[g,0,0,g,-Math.round(a/2+s)*g,-Math.round(l/2+d)*g]}return{type:"path",path:t,matrix:n}},n.exports.shapeFromText=function(e){var t,n=1,r="#000000",o='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,n="scalar"in e?e.scalar:n,o="fontFamily"in e?e.fontFamily:o,r="color"in e?e.color:r);var a=10*n,i=a+"px "+o,l=new OffscreenCanvas(a,a),c=l.getContext("2d");c.font=i;var s=c.measureText(t),d=Math.ceil(s.actualBoundingBoxRight+s.actualBoundingBoxLeft),p=Math.ceil(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent),u=s.actualBoundingBoxLeft+2,m=s.actualBoundingBoxAscent+2;d+=4,p+=4,(c=(l=new OffscreenCanvas(d,p)).getContext("2d")).font=i,c.fillStyle=r,c.fillText(t,u,m);var f=1/n;return{type:"bitmap",bitmap:l.transferToImageBitmap(),matrix:[f,0,0,f,-d*f/2,-p*f/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),no,!1);var ro=no.exports;no.exports.create;const oo=({particleCount:e,spread:n,origin:r,checkpointPosition:a=.5})=>{const i=o(null),c=o(!1);return l(()=>{if(i.current&&!c.current){ro.create(i.current,{resize:!0})({particleCount:10*e,spread:n,origin:{x:1,y:.8}}),c.current=!0}},[e,n,r,a]),t.createElement("canvas",{ref:i,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},ao=({prefixMessageText:e,suffixMessageText:n,successMessageText:r,enableConfetti:a,...i})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:f,ctaButtonBackgroundColor:g,ctaButtonTextColor:x}=i,h=dn(mn),[y,b]=c(!1),[v,w]=c(-1),C=o({});return l(()=>{d?.forEach((e,t)=>{const n=Kr(e,0,d??[],h?.item_count,i),r=String(e.couponTemplateId);(C.current[r]||0)<100&&n.progressPercentage>=100&&(w(t),b(!0),setTimeout(()=>b(!1),5e3)),C.current[r]=n.progressPercentage})},[h,d]),t.createElement(t.Fragment,null,t.createElement(to,{currentCartAmount:s,checkpoints:d,cartData:h,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:f,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:e,suffixMessageText:n,successMessageText:r,ctaButtonBackgroundColor:g,ctaButtonTextColor:x}),t.createElement(Qr,null,y&&a&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),t.createElement(Yr,null,t.createElement(qr,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Xr(u)]&&("minimum_order_value"!==u||1!==e?.[Xr(u)]))?.map((...e)=>Kr(...e,h?.item_count,i))?.map((e,n)=>t.createElement(Gr,{key:e?.couponTemplateId,$numberOfCheckpoints:d?.length??1},t.createElement(Zr,null,n<d?.length&&t.createElement(Hr,{className:"yt-cart-single-progress-bar",$isCompleted:e?.progressPercentage>=100,$percent:e?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:g}))))))))},io=e=>t.createElement(Rr,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:e.ctaButtonTextColor,$ctaButtonBackgroundColor:e.ctaButtonBackgroundColor},t.createElement(eo,{...e}));function lo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}function co(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"ellipse",attr:{transform:"rotate(-1.057 159.995 423.97) scale(.99997)",cx:"160",cy:"424",rx:"24",ry:"24"},child:[]},{tag:"ellipse",attr:{transform:"matrix(.02382 -.9997 .9997 .02382 -48.51 798.282)",cx:"384.5",cy:"424",rx:"24",ry:"24"},child:[]},{tag:"path",attr:{d:"M463.8 132.2c-.7-2.4-2.8-4-5.2-4.2L132.9 96.5c-2.8-.3-6.2-2.1-7.5-4.7-3.8-7.1-6.2-11.1-12.2-18.6-7.7-9.4-22.2-9.1-48.8-9.3-9-.1-16.3 5.2-16.3 14.1 0 8.7 6.9 14.1 15.6 14.1s21.3.5 26 1.9c4.7 1.4 8.5 9.1 9.9 15.8 0 .1 0 .2.1.3.2 1.2 2 10.2 2 10.3l40 211.6c2.4 14.5 7.3 26.5 14.5 35.7 8.4 10.8 19.5 16.2 32.9 16.2h236.6c7.6 0 14.1-5.8 14.4-13.4.4-8-6-14.6-14-14.6H188.9c-2 0-4.9 0-8.3-2.8-3.5-3-8.3-9.9-11.5-26l-4.3-23.7c0-.3.1-.5.4-.6l277.7-47c2.6-.4 4.6-2.5 4.9-5.2l16-115.8c.2-.8.2-1.7 0-2.6z"},child:[]}]})(e)}function so(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463 192H315.9L271.2 58.6C269 52.1 262.9 48 256 48s-13 4.1-15.2 10.6L196.1 192H48c-8.8 0-16 7.2-16 16 0 .9.1 1.9.3 2.7.2 3.5 1.8 7.4 6.7 11.3l120.9 85.2-46.4 134.9c-2.3 6.5 0 13.8 5.5 18 2.9 2.1 5.6 3.9 9 3.9 3.3 0 7.2-1.7 10-3.6l118-84.1 118 84.1c2.8 2 6.7 3.6 10 3.6 3.4 0 6.1-1.7 8.9-3.9 5.6-4.2 7.8-11.4 5.5-18L352 307.2l119.9-86 2.9-2.5c2.6-2.8 5.2-6.6 5.2-10.7 0-8.8-8.2-16-17-16z"},child:[]}]})(e)}function po(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M320 128L192 256l128 128z"},child:[]}]})(e)}function uo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M192 128l128 128-128 128z"},child:[]}]})(e)}function mo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M186.301 339.893L96 249.461l-32 30.507L186.301 402 448 140.506 416 110z"},child:[]}]})(e)}function fo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M442 107v141L229.2 451.7c8 8 20.8 12.3 28.8 12.3s22.8-3.7 31.4-12.3L480 272V144l-38-37z"},child:[]},{tag:"path",attr:{d:"M384 48H224L44.3 235.6c-8 8-12 17.8-12.3 28.4-.3 11.3 3.7 23.3 12.3 31.9l123.8 123.6c8 8 20.8 12.5 28.8 12.5s22.7-3.9 31.3-12.5L416 240V80l-32-32zm-30.7 102.7c-21.7 6.1-41.3-10-41.3-30.7 0-17.7 14.3-32 32-32 20.7 0 36.8 19.6 30.7 41.3-2.9 10.3-11.1 18.5-21.4 21.4z"},child:[]}]})(e)}function go(e){return _({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M160 894c0 17.7 14.3 32 32 32h286V550H160v344zm386 32h286c17.7 0 32-14.3 32-32V550H546v376zm334-616H732.4c13.6-21.4 21.6-46.8 21.6-74 0-76.1-61.9-138-138-138-41.4 0-78.7 18.4-104 47.4-25.3-29-62.6-47.4-104-47.4-76.1 0-138 61.9-138 138 0 27.2 7.9 52.6 21.6 74H144c-17.7 0-32 14.3-32 32v140h366V310h68v172h366V342c0-17.7-14.3-32-32-32zm-402-4h-70c-38.6 0-70-31.4-70-70s31.4-70 70-70 70 31.4 70 70v70zm138 0h-70v-70c0-38.6 31.4-70 70-70s70 31.4 70 70-31.4 70-70 70z"},child:[]}]})(e)}function xo(e){return _({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 0 0 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 0 0 9.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"},child:[]}]})(e)}function ho(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m10 15.586-3.293-3.293-1.414 1.414L10 18.414l9.707-9.707-1.414-1.414z"},child:[]}]})(e)}function yo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(e)}function bo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"},child:[]}]})(e)}function vo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z"},child:[]},{tag:"path",attr:{d:"M9 10h2v8H9zm4 0h2v8h-2z"},child:[]}]})(e)}function wo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 5H3a1 1 0 0 0-1 1v4h.893c.996 0 1.92.681 2.08 1.664A2.001 2.001 0 0 1 3 14H2v4a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-4h-1a2.001 2.001 0 0 1-1.973-2.336c.16-.983 1.084-1.664 2.08-1.664H22V6a1 1 0 0 0-1-1zM9 9a1 1 0 1 1 0 2 1 1 0 1 1 0-2zm-.8 6.4 6-8 1.6 1.2-6 8-1.6-1.2zM15 15a1 1 0 1 1 0-2 1 1 0 1 1 0 2z"},child:[]}]})(e)}function Co(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"},child:[]}]})(e)}function ko(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"},child:[]}]})(e)}function Eo(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function So(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"},child:[]}]})(e)}function To(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function $o(e){return _({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M95.8,56.2a28,28,0,1,1-39.6,0A28,28,0,0,1,95.8,56.2Zm104,104a28,28,0,1,0,0,39.6A28,28,0,0,0,199.8,160.2Z",opacity:"0.2"},child:[]},{tag:"path",attr:{d:"M205.66,61.64l-144,144a8,8,0,0,1-11.32-11.32l144-144a8,8,0,0,1,11.32,11.31ZM50.54,101.44a36,36,0,0,1,50.92-50.91h0a36,36,0,0,1-50.92,50.91ZM56,76A20,20,0,1,0,90.14,61.84h0A20,20,0,0,0,56,76ZM216,180a36,36,0,1,1-10.54-25.46h0A35.76,35.76,0,0,1,216,180Zm-16,0a20,20,0,1,0-5.86,14.14A19.87,19.87,0,0,0,200,180Z"},child:[]}]})(e)}const Bo=(e,n,r,o,a)=>{let i;if(i="free_product"===e?zo?.[o]:Io?.[e],!i)return t.createElement(mo,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${_r(r)}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 t.createElement(i,{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:`${_r(r??3)}px`,marginLeft:"-2px"}})},zo={tshirt:function(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21.316 4.055C19.556 3.478 15 1.985 15 2a3 3 0 1 1-6 0c0-.015-4.556 1.478-6.317 2.055A.992.992 0 0 0 2 5.003v3.716a1 1 0 0 0 1.242.97L6 9v12a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V9l2.758.689A1 1 0 0 0 22 8.719V5.003a.992.992 0 0 0-.684-.948z"},child:[]}]})(e)},box:function(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.406 6.086-9-4a1.001 1.001 0 0 0-.813 0l-9 4c-.02.009-.034.024-.054.035-.028.014-.058.023-.084.04-.022.015-.039.034-.06.05a.87.87 0 0 0-.19.194c-.02.028-.041.053-.059.081a1.119 1.119 0 0 0-.076.165c-.009.027-.023.052-.031.079A1.013 1.013 0 0 0 2 7v10c0 .396.232.753.594.914l9 4c.13.058.268.086.406.086a.997.997 0 0 0 .402-.096l.004.01 9-4A.999.999 0 0 0 22 17V7a.999.999 0 0 0-.594-.914zM12 4.095 18.538 7 12 9.905l-1.308-.581L5.463 7 12 4.095zM4 16.351V8.539l7 3.111v7.811l-7-3.11zm9 3.11V11.65l7-3.111v7.812l-7 3.11z"},child:[]}]})(e)},cup:function(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M.5 6a.5.5 0 0 0-.488.608l1.652 7.434A2.5 2.5 0 0 0 4.104 16h5.792a2.5 2.5 0 0 0 2.44-1.958l.131-.59a3 3 0 0 0 1.3-5.854l.221-.99A.5.5 0 0 0 13.5 6zM13 12.5a2 2 0 0 1-.316-.025l.867-3.898A2.001 2.001 0 0 1 13 12.5"},child:[]},{tag:"path",attr:{d:"m4.4.8-.003.004-.014.019a4 4 0 0 0-.204.31 2 2 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.6.6 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3 3 0 0 1-.202.388 5 5 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 3.6 4.2l.003-.004.014-.019a4 4 0 0 0 .204-.31 2 2 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.6.6 0 0 0-.09-.252A4 4 0 0 0 3.6 2.8l-.01-.012a5 5 0 0 1-.37-.543A1.53 1.53 0 0 1 3 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a6 6 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 4.4.8m3 0-.003.004-.014.019a4 4 0 0 0-.204.31 2 2 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.6.6 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3 3 0 0 1-.202.388 5 5 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 6.6 4.2l.003-.004.014-.019a4 4 0 0 0 .204-.31 2 2 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.6.6 0 0 0-.09-.252A4 4 0 0 0 6.6 2.8l-.01-.012a5 5 0 0 1-.37-.543A1.53 1.53 0 0 1 6 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a6 6 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 7.4.8m3 0-.003.004-.014.019a4 4 0 0 0-.204.31 2 2 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.6.6 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3 3 0 0 1-.202.388 5 5 0 0 1-.252.382l-.019.025-.005.008-.002.002A.5.5 0 0 1 9.6 4.2l.003-.004.014-.019a4 4 0 0 0 .204-.31 2 2 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.6.6 0 0 0-.09-.252A4 4 0 0 0 9.6 2.8l-.01-.012a5 5 0 0 1-.37-.543A1.53 1.53 0 0 1 9 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a6 6 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 10.4.8"},child:[]}]})(e)},gift:go,emptyCircle:$o},Io={percentage_discount_coupon:fr,amount_discount_coupon:fr,free_delivery:mt,free_gift:go,dummy_coupon:$o},No=({checkpointWithProgress:e,themeColor:n,checkpointsLength:r,progressBarFreeProductIconType:o,themeTextColor:a,ctaButtonTextColor:i})=>e?.progressPercentage>=100?t.createElement(mo,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:i,borderColor:n,borderRadius:"9999px",fontSize:`${_r(r)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):Bo(e?.couponType,"#707070",r,o??"tshirt"),Do=({showMOVForProgressTiers:e,minimumOrderValue:n,customCartProgressBarCriteria:r,cartData:o,quantityThreshold:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l})=>e?t.createElement(Mr,{$visible:n>1||a>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:i},"minimum_order_value"===r?`${Nn(o,o?.currency)} ${jn(n)}`:`${a} item${a>1?"s":""}`):null,_o="undefined"!=typeof window?m:l,Po=({prefixMessageText:e,suffixMessageText:n,successMessageText:r,enableConfetti:i,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:f,primaryTextColor:g,effectiveQuantityForProgressBar:x,progressBarFreeProductIconType:h,ctaButtonBackgroundColor:y,showMOVForProgressTiers:b,ctaButtonTextColor:v}=s,w=dn(mn),[C,k]=c(!1),[E,S]=c(-1),T=o({}),[$,B]=c(0),[z,I]=c(0),N=o(null),D=o([]);D.current.length=0;const _=a(()=>{if("undefined"==typeof window)return;const e=D.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return B(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),r=parseFloat(n.lineHeight||""),o=parseFloat(n.fontSize||""),a=Number.isNaN(r)?Number.isNaN(o)?0:1.2*o:r,i=e.getBoundingClientRect(),l=a>0?Math.max(0,i.height-a):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;B(e=>e!==n?n:e);const r=N.current,o=e[e.length-1];if(!r||!o)return void I(e=>0!==e?0:e);const a=r.getBoundingClientRect(),i=o.getBoundingClientRect(),l=Math.ceil(i.right-a.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return _o(()=>{_()}),l(()=>{if("undefined"==typeof window)return;const e=()=>{_()};window.addEventListener("resize",e);const t=N.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>_()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[_]),l(()=>{s.checkpoints?.forEach((e,t)=>{const n=Kr(e,0,s.checkpoints??[],w?.item_count,s),r=String(e.couponTemplateId);(T.current[r]||0)<100&&n.progressPercentage>=100&&(S(t),k(!0),setTimeout(()=>k(!1),5e3)),T.current[r]=n.progressPercentage})},[w,s.checkpoints]),t.createElement(t.Fragment,null,t.createElement(io,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:w,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:g,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:y,prefixMessageText:e,suffixMessageText:n,successMessageText:r,ctaButtonTextColor:v}),t.createElement(Lr,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:z,ref:N},C&&i&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(E+1)/(s.checkpoints?.length??1)}),t.createElement(jr,{$tagWrapOffsetPx:$},t.createElement(Pr,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Xr(s.customCartProgressBarCriteria)])?.map((...e)=>Kr(...e,w?.item_count,s))?.map((e,n)=>t.createElement(Vr,{key:e?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},t.createElement(Wr,null,n<s.checkpoints?.length&&t.createElement(Fr,{className:"yt-cart-multi-progress-bar",$isCompleted:e?.progressPercentage>=100,$percent:e?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:y}),("minimum_order_value"!==s.customCartProgressBarCriteria||e?.minimumOrderValue>1)&&t.createElement(Or,{$isDummy:e?.isDummyCouponTemplate},t.createElement(Ar,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{D.current[n]=e},$isCompleted:e?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:y,$primaryTextColor:g,style:{display:s.checkpoints?.length>1?"block":"none"}},e?.name),s.checkpoints?.length>1&&t.createElement(No,{checkpointWithProgress:e,themeColor:y,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:h,ctaButtonTextColor:v}),t.createElement(Do,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:e?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:w,quantityThreshold:e?.quantityThreshold,ctaButtonBackgroundColor:y,ctaButtonTextColor:v})))))))))},Oo=e=>e?.checkpoints&&e.checkpoints.length>0?1===e.checkpoints.length?t.createElement(ao,{...e}):t.createElement(Po,{...e}):null;function Fo(e){return _({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M17.707 9.293a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-7-7A.997.997 0 012 10V5a3 3 0 013-3h5c.256 0 .512.098.707.293l7 7zM5 6a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"},child:[]}]})(e)}function Ao(e){return _({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"},child:[]}]})(e)}function Mo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"},child:[]}]})(e)}const Ro=h(h.span`
|
|
985
|
+
`,eo=({prefixMessageText:e="You are",suffixMessageText:n="away from",successMessageText:r="Best reward unlocked",...o})=>{const a=(r,o)=>t.createElement(Jr,null,e&&t.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},e," "),t.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},r)," ",n&&t.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),t.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let i=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,c=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,s=Nn(o.cartData,o.cartData?.currency)??"Rs .";if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(l<o.checkpoints?.[e]?.minimumOrderValue){i=e;break}if(-1===i)return t.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const e=o.checkpoints?.[i];return a(`${s}${jn((e?.minimumOrderValue-l).toFixed(0))}`,e?.name)}if(0===c&&o.cartData?.item_count>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(c<o.checkpoints?.[e]?.quantityThreshold){i=e;break}if(-1===i)return t.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const d=o.checkpoints?.[i];return a(`${d?.quantityThreshold-c}`,d?.name)},to=e=>t.createElement(Ur,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:e.ctaButtonTextColor,$ctaButtonBackgroundColor:e.ctaButtonBackgroundColor},t.createElement(eo,{...e}));var no={};!function e(t,n,r,o){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),i="function"==typeof Path2D&&"function"==typeof DOMMatrix;function l(){}function c(e){var r=n.exports.Promise,o=void 0!==r?r:t.Promise;return"function"==typeof o?new o(e):(e(l,l),null)}var s,d,p,u,m,f,g,x,h,y=function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext("2d").drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}}(function(){if(!t.OffscreenCanvas)return!1;var e=new OffscreenCanvas(1,1),n=e.getContext("2d");n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();try{n.createPattern(r,"no-repeat")}catch(e){return!1}return!0}(),new Map),b=(p=Math.floor(1e3/60),u={},m=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(s=function(e){var t=Math.random();return u[t]=requestAnimationFrame(function n(r){m===r||m+p-1<r?(m=r,delete u[t],e()):u[t]=requestAnimationFrame(n)}),t},d=function(e){u[e]&&cancelAnimationFrame(u[e])}):(s=function(e){return setTimeout(e,p)},d=function(e){return clearTimeout(e)}),{frame:s,cancel:d}),v=(x={},function(){if(f)return f;if(!r&&a){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{f=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return void 0!==typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(n,r,o){if(g)return t(n,null),g;var a=Math.random().toString(36).slice(2);return g=c(function(r){function i(t){t.data.callback===a&&(delete x[a],e.removeEventListener("message",i),g=null,y.clear(),o(),r())}e.addEventListener("message",i),t(n,a),x[a]=i.bind(null,{data:{callback:a}})})},e.reset=function(){for(var t in e.postMessage({reset:!0}),x)x[t](),delete x[t]}}(f)}return f}),w={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function C(e,t,n){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:w[t],n)}function k(e){return e<0?0:Math.floor(e)}function E(e,t){return Math.floor(Math.random()*(t-e))+e}function S(e){return parseInt(e,16)}function T(e){return e.map($)}function $(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:S(t.substring(0,2)),g:S(t.substring(2,4)),b:S(t.substring(4,6))}}function B(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function z(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function I(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(.5*Math.random()+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function N(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,o=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,l=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-n)+")",e.beginPath(),i&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix))e.fill(function(e,t,n,r,o,a,i){var l=new Path2D(e),c=new Path2D;c.addPath(l,new DOMMatrix(t));var s=new Path2D;return s.addPath(c,new DOMMatrix([Math.cos(i)*o,Math.sin(i)*o,-Math.sin(i)*a,Math.cos(i)*a,n,r])),s}(t.shape.path,t.shape.matrix,t.x,t.y,.1*Math.abs(a-r),.1*Math.abs(l-o),Math.PI/10*t.wobble));else if("bitmap"===t.shape.type){var c=Math.PI/10*t.wobble,s=.1*Math.abs(a-r),d=.1*Math.abs(l-o),p=t.shape.bitmap.width*t.scalar,u=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*s,Math.sin(c)*s,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var f=e.createPattern(y.transform(t.shape.bitmap),"no-repeat");f.setTransform(m),e.globalAlpha=1-n,e.fillStyle=f,e.fillRect(t.x-p/2,t.y-u/2,p,u),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(l-o)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,n,r,o,a,i,l,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,o),e.arc(0,0,1,i,l,c),e.restore()}(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(l-o)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if("star"===t.shape)for(var g=Math.PI/2*3,x=4*t.scalar,h=8*t.scalar,b=t.x,v=t.y,w=5,C=Math.PI/w;w--;)b=t.x+Math.cos(g)*h,v=t.y+Math.sin(g)*h,e.lineTo(b,v),g+=C,b=t.x+Math.cos(g)*x,v=t.y+Math.sin(g)*x,e.lineTo(b,v),g+=C;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(o)),e.lineTo(Math.floor(a),Math.floor(l)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function D(e,n){var i,l=!e,s=!!C(n||{},"resize"),d=!1,p=C(n,"disableForReducedMotion",Boolean),u=a&&!!C(n||{},"useWorker")?v():null,m=l?B:z,f=!(!e||!u)&&!!e.__confetti_initialized,g="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function x(t,n,a){for(var l=C(t,"particleCount",k),s=C(t,"angle",Number),d=C(t,"spread",Number),p=C(t,"startVelocity",Number),u=C(t,"decay",Number),f=C(t,"gravity",Number),g=C(t,"drift",Number),x=C(t,"colors",T),h=C(t,"ticks",Number),v=C(t,"shapes"),w=C(t,"scalar"),S=!!C(t,"flat"),$=function(e){var t=C(e,"origin",Object);return t.x=C(t,"x",Number),t.y=C(t,"y",Number),t}(t),B=l,z=[],D=e.width*$.x,_=e.height*$.y;B--;)z.push(I({x:D,y:_,angle:s,spread:d,startVelocity:p,color:x[B%x.length],shape:v[E(0,v.length)],ticks:h,decay:u,gravity:f,drift:g,scalar:w,flat:S}));return i?i.addFettis(z):(i=function(e,t,n,a,i){var l,s,d=t.slice(),p=e.getContext("2d"),u=c(function(t){function c(){l=s=null,p.clearRect(0,0,a.width,a.height),y.clear(),i(),t()}l=b.frame(function t(){!r||a.width===o.width&&a.height===o.height||(a.width=e.width=o.width,a.height=e.height=o.height),a.width||a.height||(n(e),a.width=e.width,a.height=e.height),p.clearRect(0,0,a.width,a.height),(d=d.filter(function(e){return N(p,e)})).length?l=b.frame(t):c()}),s=c});return{addFettis:function(e){return d=d.concat(e),u},canvas:e,promise:u,reset:function(){l&&b.cancel(l),s&&s()}}}(e,z,m,n,a),i.promise)}function h(n){var r=p||C(n,"disableForReducedMotion",Boolean),o=C(n,"zIndex",Number);if(r&&g)return c(function(e){e()});l&&i?e=i.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(o),document.body.appendChild(e)),s&&!f&&m(e);var a={width:e.width,height:e.height};function h(){if(u){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return m(t),void u.postMessage({resize:{width:t.width,height:t.height}})}a.width=a.height=null}function y(){i=null,s&&(d=!1,t.removeEventListener("resize",h)),l&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,f=!1)}return u&&!f&&u.init(e),f=!0,u&&(e.__confetti_initialized=!0),s&&!d&&(d=!0,t.addEventListener("resize",h,!1)),u?u.fire(n,a,y):x(n,a,y)}return h.reset=function(){u&&u.reset(),i&&i.reset()},h}function _(){return h||(h=D(null,{useWorker:!0,resize:!0})),h}n.exports=function(){return _().apply(this,arguments)},n.exports.reset=function(){_().reset()},n.exports.create=D,n.exports.shapeFromPath=function(e){if(!i)throw new Error("path confetti are not supported in this browser");var t,n;"string"==typeof e?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),o=document.createElement("canvas").getContext("2d");if(!n){for(var a,l,c=1e3,s=c,d=c,p=0,u=0,m=0;m<c;m+=2)for(var f=0;f<c;f+=2)o.isPointInPath(r,m,f,"nonzero")&&(s=Math.min(s,m),d=Math.min(d,f),p=Math.max(p,m),u=Math.max(u,f));a=p-s,l=u-d;var g=Math.min(10/a,10/l);n=[g,0,0,g,-Math.round(a/2+s)*g,-Math.round(l/2+d)*g]}return{type:"path",path:t,matrix:n}},n.exports.shapeFromText=function(e){var t,n=1,r="#000000",o='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,n="scalar"in e?e.scalar:n,o="fontFamily"in e?e.fontFamily:o,r="color"in e?e.color:r);var a=10*n,i=a+"px "+o,l=new OffscreenCanvas(a,a),c=l.getContext("2d");c.font=i;var s=c.measureText(t),d=Math.ceil(s.actualBoundingBoxRight+s.actualBoundingBoxLeft),p=Math.ceil(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent),u=s.actualBoundingBoxLeft+2,m=s.actualBoundingBoxAscent+2;d+=4,p+=4,(c=(l=new OffscreenCanvas(d,p)).getContext("2d")).font=i,c.fillStyle=r,c.fillText(t,u,m);var f=1/n;return{type:"bitmap",bitmap:l.transferToImageBitmap(),matrix:[f,0,0,f,-d*f/2,-p*f/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),no,!1);var ro=no.exports;no.exports.create;const oo=({particleCount:e,spread:n,origin:r,checkpointPosition:a=.5})=>{const i=o(null),c=o(!1);return l(()=>{if(i.current&&!c.current){ro.create(i.current,{resize:!0})({particleCount:10*e,spread:n,origin:{x:1,y:.8}}),c.current=!0}},[e,n,r,a]),t.createElement("canvas",{ref:i,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},ao=({prefixMessageText:e,suffixMessageText:n,successMessageText:r,enableConfetti:a,...i})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:f,ctaButtonBackgroundColor:g,ctaButtonTextColor:x}=i,h=dn(mn),[y,b]=c(!1),[v,w]=c(-1),C=o({});return l(()=>{d?.forEach((e,t)=>{const n=Kr(e,0,d??[],h?.item_count,i),r=String(e.couponTemplateId);(C.current[r]||0)<100&&n.progressPercentage>=100&&(w(t),b(!0),setTimeout(()=>b(!1),5e3)),C.current[r]=n.progressPercentage})},[h,d]),t.createElement(t.Fragment,null,t.createElement(to,{currentCartAmount:s,checkpoints:d,cartData:h,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:f,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:e,suffixMessageText:n,successMessageText:r,ctaButtonBackgroundColor:g,ctaButtonTextColor:x}),t.createElement(Qr,null,y&&a&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),t.createElement(Yr,null,t.createElement(qr,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Xr(u)]&&("minimum_order_value"!==u||1!==e?.[Xr(u)]))?.map((...e)=>Kr(...e,h?.item_count,i))?.map((e,n)=>t.createElement(Gr,{key:e?.couponTemplateId,$numberOfCheckpoints:d?.length??1},t.createElement(Zr,null,n<d?.length&&t.createElement(Hr,{className:"yt-cart-single-progress-bar",$isCompleted:e?.progressPercentage>=100,$percent:e?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:g}))))))))},io=e=>t.createElement(Rr,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:e.ctaButtonTextColor,$ctaButtonBackgroundColor:e.ctaButtonBackgroundColor},t.createElement(eo,{...e}));function lo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}function co(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"ellipse",attr:{transform:"rotate(-1.057 159.995 423.97) scale(.99997)",cx:"160",cy:"424",rx:"24",ry:"24"},child:[]},{tag:"ellipse",attr:{transform:"matrix(.02382 -.9997 .9997 .02382 -48.51 798.282)",cx:"384.5",cy:"424",rx:"24",ry:"24"},child:[]},{tag:"path",attr:{d:"M463.8 132.2c-.7-2.4-2.8-4-5.2-4.2L132.9 96.5c-2.8-.3-6.2-2.1-7.5-4.7-3.8-7.1-6.2-11.1-12.2-18.6-7.7-9.4-22.2-9.1-48.8-9.3-9-.1-16.3 5.2-16.3 14.1 0 8.7 6.9 14.1 15.6 14.1s21.3.5 26 1.9c4.7 1.4 8.5 9.1 9.9 15.8 0 .1 0 .2.1.3.2 1.2 2 10.2 2 10.3l40 211.6c2.4 14.5 7.3 26.5 14.5 35.7 8.4 10.8 19.5 16.2 32.9 16.2h236.6c7.6 0 14.1-5.8 14.4-13.4.4-8-6-14.6-14-14.6H188.9c-2 0-4.9 0-8.3-2.8-3.5-3-8.3-9.9-11.5-26l-4.3-23.7c0-.3.1-.5.4-.6l277.7-47c2.6-.4 4.6-2.5 4.9-5.2l16-115.8c.2-.8.2-1.7 0-2.6z"},child:[]}]})(e)}function so(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463 192H315.9L271.2 58.6C269 52.1 262.9 48 256 48s-13 4.1-15.2 10.6L196.1 192H48c-8.8 0-16 7.2-16 16 0 .9.1 1.9.3 2.7.2 3.5 1.8 7.4 6.7 11.3l120.9 85.2-46.4 134.9c-2.3 6.5 0 13.8 5.5 18 2.9 2.1 5.6 3.9 9 3.9 3.3 0 7.2-1.7 10-3.6l118-84.1 118 84.1c2.8 2 6.7 3.6 10 3.6 3.4 0 6.1-1.7 8.9-3.9 5.6-4.2 7.8-11.4 5.5-18L352 307.2l119.9-86 2.9-2.5c2.6-2.8 5.2-6.6 5.2-10.7 0-8.8-8.2-16-17-16z"},child:[]}]})(e)}function po(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M320 128L192 256l128 128z"},child:[]}]})(e)}function uo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M192 128l128 128-128 128z"},child:[]}]})(e)}function mo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M186.301 339.893L96 249.461l-32 30.507L186.301 402 448 140.506 416 110z"},child:[]}]})(e)}function fo(e){return _({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M442 107v141L229.2 451.7c8 8 20.8 12.3 28.8 12.3s22.8-3.7 31.4-12.3L480 272V144l-38-37z"},child:[]},{tag:"path",attr:{d:"M384 48H224L44.3 235.6c-8 8-12 17.8-12.3 28.4-.3 11.3 3.7 23.3 12.3 31.9l123.8 123.6c8 8 20.8 12.5 28.8 12.5s22.7-3.9 31.3-12.5L416 240V80l-32-32zm-30.7 102.7c-21.7 6.1-41.3-10-41.3-30.7 0-17.7 14.3-32 32-32 20.7 0 36.8 19.6 30.7 41.3-2.9 10.3-11.1 18.5-21.4 21.4z"},child:[]}]})(e)}function go(e){return _({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M160 894c0 17.7 14.3 32 32 32h286V550H160v344zm386 32h286c17.7 0 32-14.3 32-32V550H546v376zm334-616H732.4c13.6-21.4 21.6-46.8 21.6-74 0-76.1-61.9-138-138-138-41.4 0-78.7 18.4-104 47.4-25.3-29-62.6-47.4-104-47.4-76.1 0-138 61.9-138 138 0 27.2 7.9 52.6 21.6 74H144c-17.7 0-32 14.3-32 32v140h366V310h68v172h366V342c0-17.7-14.3-32-32-32zm-402-4h-70c-38.6 0-70-31.4-70-70s31.4-70 70-70 70 31.4 70 70v70zm138 0h-70v-70c0-38.6 31.4-70 70-70s70 31.4 70 70-31.4 70-70 70z"},child:[]}]})(e)}function xo(e){return _({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 0 0 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 0 0 9.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"},child:[]}]})(e)}function ho(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m10 15.586-3.293-3.293-1.414 1.414L10 18.414l9.707-9.707-1.414-1.414z"},child:[]}]})(e)}function yo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(e)}function bo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"},child:[]}]})(e)}function vo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z"},child:[]},{tag:"path",attr:{d:"M9 10h2v8H9zm4 0h2v8h-2z"},child:[]}]})(e)}function wo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 5H3a1 1 0 0 0-1 1v4h.893c.996 0 1.92.681 2.08 1.664A2.001 2.001 0 0 1 3 14H2v4a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-4h-1a2.001 2.001 0 0 1-1.973-2.336c.16-.983 1.084-1.664 2.08-1.664H22V6a1 1 0 0 0-1-1zM9 9a1 1 0 1 1 0 2 1 1 0 1 1 0-2zm-.8 6.4 6-8 1.6 1.2-6 8-1.6-1.2zM15 15a1 1 0 1 1 0-2 1 1 0 1 1 0 2z"},child:[]}]})(e)}function Co(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"},child:[]}]})(e)}function ko(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"},child:[]}]})(e)}function Eo(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function So(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"},child:[]}]})(e)}function To(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"},child:[]}]})(e)}function $o(e){return _({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M95.8,56.2a28,28,0,1,1-39.6,0A28,28,0,0,1,95.8,56.2Zm104,104a28,28,0,1,0,0,39.6A28,28,0,0,0,199.8,160.2Z",opacity:"0.2"},child:[]},{tag:"path",attr:{d:"M205.66,61.64l-144,144a8,8,0,0,1-11.32-11.32l144-144a8,8,0,0,1,11.32,11.31ZM50.54,101.44a36,36,0,0,1,50.92-50.91h0a36,36,0,0,1-50.92,50.91ZM56,76A20,20,0,1,0,90.14,61.84h0A20,20,0,0,0,56,76ZM216,180a36,36,0,1,1-10.54-25.46h0A35.76,35.76,0,0,1,216,180Zm-16,0a20,20,0,1,0-5.86,14.14A19.87,19.87,0,0,0,200,180Z"},child:[]}]})(e)}const Bo=(e,n,r,o,a)=>{let i;if(i="free_product"===e?zo?.[o]:Io?.[e],!i)return t.createElement(mo,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${_r(r)}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 t.createElement(i,{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:`${_r(r??3)}px`,marginLeft:"-2px"}})},zo={tshirt:function(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21.316 4.055C19.556 3.478 15 1.985 15 2a3 3 0 1 1-6 0c0-.015-4.556 1.478-6.317 2.055A.992.992 0 0 0 2 5.003v3.716a1 1 0 0 0 1.242.97L6 9v12a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V9l2.758.689A1 1 0 0 0 22 8.719V5.003a.992.992 0 0 0-.684-.948z"},child:[]}]})(e)},box:function(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m21.406 6.086-9-4a1.001 1.001 0 0 0-.813 0l-9 4c-.02.009-.034.024-.054.035-.028.014-.058.023-.084.04-.022.015-.039.034-.06.05a.87.87 0 0 0-.19.194c-.02.028-.041.053-.059.081a1.119 1.119 0 0 0-.076.165c-.009.027-.023.052-.031.079A1.013 1.013 0 0 0 2 7v10c0 .396.232.753.594.914l9 4c.13.058.268.086.406.086a.997.997 0 0 0 .402-.096l.004.01 9-4A.999.999 0 0 0 22 17V7a.999.999 0 0 0-.594-.914zM12 4.095 18.538 7 12 9.905l-1.308-.581L5.463 7 12 4.095zM4 16.351V8.539l7 3.111v7.811l-7-3.11zm9 3.11V11.65l7-3.111v7.812l-7 3.11z"},child:[]}]})(e)},cup:function(e){return _({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M.5 6a.5.5 0 0 0-.488.608l1.652 7.434A2.5 2.5 0 0 0 4.104 16h5.792a2.5 2.5 0 0 0 2.44-1.958l.131-.59a3 3 0 0 0 1.3-5.854l.221-.99A.5.5 0 0 0 13.5 6zM13 12.5a2 2 0 0 1-.316-.025l.867-3.898A2.001 2.001 0 0 1 13 12.5"},child:[]},{tag:"path",attr:{d:"m4.4.8-.003.004-.014.019a4 4 0 0 0-.204.31 2 2 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.6.6 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3 3 0 0 1-.202.388 5 5 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 3.6 4.2l.003-.004.014-.019a4 4 0 0 0 .204-.31 2 2 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.6.6 0 0 0-.09-.252A4 4 0 0 0 3.6 2.8l-.01-.012a5 5 0 0 1-.37-.543A1.53 1.53 0 0 1 3 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a6 6 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 4.4.8m3 0-.003.004-.014.019a4 4 0 0 0-.204.31 2 2 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.6.6 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3 3 0 0 1-.202.388 5 5 0 0 1-.253.382l-.018.025-.005.008-.002.002A.5.5 0 0 1 6.6 4.2l.003-.004.014-.019a4 4 0 0 0 .204-.31 2 2 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.6.6 0 0 0-.09-.252A4 4 0 0 0 6.6 2.8l-.01-.012a5 5 0 0 1-.37-.543A1.53 1.53 0 0 1 6 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a6 6 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 7.4.8m3 0-.003.004-.014.019a4 4 0 0 0-.204.31 2 2 0 0 0-.141.267c-.026.06-.034.092-.037.103v.004a.6.6 0 0 0 .091.248c.075.133.178.272.308.445l.01.012c.118.158.26.347.37.543.112.2.22.455.22.745 0 .188-.065.368-.119.494a3 3 0 0 1-.202.388 5 5 0 0 1-.252.382l-.019.025-.005.008-.002.002A.5.5 0 0 1 9.6 4.2l.003-.004.014-.019a4 4 0 0 0 .204-.31 2 2 0 0 0 .141-.267c.026-.06.034-.092.037-.103a.6.6 0 0 0-.09-.252A4 4 0 0 0 9.6 2.8l-.01-.012a5 5 0 0 1-.37-.543A1.53 1.53 0 0 1 9 1.5c0-.188.065-.368.119-.494.059-.138.134-.274.202-.388a6 6 0 0 1 .253-.382l.025-.035A.5.5 0 0 1 10.4.8"},child:[]}]})(e)},gift:go,emptyCircle:$o},Io={percentage_discount_coupon:fr,amount_discount_coupon:fr,free_delivery:mt,free_gift:go,dummy_coupon:$o},No=({checkpointWithProgress:e,themeColor:n,checkpointsLength:r,progressBarFreeProductIconType:o,themeTextColor:a,ctaButtonTextColor:i})=>e?.progressPercentage>=100?t.createElement(mo,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:i,borderColor:n,borderRadius:"9999px",fontSize:`${_r(r)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):Bo(e?.couponType,"#707070",r,o??"tshirt"),Do=({showMOVForProgressTiers:e,minimumOrderValue:n,customCartProgressBarCriteria:r,cartData:o,quantityThreshold:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l})=>e?t.createElement(Mr,{$visible:n>1||a>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:i},"minimum_order_value"===r?`${Nn(o,o?.currency)} ${jn(n)}`:`${a} item${a>1?"s":""}`):null,_o="undefined"!=typeof window?m:l,Po=({prefixMessageText:e,suffixMessageText:n,successMessageText:r,enableConfetti:i,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:f,primaryTextColor:g,effectiveQuantityForProgressBar:x,progressBarFreeProductIconType:h,ctaButtonBackgroundColor:y,showMOVForProgressTiers:b,ctaButtonTextColor:v}=s,w=dn(mn),[C,k]=c(!1),[E,S]=c(-1),T=o({}),[$,B]=c(0),[z,I]=c(0),N=o(null),D=o([]);D.current.length=0;const _=a(()=>{if("undefined"==typeof window)return;const e=D.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return B(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),r=parseFloat(n.lineHeight||""),o=parseFloat(n.fontSize||""),a=Number.isNaN(r)?Number.isNaN(o)?0:1.2*o:r,i=e.getBoundingClientRect(),l=a>0?Math.max(0,i.height-a):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;B(e=>e!==n?n:e);const r=N.current,o=e[e.length-1];if(!r||!o)return void I(e=>0!==e?0:e);const a=r.getBoundingClientRect(),i=o.getBoundingClientRect(),l=Math.ceil(i.right-a.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return _o(()=>{_()}),l(()=>{if("undefined"==typeof window)return;const e=()=>{_()};window.addEventListener("resize",e);const t=N.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>_()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[_]),l(()=>{s.checkpoints?.forEach((e,t)=>{const n=Kr(e,0,s.checkpoints??[],w?.item_count,s),r=String(e.couponTemplateId);(T.current[r]||0)<100&&n.progressPercentage>=100&&(S(t),k(!0),setTimeout(()=>k(!1),5e3)),T.current[r]=n.progressPercentage})},[w,s.checkpoints]),t.createElement(t.Fragment,null,t.createElement(io,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:w,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:g,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:y,prefixMessageText:e,suffixMessageText:n,successMessageText:r,ctaButtonTextColor:v}),t.createElement(Lr,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:z,ref:N},C&&i&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(E+1)/(s.checkpoints?.length??1)}),t.createElement(jr,{$tagWrapOffsetPx:$},t.createElement(Pr,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[Xr(s.customCartProgressBarCriteria)])?.map((...e)=>Kr(...e,w?.item_count,s))?.map((e,n)=>t.createElement(Vr,{key:e?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},t.createElement(Wr,null,n<s.checkpoints?.length&&t.createElement(Or,{className:"yt-cart-multi-progress-bar",$isCompleted:e?.progressPercentage>=100,$percent:e?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:y}),("minimum_order_value"!==s.customCartProgressBarCriteria||e?.minimumOrderValue>1)&&t.createElement(Fr,{$isDummy:e?.isDummyCouponTemplate},t.createElement(Ar,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{D.current[n]=e},$isCompleted:e?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:y,$primaryTextColor:g,style:{display:s.checkpoints?.length>1?"block":"none"}},e?.name),s.checkpoints?.length>1&&t.createElement(No,{checkpointWithProgress:e,themeColor:y,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:h,ctaButtonTextColor:v}),t.createElement(Do,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:e?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:w,quantityThreshold:e?.quantityThreshold,ctaButtonBackgroundColor:y,ctaButtonTextColor:v})))))))))},Fo=e=>e?.checkpoints&&e.checkpoints.length>0?1===e.checkpoints.length?t.createElement(ao,{...e}):t.createElement(Po,{...e}):null;function Oo(e){return _({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M17.707 9.293a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-7-7A.997.997 0 012 10V5a3 3 0 013-3h5c.256 0 .512.098.707.293l7 7zM5 6a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"},child:[]}]})(e)}function Ao(e){return _({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"},child:[]}]})(e)}function Mo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"},child:[]}]})(e)}const Ro=h(h.span`
|
|
986
986
|
display: flex !important;
|
|
987
987
|
gap: 4px;
|
|
988
988
|
`)`
|
|
@@ -993,7 +993,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
993
993
|
width: 100%;
|
|
994
994
|
gap: 10px;
|
|
995
995
|
margin-top: 16px;
|
|
996
|
-
`;function jo({showLoyaltyCta:e,exploreCTAColor:n="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:o,isUserSignedIn:a=!1,joinNowFunction:i,exploreCtaRedirectLink:l,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:f,addCartItem:g,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:E,showEmptyCartRecommendations:S=!1,tertiaryColor:T,tertiaryTextColor:$}){const[B,z]=c(!1),[I,N]=c(null);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},t.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"},t.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"}),t.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:T??"#D9D9D9"}),t.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"})),t.createElement("span",{style:{color:b,fontWeight:"semibold"}},r),o&&t.createElement("span",{style:{color:"#929292",fontSize:"14px"}},o),!a&&e&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},t.createElement(Mo,{color:n,fontSize:"14px",strokeWidth:2}),t.createElement(Ro,null,t.createElement("span",{onClick:i,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",t.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&t.createElement(Lo,null,d.map((e,n)=>t.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>N(n),onMouseLeave:()=>N(null),onClick:()=>window.location.href=e.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"}},e.title)))),S&&f&&f.length>0&&g&&t.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},t.createElement(Nr,{products:f,addCartItem:g,productRecsTitleText:k,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:E,tertiaryColor:T,tertiaryTextColor:$}))),t.createElement("button",{onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),onClick:()=>window.location.replace(l??"/"),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"}},t.createElement(Ao,{color:b}),t.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:b,cursor:"pointer"}},"Continue Shopping")))}function Vo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,18 L12,6 M6,12 L18,12"},child:[]}]})(e)}function Wo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"polyline",attr:{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"},child:[]}]})(e)}function Ho(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M6,12 L18,12"},child:[]}]})(e)}function qo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M3,11 L21,11 L21,23 L3,23 L3,11 Z M2,11 L2,7 L22,7 L22,11 L2,11 Z M12,23 L12,7 L12,23 Z M7,7 L12,7 C12,7 10,2 7,2 C3.5,2 3,7 7,7 Z M17.1843819,7 L12.1843819,7 C12.1843819,7 14,2 17.1843819,2 C20.5,2 21.1843819,7 17.1843819,7 Z"},child:[]}]})(e)}const Uo=hn("gstNumber",""),Qo=hn("gstCompanyName",""),Yo=Kt("");q("/* 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 Go=hn("postalCode",void 0);function Zo({checkoutButtonColor:e,checkoutFontSize:n,checkoutFunction:r,discountApplied:a,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:f,applyNoteToCart:g,showNoteOption:x,enableGeoLocationDeliveryRestriction:h,applyPostalCodeAndDeliverySlotToCart:y,enableSlotPicker:b,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:k,checkoutSectionMessageDisplay:E,checkoutSectionMessageRedirectLink:S,showDiscountOnMRP:T,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:z,toggleDecimal:I,disableCheckoutButton:N,checkoutButtonBottomSpacing:D=8,showPoweredByBadge:_=!0,showCheckoutButtonPaymentIcons:P,primaryTextColor:O}){const F=dn(mn),A=dn(Uo),M=dn(Qo),R=dn(Yo),L=dn(bn),j=dn(yn),V=dn(Go),W=dn(wn),H=dn(vn),[q,U]=c(!1),Q=Nn(F,F?.currency),[Y,G]=c("closed"),Z=o(null),[X,K]=c(!1),J=i(()=>((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),r=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),a=9===n.length?parseInt(n.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),s=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==a?`${s}${a.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ee=i(()=>zn(p??0,F?.currency??"INR"),[p,F?.currency]),te=i(()=>jn(I?ee.toFixed(2):ee.toFixed(0)),[ee,I]),ne=o(null),re=o(null),oe=o(null),ae=()=>{G("closing"),setTimeout(()=>{G("closed")},300)},ie=zn(F?.original_total_price,F?.currency),le=i(()=>z?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[z]),ce=i(()=>!(!le||!le.minimumOrderValue)&&ie>=le.minimumOrderValue,[le,ie]),se=ce&&le&&le.discountValue||0,de=d?zn(d,F?.currency??"INR"):0,pe=Number((ie-de).toFixed(2)),ue=i(()=>{if(!F?.items?.length)return 0;const e=F.items.reduce((e,t)=>e+(T&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return zn(e,F?.currency)},[F?.items,T]),me=i(()=>ce?ue+se:ue,[ce,ue,se]),fe=i(()=>ee&&ee>0?`Add products worth more than ${Q}${te}`:"",[ee,Q,te]),ge=i(()=>F?.items?.length?F.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,[F?.items]),xe=zn(ge,F?.currency??"INR");l(()=>{ne.current&&Ln(ne.current),re.current&&Ln(re.current),oe.current&&Ln(oe.current)},[e,de,T,xe,Y,se]);const he=i(()=>{const e={};return F?.items?.length?(F.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[F?.items]),ye=i(()=>{const e=[];for(const t in he)if(Object.prototype.hasOwnProperty.call(he,t)){const n=he[t],r=zn(n,F?.currency??"INR"),o=Hn(t);e.push({title:o,amount:r})}return e},[he,F?.currency]),be=i(()=>{let e=0;return e+=T?de+xe:de,ce&&(e+=se),e},[de,xe,T,ce,se]),ve=async e=>{if(U(!0),pe<=0)U(!1);else{if(h){if("standard"!==H&&(b?!L:!j.isPostalCodeValid))return void U(!1);if(y)try{"standard"===H?await y(H):await y(H,String(V)||"",W&&b?new Date(W).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}f&&m&&""!==M&&""!==A&&await m(A,M),x&&g&&""!==R&&await g(R),await r(e),U(!1)}},[we,Ce]=c(!1);l(()=>{Ce(pe<=0||(!!N||!!h&&("standard"!==H&&(b?!L:!j.isPostalCodeValid))))},[j,H,h,b,L,W,N,pe]);const[ke,Ee]=c(!1),Se=o(null),[Te,$e]=c("0px");l(()=>{Se.current&&$e(ke?`${Se.current.scrollHeight}px`:"0px")},[ke,ye,ce]);const Be=()=>{Ee(!ke)};l(()=>{function e(e){Z.current&&!Z.current.contains(e.target)&&ae()}return"open"!==Y&&"opening"!==Y||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[Y]);const ze=e=>e?t.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},"Checkout"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Wo,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):t.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},t.createElement(co,{fontSize:"20px"}),t.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},"Checkout"));return t.createElement("div",{style:{position:"relative"}},!!k&&k.length>0&&!Vn()&&(()=>{const e=E||"ribbon";if("ribbon"===e)return t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:S?"pointer":"default"},onClick:()=>{S&&(window.location.href=S)}},k);const n=({children:n})=>t.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:"0 55px",marginBottom:"4px",position:"bookmark"===e?"absolute":"static",top:"bookmark"===e?"-11px":void 0,cursor:S?"pointer":"default"},onClick:()=>{S&&(window.location.href=S)}},n);return"tag"===e?t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.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"}},t.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:J}),t.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),t.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"}},k),t.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"}},t.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:J}),t.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.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:J}),t.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:$})),t.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"}},k),t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.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:J}),t.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"!==Y&&t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===Y?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ae}),t.createElement("div",{ref:Z,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===Y?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},t.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},t.createElement("span",null,"Price Summary"),t.createElement("button",{onClick:ae,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),t.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},t.createElement(t.Fragment,null,(T&&xe>0||a&&ye.length>0||ce&&se>0)&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},Q,jn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||T&&xe>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},T&&xe>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?xe.toFixed(2):xe.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?e.amount.toFixed(2):e.amount.toFixed(0))))),be>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},t.createElement("span",null,"Total Savings"),t.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",Q,jn(I?be.toFixed(2):be.toFixed(0))))),(de>0||T&&xe>0||ce&&se>0)&&t.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"}}))),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:de>0||T&&xe>0||ce&&se>0?"10px":"0"}},t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),t.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),t.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0)))),t.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"}},t.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",t.createElement("span",null,Q,jn(I?be.toFixed(2):be.toFixed(0)))," ","on your order")),t.createElement("button",{ref:re,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},ze(q)))),(!0===s||"true"===s)&&N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),!0===s||"true"===s?t.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${D}px 8px`}},t.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(de>0||T&&xe>0||ce&&se>0)&&t.createElement("div",{className:"yt-cart-checkout-save-badge",ref:oe,style:{fontSize:"9px",backgroundColor:e,width:"max-content",padding:"2px 8px"}},"Saving ",Q,jn(I?be.toFixed(2):be.toFixed(0))),q?t.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):a||ce&&le?t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},t.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0))),(de>0||xe>0||ce&&se>0)&&t.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},Q,jn(ce?me.toFixed(0):ue.toFixed(0))))):t.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0))),T&&xe>0||a&&de>0||ce&&se>0?t.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),G("opening"),requestAnimationFrame(()=>{G("open")}),K(!X)}},"See Details"):t.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),t.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{backgroundColor:e,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Wo,{fontSize:"24px"}))):"CHECKOUT"))),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}}))):t.createElement(t.Fragment,null,N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),t.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:O}},(xe>0||a&&ye.length>0||ce&&se>0)&&be>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px"}},Q,jn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||xe>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",t.createElement("button",{onClick:Be,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"}},ke?"Hide details":"See details")),t.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",Q,jn(I?be.toFixed(2):be.toFixed(0)))),t.createElement("div",{ref:Se,style:{height:Te,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:ke?1:0,marginTop:ke?"5px":"0",borderTop:ke?"1px solid #E5E7EB":"none",paddingTop:ke?"5px":"0",fontWeight:"600"}},T&&xe>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?xe.toFixed(2):xe.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?e.amount.toFixed(2):e.amount.toFixed(0))))))),t.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),t.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0))))),t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==Y||v?"0":`4px 1rem ${D}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,color:u??"white",textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"closed"!==Y?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},ze(q)),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}})))))}const Xo=h.button`
|
|
996
|
+
`;function jo({showLoyaltyCta:e,exploreCTAColor:n="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:o,isUserSignedIn:a=!1,joinNowFunction:i,exploreCtaRedirectLink:l,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:f,addCartItem:g,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:E,showEmptyCartRecommendations:S=!1,tertiaryColor:T,tertiaryTextColor:$}){const[B,z]=c(!1),[I,N]=c(null);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},t.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"},t.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"}),t.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:T??"#D9D9D9"}),t.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"})),t.createElement("span",{style:{color:b,fontWeight:"semibold"}},r),o&&t.createElement("span",{style:{color:"#929292",fontSize:"14px"}},o),!a&&e&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},t.createElement(Mo,{color:n,fontSize:"14px",strokeWidth:2}),t.createElement(Ro,null,t.createElement("span",{onClick:i,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",t.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&t.createElement(Lo,null,d.map((e,n)=>t.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>N(n),onMouseLeave:()=>N(null),onClick:()=>window.location.href=e.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"}},e.title)))),S&&f&&f.length>0&&g&&t.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},t.createElement(Nr,{products:f,addCartItem:g,productRecsTitleText:k,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:E,tertiaryColor:T,tertiaryTextColor:$}))),t.createElement("button",{onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),onClick:()=>window.location.replace(l??"/"),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"}},t.createElement(Ao,{color:b}),t.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:b,cursor:"pointer"}},"Continue Shopping")))}function Vo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,18 L12,6 M6,12 L18,12"},child:[]}]})(e)}function Wo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"polyline",attr:{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"},child:[]}]})(e)}function Ho(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M6,12 L18,12"},child:[]}]})(e)}function qo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M3,11 L21,11 L21,23 L3,23 L3,11 Z M2,11 L2,7 L22,7 L22,11 L2,11 Z M12,23 L12,7 L12,23 Z M7,7 L12,7 C12,7 10,2 7,2 C3.5,2 3,7 7,7 Z M17.1843819,7 L12.1843819,7 C12.1843819,7 14,2 17.1843819,2 C20.5,2 21.1843819,7 17.1843819,7 Z"},child:[]}]})(e)}const Uo=hn("gstNumber",""),Qo=hn("gstCompanyName",""),Yo=Kt("");q("/* 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 Go=hn("postalCode",void 0);function Zo({checkoutButtonColor:e,checkoutFontSize:n,checkoutFunction:r,discountApplied:a,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:f,applyNoteToCart:g,showNoteOption:x,enableGeoLocationDeliveryRestriction:h,applyPostalCodeAndDeliverySlotToCart:y,enableSlotPicker:b,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:k,checkoutSectionMessageDisplay:E,checkoutSectionMessageRedirectLink:S,showDiscountOnMRP:T,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:z,toggleDecimal:I,disableCheckoutButton:N,checkoutButtonBottomSpacing:D=8,showPoweredByBadge:_=!0,showCheckoutButtonPaymentIcons:P,primaryTextColor:F}){const O=dn(mn),A=dn(Uo),M=dn(Qo),R=dn(Yo),L=dn(bn),j=dn(yn),V=dn(Go),W=dn(wn),H=dn(vn),[q,U]=c(!1),Q=Nn(O,O?.currency),[Y,G]=c("closed"),Z=o(null),[X,K]=c(!1),J=i(()=>((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),r=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),a=9===n.length?parseInt(n.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),s=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==a?`${s}${a.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ee=i(()=>zn(p??0,O?.currency??"INR"),[p,O?.currency]),te=i(()=>jn(I?ee.toFixed(2):ee.toFixed(0)),[ee,I]),ne=o(null),re=o(null),oe=o(null),ae=()=>{G("closing"),setTimeout(()=>{G("closed")},300)},ie=zn(O?.original_total_price,O?.currency),le=i(()=>z?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[z]),ce=i(()=>!(!le||!le.minimumOrderValue)&&ie>=le.minimumOrderValue,[le,ie]),se=ce&&le&&le.discountValue||0,de=d?zn(d,O?.currency??"INR"):0,pe=Number((ie-de).toFixed(2)),ue=i(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(T&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return zn(e,O?.currency)},[O?.items,T]),me=i(()=>ce?ue+se:ue,[ce,ue,se]),fe=i(()=>ee&&ee>0?`Add products worth more than ${Q}${te}`:"",[ee,Q,te]),ge=i(()=>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]),xe=zn(ge,O?.currency??"INR");l(()=>{ne.current&&Ln(ne.current),re.current&&Ln(re.current),oe.current&&Ln(oe.current)},[e,de,T,xe,Y,se]);const he=i(()=>{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]),ye=i(()=>{const e=[];for(const t in he)if(Object.prototype.hasOwnProperty.call(he,t)){const n=he[t],r=zn(n,O?.currency??"INR"),o=Hn(t);e.push({title:o,amount:r})}return e},[he,O?.currency]),be=i(()=>{let e=0;return e+=T?de+xe:de,ce&&(e+=se),e},[de,xe,T,ce,se]),ve=async e=>{if(U(!0),pe<=0)U(!1);else{if(h){if("standard"!==H&&(b?!L:!j.isPostalCodeValid))return void U(!1);if(y)try{"standard"===H?await y(H):await y(H,String(V)||"",W&&b?new Date(W).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}f&&m&&""!==M&&""!==A&&await m(A,M),x&&g&&""!==R&&await g(R),await r(e),U(!1)}},[we,Ce]=c(!1);l(()=>{Ce(pe<=0||(!!N||!!h&&("standard"!==H&&(b?!L:!j.isPostalCodeValid))))},[j,H,h,b,L,W,N,pe]);const[ke,Ee]=c(!1),Se=o(null),[Te,$e]=c("0px");l(()=>{Se.current&&$e(ke?`${Se.current.scrollHeight}px`:"0px")},[ke,ye,ce]);const Be=()=>{Ee(!ke)};l(()=>{function e(e){Z.current&&!Z.current.contains(e.target)&&ae()}return"open"!==Y&&"opening"!==Y||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[Y]);const ze=e=>e?t.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},"Checkout"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Wo,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):t.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},t.createElement(co,{fontSize:"20px"}),t.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},"Checkout"));return t.createElement("div",{style:{position:"relative"}},!!k&&k.length>0&&!Vn()&&(()=>{const e=E||"ribbon";if("ribbon"===e)return t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:S?"pointer":"default"},onClick:()=>{S&&(window.location.href=S)}},k);const n=({children:n})=>t.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:"0 55px",marginBottom:"4px",position:"bookmark"===e?"absolute":"static",top:"bookmark"===e?"-11px":void 0,cursor:S?"pointer":"default"},onClick:()=>{S&&(window.location.href=S)}},n);return"tag"===e?t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.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"}},t.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:J}),t.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),t.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"}},k),t.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"}},t.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:J}),t.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.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:J}),t.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:$})),t.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"}},k),t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.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:J}),t.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"!==Y&&t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===Y?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ae}),t.createElement("div",{ref:Z,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===Y?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},t.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},t.createElement("span",null,"Price Summary"),t.createElement("button",{onClick:ae,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),t.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},t.createElement(t.Fragment,null,(T&&xe>0||a&&ye.length>0||ce&&se>0)&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},Q,jn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||T&&xe>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},T&&xe>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?xe.toFixed(2):xe.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?e.amount.toFixed(2):e.amount.toFixed(0))))),be>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},t.createElement("span",null,"Total Savings"),t.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",Q,jn(I?be.toFixed(2):be.toFixed(0))))),(de>0||T&&xe>0||ce&&se>0)&&t.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"}}))),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:de>0||T&&xe>0||ce&&se>0?"10px":"0"}},t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),t.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),t.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0)))),t.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"}},t.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",t.createElement("span",null,Q,jn(I?be.toFixed(2):be.toFixed(0)))," ","on your order")),t.createElement("button",{ref:re,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},ze(q)))),(!0===s||"true"===s)&&N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),!0===s||"true"===s?t.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${D}px 8px`}},t.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(de>0||T&&xe>0||ce&&se>0)&&t.createElement("div",{className:"yt-cart-checkout-save-badge",ref:oe,style:{fontSize:"9px",backgroundColor:e,width:"max-content",padding:"2px 8px"}},"Saving ",Q,jn(I?be.toFixed(2):be.toFixed(0))),q?t.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):a||ce&&le?t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},t.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0))),(de>0||xe>0||ce&&se>0)&&t.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},Q,jn(ce?me.toFixed(0):ue.toFixed(0))))):t.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0))),T&&xe>0||a&&de>0||ce&&se>0?t.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),G("opening"),requestAnimationFrame(()=>{G("open")}),K(!X)}},"See Details"):t.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),t.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{backgroundColor:e,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(Wo,{fontSize:"24px"}))):"CHECKOUT"))),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}}))):t.createElement(t.Fragment,null,N&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),t.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:F}},(xe>0||a&&ye.length>0||ce&&se>0)&&be>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px"}},Q,jn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(de>0||xe>0||ce&&se>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",t.createElement("button",{onClick:Be,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"}},ke?"Hide details":"See details")),t.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",Q,jn(I?be.toFixed(2):be.toFixed(0)))),t.createElement("div",{ref:Se,style:{height:Te,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:ke?1:0,marginTop:ke?"5px":"0",borderTop:ke?"1px solid #E5E7EB":"none",paddingTop:ke?"5px":"0",fontWeight:"600"}},T&&xe>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?xe.toFixed(2):xe.toFixed(0)))),ce&&se>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?se.toFixed(2):se.toFixed(0)))),ye.map(e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,jn(I?e.amount.toFixed(2):e.amount.toFixed(0))))))),t.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),t.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},Q,jn(I?pe.toFixed(2):pe.toFixed(0))))),t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==Y||v?"0":`4px 1rem ${D}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,color:u??"white",textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"closed"!==Y?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},ze(q)),_&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}})))))}const Xo=h.button`
|
|
997
997
|
background-color: ${e=>e.$ctaButtonBackgroundColor||"#BEB8EC"};
|
|
998
998
|
color: ${e=>e.$ctaButtonTextColor||"black"};
|
|
999
999
|
font-size: 11px;
|
|
@@ -1109,7 +1109,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1109
1109
|
// @media (max-width: ${Da}) {
|
|
1110
1110
|
// font-size: 12px;
|
|
1111
1111
|
// }
|
|
1112
|
-
`,
|
|
1112
|
+
`,Fa=h.div`
|
|
1113
1113
|
display: flex;
|
|
1114
1114
|
padding: ${e=>e.$hasVariantInfo?"6px 0":"4px 0"};
|
|
1115
1115
|
background: ${e=>e.$backgroundColor??"#ffffff"};
|
|
@@ -1139,7 +1139,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1139
1139
|
padding: ${e=>e.$hasVariantInfo?"6px 0":"4px 0"};
|
|
1140
1140
|
gap: 12px;
|
|
1141
1141
|
}
|
|
1142
|
-
`,
|
|
1142
|
+
`,Oa=h.div`
|
|
1143
1143
|
width: 75px;
|
|
1144
1144
|
aspect-ratio: ${e=>"portrait"===e.$imageAspectSelector?"5/6":"1"};
|
|
1145
1145
|
border-radius: 8px;
|
|
@@ -1341,7 +1341,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1341
1341
|
padding: 2px 0px 4px 0px;
|
|
1342
1342
|
border-bottom-left-radius: 8px;
|
|
1343
1343
|
border-bottom-right-radius: 8px;
|
|
1344
|
-
`,Xa=({imageUrl:e,overlayText:n,themeColor:r,themeTextColor:o})=>t.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},t.createElement("img",{src:e,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),t.createElement(Za,{$themeColor:r,$themeTextColor:o},n)),Ka=({product:e,handleDecrement:n,handleIncrement:r,removeCartItem:a,addCartItem:i,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:f,showQtySelector:g=!0,themeTextColor:x,showEditOptionOnProducts:h,percentageOff:y,removeFreebieFromCart:b,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:k,backgroundSubdued:E,backgroundColor:S,showDiscountOnMRP:T})=>{const{setLoading:$}=kn(),B=dn(mn),[z,I]=un(Ca),[N,D]=c(!1),_=pn(En),P=Ba(),O=!!e.properties?._isYtFreebie&&"number"==typeof e.final_line_price&&e.final_line_price>0&&"number"==typeof e.original_line_price&&e.original_line_price>e.final_line_price;l(()=>{function e(){const e=window.innerWidth;D(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const F=o(null),[A,M]=c(0);l(()=>{let e=null;return F.current&&(e=new ResizeObserver(e=>{e[0]&&M(e[0].contentRect.width)}),e.observe(F.current)),()=>{e&&e.disconnect()}},[]),l(()=>{const e=setTimeout(()=>{F.current&&M(F.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const R=On(e.product_title,A<200?100:120,A,"","16px"),L=()=>{if(e.line_level_discount_allocations&&e.line_level_discount_allocations.length>0&&e.line_level_discount_allocations[0].discount_application){const t=e.line_level_discount_allocations[0].discount_application.title,n=Hn(t);switch(e.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${n})`;case"percentage":case"fixed_amount":return n;default:return""}}};let j=Nn(B,B?.currency);const V=["__Added with Frequently Bought Together button","_has_gpo","_y"],W=e?.options_with_values&&e.options_with_values.filter(e=>"Title"!==e.name).length>0||e?.properties&&Object.keys(e.properties).filter(e=>!V.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||h,H=A?70/A*100:100,q=L(),U=q&&(q.length>25||!N)?On(q,H,A,"","10px"):q,Q=(()=>{const t=e?.properties?._bundleImage;if(!t||"string"!=typeof t)return;const n=t.trim();return n.length>0?n:void 0})(),Y=!!Q,G=(()=>{const t=e?.properties?.itemsInBundle;return"string"!=typeof t?[]:t.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),Z=(()=>{const t=e?.properties?._bundleItems;if("string"==typeof t&&t.trim().length>0)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=e.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(t>0)return t}}catch(e){}let n=0;for(const e of G){const t=e.match(/^(\d+)\s*x\s*/i);n+=t?parseInt(t[1],10)||0:1}return n})(),[X,K]=c(!0),J=N?"250px":"190px";return t.createElement(Oa,{$hasVariantInfo:W||Y,$backgroundColor:S,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},t.createElement(Aa,{$isBundle:Y},t.createElement(Fa,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:Y},g?t.createElement("img",{style:{height:"100%",width:"100%",opacity:0===e.quantity?.5:1},src:Wn(Q??e.image,150,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(e),loading:"lazy"}):t.createElement(Xa,{imageUrl:Wn(Q??e.image??e?.featuredImage?.url??"/placeholder.svg",150,85,"webp"),overlayText:O||y?"Special Offer":"Free Gift",themeColor:d,themeTextColor:x})),(g||e?.quantity>1)&&t.createElement(Ma,null,e.quantity)),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},t.createElement(Pa,{$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${e.url}`,ref:F},R),t.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(g||v)&&t.createElement(ja,{onClick:g?async()=>{$&&$(!0,!0);try{a&&await a(e.key)}catch(e){}$&&$(!1,!1)}:async()=>{$&&$(!0,!0);try{b&&await b(e.key)}catch(e){}$&&$(!1,!1)}},t.createElement(Ra,null,t.createElement(vt,{className:"outline"}),t.createElement(bt,{className:"filled"})))))),Y?t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement("div",{role:"button",onClick:()=>K(!X),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"}},t.createElement("span",null,`Contain ${Z} Items`),X?t.createElement(it,null):t.createElement(at,null)),X&&G.length>0&&t.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:J,width:"fit-content"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:J}},G.map((e,n)=>t.createElement("div",{key:`${e}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:J},title:e},e))))):W&&t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement(za,null,e?.options_with_values?.filter(e=>"Title"!==e.name).map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()),r=$a(n,e.value);return"color"===n?.type?.toLowerCase()&&r?t.createElement(Ia,{key:e.name,$colorValue:r.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&r?t.createElement(Na,{key:e.name,src:Wn(r.value,36,85,"webp"),alt:e.value}):e.value.length>15||e.value.includes("#")?null:t.createElement(La,{className:"yt-cart-variant-text",key:e.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},e.value)}),e?.properties&&Object.entries(e.properties).filter(([e])=>!V.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([e,n])=>{const r=String(n);return r.includes("#")||(P?.options??[]).some(t=>t.name.trim().toLowerCase()===e.trim().toLowerCase()&&t.values.some(e=>e.name.trim().toLowerCase()===r.trim().toLowerCase()))?null:t.createElement(La,{key:e,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},r)}),h&&!e?.product_has_only_default_variant&&t.createElement(ja,{onClick:()=>{const t=!!e.properties?._isYtFreebie;let n;if(t){const t=e.properties?._yt_allowed_variants;if(t&&"string"==typeof t)try{n=JSON.parse(t)}catch(r){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${e.key}:`,t,r),n=[String(e.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${e.key}. Defaulting to current variant.`),n=[String(e.variant_id)]}_({open:!0,variantId:String(e.variant_id),quantity:e.quantity,handle:e.handle,lineItemKey:e.key,freebieSelection:t,productId:String(e.product_id),allowedVariantIds:n})},style:{display:"flex",alignItems:"center"}},t.createElement(xo,null))),e?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());if($a(n,e.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(e.value.includes("#"))return null;const r=N?e.value:On(e.value,A?120/A*100:100,A,"","10px");return t.createElement(La,{key:e.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"}},r)})),t.createElement(Va,null,t.createElement("div",{style:{display:"flex",flexDirection:N?"row":"column",alignItems:N?"center":"flex-start",gap:N?"0px":"4px"}},t.createElement(Wa,null,Y?t.createElement(t.Fragment,null,t.createElement(Ha,{$primaryTextColor:p},j,jn(Number(e?.properties?._finalBundlePrice)??0)),e?.properties?._originalBundlePrice&&t.createElement(qa,null,j,jn(Number(e?.properties?._originalBundlePrice)??0))):t.createElement(Ha,{$primaryTextColor:p},0===zn(e.final_line_price,B?.currency)?t.createElement(Ga,{$primaryColor:p,$themeColor:d,$backgroundSubdued:E},"FREE"):t.createElement(t.Fragment,null,j,jn(zn(e.final_line_price,B?.currency)))),(e.compare_at_price&&Number(e.compare_at_price)*e.quantity>Number(e.final_line_price)||!e.compare_at_price&&L()&&e.original_line_price)&&T&&t.createElement(qa,null,j,e.compare_at_price?jn(zn(Number(e.compare_at_price)*e.quantity,B?.currency)):jn(zn(e.original_line_price,B?.currency))),N&&(g||O)&&L()&&t.createElement(Qa,{$tertiaryColor:m},t.createElement(fo,{size:14,color:f}),t.createElement(Ya,{$tertiaryTextColor:f},U))),!N&&(g||O)&&L()&&t.createElement(Qa,{$tertiaryColor:m},t.createElement(fo,{size:12,color:f}),t.createElement(Ya,{$tertiaryTextColor:f},U))),t.createElement(Ua,null,g?t.createElement(wa,{handleItemQuantityDecrement:async()=>{$&&$(!0,!0);try{n&&await n(e.key,e.quantity-1)}catch(e){}$&&$(!1,!1)},handleItemQuantityIncrement:async()=>{$&&$(!0,!0);try{if(r){-1===await r(e.id,e.quantity+1,e.properties)&&(I(e?.key),setTimeout(()=>I(void 0),3e3))}}catch(e){}$&&$(!1,!1)},value:e.quantity,isDev:s,themeColor:d,cartComponentsCornerType:C,cartComponentsCornerRadius:k,backgroundSubdued:E}):t.createElement("span",{style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:f??"#000",borderRadius:"4px"}},O&&e.original_line_price?`${((e.original_line_price-e.final_line_price)/e.original_line_price*100).toFixed(0)}% off`:y&&e?.properties?._isYtFreebie?`${y}% Off`:"Freebie"))),z&&z===e?.key&&t.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))};function Ja(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 10 0v4"},child:[]}]})(e)}function ei(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]}]})(e)}const ti=h.div`
|
|
1344
|
+
`,Xa=({imageUrl:e,overlayText:n,themeColor:r,themeTextColor:o})=>t.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},t.createElement("img",{src:e,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),t.createElement(Za,{$themeColor:r,$themeTextColor:o},n)),Ka=({product:e,handleDecrement:n,handleIncrement:r,removeCartItem:a,addCartItem:i,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:f,showQtySelector:g=!0,themeTextColor:x,showEditOptionOnProducts:h,percentageOff:y,removeFreebieFromCart:b,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:k,backgroundSubdued:E,backgroundColor:S,showDiscountOnMRP:T})=>{const{setLoading:$}=kn(),B=dn(mn),[z,I]=un(Ca),[N,D]=c(!1),_=pn(En),P=Ba(),F=!!e.properties?._isYtFreebie&&"number"==typeof e.final_line_price&&e.final_line_price>0&&"number"==typeof e.original_line_price&&e.original_line_price>e.final_line_price;l(()=>{function e(){const e=window.innerWidth;D(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const O=o(null),[A,M]=c(0);l(()=>{let e=null;return O.current&&(e=new ResizeObserver(e=>{e[0]&&M(e[0].contentRect.width)}),e.observe(O.current)),()=>{e&&e.disconnect()}},[]),l(()=>{const e=setTimeout(()=>{O.current&&M(O.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const R=Fn(e.product_title,A<200?100:120,A,"","16px"),L=()=>{if(e.line_level_discount_allocations&&e.line_level_discount_allocations.length>0&&e.line_level_discount_allocations[0].discount_application){const t=e.line_level_discount_allocations[0].discount_application.title,n=Hn(t);switch(e.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${n})`;case"percentage":case"fixed_amount":return n;default:return""}}};let j=Nn(B,B?.currency);const V=["__Added with Frequently Bought Together button","_has_gpo","_y"],W=e?.options_with_values&&e.options_with_values.filter(e=>"Title"!==e.name).length>0||e?.properties&&Object.keys(e.properties).filter(e=>!V.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||h,H=A?70/A*100:100,q=L(),U=q&&(q.length>25||!N)?Fn(q,H,A,"","10px"):q,Q=(()=>{const t=e?.properties?._bundleImage;if(!t||"string"!=typeof t)return;const n=t.trim();return n.length>0?n:void 0})(),Y=!!Q,G=(()=>{const t=e?.properties?.itemsInBundle;return"string"!=typeof t?[]:t.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),Z=(()=>{const t=e?.properties?._bundleItems;if("string"==typeof t&&t.trim().length>0)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=e.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(t>0)return t}}catch(e){}let n=0;for(const e of G){const t=e.match(/^(\d+)\s*x\s*/i);n+=t?parseInt(t[1],10)||0:1}return n})(),[X,K]=c(!0),J=N?"250px":"190px";return t.createElement(Fa,{$hasVariantInfo:W||Y,$backgroundColor:S,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},t.createElement(Aa,{$isBundle:Y},t.createElement(Oa,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:Y},g?t.createElement("img",{style:{height:"100%",width:"100%",opacity:0===e.quantity?.5:1},src:Wn(Q??e.image,150,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(e),loading:"lazy"}):t.createElement(Xa,{imageUrl:Wn(Q??e.image??e?.featuredImage?.url??"/placeholder.svg",150,85,"webp"),overlayText:F||y?"Special Offer":"Free Gift",themeColor:d,themeTextColor:x})),(g||e?.quantity>1)&&t.createElement(Ma,null,e.quantity)),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},t.createElement(Pa,{$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${e.url}`,ref:O},R),t.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(g||v)&&t.createElement(ja,{onClick:g?async()=>{$&&$(!0,!0);try{a&&await a(e.key)}catch(e){}$&&$(!1,!1)}:async()=>{$&&$(!0,!0);try{b&&await b(e.key)}catch(e){}$&&$(!1,!1)}},t.createElement(Ra,null,t.createElement(vt,{className:"outline"}),t.createElement(bt,{className:"filled"})))))),Y?t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement("div",{role:"button",onClick:()=>K(!X),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"}},t.createElement("span",null,`Contain ${Z} Items`),X?t.createElement(it,null):t.createElement(at,null)),X&&G.length>0&&t.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:J,width:"fit-content"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:J}},G.map((e,n)=>t.createElement("div",{key:`${e}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:J},title:e},e))))):W&&t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement(za,null,e?.options_with_values?.filter(e=>"Title"!==e.name).map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()),r=$a(n,e.value);return"color"===n?.type?.toLowerCase()&&r?t.createElement(Ia,{key:e.name,$colorValue:r.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&r?t.createElement(Na,{key:e.name,src:Wn(r.value,36,85,"webp"),alt:e.value}):e.value.length>15||e.value.includes("#")?null:t.createElement(La,{className:"yt-cart-variant-text",key:e.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},e.value)}),e?.properties&&Object.entries(e.properties).filter(([e])=>!V.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([e,n])=>{const r=String(n);return r.includes("#")||(P?.options??[]).some(t=>t.name.trim().toLowerCase()===e.trim().toLowerCase()&&t.values.some(e=>e.name.trim().toLowerCase()===r.trim().toLowerCase()))?null:t.createElement(La,{key:e,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},r)}),h&&!e?.product_has_only_default_variant&&t.createElement(ja,{onClick:()=>{const t=!!e.properties?._isYtFreebie;let n;if(t){const t=e.properties?._yt_allowed_variants;if(t&&"string"==typeof t)try{n=JSON.parse(t)}catch(r){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${e.key}:`,t,r),n=[String(e.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${e.key}. Defaulting to current variant.`),n=[String(e.variant_id)]}_({open:!0,variantId:String(e.variant_id),quantity:e.quantity,handle:e.handle,lineItemKey:e.key,freebieSelection:t,productId:String(e.product_id),allowedVariantIds:n})},style:{display:"flex",alignItems:"center"}},t.createElement(xo,null))),e?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());if($a(n,e.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(e.value.includes("#"))return null;const r=N?e.value:Fn(e.value,A?120/A*100:100,A,"","10px");return t.createElement(La,{key:e.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"}},r)})),t.createElement(Va,null,t.createElement("div",{style:{display:"flex",flexDirection:N?"row":"column",alignItems:N?"center":"flex-start",gap:N?"0px":"4px"}},t.createElement(Wa,null,Y?t.createElement(t.Fragment,null,t.createElement(Ha,{$primaryTextColor:p},j,jn(Number(e?.properties?._finalBundlePrice)??0)),e?.properties?._originalBundlePrice&&t.createElement(qa,null,j,jn(Number(e?.properties?._originalBundlePrice)??0))):t.createElement(Ha,{$primaryTextColor:p},0===zn(e.final_line_price,B?.currency)?t.createElement(Ga,{$primaryColor:p,$themeColor:d,$backgroundSubdued:E},"FREE"):t.createElement(t.Fragment,null,j,jn(zn(e.final_line_price,B?.currency)))),(e.compare_at_price&&Number(e.compare_at_price)*e.quantity>Number(e.final_line_price)||!e.compare_at_price&&L()&&e.original_line_price)&&T&&t.createElement(qa,null,j,e.compare_at_price?jn(zn(Number(e.compare_at_price)*e.quantity,B?.currency)):jn(zn(e.original_line_price,B?.currency))),N&&(g||F)&&L()&&t.createElement(Qa,{$tertiaryColor:m},t.createElement(fo,{size:14,color:f}),t.createElement(Ya,{$tertiaryTextColor:f},U))),!N&&(g||F)&&L()&&t.createElement(Qa,{$tertiaryColor:m},t.createElement(fo,{size:12,color:f}),t.createElement(Ya,{$tertiaryTextColor:f},U))),t.createElement(Ua,null,g?t.createElement(wa,{handleItemQuantityDecrement:async()=>{$&&$(!0,!0);try{n&&await n(e.key,e.quantity-1)}catch(e){}$&&$(!1,!1)},handleItemQuantityIncrement:async()=>{$&&$(!0,!0);try{if(r){-1===await r(e.id,e.quantity+1,e.properties)&&(I(e?.key),setTimeout(()=>I(void 0),3e3))}}catch(e){}$&&$(!1,!1)},value:e.quantity,isDev:s,themeColor:d,cartComponentsCornerType:C,cartComponentsCornerRadius:k,backgroundSubdued:E}):t.createElement("span",{style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:f??"#000",borderRadius:"4px"}},F&&e.original_line_price?`${((e.original_line_price-e.final_line_price)/e.original_line_price*100).toFixed(0)}% off`:y&&e?.properties?._isYtFreebie?`${y}% Off`:"Freebie"))),z&&z===e?.key&&t.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))};function Ja(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 10 0v4"},child:[]}]})(e)}function ei(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]}]})(e)}const ti=h.div`
|
|
1345
1345
|
margin: 8px 0 6px 0;
|
|
1346
1346
|
padding: 12px;
|
|
1347
1347
|
background: ${e=>e.$backgroundColor??"rgba(0,0,0,0.04)"};
|
|
@@ -1378,7 +1378,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1378
1378
|
border-bottom: 0.8px solid rgb(135 135 135 / 50%);
|
|
1379
1379
|
width: calc(100% + 2rem);
|
|
1380
1380
|
}
|
|
1381
|
-
`,ai=({addCartItem:e,handleDecrement:n,handleIncrement:r,removeCartItem:o,isDev:a,themeColor:i,primaryTextColor:l,secondaryTextColor:c,freeProduct:s,themeTextColor:d,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:f,freeProductAdjustedCartTotal:g,freebieCouponTemplates:x,cartCheckpoints:h,freebieFlowCheckpoints:y,imageAspectSelector:b,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:k,showGiftWrapAsLineItem:E=!1,backgroundSubdued:S,tertiaryColor:T,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:z,checkoutSectionMessage:I,checkoutSectionMessageRedirectLink:N,showFreebieMilestone:D,freebieMilestoneData:_,freebieProductsInCart:P})=>{const
|
|
1381
|
+
`,ai=({addCartItem:e,handleDecrement:n,handleIncrement:r,removeCartItem:o,isDev:a,themeColor:i,primaryTextColor:l,secondaryTextColor:c,freeProduct:s,themeTextColor:d,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:f,freeProductAdjustedCartTotal:g,freebieCouponTemplates:x,cartCheckpoints:h,freebieFlowCheckpoints:y,imageAspectSelector:b,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:k,showGiftWrapAsLineItem:E=!1,backgroundSubdued:S,tertiaryColor:T,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:z,checkoutSectionMessage:I,checkoutSectionMessageRedirectLink:N,showFreebieMilestone:D,freebieMilestoneData:_,freebieProductsInCart:P})=>{const F=dn(mn),{cartLoading:O}=kn(),A=!O.cartLoading&&F?.items,M=(g??Number(F?.items_subtotal_price))/100,R=_?.campaignFilter??"all_campaigns";let L=[];"all_campaigns"===R?L=x??[]:"progress_bar_tiers"===R?L=h??[]:"freebie_campaigns"===R&&(L=y??[]);const j=Array.isArray(L)?L.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>M):void 0,V=Nn(F,F?.currency),W=t.useMemo(()=>{if(console.log("[NextFreebieImage] Debug:",{showFreebieImage:_?.showFreebieImage,freebieProductsInCartLength:P?.length,nextFreebie:j,nextFreebieTemplateId:j?.couponTemplateId,nextFreebieVariantIds:j?._allVariantIds}),!_?.showFreebieImage||!P?.length)return void console.log("[NextFreebieImage] Early return - showFreebieImage or freebieProductsInCart missing");let e=P.find(e=>e?.couponTemplateId===j?.couponTemplateId);if(console.log("[NextFreebieImage] Match by couponTemplateId:",e?"Found":"Not found"),!e&&j?._allVariantIds?.[0]){const t=j._allVariantIds[0];console.log("[NextFreebieImage] Trying variant ID fallback with:",t),e=P.find(e=>(e?.variants?.edges||[]).some(e=>{const n=String(e?.node?.id||"");return n.endsWith(`/${t}`)||n===t})),console.log("[NextFreebieImage] Match by variantId:",e?"Found":"Not found")}const t=e?.featuredMedia?.preview?.image?.url||e?.featuredImage?.url;return console.log("[NextFreebieImage] Final image URL:",t),console.log("[NextFreebieImage] Matching product:",e),t},[_?.showFreebieImage,j,P]);let H=!0,q=0;if(F?.items?.length>0)for(const e of F.items)e?.properties?._isYtFreebie&&(q+=e?.quantity);return q===F?.item_count&&(H=!1),A||0!==F?.item_count?A&&0!==F?.item_count||F?.items?t.createElement(t.Fragment,null,F.items.filter(e=>!!E||!(String(e?.id)===Rn(String(C))||String(e?.id)===Rn(String(k)))).map(s=>{const g=u?.[s?.key],h=x?.find(e=>e?._allVariantIds?.includes(String(s.id)));let y=!1;return h&&M>=h.minimumOrderValue&&0===s?.line_price&&(y=!0),E||String(s?.id)!==Rn(String(C))&&Rn(String(k))!==String(s?.id)?s.properties?._isYtFreebie&&(g||y)&&H?t.createElement(t.Fragment,null,t.createElement(oi,{key:s?.key??s?.id},t.createElement(Ka,{product:s,themeColor:i,isDev:a,primaryTextColor:l,secondaryTextColor:c,themeTextColor:d,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:g,imageAspectSelector:b,showDeleteOnFreebies:f,removeFreebieFromCart:m,backgroundSubdued:S,tertiaryColor:T,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:!0}))):t.createElement(oi,{key:s?.key??s?.id},t.createElement(Ka,{themeColor:i,handleDecrement:n,handleIncrement:r,removeCartItem:o,addCartItem:e,product:s,isDev:a,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!s.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:f,imageAspectSelector:b,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:S,tertiaryColor:T,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:z})):null}),D&&H&&j&&t.createElement(ni,{name:j.name,minimumOrderValue:j.minimumOrderValue,currency:V,themeColor:i,tertiaryColor:T,imageUrl:_?.milestoneImage?.path,showFreebieImage:_?.showFreebieImage,freebieImageUrl:W}),Vn()&&I&&I.length>0?t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:T,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:N?"pointer":"default"},onClick:()=>{N&&(window.location.href=N)}},I):t.createElement("div",{style:{display:"list-item",height:"12px",background:"#87878717"}})):null:t.createElement(ri,null)};function ii(e){return _({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"},child:[]}]})(e)}const li=({bundleProducts:e})=>{const n=dn(mn);return t.createElement("div",{className:"flex flex-col gap-y-2"},t.createElement("div",{className:"flex items-center justify-center"},t.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),t.createElement("div",{className:"flex items-center justify-center gap-2 relative"},t.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},t.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:e[0].image}),t.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},Pn(e[0].title)),t.createElement("div",null,t.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},Nn(n,n?.currency),e[0].original_price)," ",t.createElement("span",{className:"line-through text-[#667085] text-[12px]"},Nn(n,n?.currency),e[0].price)),e[0]?.options_with_values?.length>0&&t.createElement("div",{className:"flex flex-col"},e[0]?.options_with_values?.map(e=>{if("Title"!==e.name)return t.createElement("span",{className:"text-[10px] text-[#868E96]"},e.name,": ",e.value)}))),t.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},t.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:e[1].image}),t.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},Pn(e[0].title)),t.createElement("div",null,t.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},Nn(n,n?.currency),e[1].original_price)," ",t.createElement("span",{className:"line-through text-[#667085] text-[12px]"},Nn(n,n?.currency),e[1].price)),e[1]?.options_with_values?.length>0&&t.createElement("div",{className:"flex flex-col"},e[0]?.options_with_values?.map(e=>{if("Title"!==e.name)return t.createElement("span",{className:"text-[10px] text-[#868E96]"},e.name,": ",e.value)}))),t.createElement("div",{className:"absolute",style:{left:"50%",transform:"translateX(-50%)"}},t.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\r\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\r\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),t.createElement("div",{className:"flex flex-row justify-between items-center"},t.createElement("div",{className:"flex flex-row gap-x-4 items-center"},t.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),t.createElement("span",null,t.createElement("span",{className:"font-bold text-black"},Nn(n,n?.currency),e[0].price+e[1].price)," ",t.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},Nn(n,n?.currency),e[0].original_price+e[1].original_price))),t.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",t.createElement("span",{className:"font-semibold"},Nn(n,n?.currency),e[0].original_price-e[0].price+(e[1].original_price-e[1].price)))),t.createElement("button",{className:"flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},t.createElement(ii,{color:"white"}),t.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",t.createElement("span",{className:"font-semibold"},Nn(n,n?.currency),e[0].price+e[1].price))))},ci=hn("showGSTInput",!1),si=h.div`
|
|
1382
1382
|
width: 95%;
|
|
1383
1383
|
background: white;
|
|
1384
1384
|
border-radius: 2px;
|
|
@@ -1519,7 +1519,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1519
1519
|
text-overflow: ellipsis;
|
|
1520
1520
|
max-width: 100%;
|
|
1521
1521
|
}
|
|
1522
|
-
`,zi=({product:e,themeColor:n,themeTextColor:r,addFreebieToCart:a,productClaimCtaButtonText:s,imageAspectSelector:d,freebieCouponTemplates:p,isMultiClaim:u=!1,isSelected:m=!1,isDisabled:f=!1,onToggleSelection:g})=>{const x=o(null),[h,y]=c(0),{setLoading:b}=kn(),v=window.innerWidth<=768,w=pn(En);l(()=>{x.current&&y(x.current.offsetWidth)},[]);const C=i(()=>{const t=e?.variants?.edges?.filter(t=>Ci(e,t?.node));return((e,t)=>{if(e?.length){if(t?.length)for(const n of e){const e=Mn(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}return Mn(String(e[0]?.node?.id))}})(t,p)},[e,p]),[k,E]=c({variantId:C}),S=i(()=>ki(e,p,k?.variantId),[e,p,k?.variantId]),T=i(()=>
|
|
1522
|
+
`,zi=({product:e,themeColor:n,themeTextColor:r,addFreebieToCart:a,productClaimCtaButtonText:s,imageAspectSelector:d,freebieCouponTemplates:p,isMultiClaim:u=!1,isSelected:m=!1,isDisabled:f=!1,onToggleSelection:g})=>{const x=o(null),[h,y]=c(0),{setLoading:b}=kn(),v=window.innerWidth<=768,w=pn(En);l(()=>{x.current&&y(x.current.offsetWidth)},[]);const C=i(()=>{const t=e?.variants?.edges?.filter(t=>Ci(e,t?.node));return((e,t)=>{if(e?.length){if(t?.length)for(const n of e){const e=Mn(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}return Mn(String(e[0]?.node?.id))}})(t,p)},[e,p]),[k,E]=c({variantId:C}),S=i(()=>ki(e,p,k?.variantId),[e,p,k?.variantId]),T=i(()=>Fn(e?.title,v?100:150,h,"",v?"11px":"16px"),[e?.title,v,h]);if(!S.availableVariants?.length)return null;const $=u?()=>{!f&&g&&g(e.id)}:()=>{(async(e,t,n,r)=>{e(!0,!0);try{const o=t._claim_allowed_variants||[],a=o[0];if(!a)return console.error("No allowed variant ID found for claiming freebie:",t),void e(!1,!1);if(o.length<=1)n&&await n(a,o);else if(r){const e=t?.id?.split("/").pop();r({open:!0,variantId:a,handle:t?.handle,freebieSelection:!0,productId:e,allowedVariantIds:o})}else console.error("Cannot open variant modal: setVariantSelectionModal not provided.")}catch(e){console.error("yt::uikit handleFreebieClaim error:",e)}finally{e(!1,!1)}})(b,e,a,w)};return t.createElement(Ei,{$isDisabled:f,$isSelected:m},t.createElement(Si,{src:e?.featuredMedia?.preview?.image?.url,alt:e?.title,$imageAspectSelector:d}),t.createElement(Ti,null,t.createElement($i,null,t.createElement(Bi,{href:`/products/${e?.handle}?variant=${k?.variantId}`,ref:x},T),S.showOptions&&S.displayVariantCount>1&&t.createElement("div",{style:{fontSize:"10px",marginBottom:"5px"}},`${S.displayVariantCount} variants available`),t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"5px",fontSize:"10px",marginBottom:"10px"}},t.createElement("span",{style:{fontWeight:"bold"}},S.dealAmount>0?`₹${S.dealAmount.toFixed(2)}`:S.isFree?"FREE":`₹${S.effectivePrice.toFixed(2)}`),t.createElement("span",{style:{color:"gray",textDecorationLine:"line-through"}},"₹",S.selectedVariantPrice),S.effectivePrice>0?t.createElement("span",{style:{padding:"2px",background:"#FFEAF2",color:"#E2454B",fontSize:"8px",fontWeight:"bold"}},"Save ",e?.percentageOffOnCustomerGetsProducts,"%"):"")),t.createElement("button",{style:{cursor:f?"not-allowed":"pointer",border:u?m?"1px solid #51B286":"1px solid #888888":"none",color:u?m?"#ffffff":"#000000":r||"#ffffff",backgroundColor:u?m?"#51B286":"#ffffff":n||"#000000",fontSize:"12px",padding:"5px 7px",width:"80%",borderRadius:"14px",fontWeight:u?m?"600":"normal":"600",display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",fontFamily:"Poppins"},onClick:$,disabled:f},t.createElement("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&t.createElement("span",{style:{display:"inline-flex"}},m?t.createElement(Ho,{size:16}):t.createElement(Vo,{size:16})),t.createElement("span",null,u?m?"Added":"Add":s||"Add")))))},Ii=async(e,t,n)=>{if(n&&0!==e.length)for(const r of e){const e=t.find(e=>e.id===r);if(!e){console.error("Product not found for ID:",r);continue}const o=e._claim_allowed_variants||[],a=o[0];a?await n(a,o):console.error("No allowed variant ID found for claiming freebie:",e)}},Ni=h.div`
|
|
1523
1523
|
position: relative;
|
|
1524
1524
|
width: 100%;
|
|
1525
1525
|
display: flex;
|
|
@@ -1544,7 +1544,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1544
1544
|
gap: 10px;
|
|
1545
1545
|
transition: transform 0.3s ease;
|
|
1546
1546
|
transform: translateX(-${e=>e.$translate}px);
|
|
1547
|
-
`,
|
|
1547
|
+
`,Fi=h.button`
|
|
1548
1548
|
position: absolute;
|
|
1549
1549
|
top: 50%;
|
|
1550
1550
|
transform: translateY(-50%);
|
|
@@ -1563,9 +1563,9 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1563
1563
|
opacity: 0.5;
|
|
1564
1564
|
cursor: not-allowed;
|
|
1565
1565
|
}
|
|
1566
|
-
`,
|
|
1566
|
+
`,Oi=h(Fi)`
|
|
1567
1567
|
left: -3px;
|
|
1568
|
-
`,Ai=h(
|
|
1568
|
+
`,Ai=h(Fi)`
|
|
1569
1569
|
right: -4px;
|
|
1570
1570
|
`,Mi=h.div`
|
|
1571
1571
|
display: flex;
|
|
@@ -1616,7 +1616,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1616
1616
|
transition: all 0.2s ease;
|
|
1617
1617
|
letter-spacing: 0.8px;
|
|
1618
1618
|
font-family: 'Poppins';
|
|
1619
|
-
`,qi=({freebieProductsInCart:e,themeColor:n,themeTextColor:r,primaryTextColor:a,addFreebieToCart:s,freebiesInCart:d,imageAspectSelector:p,freebieCouponTemplates:u,maxFreebiesInTier:m=1,tierName:f="Freebie",freebieClaimData:g})=>{const[x,h]=c(0),[y,b]=c(0),[v,w]=c([]),[C,k]=c(!1),[E,S]=c(!1),T=o(null),$=o(null),B=o(null),z=o(!1),I=m>1,N=v.length,D=v.length>=m,_=`${N}/${m} selected`,P=N===m&&N>0,A=g?.freebieSectionTitle,M=g?.productClaimCtaButtonText,R=i(()=>e?.length?e.filter(e=>(e?.variants?.edges||[]).some(t=>Ci(e,t?.node))):[],[e]);l(()=>{w(e=>e.filter(e=>R.some(t=>String(t?.id)===e)))},[R]);l(()=>{if(T.current){const e=T.current.offsetWidth,t=window.innerWidth<=768;b(t?Math.min(.95*e,280):Math.min(.8*e,320))}},[R.length]);const j=Math.max(0,(R.length||0)-1);l(()=>{x>j&&h(j)},[j,x]);const V=()=>{h(e=>0===e?j:e-1)},W=()=>{h(e=>e===j?0:e+1)};return 0===R.length?null:t.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},t.createElement(Mi,{onClick:()=>k(e=>!e)},t.createElement(Ri,{$primaryTextColor:a},t.createElement(Li,{$isCollapsed:C},t.createElement(L,{size:16})),A??"Freebies",I&&!P&&` • ${_}`),t.createElement(ji,null)),t.createElement(Vi,{$isCollapsed:C},t.createElement(Ni,{ref:T,onTouchStart:e=>{const t=e.touches[0];$.current=t.clientX,B.current=t.clientY,z.current=!1},onTouchMove:e=>{if(null===$.current||null===B.current)return;const t=e.touches[0],n=t.clientX-$.current,r=t.clientY-B.current;Math.abs(n)>10&&Math.abs(n)>Math.abs(r)&&(z.current=!0,e.preventDefault())},onTouchEnd:e=>{if(null===$.current)return;const t=e.changedTouches[0].clientX-$.current;Math.abs(t)>50&&(t<0?W():V()),$.current=null,B.current=null,z.current=!1}},R.length>1&&t.createElement(
|
|
1619
|
+
`,qi=({freebieProductsInCart:e,themeColor:n,themeTextColor:r,primaryTextColor:a,addFreebieToCart:s,freebiesInCart:d,imageAspectSelector:p,freebieCouponTemplates:u,maxFreebiesInTier:m=1,tierName:f="Freebie",freebieClaimData:g})=>{const[x,h]=c(0),[y,b]=c(0),[v,w]=c([]),[C,k]=c(!1),[E,S]=c(!1),T=o(null),$=o(null),B=o(null),z=o(!1),I=m>1,N=v.length,D=v.length>=m,_=`${N}/${m} selected`,P=N===m&&N>0,A=g?.freebieSectionTitle,M=g?.productClaimCtaButtonText,R=i(()=>e?.length?e.filter(e=>(e?.variants?.edges||[]).some(t=>Ci(e,t?.node))):[],[e]);l(()=>{w(e=>e.filter(e=>R.some(t=>String(t?.id)===e)))},[R]);l(()=>{if(T.current){const e=T.current.offsetWidth,t=window.innerWidth<=768;b(t?Math.min(.95*e,280):Math.min(.8*e,320))}},[R.length]);const j=Math.max(0,(R.length||0)-1);l(()=>{x>j&&h(j)},[j,x]);const V=()=>{h(e=>0===e?j:e-1)},W=()=>{h(e=>e===j?0:e+1)};return 0===R.length?null:t.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},t.createElement(Mi,{onClick:()=>k(e=>!e)},t.createElement(Ri,{$primaryTextColor:a},t.createElement(Li,{$isCollapsed:C},t.createElement(L,{size:16})),A??"Freebies",I&&!P&&` • ${_}`),t.createElement(ji,null)),t.createElement(Vi,{$isCollapsed:C},t.createElement(Ni,{ref:T,onTouchStart:e=>{const t=e.touches[0];$.current=t.clientX,B.current=t.clientY,z.current=!1},onTouchMove:e=>{if(null===$.current||null===B.current)return;const t=e.touches[0],n=t.clientX-$.current,r=t.clientY-B.current;Math.abs(n)>10&&Math.abs(n)>Math.abs(r)&&(z.current=!0,e.preventDefault())},onTouchEnd:e=>{if(null===$.current)return;const t=e.changedTouches[0].clientX-$.current;Math.abs(t)>50&&(t<0?W():V()),$.current=null,B.current=null,z.current=!1}},R.length>1&&t.createElement(Oi,{onClick:V},t.createElement(F,{size:30,color:"#4D4D4D",className:"yt-freebie-carousel-icon"})),t.createElement(_i,{position:"left",style:{display:"flex"}}),t.createElement(_i,{position:"right",style:{display:"flex"}}),t.createElement(Di,{$cardWidth:y},t.createElement(Pi,{$translate:x*(y+10)},R.map((e,o)=>t.createElement("div",{key:`${e?.id}-${v.includes(String(e.id))?"selected":"unselected"}`,style:{width:`${y}px`,flexShrink:0}},t.createElement(zi,{addFreebieToCart:s,product:e,themeColor:n,themeTextColor:r,productClaimCtaButtonText:M,imageAspectSelector:p,freebieCouponTemplates:u,isMultiClaim:I,isSelected:v.includes(String(e.id)),isDisabled:I&&!v.includes(String(e.id))&&D,onToggleSelection:I?e=>{w(t=>{const n=String(e);if(t.includes(n))return t.filter(e=>e!==n);if(t.length<m){return t.length+1<m&&setTimeout(()=>{W()},600),[...t,n]}return t})}:void 0}))))),R.length>1&&t.createElement(Ai,{onClick:W},t.createElement(O,{size:30,color:"#4D4D4D",className:"yt-freebie-carousel-icon"})))),I&&P&&t.createElement(Wi,null,t.createElement(Hi,{$themeColor:n,$themeTextColor:r,$disabled:E,onClick:async()=>{if(s&&0!==v.length&&!E){S(!0);try{await Ii(v,e,s),w([])}catch(e){console.error("Failed to claim gifts:",e)}finally{S(!1)}}},disabled:E},E?"Adding to Cart...":`${M} • ${N}/${m} added`)))};function Ui(e){return _({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Qi(e){return _({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}const Yi="yt-multiclaim-selection",Gi=e=>{try{if("undefined"==typeof window||!window.sessionStorage)return;sessionStorage.setItem(Yi,JSON.stringify(e))}catch{}},Zi=Kt((()=>{try{if("undefined"==typeof window||!window.sessionStorage)return null;const e=sessionStorage.getItem(Yi);return e?JSON.parse(e):null}catch{return null}})()??{selectedProducts:[],maxAllowed:1,tierName:""}),Xi=Kt(e=>{const t=e(Zi);return t.selectedProducts.length>=t.maxAllowed}),Ki=Kt(e=>e(Zi).selectedProducts.length),Ji=Kt(null,(e,t,n)=>{const r=e(Zi);let o;if(r.selectedProducts.includes(n))o={...r,selectedProducts:r.selectedProducts.filter(e=>e!==n)};else{if(!(r.selectedProducts.length<r.maxAllowed))return;o={...r,selectedProducts:[...r.selectedProducts,n]}}t(Zi,o),Gi(o)}),el=Kt(null,(e,t)=>{const n={...e(Zi),selectedProducts:[]};t(Zi,n),Gi(n)}),tl=Kt(null,(e,t,n,r)=>{const o={selectedProducts:[],maxAllowed:n,tierName:r};t(Zi,o),Gi(o)}),nl=h.div`
|
|
1620
1620
|
display: flex;
|
|
1621
1621
|
flex-direction: row;
|
|
1622
1622
|
align-items: center;
|
|
@@ -1791,7 +1791,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1791
1791
|
border: none;
|
|
1792
1792
|
max-width: unset;
|
|
1793
1793
|
margin-left: 10px;
|
|
1794
|
-
`,Tl=({freebieProductsInCart:e,maxFreebiesInTier:n,tierName:r,themeColor:o,themeTextColor:a,primaryTextColor:i,addFreebieToCart:c,imageAspectSelector:s="square",freebieCouponTemplates:d=[],freebieClaimData:p,isCartDrawerOpen:u=!0})=>{const[m]=un(Zi),[f]=un(Ki),g=pn(el),x=pn(tl),[h,y]=un(ul),[b,w]=t.useState(!1),C=p?.allowOverlayClose??!0,k=p?.freebieSectionTitle;l(()=>u?(x(n,r),y({isOpen:!0}),()=>{g(),y({isOpen:!1})}):(y({isOpen:!1}),void g()),[u,n,r,x,g,y]);const E=()=>{y({isOpen:!1}),g()},S=()=>{y({isOpen:!0})};l(()=>{const e=e=>{"Escape"===e.key&&E()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);m.selectedProducts.length;const T=f>=n,$=b?"Adding to Cart...":T?`Claim Gifts • ${f}/${n} added`:`${f}/${n} added`;if(!h.isOpen)return t.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},t.createElement(kl,{onClick:S},t.createElement(El,{$primaryTextColor:i},t.createElement(L,{size:16}),k??"Freebies"," • ",n," items available"),t.createElement(Sl,null)));const B=t.createElement(ml,{role:"dialog","aria-modal":"true",onClick:C?E:void 0},t.createElement(fl,{onClick:e=>e.stopPropagation(),"aria-labelledby":"freebie-modal-title"},t.createElement(gl,null,t.createElement(xl,null,t.createElement(pt,{color:"#4D4D4D",size:22})),t.createElement(hl,{id:"freebie-modal-title"},t.createElement("span",{className:"bold"},"Freebie")," Unlocked!"),t.createElement(yl,null,"claim up to ",t.createElement("span",{className:"bold"},n," items")," for free")),t.createElement(bl,null,t.createElement(vl,null,e.map(e=>t.createElement(pl,{key:e.id,product:e,imageAspectSelector:s,freebieCouponTemplates:d,accentColor:o})))),t.createElement(wl,null,t.createElement(Cl,{$themeColor:o||"#000",$themeTextColor:a,$disabled:!T||b,onClick:async()=>{if(m.selectedProducts.length>0&&!b){w(!0);try{await c(m.selectedProducts),E()}catch(e){console.error("Failed to add freebies:",e)}finally{w(!1)}}},disabled:!T||b},$))));return"undefined"!=typeof document&&document.body?v.createPortal(B,document.body):null},$l=({freebieProductsInCart:e,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:a,freebiesInCart:i,freebieClaimData:l,imageAspectSelector:c,freebieCouponTemplates:s,cartCheckpoints:d,isCartDrawerOpen:p})=>{const u=t.useMemo(()=>{const t=d?.filter(e=>"free_product"===e?.couponType);if(!t||0===t.length)return;const n=Array.from(new Set((e??[]).map(e=>e?.couponTemplateId).filter(e=>"number"==typeof e)));if(n.length>0){const e=t.find(e=>n.includes(e.couponTemplateId));if(e)return e}},[d,e]),m=t.useMemo(()=>{const e=u?.maxFreebiesInTier;return"number"!=typeof e||isNaN(e)?1:e},[u]),f=t.useMemo(()=>u?.name??"Freebie",[u]),g=async t=>{try{await Ii(t,e,a)}catch(e){console.error("Failed to add multiclaim freebies:",e)}},x=l?.type||"section";return"section"===x?t.createElement(qi,{freebieProductsInCart:e,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:a,freebiesInCart:i,imageAspectSelector:c,freebieCouponTemplates:s,maxFreebiesInTier:m,tierName:f,freebieClaimData:l}):"overlay"===x?t.createElement(Tl,{freebieProductsInCart:e,maxFreebiesInTier:m,tierName:f,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:g,imageAspectSelector:c,freebieCouponTemplates:s,freebieClaimData:l,isCartDrawerOpen:p}):(console.warn(`Unknown claimDisplayType: ${x}`),null)};function Bl({inlineCartOfferInfoText:e,inlineCartOfferInfoRedirectLink:n,themeColor:r,tooltipText:o,themeTextColor:a}){const[i,l]=c(!1),s="polygon(0% 100%, 100% 100%, 100% 0%, 100% 0%, 90% 18%, 0% 18%)",d=t.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:An(r,1),color:a,fontWeight:"var(--yt-cart-font-weight)",padding:"3px",cursor:n?"pointer":"default"}},e,o&&t.createElement("div",{style:{position:"relative",alignSelf:"center",justifySelf:"center",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(gt,{size:16,style:{marginLeft:"5px",cursor:"pointer",alignSelf:"center",color:a},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1)}),i&&t.createElement("div",{style:{position:"absolute",top:"100%",right:"100%",zIndex:1e3,filter:"drop-shadow(0px 0px 10px rgba(0,0,0,0.1))"}},t.createElement("div",{style:{backgroundColor:"gray",clipPath:s,padding:".5px"}},t.createElement("div",{style:{backgroundColor:"white",clipPath:s,padding:"10px",fontSize:"10px",color:"black",whiteSpace:"nowrap",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"15px",height:"10px"}},o)))));return n?t.createElement("a",{href:n,style:{textDecoration:"none",color:"inherit"}},d):d}var zl={exports:{}},Il={},Nl=t,Dl=Symbol.for("react.element"),_l=Symbol.for("react.fragment"),Pl=Object.prototype.hasOwnProperty,
|
|
1794
|
+
`,Tl=({freebieProductsInCart:e,maxFreebiesInTier:n,tierName:r,themeColor:o,themeTextColor:a,primaryTextColor:i,addFreebieToCart:c,imageAspectSelector:s="square",freebieCouponTemplates:d=[],freebieClaimData:p,isCartDrawerOpen:u=!0})=>{const[m]=un(Zi),[f]=un(Ki),g=pn(el),x=pn(tl),[h,y]=un(ul),[b,w]=t.useState(!1),C=p?.allowOverlayClose??!0,k=p?.freebieSectionTitle;l(()=>u?(x(n,r),y({isOpen:!0}),()=>{g(),y({isOpen:!1})}):(y({isOpen:!1}),void g()),[u,n,r,x,g,y]);const E=()=>{y({isOpen:!1}),g()},S=()=>{y({isOpen:!0})};l(()=>{const e=e=>{"Escape"===e.key&&E()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);m.selectedProducts.length;const T=f>=n,$=b?"Adding to Cart...":T?`Claim Gifts • ${f}/${n} added`:`${f}/${n} added`;if(!h.isOpen)return t.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},t.createElement(kl,{onClick:S},t.createElement(El,{$primaryTextColor:i},t.createElement(L,{size:16}),k??"Freebies"," • ",n," items available"),t.createElement(Sl,null)));const B=t.createElement(ml,{role:"dialog","aria-modal":"true",onClick:C?E:void 0},t.createElement(fl,{onClick:e=>e.stopPropagation(),"aria-labelledby":"freebie-modal-title"},t.createElement(gl,null,t.createElement(xl,null,t.createElement(pt,{color:"#4D4D4D",size:22})),t.createElement(hl,{id:"freebie-modal-title"},t.createElement("span",{className:"bold"},"Freebie")," Unlocked!"),t.createElement(yl,null,"claim up to ",t.createElement("span",{className:"bold"},n," items")," for free")),t.createElement(bl,null,t.createElement(vl,null,e.map(e=>t.createElement(pl,{key:e.id,product:e,imageAspectSelector:s,freebieCouponTemplates:d,accentColor:o})))),t.createElement(wl,null,t.createElement(Cl,{$themeColor:o||"#000",$themeTextColor:a,$disabled:!T||b,onClick:async()=>{if(m.selectedProducts.length>0&&!b){w(!0);try{await c(m.selectedProducts),E()}catch(e){console.error("Failed to add freebies:",e)}finally{w(!1)}}},disabled:!T||b},$))));return"undefined"!=typeof document&&document.body?v.createPortal(B,document.body):null},$l=({freebieProductsInCart:e,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:a,freebiesInCart:i,freebieClaimData:l,imageAspectSelector:c,freebieCouponTemplates:s,cartCheckpoints:d,isCartDrawerOpen:p})=>{const u=t.useMemo(()=>{const t=d?.filter(e=>"free_product"===e?.couponType);if(!t||0===t.length)return;const n=Array.from(new Set((e??[]).map(e=>e?.couponTemplateId).filter(e=>"number"==typeof e)));if(n.length>0){const e=t.find(e=>n.includes(e.couponTemplateId));if(e)return e}},[d,e]),m=t.useMemo(()=>{const e=u?.maxFreebiesInTier;return"number"!=typeof e||isNaN(e)?1:e},[u]),f=t.useMemo(()=>u?.name??"Freebie",[u]),g=async t=>{try{await Ii(t,e,a)}catch(e){console.error("Failed to add multiclaim freebies:",e)}},x=l?.type||"section";return"section"===x?t.createElement(qi,{freebieProductsInCart:e,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:a,freebiesInCart:i,imageAspectSelector:c,freebieCouponTemplates:s,maxFreebiesInTier:m,tierName:f,freebieClaimData:l}):"overlay"===x?t.createElement(Tl,{freebieProductsInCart:e,maxFreebiesInTier:m,tierName:f,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:g,imageAspectSelector:c,freebieCouponTemplates:s,freebieClaimData:l,isCartDrawerOpen:p}):(console.warn(`Unknown claimDisplayType: ${x}`),null)};function Bl({inlineCartOfferInfoText:e,inlineCartOfferInfoRedirectLink:n,themeColor:r,tooltipText:o,themeTextColor:a}){const[i,l]=c(!1),s="polygon(0% 100%, 100% 100%, 100% 0%, 100% 0%, 90% 18%, 0% 18%)",d=t.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:An(r,1),color:a,fontWeight:"var(--yt-cart-font-weight)",padding:"3px",cursor:n?"pointer":"default"}},e,o&&t.createElement("div",{style:{position:"relative",alignSelf:"center",justifySelf:"center",display:"flex",justifyContent:"center",alignItems:"center"}},t.createElement(gt,{size:16,style:{marginLeft:"5px",cursor:"pointer",alignSelf:"center",color:a},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1)}),i&&t.createElement("div",{style:{position:"absolute",top:"100%",right:"100%",zIndex:1e3,filter:"drop-shadow(0px 0px 10px rgba(0,0,0,0.1))"}},t.createElement("div",{style:{backgroundColor:"gray",clipPath:s,padding:".5px"}},t.createElement("div",{style:{backgroundColor:"white",clipPath:s,padding:"10px",fontSize:"10px",color:"black",whiteSpace:"nowrap",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"15px",height:"10px"}},o)))));return n?t.createElement("a",{href:n,style:{textDecoration:"none",color:"inherit"}},d):d}var zl={exports:{}},Il={},Nl=t,Dl=Symbol.for("react.element"),_l=Symbol.for("react.fragment"),Pl=Object.prototype.hasOwnProperty,Fl=Nl.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ol={key:!0,ref:!0,__self:!0,__source:!0};function Al(e,t,n){var r,o={},a=null,i=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(i=t.ref),t)Pl.call(t,r)&&!Ol.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:Dl,type:e,key:a,ref:i,props:o,_owner:Fl.current}}Il.Fragment=_l,Il.jsx=Al,Il.jsxs=Al;var Ml={};
|
|
1795
1795
|
/**
|
|
1796
1796
|
* @license React
|
|
1797
1797
|
* react-jsx-runtime.development.js
|
|
@@ -1800,7 +1800,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
1800
1800
|
*
|
|
1801
1801
|
* This source code is licensed under the MIT license found in the
|
|
1802
1802
|
* LICENSE file in the root directory of this source tree.
|
|
1803
|
-
*/function Rl(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Rl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ll(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rl(e))&&(r&&(r+=" "),r+=t);return r}"production"!==process.env.NODE_ENV&&function(){var e=t,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator;var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=x.ReactDebugCurrentFrame,o=r.getStackAddendum();""!==o&&(t+="%s",n=n.concat([o]));var a=n.map(function(e){return String(e)});a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,n)}var y;function b(e){return e.displayName||"Context"}function v(e){if(null==e)return null;if("number"==typeof e.tag&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case r:return"Portal";case i:return"Profiler";case a:return"StrictMode";case d:return"Suspense";case p:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return b(e)+".Consumer";case l:return b(e._context)+".Provider";case s:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case u:var t=e.displayName||null;return null!==t?t:v(e.type)||"Memo";case m:var n=e,f=n._payload,g=n._init;try{return v(g(f))}catch(e){return null}}return null}y=Symbol.for("react.module.reference");var w,C,k,E,S,T,$,B=Object.assign,z=0;function I(){}I.__reactDisabledLog=!0;var N,D=x.ReactCurrentDispatcher;function _(e,t,n){if(void 0===N)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);N=r&&r[1]||""}return"\n"+N+e}var P,O=!1,F="function"==typeof WeakMap?WeakMap:Map;function A(e,t){if(!e||O)return"";var n,r=P.get(e);if(void 0!==r)return r;O=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=D.current,D.current=null,function(){if(0===z){w=console.log,C=console.info,k=console.warn,E=console.error,S=console.group,T=console.groupCollapsed,$=console.groupEnd;var e={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){n=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){n=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var l=t.stack.split("\n"),c=n.stack.split("\n"),s=l.length-1,d=c.length-1;s>=1&&d>=0&&l[s]!==c[d];)d--;for(;s>=1&&d>=0;s--,d--)if(l[s]!==c[d]){if(1!==s||1!==d)do{if(s--,--d<0||l[s]!==c[d]){var p="\n"+l[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),"function"==typeof e&&P.set(e,p),p}}while(s>=1&&d>=0);break}}}finally{O=!1,D.current=o,function(){if(0===--z){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:w}),info:B({},e,{value:C}),warn:B({},e,{value:k}),error:B({},e,{value:E}),group:B({},e,{value:S}),groupCollapsed:B({},e,{value:T}),groupEnd:B({},e,{value:$})})}z<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var u=e?e.displayName||e.name:"",m=u?_(u):"";return"function"==typeof e&&P.set(e,m),m}function M(e,t,n){if(null==e)return"";if("function"==typeof e)return A(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return _(e);switch(e){case d:return _("Suspense");case p:return _("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return A(e.render,!1);case u:return M(e.type,t,n);case m:var r=e,o=r._payload,a=r._init;try{return M(a(o),t,n)}catch(e){}}return""}P=new F;var R=Object.prototype.hasOwnProperty,L={},j=x.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);j.setExtraStackFrame(n)}else j.setExtraStackFrame(null)}var W=Array.isArray;function H(e){return W(e)}function q(e){return""+e}function U(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}var Q,Y,G,Z=x.ReactCurrentOwner,X={key:!0,ref:!0,__self:!0,__source:!0};G={};function K(e,t,r,o,a){var i,l={},c=null,s=null;for(i in void 0!==r&&(U(r),c=""+r),function(e){if(R.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(U(t.key),c=""+t.key),function(e){if(R.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&Z.current&&t&&Z.current.stateNode!==t){var n=v(Z.current.type);G[n]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',v(Z.current.type),e.ref),G[n]=!0)}}(t,a)),t)R.call(t,i)&&!X.hasOwnProperty(i)&&(l[i]=t[i]);if(e&&e.defaultProps){var d=e.defaultProps;for(i in d)void 0===l[i]&&(l[i]=d[i])}if(c||s){var p="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){Q||(Q=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(l,p),s&&function(e,t){var n=function(){Y||(Y=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(l,p)}return function(e,t,r,o,a,i,l){var c={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:i,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,s,a,o,Z.current,l)}var J,ee=x.ReactCurrentOwner,te=x.ReactDebugCurrentFrame;function ne(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);te.setExtraStackFrame(n)}else te.setExtraStackFrame(null)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function oe(){if(ee.current){var e=v(ee.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}J=!1;var ae={};function ie(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=oe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ae[n]){ae[n]=!0;var r="";e&&e._owner&&e._owner!==ee.current&&(r=" It was passed a child from "+v(e._owner.type)+"."),ne(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ne(null)}}}function le(e,t){if("object"==typeof e)if(H(e))for(var n=0;n<e.length;n++){var r=e[n];re(r)&&ie(r,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=g&&e[g]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)re(a.value)&&ie(a.value,t)}}function ce(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==s&&n.$$typeof!==u)return;t=n.propTypes}if(t){var r=v(n);!function(e,t,n,r,o){var a=Function.call.bind(R);for(var i in e)if(a(e,i)){var l=void 0;try{if("function"!=typeof e[i]){var c=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}l=e[i](t,i,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){l=e}!l||l instanceof Error||(V(o),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,i,typeof l),V(null)),l instanceof Error&&!(l.message in L)&&(L[l.message]=!0,V(o),h("Failed %s type: %s",n,l.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!J){J=!0,h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var se={};function de(e,t,r,g,x,b){var w=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===i||e===a||e===d||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===c||e.$$typeof===s||e.$$typeof===y||void 0!==e.getModuleId)}(e);if(!w){var C="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var k,E=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(x);C+=E||oe(),null===e?k="null":H(e)?k="array":void 0!==e&&e.$$typeof===n?(k="<"+(v(e.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):k=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,C)}var S=K(e,t,r,x,b);if(null==S)return S;if(w){var T=t.children;if(void 0!==T)if(g)if(H(T)){for(var $=0;$<T.length;$++)le(T[$],e);Object.freeze&&Object.freeze(T)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else le(T,e)}if(R.call(t,"key")){var B=v(e),z=Object.keys(t).filter(function(e){return"key"!==e}),I=z.length>0?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}";if(!se[B+I])h('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',I,B,z.length>0?"{"+z.join(": ..., ")+": ...}":"{}",B),se[B+I]=!0}return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ne(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ne(null);break}}null!==e.ref&&(ne(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),ne(null))}(S):ce(S),S}var pe=function(e,t,n){return de(e,t,n,!1)},ue=function(e,t,n){return de(e,t,n,!0)};Ml.Fragment=o,Ml.jsx=pe,Ml.jsxs=ue}(),"production"===process.env.NODE_ENV?zl.exports=Il:zl.exports=Ml;const jl=(e,t,n,r)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const o=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!Vl(o,a)&&r||Object.defineProperty(e,n,a)},Vl=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Wl=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Hl=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ql=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");var Ul=(e,t,{ignoreNonConfigurable:n=!1}={})=>{const{name:r}=e;for(const r of Reflect.ownKeys(t))jl(e,t,r,n);return((e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)})(e,t),((e,t,n)=>{const r=""===n?"":`with ${n.trim()}() `,o=Wl.bind(null,r,t.toString());Object.defineProperty(o,"name",ql),Object.defineProperty(e,"toString",{...Hl,value:o})})(e,t,r),e},Ql={exports:{}},Yl=()=>{const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e};!function(e,t){var n=Sn&&Sn.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function l(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,l)}c((r=r.apply(e,t||[])).next())})},r=Sn&&Sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(Yl);function a(e,t="maxAge"){let r,a,i;const l=()=>n(this,void 0,void 0,function*(){if(void 0!==r)return;const l=l=>n(this,void 0,void 0,function*(){i=o.default();const n=l[1][t]-Date.now();return n<=0?(e.delete(l[0]),void i.resolve()):(r=l[0],a=setTimeout(()=>{e.delete(l[0]),i&&i.resolve()},n),"function"==typeof a.unref&&a.unref(),i.promise)});try{for(const t of e)yield l(t)}catch(e){}r=void 0}),c=e.set.bind(e);return e.set=(t,n)=>{e.has(t)&&e.delete(t);const o=c(t,n);return r&&r===t&&(r=void 0,void 0!==a&&(clearTimeout(a),a=void 0),void 0!==i&&(i.reject(void 0),i=void 0)),l(),o},l(),e}t.default=a,e.exports=a,e.exports.default=a}(Ql,Ql.exports);const Gl=Ul,Zl=Ql.exports,Xl=new WeakMap,Kl=new WeakMap,Jl=(e,{cacheKey:t,cache:n=new Map,maxAge:r}={})=>{"number"==typeof r&&Zl(n);const o=function(...o){const a=t?t(o):o[0],i=n.get(a);if(i)return i.data;const l=e.apply(this,o);return n.set(a,{data:l,maxAge:r?Date.now()+r:Number.POSITIVE_INFINITY}),l};return Gl(o,e,{ignoreNonConfigurable:!0}),Kl.set(o,n),o};Jl.decorator=(e={})=>(t,n,r)=>{const o=t[n];if("function"!=typeof o)throw new TypeError("The decorated value must be a function");delete r.value,delete r.writable,r.get=function(){if(!Xl.has(this)){const t=Jl(o,e);return Xl.set(this,t),t}return Xl.get(this)}},Jl.clear=e=>{const t=Kl.get(e);if(!t)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof t.clear)throw new TypeError("The cache Map can't be cleared!");t.clear()};var ec=Jl;function tc(e){return"string"==typeof e}function nc(e,t,n){return n.indexOf(e)===t}function rc(e){return-1===e.indexOf(",")?e:e.split(",")}function oc(e){if(!e)return e;if("C"===e||"posix"===e||"POSIX"===e)return"en-US";if(-1!==e.indexOf(".")){var t=e.split(".")[0];return oc(void 0===t?"":t)}if(-1!==e.indexOf("@")){var n=e.split("@")[0];return oc(void 0===n?"":n)}if(-1===e.indexOf("-")||(r=e).toLowerCase()!==r)return e;var r,o=e.split("-"),a=o[0],i=o[1],l=void 0===i?"":i;return"".concat(a,"-").concat(l.toUpperCase())}var ac=ec(function(e){var t=void 0===e?{}:e,n=t.useFallbackLocale,r=void 0===n||n,o=t.fallbackLocale,a=void 0===o?"en-US":o,i=[];if("undefined"!=typeof navigator){for(var l=[],c=0,s=navigator.languages||[];c<s.length;c++){var d=s[c];l=l.concat(rc(d))}var p=navigator.language,u=p?rc(p):p;i=i.concat(l,u)}return r&&i.push(a),i.filter(tc).map(oc).filter(nc)},{cacheKey:JSON.stringify});var ic=ec(function(e){return ac(e)[0]||null},{cacheKey:JSON.stringify});function lc(e,t,n){return function(r,o){void 0===o&&(o=n);var a=e(r)+o;return t(a)}}function cc(e){return function(t){return new Date(e(t).getTime()-1)}}function sc(e,t){return function(n){return[e(n),t(n)]}}function dc(e){if(e instanceof Date)return e.getFullYear();if("number"==typeof e)return e;var t=parseInt(e,10);if("string"==typeof e&&!isNaN(t))return t;throw new Error("Failed to get year from date: ".concat(e,"."))}function pc(e){if(e instanceof Date)return e.getMonth();throw new Error("Failed to get month from date: ".concat(e,"."))}function uc(e){if(e instanceof Date)return e.getDate();throw new Error("Failed to get year from date: ".concat(e,"."))}function mc(e){var t=dc(e),n=t+(1-t)%100,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}var fc=lc(dc,mc,-100),gc=lc(dc,mc,100),xc=cc(gc),hc=lc(dc,xc,-100),yc=sc(mc,xc);function bc(e){var t=dc(e),n=t+(1-t)%10,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}var vc=lc(dc,bc,-10),wc=lc(dc,bc,10),Cc=cc(wc),kc=lc(dc,Cc,-10),Ec=sc(bc,Cc);function Sc(e){var t=dc(e),n=new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}var Tc=lc(dc,Sc,-1),$c=lc(dc,Sc,1),Bc=cc($c),zc=lc(dc,Bc,-1),Ic=sc(Sc,Bc);function Nc(e,t){return function(n,r){void 0===r&&(r=t);var o=dc(n),a=pc(n)+r,i=new Date;return i.setFullYear(o,a,1),i.setHours(0,0,0,0),e(i)}}function Dc(e){var t=dc(e),n=pc(e),r=new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}var _c=Nc(Dc,-1),Pc=Nc(Dc,1),Oc=cc(Pc),Fc=Nc(Oc,-1),Ac=sc(Dc,Oc);function Mc(e){var t=dc(e),n=pc(e),r=uc(e),o=new Date;return o.setFullYear(t,n,r),o.setHours(0,0,0,0),o}var Rc,Lc,jc=cc((Rc=Mc,Lc=1,function(e,t){void 0===t&&(t=Lc);var n=dc(e),r=pc(e),o=uc(e)+t,a=new Date;return a.setFullYear(n,r,o),a.setHours(0,0,0,0),Rc(a)})),Vc=sc(Mc,jc);function Wc(e){return uc(Oc(e))}var Hc="gregory",qc="hebrew",Uc="islamic",Qc="iso8601",Yc={gregory:["en-CA","en-US","es-AR","es-BO","es-CL","es-CO","es-CR","es-DO","es-EC","es-GT","es-HN","es-MX","es-NI","es-PA","es-PE","es-PR","es-SV","es-VE","pt-BR"],hebrew:["he","he-IL"],islamic:["ar","ar-AE","ar-BH","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LY","ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-YE","dv","dv-MV","ps","ps-AR"]},Gc=[0,1,2,3,4,5,6],Zc=new Map;function Xc(e){return function(t,n){return function(e){return function(t,n){var r=t||ic();Zc.has(r)||Zc.set(r,new Map);var o=Zc.get(r);return o.has(e)||o.set(e,new Intl.DateTimeFormat(r||void 0,e).format),o.get(e)(n)}}(e)(t,function(e){var t=new Date(e);return new Date(t.setHours(12))}(n))}}var Kc=Xc({day:"numeric"}),Jc=Xc({day:"numeric",month:"long",year:"numeric"}),es=Xc({month:"long"}),ts=Xc({month:"long",year:"numeric"}),ns=Xc({weekday:"short"}),rs=Xc({weekday:"long"}),os=Xc({year:"numeric"}),as=Gc[0],is=Gc[5],ls=Gc[6];function cs(e,t){void 0===t&&(t=Qc);var n=e.getDay();switch(t){case Qc:return(n+6)%7;case Uc:return(n+1)%7;case qc:case Hc:return n;default:throw new Error("Unsupported calendar type.")}}function ss(e,t){void 0===t&&(t=Qc);var n=dc(e),r=pc(e),o=e.getDate()-cs(e,t);return new Date(n,r,o)}function ds(e,t){switch(e){case"century":return mc(t);case"decade":return bc(t);case"year":return Sc(t);case"month":return Dc(t);case"day":return Mc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function ps(e,t){switch(e){case"century":return gc(t);case"decade":return wc(t);case"year":return $c(t);case"month":return Pc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function us(e,t){switch(e){case"century":return xc(t);case"decade":return Cc(t);case"year":return Bc(t);case"month":return Oc(t);case"day":return jc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function ms(e,t){switch(e){case"century":return yc(t);case"decade":return Ec(t);case"year":return Ic(t);case"month":return Ac(t);case"day":return Vc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function fs(e,t,n){return n.map(function(n){return(t||os)(e,n)}).join(" – ")}function gs(e,t,n){return fs(e,t,Ec(n))}function xs(e){return e.getDay()===(new Date).getDay()}function hs(e,t){void 0===t&&(t=Qc);var n=e.getDay();switch(t){case Uc:case qc:return n===is||n===ls;case Qc:case Hc:return n===ls||n===as;default:throw new Error("Unsupported calendar type.")}}var ys="react-calendar__navigation";function bs(e){var t,n=e.activeStartDate,r=e.drillUp,o=e.formatMonthYear,a=void 0===o?ts:o,i=e.formatYear,l=void 0===i?os:i,c=e.locale,s=e.maxDate,d=e.minDate,p=e.navigationAriaLabel,u=void 0===p?"":p,m=e.navigationAriaLive,f=e.navigationLabel,g=e.next2AriaLabel,x=void 0===g?"":g,h=e.next2Label,y=void 0===h?"»":h,b=e.nextAriaLabel,v=void 0===b?"":b,w=e.nextLabel,C=void 0===w?"›":w,k=e.prev2AriaLabel,E=void 0===k?"":k,S=e.prev2Label,T=void 0===S?"«":S,$=e.prevAriaLabel,B=void 0===$?"":$,z=e.prevLabel,I=void 0===z?"‹":z,N=e.setActiveStartDate,D=e.showDoubleView,_=e.view,P=e.views.indexOf(_)>0,O="century"!==_,F=function(e,t){switch(e){case"century":return fc(t);case"decade":return vc(t);case"year":return Tc(t);case"month":return _c(t);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n),A=O?function(e,t){switch(e){case"decade":return vc(t,-100);case"year":return Tc(t,-10);case"month":return _c(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n):void 0,M=ps(_,n),R=O?function(e,t){switch(e){case"decade":return wc(t,100);case"year":return $c(t,10);case"month":return Pc(t,12);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n):void 0,L=function(){if(F.getFullYear()<0)return!0;var e=function(e,t){switch(e){case"century":return hc(t);case"decade":return kc(t);case"year":return zc(t);case"month":return Fc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n);return d&&d>=e}(),j=O&&function(){if(A.getFullYear()<0)return!0;var e=function(e,t){switch(e){case"decade":return kc(t,-100);case"year":return zc(t,-10);case"month":return Fc(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n);return d&&d>=e}(),V=s&&s<M,W=O&&s&&s<R;function H(e){var t=function(){switch(_){case"century":return function(e,t,n){return fs(e,t,yc(n))}(c,l,e);case"decade":return gs(c,l,e);case"year":return l(c,e);case"month":return a(c,e);default:throw new Error("Invalid view: ".concat(_,"."))}}();return f?f({date:e,label:t,locale:c||ic()||void 0,view:_}):t}return zl.exports.jsxs("div",{className:ys,children:[null!==T&&O?zl.exports.jsx("button",{"aria-label":E,className:"".concat(ys,"__arrow ").concat(ys,"__prev2-button"),disabled:j,onClick:function(){N(A,"prev2")},type:"button",children:T}):null,null!==I&&zl.exports.jsx("button",{"aria-label":B,className:"".concat(ys,"__arrow ").concat(ys,"__prev-button"),disabled:L,onClick:function(){N(F,"prev")},type:"button",children:I}),(t="".concat(ys,"__label"),zl.exports.jsxs("button",{"aria-label":u,"aria-live":m,className:t,disabled:!P,onClick:r,style:{flexGrow:1},type:"button",children:[zl.exports.jsx("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--from"),children:H(n)}),D?zl.exports.jsxs(zl.exports.Fragment,{children:[zl.exports.jsx("span",{className:"".concat(t,"__divider"),children:" – "}),zl.exports.jsx("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--to"),children:H(M)})]}):null]})),null!==C&&zl.exports.jsx("button",{"aria-label":v,className:"".concat(ys,"__arrow ").concat(ys,"__next-button"),disabled:V,onClick:function(){N(M,"next")},type:"button",children:C}),null!==y&&O?zl.exports.jsx("button",{"aria-label":x,className:"".concat(ys,"__arrow ").concat(ys,"__next2-button"),disabled:W,onClick:function(){N(R,"next2")},type:"button",children:y}):null]})}var vs=function(){return vs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vs.apply(this,arguments)},ws=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Cs(e){return"".concat(e,"%")}function ks(e){var t=e.children,n=e.className,r=e.count,o=e.direction,a=e.offset,i=e.style,l=e.wrap,c=ws(e,["children","className","count","direction","offset","style","wrap"]);return zl.exports.jsx("div",vs({className:n,style:vs({display:"flex",flexDirection:o,flexWrap:l?"wrap":"nowrap"},i)},c,{children:f.map(t,function(e,t){var n=a&&0===t?Cs(100*a/r):null;return g(e,vs(vs({},e.props),{style:{flexBasis:Cs(100/r),flexShrink:0,flexGrow:0,overflow:"hidden",marginLeft:n,marginInlineStart:n,marginInlineEnd:0}}))})}))}function Es(e,t){return t[0]<=e&&t[1]>=e}function Ss(e,t){return Es(e[0],t)||Es(e[1],t)}function Ts(e,t,n){var r=[];if(Ss(t,e)){r.push(n);var o=Es(e[0],t),a=Es(e[1],t);o&&r.push("".concat(n,"Start")),a&&r.push("".concat(n,"End")),o&&a&&r.push("".concat(n,"BothEnds"))}return r}function $s(e){if(!e)throw new Error("args is required");var t=e.value,n=e.date,r=e.hover,o="react-calendar__tile",a=[o];if(!n)return a;var i=new Date,l=function(){if(Array.isArray(n))return n;var t=e.dateType;if(!t)throw new Error("dateType is required when date is not an array of two dates");return ms(t,n)}();if(Es(i,l)&&a.push("".concat(o,"--now")),!t||!function(e){return Array.isArray(e)?null!==e[0]&&null!==e[1]:null!==e}(t))return a;var c,s,d=function(){if(Array.isArray(t))return t;var n=e.valueType;if(!n)throw new Error("valueType is required when value is not an array of two dates");return ms(n,t)}();s=l,(c=d)[0]<=s[0]&&c[1]>=s[1]?a.push("".concat(o,"--active")):Ss(d,l)&&a.push("".concat(o,"--hasActive"));var p=Ts(d,l,"".concat(o,"--range"));a.push.apply(a,p);var u=Array.isArray(t)?t:[t];if(r&&1===u.length){var m=Ts(r>d[0]?[d[0],r]:[r,d[0]],l,"".concat(o,"--hover"));a.push.apply(a,m)}return a}function Bs(e){for(var t=e.className,n=e.count,r=void 0===n?3:n,o=e.dateTransform,a=e.dateType,i=e.end,l=e.hover,c=e.offset,s=e.renderTile,d=e.start,p=e.step,u=void 0===p?1:p,m=e.value,f=e.valueType,g=[],x=d;x<=i;x+=u){var h=o(x);g.push(s({classes:$s({date:h,dateType:a,hover:l,value:m,valueType:f}),date:h}))}return zl.exports.jsx(ks,{className:t,count:r,offset:c,wrap:!0,children:g})}function zs(e){var t=e.activeStartDate,n=e.children,r=e.classes,o=e.date,a=e.formatAbbr,l=e.locale,c=e.maxDate,s=e.maxDateTransform,d=e.minDate,p=e.minDateTransform,u=e.onClick,m=e.onMouseOver,f=e.style,g=e.tileClassName,x=e.tileContent,h=e.tileDisabled,y=e.view,b=i(function(){return"function"==typeof g?g({activeStartDate:t,date:o,view:y}):g},[t,o,g,y]),v=i(function(){return"function"==typeof x?x({activeStartDate:t,date:o,view:y}):x},[t,o,x,y]);return zl.exports.jsxs("button",{className:Ll(r,b),disabled:d&&p(d)>o||c&&s(c)<o||(null==h?void 0:h({activeStartDate:t,date:o,view:y})),onClick:u?function(e){return u(o,e)}:void 0,onFocus:m?function(){return m(o)}:void 0,onMouseOver:m?function(){return m(o)}:void 0,style:f,type:"button",children:[a?zl.exports.jsx("abbr",{"aria-label":a(l,o),children:n}):n,v]})}var Is=function(){return Is=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Is.apply(this,arguments)},Ns=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Ds="react-calendar__century-view__decades__decade";function _s(e){var t=e.classes,n=void 0===t?[]:t,r=e.currentCentury,o=e.formatYear,a=void 0===o?os:o,i=Ns(e,["classes","currentCentury","formatYear"]),l=i.date,c=i.locale,s=[];return n&&s.push.apply(s,n),Ds&&s.push(Ds),mc(l).getFullYear()!==r&&s.push("".concat(Ds,"--neighboringCentury")),zl.exports.jsx(zs,Is({},i,{classes:s,maxDateTransform:Cc,minDateTransform:bc,view:"century",children:gs(c,a,l)}))}var Ps=function(){return Ps=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ps.apply(this,arguments)},Os=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Fs(e){var t=e.activeStartDate,n=e.hover,r=e.showNeighboringCentury,o=e.value,a=e.valueType,i=Os(e,["activeStartDate","hover","showNeighboringCentury","value","valueType"]),l=dc(mc(t)),c=l+(r?119:99);return zl.exports.jsx(Bs,{className:"react-calendar__century-view__decades",dateTransform:bc,dateType:"decade",end:c,hover:n,renderTile:function(e){var n=e.date,r=Os(e,["date"]);return zl.exports.jsx(_s,Ps({},i,r,{activeStartDate:t,currentCentury:l,date:n}),n.getTime())},start:l,step:10,value:o,valueType:a})}var As=function(){return As=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},As.apply(this,arguments)};function Ms(e){return zl.exports.jsx("div",{className:"react-calendar__century-view",children:zl.exports.jsx(Fs,As({},e))})}var Rs=function(){return Rs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Rs.apply(this,arguments)},Ls=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},js="react-calendar__decade-view__years__year";function Vs(e){var t=e.classes,n=void 0===t?[]:t,r=e.currentDecade,o=e.formatYear,a=void 0===o?os:o,i=Ls(e,["classes","currentDecade","formatYear"]),l=i.date,c=i.locale,s=[];return n&&s.push.apply(s,n),js&&s.push(js),bc(l).getFullYear()!==r&&s.push("".concat(js,"--neighboringDecade")),zl.exports.jsx(zs,Rs({},i,{classes:s,maxDateTransform:Bc,minDateTransform:Sc,view:"decade",children:a(c,l)}))}var Ws=function(){return Ws=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ws.apply(this,arguments)},Hs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function qs(e){var t=e.activeStartDate,n=e.hover,r=e.showNeighboringDecade,o=e.value,a=e.valueType,i=Hs(e,["activeStartDate","hover","showNeighboringDecade","value","valueType"]),l=dc(bc(t)),c=l+(r?11:9);return zl.exports.jsx(Bs,{className:"react-calendar__decade-view__years",dateTransform:Sc,dateType:"year",end:c,hover:n,renderTile:function(e){var n=e.date,r=Hs(e,["date"]);return zl.exports.jsx(Vs,Ws({},i,r,{activeStartDate:t,currentDecade:l,date:n}),n.getTime())},start:l,value:o,valueType:a})}var Us=function(){return Us=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Us.apply(this,arguments)};function Qs(e){return zl.exports.jsx("div",{className:"react-calendar__decade-view",children:zl.exports.jsx(qs,Us({},e))})}var Ys=function(){return Ys=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ys.apply(this,arguments)},Gs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Zs=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Xs(e){var t=e.classes,n=void 0===t?[]:t,r=e.formatMonth,o=void 0===r?es:r,a=e.formatMonthYear,i=void 0===a?ts:a,l=Gs(e,["classes","formatMonth","formatMonthYear"]),c=l.date,s=l.locale;return zl.exports.jsx(zs,Ys({},l,{classes:Zs(Zs([],n,!0),["react-calendar__year-view__months__month"],!1),formatAbbr:i,maxDateTransform:Oc,minDateTransform:Dc,view:"year",children:o(s,c)}))}var Ks=function(){return Ks=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ks.apply(this,arguments)},Js=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function ed(e){var t=e.activeStartDate,n=e.hover,r=e.value,o=e.valueType,a=Js(e,["activeStartDate","hover","value","valueType"]),i=dc(t);return zl.exports.jsx(Bs,{className:"react-calendar__year-view__months",dateTransform:function(e){var t=new Date;return t.setFullYear(i,e,1),Dc(t)},dateType:"month",end:11,hover:n,renderTile:function(e){var n=e.date,r=Js(e,["date"]);return zl.exports.jsx(Xs,Ks({},a,r,{activeStartDate:t,date:n}),n.getTime())},start:0,value:r,valueType:o})}var td=function(){return td=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},td.apply(this,arguments)};function nd(e){return zl.exports.jsx("div",{className:"react-calendar__year-view",children:zl.exports.jsx(ed,td({},e))})}var rd=function(){return rd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rd.apply(this,arguments)},od=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ad="react-calendar__month-view__days__day";function id(e){var t=e.calendarType,n=e.classes,r=void 0===n?[]:n,o=e.currentMonthIndex,a=e.formatDay,i=void 0===a?Kc:a,l=e.formatLongDate,c=void 0===l?Jc:l,s=od(e,["calendarType","classes","currentMonthIndex","formatDay","formatLongDate"]),d=s.date,p=s.locale,u=[];return r&&u.push.apply(u,r),ad&&u.push(ad),hs(d,t)&&u.push("".concat(ad,"--weekend")),d.getMonth()!==o&&u.push("".concat(ad,"--neighboringMonth")),zl.exports.jsx(zs,rd({},s,{classes:u,formatAbbr:c,maxDateTransform:jc,minDateTransform:Mc,view:"month",children:i(p,d)}))}var ld=function(){return ld=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ld.apply(this,arguments)},cd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function sd(e){var t=e.activeStartDate,n=e.calendarType,r=e.hover,o=e.showFixedNumberOfWeeks,a=e.showNeighboringMonth,i=e.value,l=e.valueType,c=cd(e,["activeStartDate","calendarType","hover","showFixedNumberOfWeeks","showNeighboringMonth","value","valueType"]),s=dc(t),d=pc(t),p=o||a,u=cs(t,n),m=p?0:u,f=1+(p?-u:0),g=function(){if(o)return f+42-1;var e=Wc(t);if(a){var r=new Date;return r.setFullYear(s,d,e),r.setHours(0,0,0,0),e+(7-cs(r,n)-1)}return e}();return zl.exports.jsx(Bs,{className:"react-calendar__month-view__days",count:7,dateTransform:function(e){var t=new Date;return t.setFullYear(s,d,e),Mc(t)},dateType:"day",hover:r,end:g,renderTile:function(e){var r=e.date,o=cd(e,["date"]);return zl.exports.jsx(id,ld({},c,o,{activeStartDate:t,calendarType:n,currentMonthIndex:d,date:r}),r.getTime())},offset:m,start:f,value:i,valueType:l})}var dd="react-calendar__month-view__weekdays",pd="".concat(dd,"__weekday");function ud(e){for(var t=e.calendarType,n=e.formatShortWeekday,r=void 0===n?ns:n,o=e.formatWeekday,a=void 0===o?rs:o,i=e.locale,l=e.onMouseLeave,c=Dc(new Date),s=dc(c),d=pc(c),p=[],u=1;u<=7;u+=1){var m=new Date(s,d,u-cs(c,t)),f=a(i,m);p.push(zl.exports.jsx("div",{className:Ll(pd,xs(m)&&"".concat(pd,"--current"),hs(m,t)&&"".concat(pd,"--weekend")),children:zl.exports.jsx("abbr",{"aria-label":f,title:f,children:r(i,m).replace(".","")})},u))}return zl.exports.jsx(ks,{className:dd,count:7,onFocus:l,onMouseOver:l,children:p})}var md=function(){return md=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},md.apply(this,arguments)},fd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},gd="react-calendar__tile";function xd(e){var t=e.onClickWeekNumber,n=e.weekNumber,r=zl.exports.jsx("span",{children:n});if(t){var o=e.date,a=e.onClickWeekNumber,i=e.weekNumber,l=fd(e,["date","onClickWeekNumber","weekNumber"]);return zl.exports.jsx("button",md({},l,{className:gd,onClick:function(e){return a(i,o,e)},type:"button",children:r}))}e.date,e.onClickWeekNumber,e.weekNumber;l=fd(e,["date","onClickWeekNumber","weekNumber"]);return zl.exports.jsx("div",md({},l,{className:gd,children:r}))}function hd(e){var t=e.activeStartDate,n=e.calendarType,r=e.onClickWeekNumber,o=e.onMouseLeave,a=e.showFixedNumberOfWeeks,i=function(){if(a)return 6;var e=Wc(t)-(7-cs(t,n));return 1+Math.ceil(e/7)}(),l=function(){for(var e=dc(t),r=pc(t),o=uc(t),a=[],l=0;l<i;l+=1)a.push(ss(new Date(e,r,o+7*l),n));return a}(),c=l.map(function(e){return function(e,t){void 0===t&&(t=Qc);var n,r=t===Hc?Hc:Qc,o=ss(e,t),a=dc(e)+1;do{n=ss(new Date(a,0,r===Qc?4:1),t),a-=1}while(e<n);return Math.round((o.getTime()-n.getTime())/6048e5)+1}(e,n)});return zl.exports.jsx(ks,{className:"react-calendar__month-view__weekNumbers",count:i,direction:"column",onFocus:o,onMouseOver:o,style:{flexBasis:"calc(100% * (1 / 8)",flexShrink:0},children:c.map(function(e,t){var n=l[t];if(!n)throw new Error("date is not defined");return zl.exports.jsx(xd,{date:n,onClickWeekNumber:r,weekNumber:e},e)})})}var yd=function(){return yd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yd.apply(this,arguments)},bd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function vd(e){var t=e.activeStartDate,n=e.locale,r=e.onMouseLeave,o=e.showFixedNumberOfWeeks,a=e.calendarType,i=void 0===a?function(e){if(e)for(var t=0,n=Object.entries(Yc);t<n.length;t++){var r=n[t],o=r[0];if(r[1].includes(e))return o}return Qc}(n):a,l=e.formatShortWeekday,c=e.formatWeekday,s=e.onClickWeekNumber,d=e.showWeekNumbers,p=bd(e,["calendarType","formatShortWeekday","formatWeekday","onClickWeekNumber","showWeekNumbers"]);var u="react-calendar__month-view";return zl.exports.jsx("div",{className:Ll(u,d?"".concat(u,"--weekNumbers"):""),children:zl.exports.jsxs("div",{style:{display:"flex",alignItems:"flex-end"},children:[d?zl.exports.jsx(hd,{activeStartDate:t,calendarType:i,onClickWeekNumber:s,onMouseLeave:r,showFixedNumberOfWeeks:o}):null,zl.exports.jsxs("div",{style:{flexGrow:1,width:"100%"},children:[zl.exports.jsx(ud,{calendarType:i,formatShortWeekday:l,formatWeekday:c,locale:n,onMouseLeave:r}),zl.exports.jsx(sd,yd({calendarType:i},p))]})]})})}var wd=function(){return wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wd.apply(this,arguments)},Cd="react-calendar",kd=["century","decade","year","month"],Ed=["decade","year","month","day"],Sd=new Date;Sd.setFullYear(1,0,1),Sd.setHours(0,0,0,0);var Td=new Date(864e13);function $d(e){return e instanceof Date?e:new Date(e)}function Bd(e,t){return kd.slice(kd.indexOf(e),kd.indexOf(t)+1)}function zd(e,t,n){return e&&function(e,t,n){return-1!==Bd(t,n).indexOf(e)}(e,t,n)?e:n}function Id(e){var t=kd.indexOf(e);return Ed[t]}function Nd(e,t){var n=e.value,r=e.minDate,o=e.maxDate,a=e.maxDetail,i=function(e,t){var n=Array.isArray(e)?e[t]:e;if(!n)return null;var r=$d(n);if(Number.isNaN(r.getTime()))throw new Error("Invalid date: ".concat(e));return r}(n,t);if(!i)return null;var l=Id(a);return function(e,t,n){return t&&t>e?t:n&&n<e?n:e}(function(){switch(t){case 0:return ds(l,i);case 1:return us(l,i);default:throw new Error("Invalid index value: ".concat(t))}}(),r,o)}var Dd=function(e){return Nd(e,0)},_d=function(e){return Nd(e,1)},Pd=function(e){return[Dd,_d].map(function(t){return t(e)})};function Od(e){var t=e.maxDate,n=e.maxDetail,r=e.minDate,o=e.minDetail,a=e.value;return ds(zd(e.view,o,n),Dd({value:a,minDate:r,maxDate:t,maxDetail:n})||new Date)}function Fd(e){return e&&(!Array.isArray(e)||1===e.length)}function Ad(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var Md=n(function(e,t){var n,o=e.activeStartDate,i=e.allowPartialRange,l=e.calendarType,s=e.className,d=e.defaultActiveStartDate,p=e.defaultValue,u=e.defaultView,m=e.formatDay,f=e.formatLongDate,g=e.formatMonth,x=e.formatMonthYear,h=e.formatShortWeekday,y=e.formatWeekday,b=e.formatYear,v=e.goToRangeStartOnSelect,w=void 0===v||v,C=e.inputRef,k=e.locale,E=e.maxDate,S=void 0===E?Td:E,T=e.maxDetail,$=void 0===T?"month":T,B=e.minDate,z=void 0===B?Sd:B,I=e.minDetail,N=void 0===I?"century":I,D=e.navigationAriaLabel,_=e.navigationAriaLive,P=e.navigationLabel,O=e.next2AriaLabel,F=e.next2Label,A=e.nextAriaLabel,M=e.nextLabel,R=e.onActiveStartDateChange,L=e.onChange,j=e.onClickDay,V=e.onClickDecade,W=e.onClickMonth,H=e.onClickWeekNumber,q=e.onClickYear,U=e.onDrillDown,Q=e.onDrillUp,Y=e.onViewChange,G=e.prev2AriaLabel,Z=e.prev2Label,X=e.prevAriaLabel,K=e.prevLabel,J=e.returnValue,ee=void 0===J?"start":J,te=e.selectRange,ne=e.showDoubleView,re=e.showFixedNumberOfWeeks,oe=e.showNavigation,ae=void 0===oe||oe,ie=e.showNeighboringCentury,le=e.showNeighboringDecade,ce=e.showNeighboringMonth,se=void 0===ce||ce,de=e.showWeekNumbers,pe=e.tileClassName,ue=e.tileContent,me=e.tileDisabled,fe=e.value,ge=e.view,xe=c(d),he=xe[0],ye=xe[1],be=c(null),ve=be[0],we=be[1],Ce=c(Array.isArray(p)?p.map(function(e){return null!==e?$d(e):null}):null!=p?$d(p):null),ke=Ce[0],Ee=Ce[1],Se=c(u),Te=Se[0],$e=Se[1],Be=o||he||function(e){var t=e.activeStartDate,n=e.defaultActiveStartDate,r=e.defaultValue,o=e.defaultView,a=e.maxDate,i=e.maxDetail,l=e.minDate,c=e.minDetail,s=e.value,d=e.view,p=zd(d,c,i),u=t||n;return u?ds(p,u):Od({maxDate:a,maxDetail:i,minDate:l,minDetail:c,value:s||r,view:d||o})}({activeStartDate:o,defaultActiveStartDate:d,defaultValue:p,defaultView:u,maxDate:S,maxDetail:$,minDate:z,minDetail:N,value:fe,view:ge}),ze=(n=te&&Fd(ke)?ke:void 0!==fe?fe:ke)?Array.isArray(n)?n.map(function(e){return null!==e?$d(e):null}):null!==n?$d(n):null:null,Ie=Id($),Ne=zd(ge||Te,N,$),De=Bd(N,$),_e=te?ve:null,Pe=De.indexOf(Ne)<De.length-1,Oe=De.indexOf(Ne)>0,Fe=a(function(e){return function(){switch(ee){case"start":return Dd;case"end":return _d;case"range":return Pd;default:throw new Error("Invalid returnValue.")}}()({maxDate:S,maxDetail:$,minDate:z,value:e})},[S,$,z,ee]),Ae=a(function(e,t){ye(e);var n={action:t,activeStartDate:e,value:ze,view:Ne};R&&!Ad(Be,e)&&R(n)},[Be,R,ze,Ne]),Me=a(function(e,t){var n=function(){switch(Ne){case"century":return V;case"decade":return q;case"year":return W;case"month":return j;default:throw new Error("Invalid view: ".concat(Ne,"."))}}();n&&n(e,t)},[j,V,W,q,Ne]),Re=a(function(e,t){if(Pe){Me(e,t);var n=De[De.indexOf(Ne)+1];if(!n)throw new Error("Attempted to drill down from the lowest view.");ye(e),$e(n);var r={action:"drillDown",activeStartDate:e,value:ze,view:n};R&&!Ad(Be,e)&&R(r),Y&&Ne!==n&&Y(r),U&&U(r)}},[Be,Pe,R,Me,U,Y,ze,Ne,De]),Le=a(function(){if(Oe){var e=De[De.indexOf(Ne)-1];if(!e)throw new Error("Attempted to drill up from the highest view.");var t=ds(e,Be);ye(t),$e(e);var n={action:"drillUp",activeStartDate:t,value:ze,view:e};R&&!Ad(Be,t)&&R(n),Y&&Ne!==e&&Y(n),Q&&Q(n)}},[Be,Oe,R,Q,Y,ze,Ne,De]),je=a(function(e,t){var n=ze;Me(e,t);var r,o=te&&!Fd(n);if(te)if(o)r=ds(Ie,e);else{if(!n)throw new Error("previousValue is required");if(Array.isArray(n))throw new Error("previousValue must not be an array");r=function(e,t,n){var r=[t,n].sort(function(e,t){return e.getTime()-t.getTime()});return[ds(e,r[0]),us(e,r[1])]}(Ie,n,e)}else r=Fe(e);var a=!te||o||w?Od({maxDate:S,maxDetail:$,minDate:z,minDetail:N,value:r,view:Ne}):null;t.persist(),ye(a),Ee(r);var l={action:"onChange",activeStartDate:a,value:r,view:Ne};if(R&&!Ad(Be,a)&&R(l),L)if(te)if(Fd(r)){if(i){if(Array.isArray(r))throw new Error("value must not be an array");L([r||null,null],t)}}else L(r||null,t);else L(r||null,t)},[Be,i,Fe,w,S,$,z,N,R,L,Me,te,ze,Ie,Ne]);function Ve(e){we(e)}function We(){we(null)}function He(e){var t={activeStartDate:e?ps(Ne,Be):ds(Ne,Be),hover:_e,locale:k,maxDate:S,minDate:z,onClick:Pe?Re:je,onMouseOver:te?Ve:void 0,tileClassName:pe,tileContent:ue,tileDisabled:me,value:ze,valueType:Ie};switch(Ne){case"century":return zl.exports.jsx(Ms,wd({formatYear:b,showNeighboringCentury:ie},t));case"decade":return zl.exports.jsx(Qs,wd({formatYear:b,showNeighboringDecade:le},t));case"year":return zl.exports.jsx(nd,wd({formatMonth:g,formatMonthYear:x},t));case"month":return zl.exports.jsx(vd,wd({calendarType:l,formatDay:m,formatLongDate:f,formatShortWeekday:h,formatWeekday:y,onClickWeekNumber:H,onMouseLeave:te?We:void 0,showFixedNumberOfWeeks:void 0!==re?re:ne,showNeighboringMonth:se,showWeekNumbers:de},t));default:throw new Error("Invalid view: ".concat(Ne,"."))}}r(t,function(){return{activeStartDate:Be,drillDown:Re,drillUp:Le,onChange:je,setActiveStartDate:Ae,value:ze,view:Ne}},[Be,Re,Le,je,Ae,ze,Ne]);var qe=Array.isArray(ze)?ze:[ze];return zl.exports.jsxs("div",{className:Ll(Cd,te&&1===qe.length&&"".concat(Cd,"--selectRange"),ne&&"".concat(Cd,"--doubleView"),s),ref:C,children:[ae?zl.exports.jsx(bs,{activeStartDate:Be,drillUp:Le,formatMonthYear:x,formatYear:b,locale:k,maxDate:S,minDate:z,navigationAriaLabel:D,navigationAriaLive:_,navigationLabel:P,next2AriaLabel:O,next2Label:F,nextAriaLabel:A,nextLabel:M,prev2AriaLabel:G,prev2Label:Z,prevAriaLabel:X,prevLabel:K,setActiveStartDate:Ae,showDoubleView:ne,view:Ne,views:De}):null,zl.exports.jsxs("div",{className:"".concat(Cd,"__viewContainer"),onBlur:te?We:void 0,onMouseLeave:te?We:void 0,children:[He(),ne?He(!0):null]})]})}),Rd=Md;q(".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");q(".custom-date-picker {\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.date-display {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n cursor: pointer;\r\n}\r\n\r\n.date-display span {\r\n color: black;\r\n}\r\n\r\n.date-display svg {\r\n width: 20px;\r\n height: 20px;\r\n color: rgb(73, 69, 69);\r\n}\r\n\r\n.calendar-container {\r\n position: absolute;\r\n bottom: 100%;\r\n left: -10%;\r\n z-index: 10;\r\n margin-top: 10px;\r\n}\r\n\r\n.custom-calendar {\r\n background-color: white;\r\n border-radius: 6px;\r\n box-shadow: 0 4px 6px rgba(10, 8, 8, 0.1);\r\n border: 1px solid darken(#674918, 50%);\r\n}\r\n");const Ld=h(Rd)`
|
|
1803
|
+
*/function Rl(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Rl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ll(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rl(e))&&(r&&(r+=" "),r+=t);return r}"production"!==process.env.NODE_ENV&&function(){var e=t,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),g=Symbol.iterator;var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=x.ReactDebugCurrentFrame,o=r.getStackAddendum();""!==o&&(t+="%s",n=n.concat([o]));var a=n.map(function(e){return String(e)});a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,n)}var y;function b(e){return e.displayName||"Context"}function v(e){if(null==e)return null;if("number"==typeof e.tag&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case o:return"Fragment";case r:return"Portal";case i:return"Profiler";case a:return"StrictMode";case d:return"Suspense";case p:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return b(e)+".Consumer";case l:return b(e._context)+".Provider";case s:return function(e,t,n){var r=e.displayName;if(r)return r;var o=t.displayName||t.name||"";return""!==o?n+"("+o+")":n}(e,e.render,"ForwardRef");case u:var t=e.displayName||null;return null!==t?t:v(e.type)||"Memo";case m:var n=e,f=n._payload,g=n._init;try{return v(g(f))}catch(e){return null}}return null}y=Symbol.for("react.module.reference");var w,C,k,E,S,T,$,B=Object.assign,z=0;function I(){}I.__reactDisabledLog=!0;var N,D=x.ReactCurrentDispatcher;function _(e,t,n){if(void 0===N)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);N=r&&r[1]||""}return"\n"+N+e}var P,F=!1,O="function"==typeof WeakMap?WeakMap:Map;function A(e,t){if(!e||F)return"";var n,r=P.get(e);if(void 0!==r)return r;F=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=D.current,D.current=null,function(){if(0===z){w=console.log,C=console.info,k=console.warn,E=console.error,S=console.group,T=console.groupCollapsed,$=console.groupEnd;var e={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){n=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){n=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var l=t.stack.split("\n"),c=n.stack.split("\n"),s=l.length-1,d=c.length-1;s>=1&&d>=0&&l[s]!==c[d];)d--;for(;s>=1&&d>=0;s--,d--)if(l[s]!==c[d]){if(1!==s||1!==d)do{if(s--,--d<0||l[s]!==c[d]){var p="\n"+l[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),"function"==typeof e&&P.set(e,p),p}}while(s>=1&&d>=0);break}}}finally{F=!1,D.current=o,function(){if(0===--z){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:w}),info:B({},e,{value:C}),warn:B({},e,{value:k}),error:B({},e,{value:E}),group:B({},e,{value:S}),groupCollapsed:B({},e,{value:T}),groupEnd:B({},e,{value:$})})}z<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var u=e?e.displayName||e.name:"",m=u?_(u):"";return"function"==typeof e&&P.set(e,m),m}function M(e,t,n){if(null==e)return"";if("function"==typeof e)return A(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return _(e);switch(e){case d:return _("Suspense");case p:return _("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case s:return A(e.render,!1);case u:return M(e.type,t,n);case m:var r=e,o=r._payload,a=r._init;try{return M(a(o),t,n)}catch(e){}}return""}P=new O;var R=Object.prototype.hasOwnProperty,L={},j=x.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);j.setExtraStackFrame(n)}else j.setExtraStackFrame(null)}var W=Array.isArray;function H(e){return W(e)}function q(e){return""+e}function U(e){if(function(e){try{return q(e),!1}catch(e){return!0}}(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),q(e)}var Q,Y,G,Z=x.ReactCurrentOwner,X={key:!0,ref:!0,__self:!0,__source:!0};G={};function K(e,t,r,o,a){var i,l={},c=null,s=null;for(i in void 0!==r&&(U(r),c=""+r),function(e){if(R.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(U(t.key),c=""+t.key),function(e){if(R.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(s=t.ref,function(e,t){if("string"==typeof e.ref&&Z.current&&t&&Z.current.stateNode!==t){var n=v(Z.current.type);G[n]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',v(Z.current.type),e.ref),G[n]=!0)}}(t,a)),t)R.call(t,i)&&!X.hasOwnProperty(i)&&(l[i]=t[i]);if(e&&e.defaultProps){var d=e.defaultProps;for(i in d)void 0===l[i]&&(l[i]=d[i])}if(c||s){var p="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){Q||(Q=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(l,p),s&&function(e,t){var n=function(){Y||(Y=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(l,p)}return function(e,t,r,o,a,i,l){var c={$$typeof:n,type:e,key:t,ref:r,props:l,_owner:i,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,s,a,o,Z.current,l)}var J,ee=x.ReactCurrentOwner,te=x.ReactDebugCurrentFrame;function ne(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);te.setExtraStackFrame(n)}else te.setExtraStackFrame(null)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}function oe(){if(ee.current){var e=v(ee.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}J=!1;var ae={};function ie(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=oe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ae[n]){ae[n]=!0;var r="";e&&e._owner&&e._owner!==ee.current&&(r=" It was passed a child from "+v(e._owner.type)+"."),ne(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),ne(null)}}}function le(e,t){if("object"==typeof e)if(H(e))for(var n=0;n<e.length;n++){var r=e[n];re(r)&&ie(r,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=g&&e[g]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)re(a.value)&&ie(a.value,t)}}function ce(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==s&&n.$$typeof!==u)return;t=n.propTypes}if(t){var r=v(n);!function(e,t,n,r,o){var a=Function.call.bind(R);for(var i in e)if(a(e,i)){var l=void 0;try{if("function"!=typeof e[i]){var c=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}l=e[i](t,i,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){l=e}!l||l instanceof Error||(V(o),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,i,typeof l),V(null)),l instanceof Error&&!(l.message in L)&&(L[l.message]=!0,V(o),h("Failed %s type: %s",n,l.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!J){J=!0,h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var se={};function de(e,t,r,g,x,b){var w=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===i||e===a||e===d||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===c||e.$$typeof===s||e.$$typeof===y||void 0!==e.getModuleId)}(e);if(!w){var C="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(C+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var k,E=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(x);C+=E||oe(),null===e?k="null":H(e)?k="array":void 0!==e&&e.$$typeof===n?(k="<"+(v(e.type)||"Unknown")+" />",C=" Did you accidentally export a JSX literal instead of a component?"):k=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",k,C)}var S=K(e,t,r,x,b);if(null==S)return S;if(w){var T=t.children;if(void 0!==T)if(g)if(H(T)){for(var $=0;$<T.length;$++)le(T[$],e);Object.freeze&&Object.freeze(T)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else le(T,e)}if(R.call(t,"key")){var B=v(e),z=Object.keys(t).filter(function(e){return"key"!==e}),I=z.length>0?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}";if(!se[B+I])h('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',I,B,z.length>0?"{"+z.join(": ..., ")+": ...}":"{}",B),se[B+I]=!0}return e===o?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){ne(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),ne(null);break}}null!==e.ref&&(ne(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),ne(null))}(S):ce(S),S}var pe=function(e,t,n){return de(e,t,n,!1)},ue=function(e,t,n){return de(e,t,n,!0)};Ml.Fragment=o,Ml.jsx=pe,Ml.jsxs=ue}(),"production"===process.env.NODE_ENV?zl.exports=Il:zl.exports=Ml;const jl=(e,t,n,r)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const o=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!Vl(o,a)&&r||Object.defineProperty(e,n,a)},Vl=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Wl=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Hl=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ql=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");var Ul=(e,t,{ignoreNonConfigurable:n=!1}={})=>{const{name:r}=e;for(const r of Reflect.ownKeys(t))jl(e,t,r,n);return((e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)})(e,t),((e,t,n)=>{const r=""===n?"":`with ${n.trim()}() `,o=Wl.bind(null,r,t.toString());Object.defineProperty(o,"name",ql),Object.defineProperty(e,"toString",{...Hl,value:o})})(e,t,r),e},Ql={exports:{}},Yl=()=>{const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e};!function(e,t){var n=Sn&&Sn.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function l(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,l)}c((r=r.apply(e,t||[])).next())})},r=Sn&&Sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(Yl);function a(e,t="maxAge"){let r,a,i;const l=()=>n(this,void 0,void 0,function*(){if(void 0!==r)return;const l=l=>n(this,void 0,void 0,function*(){i=o.default();const n=l[1][t]-Date.now();return n<=0?(e.delete(l[0]),void i.resolve()):(r=l[0],a=setTimeout(()=>{e.delete(l[0]),i&&i.resolve()},n),"function"==typeof a.unref&&a.unref(),i.promise)});try{for(const t of e)yield l(t)}catch(e){}r=void 0}),c=e.set.bind(e);return e.set=(t,n)=>{e.has(t)&&e.delete(t);const o=c(t,n);return r&&r===t&&(r=void 0,void 0!==a&&(clearTimeout(a),a=void 0),void 0!==i&&(i.reject(void 0),i=void 0)),l(),o},l(),e}t.default=a,e.exports=a,e.exports.default=a}(Ql,Ql.exports);const Gl=Ul,Zl=Ql.exports,Xl=new WeakMap,Kl=new WeakMap,Jl=(e,{cacheKey:t,cache:n=new Map,maxAge:r}={})=>{"number"==typeof r&&Zl(n);const o=function(...o){const a=t?t(o):o[0],i=n.get(a);if(i)return i.data;const l=e.apply(this,o);return n.set(a,{data:l,maxAge:r?Date.now()+r:Number.POSITIVE_INFINITY}),l};return Gl(o,e,{ignoreNonConfigurable:!0}),Kl.set(o,n),o};Jl.decorator=(e={})=>(t,n,r)=>{const o=t[n];if("function"!=typeof o)throw new TypeError("The decorated value must be a function");delete r.value,delete r.writable,r.get=function(){if(!Xl.has(this)){const t=Jl(o,e);return Xl.set(this,t),t}return Xl.get(this)}},Jl.clear=e=>{const t=Kl.get(e);if(!t)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof t.clear)throw new TypeError("The cache Map can't be cleared!");t.clear()};var ec=Jl;function tc(e){return"string"==typeof e}function nc(e,t,n){return n.indexOf(e)===t}function rc(e){return-1===e.indexOf(",")?e:e.split(",")}function oc(e){if(!e)return e;if("C"===e||"posix"===e||"POSIX"===e)return"en-US";if(-1!==e.indexOf(".")){var t=e.split(".")[0];return oc(void 0===t?"":t)}if(-1!==e.indexOf("@")){var n=e.split("@")[0];return oc(void 0===n?"":n)}if(-1===e.indexOf("-")||(r=e).toLowerCase()!==r)return e;var r,o=e.split("-"),a=o[0],i=o[1],l=void 0===i?"":i;return"".concat(a,"-").concat(l.toUpperCase())}var ac=ec(function(e){var t=void 0===e?{}:e,n=t.useFallbackLocale,r=void 0===n||n,o=t.fallbackLocale,a=void 0===o?"en-US":o,i=[];if("undefined"!=typeof navigator){for(var l=[],c=0,s=navigator.languages||[];c<s.length;c++){var d=s[c];l=l.concat(rc(d))}var p=navigator.language,u=p?rc(p):p;i=i.concat(l,u)}return r&&i.push(a),i.filter(tc).map(oc).filter(nc)},{cacheKey:JSON.stringify});var ic=ec(function(e){return ac(e)[0]||null},{cacheKey:JSON.stringify});function lc(e,t,n){return function(r,o){void 0===o&&(o=n);var a=e(r)+o;return t(a)}}function cc(e){return function(t){return new Date(e(t).getTime()-1)}}function sc(e,t){return function(n){return[e(n),t(n)]}}function dc(e){if(e instanceof Date)return e.getFullYear();if("number"==typeof e)return e;var t=parseInt(e,10);if("string"==typeof e&&!isNaN(t))return t;throw new Error("Failed to get year from date: ".concat(e,"."))}function pc(e){if(e instanceof Date)return e.getMonth();throw new Error("Failed to get month from date: ".concat(e,"."))}function uc(e){if(e instanceof Date)return e.getDate();throw new Error("Failed to get year from date: ".concat(e,"."))}function mc(e){var t=dc(e),n=t+(1-t)%100,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}var fc=lc(dc,mc,-100),gc=lc(dc,mc,100),xc=cc(gc),hc=lc(dc,xc,-100),yc=sc(mc,xc);function bc(e){var t=dc(e),n=t+(1-t)%10,r=new Date;return r.setFullYear(n,0,1),r.setHours(0,0,0,0),r}var vc=lc(dc,bc,-10),wc=lc(dc,bc,10),Cc=cc(wc),kc=lc(dc,Cc,-10),Ec=sc(bc,Cc);function Sc(e){var t=dc(e),n=new Date;return n.setFullYear(t,0,1),n.setHours(0,0,0,0),n}var Tc=lc(dc,Sc,-1),$c=lc(dc,Sc,1),Bc=cc($c),zc=lc(dc,Bc,-1),Ic=sc(Sc,Bc);function Nc(e,t){return function(n,r){void 0===r&&(r=t);var o=dc(n),a=pc(n)+r,i=new Date;return i.setFullYear(o,a,1),i.setHours(0,0,0,0),e(i)}}function Dc(e){var t=dc(e),n=pc(e),r=new Date;return r.setFullYear(t,n,1),r.setHours(0,0,0,0),r}var _c=Nc(Dc,-1),Pc=Nc(Dc,1),Fc=cc(Pc),Oc=Nc(Fc,-1),Ac=sc(Dc,Fc);function Mc(e){var t=dc(e),n=pc(e),r=uc(e),o=new Date;return o.setFullYear(t,n,r),o.setHours(0,0,0,0),o}var Rc,Lc,jc=cc((Rc=Mc,Lc=1,function(e,t){void 0===t&&(t=Lc);var n=dc(e),r=pc(e),o=uc(e)+t,a=new Date;return a.setFullYear(n,r,o),a.setHours(0,0,0,0),Rc(a)})),Vc=sc(Mc,jc);function Wc(e){return uc(Fc(e))}var Hc="gregory",qc="hebrew",Uc="islamic",Qc="iso8601",Yc={gregory:["en-CA","en-US","es-AR","es-BO","es-CL","es-CO","es-CR","es-DO","es-EC","es-GT","es-HN","es-MX","es-NI","es-PA","es-PE","es-PR","es-SV","es-VE","pt-BR"],hebrew:["he","he-IL"],islamic:["ar","ar-AE","ar-BH","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LY","ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-YE","dv","dv-MV","ps","ps-AR"]},Gc=[0,1,2,3,4,5,6],Zc=new Map;function Xc(e){return function(t,n){return function(e){return function(t,n){var r=t||ic();Zc.has(r)||Zc.set(r,new Map);var o=Zc.get(r);return o.has(e)||o.set(e,new Intl.DateTimeFormat(r||void 0,e).format),o.get(e)(n)}}(e)(t,function(e){var t=new Date(e);return new Date(t.setHours(12))}(n))}}var Kc=Xc({day:"numeric"}),Jc=Xc({day:"numeric",month:"long",year:"numeric"}),es=Xc({month:"long"}),ts=Xc({month:"long",year:"numeric"}),ns=Xc({weekday:"short"}),rs=Xc({weekday:"long"}),os=Xc({year:"numeric"}),as=Gc[0],is=Gc[5],ls=Gc[6];function cs(e,t){void 0===t&&(t=Qc);var n=e.getDay();switch(t){case Qc:return(n+6)%7;case Uc:return(n+1)%7;case qc:case Hc:return n;default:throw new Error("Unsupported calendar type.")}}function ss(e,t){void 0===t&&(t=Qc);var n=dc(e),r=pc(e),o=e.getDate()-cs(e,t);return new Date(n,r,o)}function ds(e,t){switch(e){case"century":return mc(t);case"decade":return bc(t);case"year":return Sc(t);case"month":return Dc(t);case"day":return Mc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function ps(e,t){switch(e){case"century":return gc(t);case"decade":return wc(t);case"year":return $c(t);case"month":return Pc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function us(e,t){switch(e){case"century":return xc(t);case"decade":return Cc(t);case"year":return Bc(t);case"month":return Fc(t);case"day":return jc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function ms(e,t){switch(e){case"century":return yc(t);case"decade":return Ec(t);case"year":return Ic(t);case"month":return Ac(t);case"day":return Vc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function fs(e,t,n){return n.map(function(n){return(t||os)(e,n)}).join(" – ")}function gs(e,t,n){return fs(e,t,Ec(n))}function xs(e){return e.getDay()===(new Date).getDay()}function hs(e,t){void 0===t&&(t=Qc);var n=e.getDay();switch(t){case Uc:case qc:return n===is||n===ls;case Qc:case Hc:return n===ls||n===as;default:throw new Error("Unsupported calendar type.")}}var ys="react-calendar__navigation";function bs(e){var t,n=e.activeStartDate,r=e.drillUp,o=e.formatMonthYear,a=void 0===o?ts:o,i=e.formatYear,l=void 0===i?os:i,c=e.locale,s=e.maxDate,d=e.minDate,p=e.navigationAriaLabel,u=void 0===p?"":p,m=e.navigationAriaLive,f=e.navigationLabel,g=e.next2AriaLabel,x=void 0===g?"":g,h=e.next2Label,y=void 0===h?"»":h,b=e.nextAriaLabel,v=void 0===b?"":b,w=e.nextLabel,C=void 0===w?"›":w,k=e.prev2AriaLabel,E=void 0===k?"":k,S=e.prev2Label,T=void 0===S?"«":S,$=e.prevAriaLabel,B=void 0===$?"":$,z=e.prevLabel,I=void 0===z?"‹":z,N=e.setActiveStartDate,D=e.showDoubleView,_=e.view,P=e.views.indexOf(_)>0,F="century"!==_,O=function(e,t){switch(e){case"century":return fc(t);case"decade":return vc(t);case"year":return Tc(t);case"month":return _c(t);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n),A=F?function(e,t){switch(e){case"decade":return vc(t,-100);case"year":return Tc(t,-10);case"month":return _c(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n):void 0,M=ps(_,n),R=F?function(e,t){switch(e){case"decade":return wc(t,100);case"year":return $c(t,10);case"month":return Pc(t,12);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n):void 0,L=function(){if(O.getFullYear()<0)return!0;var e=function(e,t){switch(e){case"century":return hc(t);case"decade":return kc(t);case"year":return zc(t);case"month":return Oc(t);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n);return d&&d>=e}(),j=F&&function(){if(A.getFullYear()<0)return!0;var e=function(e,t){switch(e){case"decade":return kc(t,-100);case"year":return zc(t,-10);case"month":return Oc(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}}(_,n);return d&&d>=e}(),V=s&&s<M,W=F&&s&&s<R;function H(e){var t=function(){switch(_){case"century":return function(e,t,n){return fs(e,t,yc(n))}(c,l,e);case"decade":return gs(c,l,e);case"year":return l(c,e);case"month":return a(c,e);default:throw new Error("Invalid view: ".concat(_,"."))}}();return f?f({date:e,label:t,locale:c||ic()||void 0,view:_}):t}return zl.exports.jsxs("div",{className:ys,children:[null!==T&&F?zl.exports.jsx("button",{"aria-label":E,className:"".concat(ys,"__arrow ").concat(ys,"__prev2-button"),disabled:j,onClick:function(){N(A,"prev2")},type:"button",children:T}):null,null!==I&&zl.exports.jsx("button",{"aria-label":B,className:"".concat(ys,"__arrow ").concat(ys,"__prev-button"),disabled:L,onClick:function(){N(O,"prev")},type:"button",children:I}),(t="".concat(ys,"__label"),zl.exports.jsxs("button",{"aria-label":u,"aria-live":m,className:t,disabled:!P,onClick:r,style:{flexGrow:1},type:"button",children:[zl.exports.jsx("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--from"),children:H(n)}),D?zl.exports.jsxs(zl.exports.Fragment,{children:[zl.exports.jsx("span",{className:"".concat(t,"__divider"),children:" – "}),zl.exports.jsx("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--to"),children:H(M)})]}):null]})),null!==C&&zl.exports.jsx("button",{"aria-label":v,className:"".concat(ys,"__arrow ").concat(ys,"__next-button"),disabled:V,onClick:function(){N(M,"next")},type:"button",children:C}),null!==y&&F?zl.exports.jsx("button",{"aria-label":x,className:"".concat(ys,"__arrow ").concat(ys,"__next2-button"),disabled:W,onClick:function(){N(R,"next2")},type:"button",children:y}):null]})}var vs=function(){return vs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},vs.apply(this,arguments)},ws=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Cs(e){return"".concat(e,"%")}function ks(e){var t=e.children,n=e.className,r=e.count,o=e.direction,a=e.offset,i=e.style,l=e.wrap,c=ws(e,["children","className","count","direction","offset","style","wrap"]);return zl.exports.jsx("div",vs({className:n,style:vs({display:"flex",flexDirection:o,flexWrap:l?"wrap":"nowrap"},i)},c,{children:f.map(t,function(e,t){var n=a&&0===t?Cs(100*a/r):null;return g(e,vs(vs({},e.props),{style:{flexBasis:Cs(100/r),flexShrink:0,flexGrow:0,overflow:"hidden",marginLeft:n,marginInlineStart:n,marginInlineEnd:0}}))})}))}function Es(e,t){return t[0]<=e&&t[1]>=e}function Ss(e,t){return Es(e[0],t)||Es(e[1],t)}function Ts(e,t,n){var r=[];if(Ss(t,e)){r.push(n);var o=Es(e[0],t),a=Es(e[1],t);o&&r.push("".concat(n,"Start")),a&&r.push("".concat(n,"End")),o&&a&&r.push("".concat(n,"BothEnds"))}return r}function $s(e){if(!e)throw new Error("args is required");var t=e.value,n=e.date,r=e.hover,o="react-calendar__tile",a=[o];if(!n)return a;var i=new Date,l=function(){if(Array.isArray(n))return n;var t=e.dateType;if(!t)throw new Error("dateType is required when date is not an array of two dates");return ms(t,n)}();if(Es(i,l)&&a.push("".concat(o,"--now")),!t||!function(e){return Array.isArray(e)?null!==e[0]&&null!==e[1]:null!==e}(t))return a;var c,s,d=function(){if(Array.isArray(t))return t;var n=e.valueType;if(!n)throw new Error("valueType is required when value is not an array of two dates");return ms(n,t)}();s=l,(c=d)[0]<=s[0]&&c[1]>=s[1]?a.push("".concat(o,"--active")):Ss(d,l)&&a.push("".concat(o,"--hasActive"));var p=Ts(d,l,"".concat(o,"--range"));a.push.apply(a,p);var u=Array.isArray(t)?t:[t];if(r&&1===u.length){var m=Ts(r>d[0]?[d[0],r]:[r,d[0]],l,"".concat(o,"--hover"));a.push.apply(a,m)}return a}function Bs(e){for(var t=e.className,n=e.count,r=void 0===n?3:n,o=e.dateTransform,a=e.dateType,i=e.end,l=e.hover,c=e.offset,s=e.renderTile,d=e.start,p=e.step,u=void 0===p?1:p,m=e.value,f=e.valueType,g=[],x=d;x<=i;x+=u){var h=o(x);g.push(s({classes:$s({date:h,dateType:a,hover:l,value:m,valueType:f}),date:h}))}return zl.exports.jsx(ks,{className:t,count:r,offset:c,wrap:!0,children:g})}function zs(e){var t=e.activeStartDate,n=e.children,r=e.classes,o=e.date,a=e.formatAbbr,l=e.locale,c=e.maxDate,s=e.maxDateTransform,d=e.minDate,p=e.minDateTransform,u=e.onClick,m=e.onMouseOver,f=e.style,g=e.tileClassName,x=e.tileContent,h=e.tileDisabled,y=e.view,b=i(function(){return"function"==typeof g?g({activeStartDate:t,date:o,view:y}):g},[t,o,g,y]),v=i(function(){return"function"==typeof x?x({activeStartDate:t,date:o,view:y}):x},[t,o,x,y]);return zl.exports.jsxs("button",{className:Ll(r,b),disabled:d&&p(d)>o||c&&s(c)<o||(null==h?void 0:h({activeStartDate:t,date:o,view:y})),onClick:u?function(e){return u(o,e)}:void 0,onFocus:m?function(){return m(o)}:void 0,onMouseOver:m?function(){return m(o)}:void 0,style:f,type:"button",children:[a?zl.exports.jsx("abbr",{"aria-label":a(l,o),children:n}):n,v]})}var Is=function(){return Is=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Is.apply(this,arguments)},Ns=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Ds="react-calendar__century-view__decades__decade";function _s(e){var t=e.classes,n=void 0===t?[]:t,r=e.currentCentury,o=e.formatYear,a=void 0===o?os:o,i=Ns(e,["classes","currentCentury","formatYear"]),l=i.date,c=i.locale,s=[];return n&&s.push.apply(s,n),Ds&&s.push(Ds),mc(l).getFullYear()!==r&&s.push("".concat(Ds,"--neighboringCentury")),zl.exports.jsx(zs,Is({},i,{classes:s,maxDateTransform:Cc,minDateTransform:bc,view:"century",children:gs(c,a,l)}))}var Ps=function(){return Ps=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ps.apply(this,arguments)},Fs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Os(e){var t=e.activeStartDate,n=e.hover,r=e.showNeighboringCentury,o=e.value,a=e.valueType,i=Fs(e,["activeStartDate","hover","showNeighboringCentury","value","valueType"]),l=dc(mc(t)),c=l+(r?119:99);return zl.exports.jsx(Bs,{className:"react-calendar__century-view__decades",dateTransform:bc,dateType:"decade",end:c,hover:n,renderTile:function(e){var n=e.date,r=Fs(e,["date"]);return zl.exports.jsx(_s,Ps({},i,r,{activeStartDate:t,currentCentury:l,date:n}),n.getTime())},start:l,step:10,value:o,valueType:a})}var As=function(){return As=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},As.apply(this,arguments)};function Ms(e){return zl.exports.jsx("div",{className:"react-calendar__century-view",children:zl.exports.jsx(Os,As({},e))})}var Rs=function(){return Rs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Rs.apply(this,arguments)},Ls=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},js="react-calendar__decade-view__years__year";function Vs(e){var t=e.classes,n=void 0===t?[]:t,r=e.currentDecade,o=e.formatYear,a=void 0===o?os:o,i=Ls(e,["classes","currentDecade","formatYear"]),l=i.date,c=i.locale,s=[];return n&&s.push.apply(s,n),js&&s.push(js),bc(l).getFullYear()!==r&&s.push("".concat(js,"--neighboringDecade")),zl.exports.jsx(zs,Rs({},i,{classes:s,maxDateTransform:Bc,minDateTransform:Sc,view:"decade",children:a(c,l)}))}var Ws=function(){return Ws=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ws.apply(this,arguments)},Hs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function qs(e){var t=e.activeStartDate,n=e.hover,r=e.showNeighboringDecade,o=e.value,a=e.valueType,i=Hs(e,["activeStartDate","hover","showNeighboringDecade","value","valueType"]),l=dc(bc(t)),c=l+(r?11:9);return zl.exports.jsx(Bs,{className:"react-calendar__decade-view__years",dateTransform:Sc,dateType:"year",end:c,hover:n,renderTile:function(e){var n=e.date,r=Hs(e,["date"]);return zl.exports.jsx(Vs,Ws({},i,r,{activeStartDate:t,currentDecade:l,date:n}),n.getTime())},start:l,value:o,valueType:a})}var Us=function(){return Us=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Us.apply(this,arguments)};function Qs(e){return zl.exports.jsx("div",{className:"react-calendar__decade-view",children:zl.exports.jsx(qs,Us({},e))})}var Ys=function(){return Ys=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ys.apply(this,arguments)},Gs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Zs=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Xs(e){var t=e.classes,n=void 0===t?[]:t,r=e.formatMonth,o=void 0===r?es:r,a=e.formatMonthYear,i=void 0===a?ts:a,l=Gs(e,["classes","formatMonth","formatMonthYear"]),c=l.date,s=l.locale;return zl.exports.jsx(zs,Ys({},l,{classes:Zs(Zs([],n,!0),["react-calendar__year-view__months__month"],!1),formatAbbr:i,maxDateTransform:Fc,minDateTransform:Dc,view:"year",children:o(s,c)}))}var Ks=function(){return Ks=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ks.apply(this,arguments)},Js=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function ed(e){var t=e.activeStartDate,n=e.hover,r=e.value,o=e.valueType,a=Js(e,["activeStartDate","hover","value","valueType"]),i=dc(t);return zl.exports.jsx(Bs,{className:"react-calendar__year-view__months",dateTransform:function(e){var t=new Date;return t.setFullYear(i,e,1),Dc(t)},dateType:"month",end:11,hover:n,renderTile:function(e){var n=e.date,r=Js(e,["date"]);return zl.exports.jsx(Xs,Ks({},a,r,{activeStartDate:t,date:n}),n.getTime())},start:0,value:r,valueType:o})}var td=function(){return td=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},td.apply(this,arguments)};function nd(e){return zl.exports.jsx("div",{className:"react-calendar__year-view",children:zl.exports.jsx(ed,td({},e))})}var rd=function(){return rd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rd.apply(this,arguments)},od=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},ad="react-calendar__month-view__days__day";function id(e){var t=e.calendarType,n=e.classes,r=void 0===n?[]:n,o=e.currentMonthIndex,a=e.formatDay,i=void 0===a?Kc:a,l=e.formatLongDate,c=void 0===l?Jc:l,s=od(e,["calendarType","classes","currentMonthIndex","formatDay","formatLongDate"]),d=s.date,p=s.locale,u=[];return r&&u.push.apply(u,r),ad&&u.push(ad),hs(d,t)&&u.push("".concat(ad,"--weekend")),d.getMonth()!==o&&u.push("".concat(ad,"--neighboringMonth")),zl.exports.jsx(zs,rd({},s,{classes:u,formatAbbr:c,maxDateTransform:jc,minDateTransform:Mc,view:"month",children:i(p,d)}))}var ld=function(){return ld=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ld.apply(this,arguments)},cd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function sd(e){var t=e.activeStartDate,n=e.calendarType,r=e.hover,o=e.showFixedNumberOfWeeks,a=e.showNeighboringMonth,i=e.value,l=e.valueType,c=cd(e,["activeStartDate","calendarType","hover","showFixedNumberOfWeeks","showNeighboringMonth","value","valueType"]),s=dc(t),d=pc(t),p=o||a,u=cs(t,n),m=p?0:u,f=1+(p?-u:0),g=function(){if(o)return f+42-1;var e=Wc(t);if(a){var r=new Date;return r.setFullYear(s,d,e),r.setHours(0,0,0,0),e+(7-cs(r,n)-1)}return e}();return zl.exports.jsx(Bs,{className:"react-calendar__month-view__days",count:7,dateTransform:function(e){var t=new Date;return t.setFullYear(s,d,e),Mc(t)},dateType:"day",hover:r,end:g,renderTile:function(e){var r=e.date,o=cd(e,["date"]);return zl.exports.jsx(id,ld({},c,o,{activeStartDate:t,calendarType:n,currentMonthIndex:d,date:r}),r.getTime())},offset:m,start:f,value:i,valueType:l})}var dd="react-calendar__month-view__weekdays",pd="".concat(dd,"__weekday");function ud(e){for(var t=e.calendarType,n=e.formatShortWeekday,r=void 0===n?ns:n,o=e.formatWeekday,a=void 0===o?rs:o,i=e.locale,l=e.onMouseLeave,c=Dc(new Date),s=dc(c),d=pc(c),p=[],u=1;u<=7;u+=1){var m=new Date(s,d,u-cs(c,t)),f=a(i,m);p.push(zl.exports.jsx("div",{className:Ll(pd,xs(m)&&"".concat(pd,"--current"),hs(m,t)&&"".concat(pd,"--weekend")),children:zl.exports.jsx("abbr",{"aria-label":f,title:f,children:r(i,m).replace(".","")})},u))}return zl.exports.jsx(ks,{className:dd,count:7,onFocus:l,onMouseOver:l,children:p})}var md=function(){return md=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},md.apply(this,arguments)},fd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},gd="react-calendar__tile";function xd(e){var t=e.onClickWeekNumber,n=e.weekNumber,r=zl.exports.jsx("span",{children:n});if(t){var o=e.date,a=e.onClickWeekNumber,i=e.weekNumber,l=fd(e,["date","onClickWeekNumber","weekNumber"]);return zl.exports.jsx("button",md({},l,{className:gd,onClick:function(e){return a(i,o,e)},type:"button",children:r}))}e.date,e.onClickWeekNumber,e.weekNumber;l=fd(e,["date","onClickWeekNumber","weekNumber"]);return zl.exports.jsx("div",md({},l,{className:gd,children:r}))}function hd(e){var t=e.activeStartDate,n=e.calendarType,r=e.onClickWeekNumber,o=e.onMouseLeave,a=e.showFixedNumberOfWeeks,i=function(){if(a)return 6;var e=Wc(t)-(7-cs(t,n));return 1+Math.ceil(e/7)}(),l=function(){for(var e=dc(t),r=pc(t),o=uc(t),a=[],l=0;l<i;l+=1)a.push(ss(new Date(e,r,o+7*l),n));return a}(),c=l.map(function(e){return function(e,t){void 0===t&&(t=Qc);var n,r=t===Hc?Hc:Qc,o=ss(e,t),a=dc(e)+1;do{n=ss(new Date(a,0,r===Qc?4:1),t),a-=1}while(e<n);return Math.round((o.getTime()-n.getTime())/6048e5)+1}(e,n)});return zl.exports.jsx(ks,{className:"react-calendar__month-view__weekNumbers",count:i,direction:"column",onFocus:o,onMouseOver:o,style:{flexBasis:"calc(100% * (1 / 8)",flexShrink:0},children:c.map(function(e,t){var n=l[t];if(!n)throw new Error("date is not defined");return zl.exports.jsx(xd,{date:n,onClickWeekNumber:r,weekNumber:e},e)})})}var yd=function(){return yd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yd.apply(this,arguments)},bd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function vd(e){var t=e.activeStartDate,n=e.locale,r=e.onMouseLeave,o=e.showFixedNumberOfWeeks,a=e.calendarType,i=void 0===a?function(e){if(e)for(var t=0,n=Object.entries(Yc);t<n.length;t++){var r=n[t],o=r[0];if(r[1].includes(e))return o}return Qc}(n):a,l=e.formatShortWeekday,c=e.formatWeekday,s=e.onClickWeekNumber,d=e.showWeekNumbers,p=bd(e,["calendarType","formatShortWeekday","formatWeekday","onClickWeekNumber","showWeekNumbers"]);var u="react-calendar__month-view";return zl.exports.jsx("div",{className:Ll(u,d?"".concat(u,"--weekNumbers"):""),children:zl.exports.jsxs("div",{style:{display:"flex",alignItems:"flex-end"},children:[d?zl.exports.jsx(hd,{activeStartDate:t,calendarType:i,onClickWeekNumber:s,onMouseLeave:r,showFixedNumberOfWeeks:o}):null,zl.exports.jsxs("div",{style:{flexGrow:1,width:"100%"},children:[zl.exports.jsx(ud,{calendarType:i,formatShortWeekday:l,formatWeekday:c,locale:n,onMouseLeave:r}),zl.exports.jsx(sd,yd({calendarType:i},p))]})]})})}var wd=function(){return wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},wd.apply(this,arguments)},Cd="react-calendar",kd=["century","decade","year","month"],Ed=["decade","year","month","day"],Sd=new Date;Sd.setFullYear(1,0,1),Sd.setHours(0,0,0,0);var Td=new Date(864e13);function $d(e){return e instanceof Date?e:new Date(e)}function Bd(e,t){return kd.slice(kd.indexOf(e),kd.indexOf(t)+1)}function zd(e,t,n){return e&&function(e,t,n){return-1!==Bd(t,n).indexOf(e)}(e,t,n)?e:n}function Id(e){var t=kd.indexOf(e);return Ed[t]}function Nd(e,t){var n=e.value,r=e.minDate,o=e.maxDate,a=e.maxDetail,i=function(e,t){var n=Array.isArray(e)?e[t]:e;if(!n)return null;var r=$d(n);if(Number.isNaN(r.getTime()))throw new Error("Invalid date: ".concat(e));return r}(n,t);if(!i)return null;var l=Id(a);return function(e,t,n){return t&&t>e?t:n&&n<e?n:e}(function(){switch(t){case 0:return ds(l,i);case 1:return us(l,i);default:throw new Error("Invalid index value: ".concat(t))}}(),r,o)}var Dd=function(e){return Nd(e,0)},_d=function(e){return Nd(e,1)},Pd=function(e){return[Dd,_d].map(function(t){return t(e)})};function Fd(e){var t=e.maxDate,n=e.maxDetail,r=e.minDate,o=e.minDetail,a=e.value;return ds(zd(e.view,o,n),Dd({value:a,minDate:r,maxDate:t,maxDetail:n})||new Date)}function Od(e){return e&&(!Array.isArray(e)||1===e.length)}function Ad(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var Md=n(function(e,t){var n,o=e.activeStartDate,i=e.allowPartialRange,l=e.calendarType,s=e.className,d=e.defaultActiveStartDate,p=e.defaultValue,u=e.defaultView,m=e.formatDay,f=e.formatLongDate,g=e.formatMonth,x=e.formatMonthYear,h=e.formatShortWeekday,y=e.formatWeekday,b=e.formatYear,v=e.goToRangeStartOnSelect,w=void 0===v||v,C=e.inputRef,k=e.locale,E=e.maxDate,S=void 0===E?Td:E,T=e.maxDetail,$=void 0===T?"month":T,B=e.minDate,z=void 0===B?Sd:B,I=e.minDetail,N=void 0===I?"century":I,D=e.navigationAriaLabel,_=e.navigationAriaLive,P=e.navigationLabel,F=e.next2AriaLabel,O=e.next2Label,A=e.nextAriaLabel,M=e.nextLabel,R=e.onActiveStartDateChange,L=e.onChange,j=e.onClickDay,V=e.onClickDecade,W=e.onClickMonth,H=e.onClickWeekNumber,q=e.onClickYear,U=e.onDrillDown,Q=e.onDrillUp,Y=e.onViewChange,G=e.prev2AriaLabel,Z=e.prev2Label,X=e.prevAriaLabel,K=e.prevLabel,J=e.returnValue,ee=void 0===J?"start":J,te=e.selectRange,ne=e.showDoubleView,re=e.showFixedNumberOfWeeks,oe=e.showNavigation,ae=void 0===oe||oe,ie=e.showNeighboringCentury,le=e.showNeighboringDecade,ce=e.showNeighboringMonth,se=void 0===ce||ce,de=e.showWeekNumbers,pe=e.tileClassName,ue=e.tileContent,me=e.tileDisabled,fe=e.value,ge=e.view,xe=c(d),he=xe[0],ye=xe[1],be=c(null),ve=be[0],we=be[1],Ce=c(Array.isArray(p)?p.map(function(e){return null!==e?$d(e):null}):null!=p?$d(p):null),ke=Ce[0],Ee=Ce[1],Se=c(u),Te=Se[0],$e=Se[1],Be=o||he||function(e){var t=e.activeStartDate,n=e.defaultActiveStartDate,r=e.defaultValue,o=e.defaultView,a=e.maxDate,i=e.maxDetail,l=e.minDate,c=e.minDetail,s=e.value,d=e.view,p=zd(d,c,i),u=t||n;return u?ds(p,u):Fd({maxDate:a,maxDetail:i,minDate:l,minDetail:c,value:s||r,view:d||o})}({activeStartDate:o,defaultActiveStartDate:d,defaultValue:p,defaultView:u,maxDate:S,maxDetail:$,minDate:z,minDetail:N,value:fe,view:ge}),ze=(n=te&&Od(ke)?ke:void 0!==fe?fe:ke)?Array.isArray(n)?n.map(function(e){return null!==e?$d(e):null}):null!==n?$d(n):null:null,Ie=Id($),Ne=zd(ge||Te,N,$),De=Bd(N,$),_e=te?ve:null,Pe=De.indexOf(Ne)<De.length-1,Fe=De.indexOf(Ne)>0,Oe=a(function(e){return function(){switch(ee){case"start":return Dd;case"end":return _d;case"range":return Pd;default:throw new Error("Invalid returnValue.")}}()({maxDate:S,maxDetail:$,minDate:z,value:e})},[S,$,z,ee]),Ae=a(function(e,t){ye(e);var n={action:t,activeStartDate:e,value:ze,view:Ne};R&&!Ad(Be,e)&&R(n)},[Be,R,ze,Ne]),Me=a(function(e,t){var n=function(){switch(Ne){case"century":return V;case"decade":return q;case"year":return W;case"month":return j;default:throw new Error("Invalid view: ".concat(Ne,"."))}}();n&&n(e,t)},[j,V,W,q,Ne]),Re=a(function(e,t){if(Pe){Me(e,t);var n=De[De.indexOf(Ne)+1];if(!n)throw new Error("Attempted to drill down from the lowest view.");ye(e),$e(n);var r={action:"drillDown",activeStartDate:e,value:ze,view:n};R&&!Ad(Be,e)&&R(r),Y&&Ne!==n&&Y(r),U&&U(r)}},[Be,Pe,R,Me,U,Y,ze,Ne,De]),Le=a(function(){if(Fe){var e=De[De.indexOf(Ne)-1];if(!e)throw new Error("Attempted to drill up from the highest view.");var t=ds(e,Be);ye(t),$e(e);var n={action:"drillUp",activeStartDate:t,value:ze,view:e};R&&!Ad(Be,t)&&R(n),Y&&Ne!==e&&Y(n),Q&&Q(n)}},[Be,Fe,R,Q,Y,ze,Ne,De]),je=a(function(e,t){var n=ze;Me(e,t);var r,o=te&&!Od(n);if(te)if(o)r=ds(Ie,e);else{if(!n)throw new Error("previousValue is required");if(Array.isArray(n))throw new Error("previousValue must not be an array");r=function(e,t,n){var r=[t,n].sort(function(e,t){return e.getTime()-t.getTime()});return[ds(e,r[0]),us(e,r[1])]}(Ie,n,e)}else r=Oe(e);var a=!te||o||w?Fd({maxDate:S,maxDetail:$,minDate:z,minDetail:N,value:r,view:Ne}):null;t.persist(),ye(a),Ee(r);var l={action:"onChange",activeStartDate:a,value:r,view:Ne};if(R&&!Ad(Be,a)&&R(l),L)if(te)if(Od(r)){if(i){if(Array.isArray(r))throw new Error("value must not be an array");L([r||null,null],t)}}else L(r||null,t);else L(r||null,t)},[Be,i,Oe,w,S,$,z,N,R,L,Me,te,ze,Ie,Ne]);function Ve(e){we(e)}function We(){we(null)}function He(e){var t={activeStartDate:e?ps(Ne,Be):ds(Ne,Be),hover:_e,locale:k,maxDate:S,minDate:z,onClick:Pe?Re:je,onMouseOver:te?Ve:void 0,tileClassName:pe,tileContent:ue,tileDisabled:me,value:ze,valueType:Ie};switch(Ne){case"century":return zl.exports.jsx(Ms,wd({formatYear:b,showNeighboringCentury:ie},t));case"decade":return zl.exports.jsx(Qs,wd({formatYear:b,showNeighboringDecade:le},t));case"year":return zl.exports.jsx(nd,wd({formatMonth:g,formatMonthYear:x},t));case"month":return zl.exports.jsx(vd,wd({calendarType:l,formatDay:m,formatLongDate:f,formatShortWeekday:h,formatWeekday:y,onClickWeekNumber:H,onMouseLeave:te?We:void 0,showFixedNumberOfWeeks:void 0!==re?re:ne,showNeighboringMonth:se,showWeekNumbers:de},t));default:throw new Error("Invalid view: ".concat(Ne,"."))}}r(t,function(){return{activeStartDate:Be,drillDown:Re,drillUp:Le,onChange:je,setActiveStartDate:Ae,value:ze,view:Ne}},[Be,Re,Le,je,Ae,ze,Ne]);var qe=Array.isArray(ze)?ze:[ze];return zl.exports.jsxs("div",{className:Ll(Cd,te&&1===qe.length&&"".concat(Cd,"--selectRange"),ne&&"".concat(Cd,"--doubleView"),s),ref:C,children:[ae?zl.exports.jsx(bs,{activeStartDate:Be,drillUp:Le,formatMonthYear:x,formatYear:b,locale:k,maxDate:S,minDate:z,navigationAriaLabel:D,navigationAriaLive:_,navigationLabel:P,next2AriaLabel:F,next2Label:O,nextAriaLabel:A,nextLabel:M,prev2AriaLabel:G,prev2Label:Z,prevAriaLabel:X,prevLabel:K,setActiveStartDate:Ae,showDoubleView:ne,view:Ne,views:De}):null,zl.exports.jsxs("div",{className:"".concat(Cd,"__viewContainer"),onBlur:te?We:void 0,onMouseLeave:te?We:void 0,children:[He(),ne?He(!0):null]})]})}),Rd=Md;q(".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");q(".custom-date-picker {\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.date-display {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n cursor: pointer;\r\n}\r\n\r\n.date-display span {\r\n color: black;\r\n}\r\n\r\n.date-display svg {\r\n width: 20px;\r\n height: 20px;\r\n color: rgb(73, 69, 69);\r\n}\r\n\r\n.calendar-container {\r\n position: absolute;\r\n bottom: 100%;\r\n left: -10%;\r\n z-index: 10;\r\n margin-top: 10px;\r\n}\r\n\r\n.custom-calendar {\r\n background-color: white;\r\n border-radius: 6px;\r\n box-shadow: 0 4px 6px rgba(10, 8, 8, 0.1);\r\n border: 1px solid darken(#674918, 50%);\r\n}\r\n");const Ld=h(Rd)`
|
|
1804
1804
|
.react-calendar {
|
|
1805
1805
|
font-family: Arial, sans-serif;
|
|
1806
1806
|
color: ${e=>e.tileTextColor||"#374151"} !important;
|
|
@@ -2201,7 +2201,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2201
2201
|
left: 150%;
|
|
2202
2202
|
}
|
|
2203
2203
|
}
|
|
2204
|
-
`,zp=({loyaltyIcon:e,pointsRewardRate:n=0,brandTokenName:r,themeColor:o,themeTextColor:a,rewardMultiplier:i})=>{const l=dn(mn),c=.01*n*zn(l?.items_subtotal_price,l?.currency),s="number"==typeof i&&i>0?c*i:c;return n<=0?null:t.createElement(Bp,{$themeColor:o,$themeTextColor:a},"Get"," ",e&&t.createElement("img",{src:e,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}),Number(s.toFixed(0))," ",r??"points"," ",t.createElement("div",{className:"shine-container"},t.createElement("div",{className:"shine-element"})))},Ip=({backgroundSubdued:e,themeColor:n,themeTextColor:r,primaryTextColor:a,cartComponentsCornerRadius:i,applyCouponCode:s,removeDiscount:d,enableConfetti:p})=>{const u=dn(mn),[m,f]=c(""),[g,x]=c(null),[h,y]=c(!1),[b,v]=c(!1),[w,C]=c(!1),{setLoading:k}=kn(),[E,S]=c(null),[T,$]=c(!1),[B,z]=c(!1),I=o(null);l(()=>{if(E){$(!0);const e=setTimeout(()=>{$(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}$(!1)},[E]),l(()=>{if(u&&u.discount_codes&&g){const e=u.discount_codes.find(e=>e.code===g);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(z(!0),setTimeout(()=>z(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),x(null))}},[u,g]);const N=async()=>{if(s&&m&&!h){S(null),y(!0),x(m);try{await s(m),f("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),x(null)}finally{y(!1)}}},D=async()=>{if(d&&!w){S(null),C(!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),C(!1)}}},_="error"===E?.type,P=u?.discount_codes?.filter(e=>!1!==e?.applicable);return t.createElement("div",{ref:I,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},B&&p&&t.createElement(oo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),t.createElement("div",{style:{display:"flex",alignItems:"stretch",border:_?"0.5px solid #FF4E4E":b?`1px solid ${n||"#007bff"}`:"1px solid #e0e0e0",borderRadius:i??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},t.createElement("input",{type:"text",placeholder:"Have a Coupon Code?",value:m,disabled:h,onFocus:()=>{v(!0),setTimeout(()=>{I.current&&window.innerWidth<=768&&I.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>v(!1),onChange:e=>{f(e.target.value),E&&S(null)},onKeyDown:e=>{"Enter"===e.key&&N()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:i??4,borderBottomLeftRadius:i??4,backgroundColor:e,color:a,boxShadow:"none",cursor:h?"not-allowed":"auto",margin:"0"}}),t.createElement("button",{onClick:N,disabled:!m||h,style:{padding:"10px 15px",border:"none",backgroundColor:_?"#D98181":m?n||"#007bff":"#cccccc",color:m||_?r||"#ffffff":"#666666",cursor:!m||h?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:i??4,borderBottomRightRadius:i??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:h?.7:1}},h?t.createElement(da,{color:r||"#ffffff",size:18}):"Apply")),E&&t.createElement("div",{style:{color:"success"===E.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:T?1:0,transform:T?"translateY(0)":"translateY(-10px)",maxHeight:T?"50px":"0",overflow:"hidden"}},E.message),P&&P.length>0&&t.createElement("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},P.map(r=>t.createElement("div",{key:r.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},t.createElement("div",{style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:e,paddingInlineStart:"6px",gap:"4px"}},t.createElement(
|
|
2204
|
+
`,zp=({loyaltyIcon:e,pointsRewardRate:n=0,brandTokenName:r,themeColor:o,themeTextColor:a,rewardMultiplier:i})=>{const l=dn(mn),c=.01*n*zn(l?.items_subtotal_price,l?.currency),s="number"==typeof i&&i>0?c*i:c;return n<=0?null:t.createElement(Bp,{$themeColor:o,$themeTextColor:a},"Get"," ",e&&t.createElement("img",{src:e,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}),Number(s.toFixed(0))," ",r??"points"," ",t.createElement("div",{className:"shine-container"},t.createElement("div",{className:"shine-element"})))},Ip=({backgroundSubdued:e,themeColor:n,themeTextColor:r,primaryTextColor:a,cartComponentsCornerRadius:i,applyCouponCode:s,removeDiscount:d,enableConfetti:p})=>{const u=dn(mn),[m,f]=c(""),[g,x]=c(null),[h,y]=c(!1),[b,v]=c(!1),[w,C]=c(!1),{setLoading:k}=kn(),[E,S]=c(null),[T,$]=c(!1),[B,z]=c(!1),I=o(null);l(()=>{if(E){$(!0);const e=setTimeout(()=>{$(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}$(!1)},[E]),l(()=>{if(u&&u.discount_codes&&g){const e=u.discount_codes.find(e=>e.code===g);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(z(!0),setTimeout(()=>z(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),x(null))}},[u,g]);const N=async()=>{if(s&&m&&!h){S(null),y(!0),x(m);try{await s(m),f("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),x(null)}finally{y(!1)}}},D=async()=>{if(d&&!w){S(null),C(!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),C(!1)}}},_="error"===E?.type,P=u?.discount_codes?.filter(e=>!1!==e?.applicable);return t.createElement("div",{ref:I,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},B&&p&&t.createElement(oo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),t.createElement("div",{style:{display:"flex",alignItems:"stretch",border:_?"0.5px solid #FF4E4E":b?`1px solid ${n||"#007bff"}`:"1px solid #e0e0e0",borderRadius:i??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},t.createElement("input",{type:"text",placeholder:"Have a Coupon Code?",value:m,disabled:h,onFocus:()=>{v(!0),setTimeout(()=>{I.current&&window.innerWidth<=768&&I.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>v(!1),onChange:e=>{f(e.target.value),E&&S(null)},onKeyDown:e=>{"Enter"===e.key&&N()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:i??4,borderBottomLeftRadius:i??4,backgroundColor:e,color:a,boxShadow:"none",cursor:h?"not-allowed":"auto",margin:"0"}}),t.createElement("button",{onClick:N,disabled:!m||h,style:{padding:"10px 15px",border:"none",backgroundColor:_?"#D98181":m?n||"#007bff":"#cccccc",color:m||_?r||"#ffffff":"#666666",cursor:!m||h?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:i??4,borderBottomRightRadius:i??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:h?.7:1}},h?t.createElement(da,{color:r||"#ffffff",size:18}):"Apply")),E&&t.createElement("div",{style:{color:"success"===E.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:T?1:0,transform:T?"translateY(0)":"translateY(-10px)",maxHeight:T?"50px":"0",overflow:"hidden"}},E.message),P&&P.length>0&&t.createElement("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},P.map(r=>t.createElement("div",{key:r.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},t.createElement("div",{style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:e,paddingInlineStart:"6px",gap:"4px"}},t.createElement(Oo,{size:12,color:"#4D4D4D"}),t.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},r.code)," applied!",t.createElement("button",{onClick:D,disabled:w,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},w?t.createElement(da,{color:n||"#007bff",size:14}):t.createElement(hr,{size:16})))))))},Np=h.div`
|
|
2205
2205
|
line-height: normal;
|
|
2206
2206
|
position: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"relative":"fixed"};
|
|
2207
2207
|
top: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"auto":"0"};
|
|
@@ -2236,9 +2236,9 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2236
2236
|
font-weight: 400;
|
|
2237
2237
|
min-width: 14px;
|
|
2238
2238
|
line-height: 14px;
|
|
2239
|
-
`,_p=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:x,handleIncrement:h,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,rewardMultiplier:T,redemptionMultiplier:$,discountApplied:B,removeDiscount:z,applyDiscount:I,checkoutFunction:N,joinNowFunction:D,guestLoyaltyPercentage:_,isDev:P,recProductsList:O,showMultiStepProgressBar:F,cartCheckpoints:A,redemptionRate:M,pointsRewardRate:R,showCartLevelAltPay:L,exploreCtaRedirectLink:j,discountAmountApplied:V,minimumCartValue:W,discountInCheckoutButton:H,isStickyCheckout:q,handleCheckpointCrossed:U,customCartProgressBarCriteria:Q,checkoutButtonColor:Y="#252E69",ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,productRecsCtaButtonText:J,productRecsTitleText:ee,emptyProductRecsTitleText:te,showProductRecsOnDesktop:ne,showProductRecsOnMobile:re,themeColor:oe,themeTextColor:ae,companyName:ie,gstNumber:le,showGSTOption:ce,applyGSTToCart:se,showMOVForProgressTiers:de,freeProduct:pe,showLoyaltyCta:ue=!1,freeProductAdjustedCartTotal:me,minimumOrderValueToAvailDiscount:fe,signinCTAButtonVisible:ge,cartSigninCTAMainText:xe,applyNoteToCart:he,note:ye,showNoteOption:be,inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,cartOfferTermsAndConditionsText:Ce,showEditOptionOnProducts:ke,onSetLoading:Ee,showVariantSelectionDropdownInProductRecs:Se,originalCartSubtotal:Te,freebieProductsInCart:$e,showFreebieClaim:Be,addFreebieToCart:ze,freebiesInCart:Ie,effectiveQuantityForProgressBar:Ne,productPercentageOffMapping:De,removeFreebieFromCart:_e,postalCodeList:Pe,enableGeoLocationDeliveryRestriction:Oe=!1,getProductDetailsByVariantId:Fe,applyPostalCodeAndDeliverySlotToCart:Ae,showDeleteOnFreebies:Me,freebieCouponTemplates:Re,freebieFlowCheckpoints:Le,freebieClaimData:je,postalCodeBasedItemTrackingParameter:Ve,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,giftWrapSetupData:Qe,giftWrapProductDetail:Ye,progressBarFreeProductIconType:Ge,enableCustomCartOnCartPage:Ze,isCartPage:Xe,showCartTimer:Ke,showFreebieMilestone:Je,freebieMilestoneData:et,cartTimerInMinutes:tt,cartTimerCustomText:nt,productRecsCardLayout:rt,productRecsCardListVariant:ot,imageAspectSelector:at,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,cartOffersCarousalData:ct,gstSectionCustomizationData:pt,noteSectionTitle:ut,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,showVariantSelectionDropdownInProductClaim:gt,loyaltyDiscount:ht,brandTokenName:bt,showDiscountOnMRP:vt,switchWidthVariant:wt,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,toggleDecimal:St,cartOffersCarouselHeight:Tt,disableCheckoutButton:$t,showEmptyCartRecommendations:Bt=!1,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,applyCouponCode:Nt,showApplyCoupon:Dt,enableConfetti:_t,checkoutSectionMessageRedirectLink:Pt,showCheckoutButtonPaymentIcons:Ot})=>{const Ft=dn(mn),At=dn(Cn),[Mt,Rt]=c(!1),[Lt,jt]=c(!1),[Vt,Wt]=c(!0),{setLoading:Ht}=kn();t.useEffect(()=>{Ee&&Ee(Ht)},[Ee]);const qt=o(!1);l(()=>{const t=()=>{n(!1)};return e?(qt.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),qt.current=!0):(qt.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),qt.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[Ut,Qt]=c(!1);l(()=>{const t=document.querySelector("body");if(t)return Ze&&Xe?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(Ut?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))},[e,Ze,Xe,Ut]),l(()=>{function e(){const e=window.innerWidth;Qt(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const Yt=Ft?.items?.reduce((e,t)=>e+t?.quantity,0);l(()=>{const e=()=>{Rt(!0),window.setTimeout(()=>Rt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[Gt,Zt]=c("normal"),[Xt,Kt]=c("normal"),[Jt,en]=c("auto");l(()=>{CSS.supports("font-weight","500")?Zt("500"):CSS.supports("font-weight","400")?Zt("400"):CSS.supports("font-weight","600")&&Zt("600"),CSS.supports("font-weight","400")?Kt("400"):CSS.supports("font-weight","300")?Kt("300"):CSS.supports("font-weight","200")&&Kt("200"),CSS.supports("width","-webkit-fill-available")?en("-webkit-fill-available"):CSS.supports("width","-moz-available")&&en("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",Gt),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Xt),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Jt)},[Gt,Xt]);const[tn]=un(yn),[nn]=un(wn),[rn]=un(vn);l(()=>{Wt(!("all-products"!==Ve&&("specific-tags"!==Ve||tn.isPostalCodeValid||We)&&("specific-tags"!==Ve||tn.isPostalCodeValid||nn||!We)&&("specific-tags"===Ve&&"standard"===rn||Lt&&(We?tn.isPostalCodeValid&&nn:tn.isPostalCodeValid))))},[tn.isPostalCodeValid,nn,Lt,Ve,We]),un(En);const[on,an]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&an(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&an(!1)},[]);const ln=new Date("2024-11-01");return zn(Ft?.items_subtotal_price,Ft?.currency),t.createElement(Np,{className:"yt-cart-drawer",$isDev:P,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:Ze,$isCartPage:Xe,$isLargeScreen:Ut,$switchWidthVariant:wt},At.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},At.showLoader&&!At.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:X,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ft?.item_count>0&&L&&!(ue&&L)&&R>0&&t.createElement(zp,{pointsRewardRate:R,loyaltyIcon:E,brandTokenName:bt,themeColor:oe,themeTextColor:ae,rewardMultiplier:T}),Yt>0&&t.createElement(Dp,{$backgroundSubdued:a},Yt)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(Ze&&Xe)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(yt,{style:{height:"auto",width:"auto",color:X},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),At&&t.createElement(Sp,{$themeColor:oe,show:At.showLoader}),ct?.enableCartOffersCarousel&&t.createElement(wp,{themeColor:oe,cartOffersCarousalData:ct,cartOffersCarouselHeight:Tt,cartData:Ft}),Ke&&on&&Ft?.item_count?t.createElement(ep,{minutes:tt,customText:nt,onTimerComplete:()=>{an(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Mt&&_t&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3}}),ve?t.createElement(Bl,{inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,themeColor:oe,tooltipText:Ce,themeTextColor:ae}):null),F&&Ft?.items_subtotal_price>0&&Ft?.currency&&!!A&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return a.filter(e=>0!==e?.[Xr(r)]&&("minimum_order_value"!==r||1!==e?.[Xr(r)])).some((e,i)=>Kr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(A,zn(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),void 0===Ne?Ft?.item_count:Ne,Q??"minimum_order_value",Ft?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Oo,{customCartProgressBarCriteria:Q??"minimum_order_value",handleCheckpointCrossed:U,checkpoints:A,effectiveQuantityForProgressBar:void 0===Ne?Ft?.item_count:Ne,currentCartAmount:zn(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),themeColor:oe,themeTextColor:ae,primaryTextColor:X,secondaryTextColor:K,showMOVForProgressTiers:de,progressBarFreeProductIconType:Ge,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,enableConfetti:_t})),Ft?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ft?.items?.length&&0===Ft?.item_count&&!1===At?.showSkeletonLoader?t.createElement(jo,{showLoyaltyCta:ue,joinNowFunction:D,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:j,themeColor:oe,emptyCartButtons:g,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,themeTextColor:ae,recProductsList:O,addCartItem:b,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,emptyProductRecsTitleText:te,backgroundSubdued:a,showEmptyCartRecommendations:Bt,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ai,{isDev:P,themeColor:oe,handleDecrement:y,handleIncrement:h,removeCartItem:x,addCartItem:b,primaryTextColor:X,secondaryTextColor:K,freeProduct:pe,themeTextColor:ae,showEditOptionOnProducts:ke,productPercentageOffMapping:De,removeFreebieFromCart:_e,showDeleteOnFreebies:Me,freebieCouponTemplates:Re??[],freebieProductsInCart:$e,freebieFlowCheckpoints:Le??[],cartCheckpoints:A,freeProductAdjustedCartTotal:me,imageAspectSelector:at,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,giftWrapVariantId:Ye?.variants?.nodes[0]?.id,giftWrapProductId:Qe?.giftProductId,showGiftWrapAsLineItem:Qe?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s,backgroundColor:r,showDiscountOnMRP:vt,checkoutSectionMessage:mt,checkoutSectionMessageRedirectLink:Pt,showFreebieMilestone:Je,freebieMilestoneData:et}),Ut&&ne&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:s}),!Ut&&re&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s})),t.createElement(ra,null,Ft?.item_count>0&&w&&C&&t.createElement(li,{bundleProducts:C}),ce&&!!se&&Ft?.item_count>0&&t.createElement(vi,{companyName:ie,gstNumber:le,themeColor:oe,iconColor:pt?.iconColor,showIcon:pt?.showIcon,backgroundColor:pt?.backgroundColor,textColor:pt?.textColor,title:pt?.title}),!!Ft&&Ft?.item_count>0&&!!ze&&!!$e&&!!Ie&&$e.length>0&&t.createElement($l,{freebieProductsInCart:$e,themeColor:oe,themeTextColor:ae,primaryTextColor:X,addFreebieToCart:ze,freebiesInCart:Ie,imageAspectSelector:at,freebieCouponTemplates:Re,freebieClaimData:je,cartCheckpoints:A,isCartDrawerOpen:e}),Oe&&(Pe?.length??0)>0&&!!Ae&&Ft?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>Wt(!Vt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(xt,null)),t.createElement("div",{className:"icon-transition"},Vt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Ve&&Vt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):Vt&&(Lt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):t.createElement(Wd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,disabledDates:ln}))),be&&!!he&&Ft?.item_count>0&&t.createElement(wi,{note:ye,noteSectionTitle:ut}),Qe?.showGiftWrapOption&&Ft?.item_count>0&&t.createElement(Xd,{themeColor:oe,id:Qe?.giftProductId,detail:Ye,showPrice:Qe?.showPrice,errorText:Qe?.errorText,customText:Qe?.customText,showGiftIcon:Qe?.showGiftIcon,addCartItem:b,removeCartItem:x}),Ft?.item_count>0&&Dt&&!ue&&Nt&&t.createElement(Ip,{backgroundSubdued:a,themeColor:oe,themeTextColor:ae,primaryTextColor:X,cartComponentsCornerRadius:lt,applyCouponCode:Nt,removeDiscount:z,enableConfetti:_t}),Ft?.item_count>0&&t.createElement(t.Fragment,null,v||!ue||ht?!ht&&void 0!==k&&void 0!==S&&!!E&&ue&&!!I&&t.createElement(va,{themeColor:oe,applyDiscount:I,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,minimumOrderValueToAvailDiscount:fe,brandTokenName:bt,showCartLevelAltPay:L,redemptionMultiplier:$}):!!_&&!!D&&t.createElement(ta,{cartSigninCTAMainText:xe,signinCTAButtonVisible:ge,themeColor:oe,joinNowFunction:D,guestLoyaltyPercentage:_,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,showCartLevelAltPay:L})),Ft?.item_count>0&&!!ht&&!!z&&ue&&ht&&void 0!==S&&t.createElement(xa,{themeColor:oe,removeDiscount:z,loyaltyDiscount:ht,isDev:P,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,pointsToBeUsed:S,brandTokenName:bt,showCartLevelAltPay:L}),ue&&L&&M&&E&&Ft?.item_count>0&&t.createElement($p,{loyaltyIcon:E,backgroundSubdued:a,primaryTextColor:X,pointsRewardRate:R,rewardMultiplier:T}),ue&&Ft&&Ft.item_count>0&&!!fe&&fe>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:oe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ge?"space-between":"center"}},"Minimum order value to use ",bt,":"," ",fe),Ft&&N&&Ft?.item_count>0&&t.createElement("div",null,t.createElement(Zo,{disableCheckoutButton:!!$t||At.cartLoading,discountApplied:B,checkoutFunction:N,checkoutButtonColor:Y,checkoutFontSize:p,discountInCheckoutButton:H,isStickyCheckout:q,discountAmountApplied:V,minimumCartValue:W,themeTextColor:ae,applyGSTToCart:se,showGSTOption:ce,applyNoteToCart:he,showNoteOption:be,enableGeoLocationDeliveryRestriction:Oe,applyPostalCodeAndDeliverySlotToCart:Ae,enableSlotPicker:We,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,checkoutSectionMessageRedirectLink:Pt,showDiscountOnMRP:vt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:A,toggleDecimal:St,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:X}))))))},Pp=h.div`
|
|
2239
|
+
`,_p=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:x,handleIncrement:h,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,rewardMultiplier:T,redemptionMultiplier:$,discountApplied:B,removeDiscount:z,applyDiscount:I,checkoutFunction:N,joinNowFunction:D,guestLoyaltyPercentage:_,isDev:P,recProductsList:F,showMultiStepProgressBar:O,cartCheckpoints:A,redemptionRate:M,pointsRewardRate:R,showCartLevelAltPay:L,exploreCtaRedirectLink:j,discountAmountApplied:V,minimumCartValue:W,discountInCheckoutButton:H,isStickyCheckout:q,handleCheckpointCrossed:U,customCartProgressBarCriteria:Q,checkoutButtonColor:Y="#252E69",ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,productRecsCtaButtonText:J,productRecsTitleText:ee,emptyProductRecsTitleText:te,showProductRecsOnDesktop:ne,showProductRecsOnMobile:re,themeColor:oe,themeTextColor:ae,companyName:ie,gstNumber:le,showGSTOption:ce,applyGSTToCart:se,showMOVForProgressTiers:de,freeProduct:pe,showLoyaltyCta:ue=!1,freeProductAdjustedCartTotal:me,minimumOrderValueToAvailDiscount:fe,signinCTAButtonVisible:ge,cartSigninCTAMainText:xe,applyNoteToCart:he,note:ye,showNoteOption:be,inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,cartOfferTermsAndConditionsText:Ce,showEditOptionOnProducts:ke,onSetLoading:Ee,showVariantSelectionDropdownInProductRecs:Se,originalCartSubtotal:Te,freebieProductsInCart:$e,showFreebieClaim:Be,addFreebieToCart:ze,freebiesInCart:Ie,effectiveQuantityForProgressBar:Ne,productPercentageOffMapping:De,removeFreebieFromCart:_e,postalCodeList:Pe,enableGeoLocationDeliveryRestriction:Fe=!1,getProductDetailsByVariantId:Oe,applyPostalCodeAndDeliverySlotToCart:Ae,showDeleteOnFreebies:Me,freebieCouponTemplates:Re,freebieFlowCheckpoints:Le,freebieClaimData:je,postalCodeBasedItemTrackingParameter:Ve,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,giftWrapSetupData:Qe,giftWrapProductDetail:Ye,progressBarFreeProductIconType:Ge,enableCustomCartOnCartPage:Ze,isCartPage:Xe,showCartTimer:Ke,showFreebieMilestone:Je,freebieMilestoneData:et,cartTimerInMinutes:tt,cartTimerCustomText:nt,productRecsCardLayout:rt,productRecsCardListVariant:ot,imageAspectSelector:at,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,cartOffersCarousalData:ct,gstSectionCustomizationData:pt,noteSectionTitle:ut,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,showVariantSelectionDropdownInProductClaim:gt,loyaltyDiscount:ht,brandTokenName:bt,showDiscountOnMRP:vt,switchWidthVariant:wt,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,toggleDecimal:St,cartOffersCarouselHeight:Tt,disableCheckoutButton:$t,showEmptyCartRecommendations:Bt=!1,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,applyCouponCode:Nt,showApplyCoupon:Dt,enableConfetti:_t,checkoutSectionMessageRedirectLink:Pt,showCheckoutButtonPaymentIcons:Ft})=>{const Ot=dn(mn),At=dn(Cn),[Mt,Rt]=c(!1),[Lt,jt]=c(!1),[Vt,Wt]=c(!0),{setLoading:Ht}=kn();t.useEffect(()=>{Ee&&Ee(Ht)},[Ee]);const qt=o(!1);l(()=>{const t=()=>{n(!1)};return e?(qt.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),qt.current=!0):(qt.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),qt.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[Ut,Qt]=c(!1);l(()=>{const t=document.querySelector("body");if(t)return Ze&&Xe?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(Ut?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))},[e,Ze,Xe,Ut]),l(()=>{function e(){const e=window.innerWidth;Qt(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const Yt=Ot?.items?.reduce((e,t)=>e+t?.quantity,0);l(()=>{const e=()=>{Rt(!0),window.setTimeout(()=>Rt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[Gt,Zt]=c("normal"),[Xt,Kt]=c("normal"),[Jt,en]=c("auto");l(()=>{CSS.supports("font-weight","500")?Zt("500"):CSS.supports("font-weight","400")?Zt("400"):CSS.supports("font-weight","600")&&Zt("600"),CSS.supports("font-weight","400")?Kt("400"):CSS.supports("font-weight","300")?Kt("300"):CSS.supports("font-weight","200")&&Kt("200"),CSS.supports("width","-webkit-fill-available")?en("-webkit-fill-available"):CSS.supports("width","-moz-available")&&en("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",Gt),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Xt),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Jt)},[Gt,Xt]);const[tn]=un(yn),[nn]=un(wn),[rn]=un(vn);l(()=>{Wt(!("all-products"!==Ve&&("specific-tags"!==Ve||tn.isPostalCodeValid||We)&&("specific-tags"!==Ve||tn.isPostalCodeValid||nn||!We)&&("specific-tags"===Ve&&"standard"===rn||Lt&&(We?tn.isPostalCodeValid&&nn:tn.isPostalCodeValid))))},[tn.isPostalCodeValid,nn,Lt,Ve,We]),un(En);const[on,an]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&an(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&an(!1)},[]);const ln=new Date("2024-11-01");return zn(Ot?.items_subtotal_price,Ot?.currency),t.createElement(Np,{className:"yt-cart-drawer",$isDev:P,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:Ze,$isCartPage:Xe,$isLargeScreen:Ut,$switchWidthVariant:wt},At.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},At.showLoader&&!At.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:X,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ot?.item_count>0&&L&&!(ue&&L)&&R>0&&t.createElement(zp,{pointsRewardRate:R,loyaltyIcon:E,brandTokenName:bt,themeColor:oe,themeTextColor:ae,rewardMultiplier:T}),Yt>0&&t.createElement(Dp,{$backgroundSubdued:a},Yt)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(Ze&&Xe)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(yt,{style:{height:"auto",width:"auto",color:X},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),At&&t.createElement(Sp,{$themeColor:oe,show:At.showLoader}),ct?.enableCartOffersCarousel&&t.createElement(wp,{themeColor:oe,cartOffersCarousalData:ct,cartOffersCarouselHeight:Tt,cartData:Ot}),Ke&&on&&Ot?.item_count?t.createElement(ep,{minutes:tt,customText:nt,onTimerComplete:()=>{an(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Mt&&_t&&t.createElement(oo,{particleCount:50,spread:90,origin:{y:.3}}),ve?t.createElement(Bl,{inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,themeColor:oe,tooltipText:Ce,themeTextColor:ae}):null),O&&Ot?.items_subtotal_price>0&&Ot?.currency&&!!A&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return a.filter(e=>0!==e?.[Xr(r)]&&("minimum_order_value"!==r||1!==e?.[Xr(r)])).some((e,i)=>Kr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(A,zn(void 0!==Te?Te:Ot?.items_subtotal_price,Ot.currency),void 0===Ne?Ot?.item_count:Ne,Q??"minimum_order_value",Ot?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Fo,{customCartProgressBarCriteria:Q??"minimum_order_value",handleCheckpointCrossed:U,checkpoints:A,effectiveQuantityForProgressBar:void 0===Ne?Ot?.item_count:Ne,currentCartAmount:zn(void 0!==Te?Te:Ot?.items_subtotal_price,Ot.currency),themeColor:oe,themeTextColor:ae,primaryTextColor:X,secondaryTextColor:K,showMOVForProgressTiers:de,progressBarFreeProductIconType:Ge,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,prefixMessageText:Ct,suffixMessageText:kt,successMessageText:Et,enableConfetti:_t})),Ot?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ot?.items?.length&&0===Ot?.item_count&&!1===At?.showSkeletonLoader?t.createElement(jo,{showLoyaltyCta:ue,joinNowFunction:D,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:j,themeColor:oe,emptyCartButtons:g,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,themeTextColor:ae,recProductsList:F,addCartItem:b,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,emptyProductRecsTitleText:te,backgroundSubdued:a,showEmptyCartRecommendations:Bt,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(ai,{isDev:P,themeColor:oe,handleDecrement:y,handleIncrement:h,removeCartItem:x,addCartItem:b,primaryTextColor:X,secondaryTextColor:K,freeProduct:pe,themeTextColor:ae,showEditOptionOnProducts:ke,productPercentageOffMapping:De,removeFreebieFromCart:_e,showDeleteOnFreebies:Me,freebieCouponTemplates:Re??[],freebieProductsInCart:$e,freebieFlowCheckpoints:Le??[],cartCheckpoints:A,freeProductAdjustedCartTotal:me,imageAspectSelector:at,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,giftWrapVariantId:Ye?.variants?.nodes[0]?.id,giftWrapProductId:Qe?.giftProductId,showGiftWrapAsLineItem:Qe?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s,backgroundColor:r,showDiscountOnMRP:vt,checkoutSectionMessage:mt,checkoutSectionMessageRedirectLink:Pt,showFreebieMilestone:Je,freebieMilestoneData:et}),Ut&&ne&&!!F&&F?.length>0&&Ot?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:F,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:s}),!Ut&&re&&!!F&&F?.length>0&&Ot?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:F,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s})),t.createElement(ra,null,Ot?.item_count>0&&w&&C&&t.createElement(li,{bundleProducts:C}),ce&&!!se&&Ot?.item_count>0&&t.createElement(vi,{companyName:ie,gstNumber:le,themeColor:oe,iconColor:pt?.iconColor,showIcon:pt?.showIcon,backgroundColor:pt?.backgroundColor,textColor:pt?.textColor,title:pt?.title}),!!Ot&&Ot?.item_count>0&&!!ze&&!!$e&&!!Ie&&$e.length>0&&t.createElement($l,{freebieProductsInCart:$e,themeColor:oe,themeTextColor:ae,primaryTextColor:X,addFreebieToCart:ze,freebiesInCart:Ie,imageAspectSelector:at,freebieCouponTemplates:Re,freebieClaimData:je,cartCheckpoints:A,isCartDrawerOpen:e}),Fe&&(Pe?.length??0)>0&&!!Ae&&Ot?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>Wt(!Vt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(xt,null)),t.createElement("div",{className:"icon-transition"},Vt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Ve&&Vt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):Vt&&(Lt?t.createElement(Vd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:ln}):t.createElement(Wd,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,disabledDates:ln}))),be&&!!he&&Ot?.item_count>0&&t.createElement(wi,{note:ye,noteSectionTitle:ut}),Qe?.showGiftWrapOption&&Ot?.item_count>0&&t.createElement(Xd,{themeColor:oe,id:Qe?.giftProductId,detail:Ye,showPrice:Qe?.showPrice,errorText:Qe?.errorText,customText:Qe?.customText,showGiftIcon:Qe?.showGiftIcon,addCartItem:b,removeCartItem:x}),Ot?.item_count>0&&Dt&&!ue&&Nt&&t.createElement(Ip,{backgroundSubdued:a,themeColor:oe,themeTextColor:ae,primaryTextColor:X,cartComponentsCornerRadius:lt,applyCouponCode:Nt,removeDiscount:z,enableConfetti:_t}),Ot?.item_count>0&&t.createElement(t.Fragment,null,v||!ue||ht?!ht&&void 0!==k&&void 0!==S&&!!E&&ue&&!!I&&t.createElement(va,{themeColor:oe,applyDiscount:I,discountAmountOff:k,loyaltyIcon:E,pointsToBeUsed:S,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,minimumOrderValueToAvailDiscount:fe,brandTokenName:bt,showCartLevelAltPay:L,redemptionMultiplier:$}):!!_&&!!D&&t.createElement(ta,{cartSigninCTAMainText:xe,signinCTAButtonVisible:ge,themeColor:oe,joinNowFunction:D,guestLoyaltyPercentage:_,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,showCartLevelAltPay:L})),Ot?.item_count>0&&!!ht&&!!z&&ue&&ht&&void 0!==S&&t.createElement(xa,{themeColor:oe,removeDiscount:z,loyaltyDiscount:ht,isDev:P,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,pointsToBeUsed:S,brandTokenName:bt,showCartLevelAltPay:L}),ue&&L&&M&&E&&Ot?.item_count>0&&t.createElement($p,{loyaltyIcon:E,backgroundSubdued:a,primaryTextColor:X,pointsRewardRate:R,rewardMultiplier:T}),ue&&Ot&&Ot.item_count>0&&!!fe&&fe>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:oe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ge?"space-between":"center"}},"Minimum order value to use ",bt,":"," ",fe),Ot&&N&&Ot?.item_count>0&&t.createElement("div",null,t.createElement(Zo,{disableCheckoutButton:!!$t||At.cartLoading,discountApplied:B,checkoutFunction:N,checkoutButtonColor:Y,checkoutFontSize:p,discountInCheckoutButton:H,isStickyCheckout:q,discountAmountApplied:V,minimumCartValue:W,themeTextColor:ae,applyGSTToCart:se,showGSTOption:ce,applyNoteToCart:he,showNoteOption:be,enableGeoLocationDeliveryRestriction:Fe,applyPostalCodeAndDeliverySlotToCart:Ae,enableSlotPicker:We,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,checkoutSectionMessageRedirectLink:Pt,showDiscountOnMRP:vt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:A,toggleDecimal:St,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,showCheckoutButtonPaymentIcons:Ft,primaryTextColor:X}))))))},Pp=h.div`
|
|
2240
2240
|
position: relative;
|
|
2241
|
-
`,
|
|
2241
|
+
`,Fp=h.button`
|
|
2242
2242
|
border: 1px solid #ccc;
|
|
2243
2243
|
border-radius: 4px;
|
|
2244
2244
|
padding: 2px 8px;
|
|
@@ -2248,7 +2248,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2248
2248
|
font-size: 13px;
|
|
2249
2249
|
font-weight: 500;
|
|
2250
2250
|
cursor: pointer;
|
|
2251
|
-
`,
|
|
2251
|
+
`,Op=h.div`
|
|
2252
2252
|
position: absolute;
|
|
2253
2253
|
bottom: calc(100% + 5px);
|
|
2254
2254
|
left: 0;
|
|
@@ -2438,7 +2438,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2438
2438
|
transform: scale(1.01);
|
|
2439
2439
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
|
|
2440
2440
|
}
|
|
2441
|
-
`,Xp={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},Kp=({showStickyCart:e,product:n,addCartItem:r,onSetLoading:i,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:f,addToStickyCart:g,cartComponentsCornerType:x,cartComponentsCornerRadius:h,themeTextColor:y,stickyCartCustomizationData:b,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:k,comboBundleAddToCartFunction:E})=>{const[S,T]=c(""),[$,B]=c(null),[z,I]=c({}),N=Ba(),[D,_]=c(null),P=o(null);l(()=>{const e=e=>{P.current&&!P.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const
|
|
2441
|
+
`,Xp={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},Kp=({showStickyCart:e,product:n,addCartItem:r,onSetLoading:i,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:f,addToStickyCart:g,cartComponentsCornerType:x,cartComponentsCornerRadius:h,themeTextColor:y,stickyCartCustomizationData:b,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:k,comboBundleAddToCartFunction:E})=>{const[S,T]=c(""),[$,B]=c(null),[z,I]=c({}),N=Ba(),[D,_]=c(null),P=o(null);l(()=>{const e=e=>{P.current&&!P.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const F=a(()=>k&&"combo"===k.type?k?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.availableForSale)?.node:n?.variants?.find(e=>e?.available),[k,n]),[O,A]=c(()=>{if(!k||"combo"!==k.type)return{};const e={};return k?.products?.forEach((t,n)=>{const r=t?.productDetails?.variants?.edges?.find(e=>e?.node?.availableForSale)?.node;r&&(e[n]=r.id)}),e}),M=a(e=>{if(!k||"combo"!==k.type)return;const t={};k?.products?.forEach((n,r)=>{const o=n?.productDetails?.variants?.edges?.find(t=>{const r=t?.node;return n?.productDetails?.options?.every((t,n)=>{const o=e?.[t?.name],a=r?.title?.split(" / ")?.at(n);return!(!o||!a)&&o.trim().toLowerCase()===a.trim().toLowerCase()})});o?.node?.id&&(t[r]=o.node.id)}),Object.keys(t).length>0&&A(e=>({...e,...t}))},[k]);l(()=>{const e=F();if(e){T(String(e.id)),B(e);const t={};n?.options&&Array.isArray(n.options)&&n.options.forEach((n,r)=>{const o=`option${r+1}`;e?.[o]&&(t[n?.name]=e[o])}),I(t)}},[n,F]);const R=a(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),L=()=>{const e=R();if(e){const t=n?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){T(String(t.id)),B(t);const e={};n?.options?.forEach((n,r)=>{const o=`option${r+1}`;t?.[o]&&(e[n?.name]=t[o])}),I(e)}else{const e=F();e&&(T(String(e.id)),B(e))}}};l(()=>{L();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",L),()=>{t=!1,window.removeEventListener("urlChange",L),window.history.pushState=n,window.history.replaceState=r}},[R,n,F,$,S]);const j=o(null),[V,W]=c(1),H=Nn(d,d?.currency);l(()=>{(async()=>{try{n&&S&&B(n?.variants?.filter(e=>String(e?.id)===String(S))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[n,S]);const{cartLoading:q}=kn(),U=o(null),[Q,Y]=c(0);l(()=>{U.current&&Y(U.current.offsetWidth)},[]);const G=n?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,Z=G?z?.[G]:null,X=b&&(K=b,0!==Object.keys(K).length||K.constructor!==Object)?b:Xp;var K;const{showProductName:J,showPrice:ee,showVariantSelector:te,showBuyNowButton:ne,showAddToCartButton:re,desktopBarType:oe,showProductImage:ae,buyNowCtaTitle:ie,addToCartCtaTitle:le,productInfoVisibility:ce,showBarOnDesktop:se,ctaButtonFontSize:de,startsAppearingAtHeight:pe,fullyAppearsAtHeight:ue,topRibbonText:me}=X,[fe,ge]=c(0),[xe,he]=c(100),[ye,be]=c(!1);if(l(()=>{const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=pe||200,n=ue||400;if(e>t){const r=Math.min((e-t)/(n-t),1);ge(r),he(100-100*r)}else ge(0),he(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),l(()=>{const e=()=>{const e=window.innerWidth<768;be(e||!1!==se)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[se]),n?.variants?.length<1)return null;const ve=n?.available??!0,we=F(),Ce=k&&"combo"===k.type?k?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===O?.[0])?.node?.price:$?.price??we?.price??n?.variants?.[0]?.price;if(0===Number(Ce))return null;if(!e||!ye)return null;if(b?.excludeProducts?.includes(n?.handle))return null;const ke=k&&"combo"===k.type?Object.values(O).length>0:$?.available??!0;return t.createElement(Wp,{className:"yt-sticky-bar-container",$opacity:fe,$translateY:xe,$desktopBarType:oe||"stretch"},t.createElement(Hp,{className:"yt-sticky-bar-inner-container",$desktopBarType:oe||"stretch",$themeColor:s,$cornerType:x??"sharp",$cornerRadius:h??20,$themeTextColor:y,$productInfoVisibility:ce,$topRibbonText:me,$backgroundColor:w},ce&&t.createElement(qp,null,ae&&t.createElement(Up,{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)($,n),alt:$?.name}),t.createElement(Qp,{ref:U,className:"yt-sticky-bar-product-details"},J&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${n?.title}`),Z&&t.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},Z)),n?.variants?.length>1&&te&&t.createElement(jp,{className:"yt-sticky-bar-option-container",ref:P},n?.options?.map(e=>{const r=N?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase()),o=z[e.name],a=D===e.name,i=t=>{((e,t)=>{const r={...z,[e]:t};I(r);const o=n?.variants?.find(e=>n?.options?.every((t,n)=>{const o=r?.[t?.name],a=e?.[`option${n+1}`];return"string"==typeof o&&"string"==typeof a?o.trim().toLowerCase()===a.trim().toLowerCase():o===a}));o&&(T(String(o.id)),B(o)),k&&"combo"===k?.type&&M(r)})(e.name,t),_(null)},l=$a(r,o);return t.createElement("div",{key:e.name,style:{display:"flex",alignItems:"center",gap:"8px"}},t.createElement(Vp,null,e.name),t.createElement(Pp,null,t.createElement(Fp,{onClick:()=>{_(a?null:e.name)},className:"yt-sticky-bar-dropdown-button"},"color"===r?.type&&l?.value?t.createElement(Mp,{$colorValue:l.value}):"image"===r?.type&&l?.value?t.createElement(Rp,{src:l.value}):null,o,t.createElement(Lp,{size:8,$isOpen:a})),a&&t.createElement(Op,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},e.values.map(e=>{const n=$a(r,e);return t.createElement(Ap,{className:"yt-sticky-bar-dropdown-item",key:e,onClick:()=>i(e)},"color"===r?.type&&n?.value?t.createElement(Mp,{$colorValue:n.value}):"image"===r?.type&&n?.value?t.createElement(Rp,{src:n.value}):null,e)}))))})),ee&&t.createElement(t.Fragment,null,$?.compare_at_price&&$?.compare_at_price>$?.price?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},t.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${H}`,zn($?.price,d?.currency)),t.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${H}`,zn($?.compare_at_price,d?.currency)),t.createElement("span",{style:{backgroundColor:s??"black",color:y??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===x?`${h}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${H}`,zn($?.compare_at_price-$?.price,d?.currency))):t.createElement(t.Fragment,null,t.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${H}`,zn($?.price,d?.currency)))),t.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),ve&&t.createElement(Yp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:ce?"row":"column"},re&&t.createElement(Zp,{ref:j,onClick:async()=>{if(k&&"combo"===k.type){if(!E)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(O);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=k?.products?.[Number(e)],r=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return r?{variantId:t,price:Number(r?.price),compareAtPrice:Number(r?.compareAtPrice||r?.price)}:null}).filter(e=>null!==e),r=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),o=n.reduce((e,t)=>e+t.price,0);let a=Math.min(r,o);k?.percentageOff?a=o*(1-k.percentageOff/100):k?.dealAmount?a=k.dealAmount:k?.amountOff&&(a=o-k.amountOff);const i=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));return void await E(Number(r.toFixed(2)),t,Number(a.toFixed(2)),i)}g&&await g(String(S)??String(n?.variants[0]?.id),V)},disabled:q.cartLoading||!ke,$bgColor:ke?m:"#d1d5db",$textColor:ke?f:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:x??"sharp",$cornerRadius:h??20,$fontSize:de,style:{cursor:ke?"pointer":"not-allowed",opacity:ke?1:.6}},q.cartLoading?t.createElement(da,{color:"white",loading:q.cartLoading,size:15}):t.createElement(t.Fragment,null,ke?le??"Add to Cart":"Out of Stock")),ne&&t.createElement(Gp,{onClick:async()=>{try{v&&await v(String(S)??String(n?.variants[0]?.id),V)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:q.cartLoading||!ke,$bgColor:ke?s:"#d1d5db",$textColor:ke?y:"#6b7280",$cornerType:x??"sharp",$cornerRadius:h??20,$fontSize:de,style:{cursor:ke?"pointer":"not-allowed",opacity:ke?1:.6}},q.cartLoading?t.createElement(da,{color:"white",loading:q.cartLoading,size:15}):t.createElement(t.Fragment,null,ke?ie??"Buy Now":"Out of Stock")))))},Jp=h.div`
|
|
2442
2442
|
width: 100%;
|
|
2443
2443
|
height: 100%;
|
|
2444
2444
|
display: flex;
|
|
@@ -2869,7 +2869,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2869
2869
|
&:hover {
|
|
2870
2870
|
border-color: ${({$themeColor:e})=>e||"#000"};
|
|
2871
2871
|
}
|
|
2872
|
-
`,wu=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:x},h)=>{const[y,b]=un(En),v=dn(mn),w=o(null),[C,k]=c(null),[E,S]=c(!1),[T,$]=c({}),[B,z]=c(y?.variantId),[I,N]=c(y?.quantity||1),[D,_]=c(!1),P=Ba();l(()=>{y?.open?setTimeout(()=>{_(!0)},10):_(!1)},[y?.open]);l(()=>{(async()=>{if(!C&&r&&y?.variantId&&y?.handle){const e=await r(y.handle,y.variantId);if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),$(n)}else z(void 0),$({})}k(e)}})()},[C,r,y]);const O=(e,t)=>{const n={...T,[e]:t};$(n);const r=C?.variants?.find(e=>C.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&z(String(r.id))}},F=C?.variants?.find(e=>String(e.id)===String(B)),A=Nn(v,v?.currency),M=i(()=>{const e={};if(!C)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(r=>{const o=C.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const o=T[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,T,y]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{_(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(Jp,{ref:h,className:"yt-variant-selection-popup"},t.createElement(tu,{ref:w,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(eu,null,"Unlocked Freebie"),t.createElement(ru,null,t.createElement(ou,null,t.createElement(au,null,t.createElement(iu,{src:F?.featured_image?.src??C?.featured_image,alt:F?.featured_image?.alt??C?.title})),t.createElement(lu,null,t.createElement(cu,{$themeColor:a,$primaryTextColor:x,href:`${C?.url}?variant=${F?.id}`},C?.title),t.createElement(yu,null,t.createElement(su,null,t.createElement(du,{$primaryTextColor:x},A,zn(F?.price,v?.currency??"INR")),null!=F?.compare_at_price&&null!=F?.price&&F.compare_at_price>F.price&&t.createElement(pu,null,A,zn(F?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(wa,{value:I,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&N(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),C?.options?.map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(mu,{key:e.name},t.createElement(gu,null,t.createElement("span",null,"Select ",e.name),T[e.name]&&t.createElement(xu,null,T[e.name])),t.createElement(hu,null,M[e.name]?.map(r=>{const o=T[e.name]===r,i=$a(n,r);return"color"===n?.type&&i?.value?t.createElement(bu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>O(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(vu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>O(e.name,r),$imageUrl:i.value}):t.createElement(fu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>O(e.name,r)},r)})))})),t.createElement(uu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if(B&&n){S(!0);try{await n(B,I,"product-recommendation-variant-selector",!1,y.handle),b({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 t=!!y?.lineItemKey,r=String(B)!==String(y?.variantId);if(!t||r){S(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m(B,y.allowedVariantIds):n&&B&&await n(B,I,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||E},E?t.createElement(da,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Jp,{ref:h},t.createElement(tu,{style:{backgroundColor:p||"white"}},t.createElement(nu,null,t.createElement(fa,{color:a||"#868E96"}))))});wu.displayName="DesktopVariantPopup";const Cu=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:x},h)=>{const[y,b]=un(En),v=dn(mn),[w,C]=c(null),[k,E]=c(!1),[S,T]=c({}),[$,B]=c(y?.variantId),[z,I]=c(y?.quantity||1),N=o(null),D=Ba(),[_,P]=c(!1);l(()=>{y?.open?setTimeout(()=>{P(!0)},10):P(!1)},[y?.open]);l(()=>{(async()=>{if(!w&&r&&y?.variantId&&y?.handle)try{const e=await r(y.handle,y.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){B(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),T(n)}else B(void 0),T({})}C(e)}catch(e){}})()},[w,r,y]),l(()=>{},[p,e,n,r]);const O=(e,t)=>{const n={...S,[e]:t};T(n);const r=w?.variants?.find(e=>w.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&B(String(r.id))}},F=w?.variants?.find(e=>String(e.id)===String($)),A=Nn(v,v?.currency),M=i(()=>{const e={};if(!w)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return w.options.forEach(n=>{e[n.name]=n.values.filter(e=>w.variants.filter(r=>{const o=w.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!w.options.every((e,t)=>{if(e.name===n.name)return!0;const o=S[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[w,S,y]);return w?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(Jp,{ref:h,className:"yt-variant-selection-popup"},t.createElement(tu,{ref:N,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(eu,null,"Unlocked Freebie"),t.createElement(ru,null,t.createElement(ou,null,t.createElement(au,null,t.createElement(iu,{src:F?.featured_image?.src??w?.featured_image,alt:F?.featured_image?.alt??w?.title})),t.createElement(lu,null,t.createElement(cu,{$themeColor:a,$primaryTextColor:x,href:`${w?.url}?variant=${F?.id}`},w?.title),t.createElement(yu,null,t.createElement(su,null,t.createElement(du,{$primaryTextColor:x},A,zn(F?.price,v?.currency??"INR")),null!=F?.compare_at_price&&null!=F?.price&&F.compare_at_price>F.price&&t.createElement(pu,null,A,zn(F?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(wa,{value:z,handleItemQuantityIncrement:async()=>{I(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&I(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),w?.options?.map(e=>{const n=D?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(mu,{key:e.name},t.createElement(gu,null,t.createElement("span",null,"Select ",e.name,":"),S[e.name]&&t.createElement(xu,null,S[e.name])),t.createElement(hu,null,M[e.name]?.map(r=>{const o=S[e.name]===r,i=$a(n,r);return"color"===n?.type&&i?.value?t.createElement(bu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>O(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(vu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>O(e.name,r),$imageUrl:i.value}):t.createElement(fu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>O(e.name,r)},r)})))})),t.createElement(uu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if($&&n){E(!0);try{await n($,z,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}E(!1)}}:async()=>{if(!$)return;const t=!!y?.lineItemKey,r=String($)!==String(y?.variantId);if(!t||r){E(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m($,y.allowedVariantIds):n&&$&&await n($,z,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}E(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||k},k?t.createElement(da,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Jp,{ref:h},t.createElement(tu,{style:{backgroundColor:p||"white"}},t.createElement(nu,null,t.createElement(fa,{color:a||"#868E96"}))))});const ku=({setIsCartOpen:e,isCartOpen:n,cartCheckpoints:r,customCartProgressBarCriteria:o,floatingCartData:a,effectiveQuantityForProgressBar:i,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=dn(mn),d=a?.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 r=t.toLowerCase(),o=r.endsWith("/")?r:`${r}/`;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 o.includes(n)})}catch{return!1}})(a),m=s?.item_count??0,f=zn(s?.items_subtotal_price??0,s?.currency??"INR"),g=Nn(s),x=function(e,t,n,r,o){if(!e||0===e.length)return{deltaValue:0,show:!1};const a=(t??"minimum_order_value").toLowerCase(),i="quantity_threshold"===a?"number"==typeof o?o:r:n,l=[...e].sort((e,t)=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===a?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)>i);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===a?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-i);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===a}}(r,o,f,m,i),h="sharp"===l?0:c??12,y=a?.textColor??"#111",b=a?.backgroundColor??"#FF7E6E",v=a?.bannerBackgroundColor??"#FFE0DC",w=a?.buttonColor??"#E8513F",C=t.useRef(null);t.useEffect(()=>{Ln(C.current)},[w]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},E={background:"#FFFFFF",color:y,padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:y,borderRadius:h,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},T={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:v,color:y,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},$={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:b},B={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:y},z={fontSize:12,color:y,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},I={padding:"5px 10px",background:w,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!x.show)return null;const e=x.isQuantity?`${x.deltaValue} more items to get freebie`:`Add items worth ${g}${jn(x.deltaValue.toFixed(0))} to get freebie`;return t.createElement("div",{style:k},t.createElement("div",{style:E},t.createElement(W,{"aria-hidden":!0}),t.createElement("span",null,e)))}const N=1===m?"1 item":`${m} items`,D=x.show?x.isQuantity?`${x.deltaValue} more items to get freebie`:`Add items worth ${g}${jn(x.deltaValue.toFixed(0))} more to get freebie`:"";return t.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},t.createElement("div",{style:{position:"relative"}},x.show&&t.createElement("div",{style:T},t.createElement(W,{"aria-hidden":!0,style:{marginBottom:7}}),t.createElement("span",{style:{display:"inline-block",marginBottom:7}},D)),t.createElement("div",{style:S},t.createElement("div",{style:$},t.createElement(mt,{width:24,height:24,color:y}),t.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},t.createElement("div",{style:B},t.createElement("span",null,g,jn(f.toFixed(0))),t.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?t.createElement("span",{style:z,title:d},d):null),t.createElement("button",{ref:C,style:I,onClick:()=>e(!0),"aria-label":"View Cart"},"View Cart")))))},Eu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,cartTitle:d,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:f,backgroundColor:g,backgroundSubdued:x,tertiaryColor:h,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:S,pointsToBeUsed:T,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:z,applyDiscount:I,discountApplied:N,checkoutFunction:D,joinNowFunction:_,guestLoyaltyPercentage:P,showToggleButton:O,isOpen:F,setIsOpen:A,isDev:M,switchWidthVariant:R,recProductsList:L,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:U,discountAmountApplied:Q,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:Z,handleCheckpointCrossed:X,customCartProgressBarCriteria:K,checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:oe,secondaryTextColor:ae,showProductRecsOnDesktop:ie,showProductRecsOnMobile:le,themeColor:ce,themeTextColor:se,companyName:de,gstNumber:pe,showGSTOption:ue,applyGSTToCart:me,showMOVForProgressTiers:fe,freeProduct:ge,showLoyaltyCta:xe,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ye,signinCTAButtonVisible:be,cartSigninCTAMainText:ve,showNoteOption:we,applyNoteToCart:Ce,note:ke,inlineCartOfferInfoText:Ee,inlineCartOfferInfoRedirectLink:Se,cartOfferTermsAndConditionsText:Te,showEditOptionOnProducts:$e,getProductDetailsByVariantId:Be,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Ie,originalCartSubtotal:Ne,currentTier:De,freebieProductsInCart:_e,showFreebieClaim:Pe,addFreebieToCart:Oe,freebiesInCart:Fe,effectiveQuantityForProgressBar:Ae,productPercentageOffMapping:Me,removeFreebieFromCart:Re,postalCodeList:Le,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:Ve,showDeleteOnFreebies:We,freebieCouponTemplates:He,freebieFlowCheckpoints:qe,freebieClaimData:Ue,showStickyAddToCart:Qe,stickyCartLineItem:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Ze,deliveryHeaderTitle:Xe,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,enableCustomCartOnCartPage:nt,isCartPage:rt,progressBarFreeProductIconType:ot,addToStickyCart:at,productRecsCardLayout:it,productRecsCardListVariant:lt,showCartTimer:ct,showFreebieMilestone:st,showFloatingCart:dt,floatingCartData:pt,freebieMilestoneData:ut,cartTimerInMinutes:mt,cartTimerCustomText:ft,imageAspectSelector:gt,cartComponentsCornerType:xt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:yt,cartOffersCarousalData:bt,stickyBarBuyNowFunction:vt,gstSectionCustomizationData:wt,noteSectionTitle:Ct,checkoutSectionMessage:kt,checkoutSectionMessageRedirectLink:Et,checkoutSectionMessageDisplay:St,showVariantSelectionDropdownInProductClaim:Tt,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,prefixMessageText:It,suffixMessageText:Nt,successMessageText:Dt,toggleDecimal:_t,cartOffersCarouselHeight:Pt,disableCheckoutButton:Ot,showEmptyCartRecommendations:Ft,emptyProductRecsTitleText:At,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt=!0,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,showCheckoutButtonPaymentIcons:Wt=!0,comboBundleData:Ht,comboBundleAddToCartFunction:qt})=>{const Ut=pn(mn),[Qt,Yt]=un(En),[Gt,Zt]=un(ul),Xt=()=>A(!F),[Kt,Jt]=c(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});l(()=>{const e=e=>{const t=e.detail;Jt({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const en=Kt.comboBundleData??Ht,tn=Kt.comboBundleAddToCartFunction??qt;m(()=>{v&&Ut(v)},[v]);const nn=o(null);l(()=>{function e(e){nn.current&&!nn.current.contains(e.target)&&(Yt({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),Zt({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[rn,on]=c(!1);return l(()=>{const e=()=>{on(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:nt&&rt?"relative":"absolute",width:"100%",display:nt&&rt?"flex":"block",alignItems:"center",justifyContent:"center"}},O&&!(nt&&rt)&&t.createElement("button",{style:{margin:"16px"},onClick:Xt},F?"Close Drawer":"Open Drawer"),F&&b&&!(nt&&rt)&&t.createElement("div",{onClick:Xt,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%"}},""),t.createElement(_p,{isCartPage:rt,enableCustomCartOnCartPage:nt,isOpen:F,setIsOpen:A,backgroundColor:g,backgroundSubdued:x??"#F5F5F5",tertiaryColor:h,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:d,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,emptyCartTitle:p,emptyCartButtons:f,emptyCartDescription:u,showBundle:C,isUserSignedIn:w,bundleProducts:k,discountAmountOff:E,loyaltyIcon:S,pointsToBeUsed:T,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:z,applyDiscount:I,discountApplied:N,checkoutFunction:D,joinNowFunction:_,guestLoyaltyPercentage:P,isDev:M,switchWidthVariant:R,recProductsList:L,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:U,discountAmountApplied:Q,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:Z,handleCheckpointCrossed:X,customCartProgressBarCriteria:K??"minimum_order_value",checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:oe,secondaryTextColor:ae,showProductRecsOnDesktop:ie,showProductRecsOnMobile:le,themeColor:ce,themeTextColor:se,companyName:de,gstNumber:pe,showGSTOption:ue,applyGSTToCart:me,showMOVForProgressTiers:fe,freeProduct:ge,showLoyaltyCta:xe,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ye,signinCTAButtonVisible:be,cartSigninCTAMainText:ve,applyNoteToCart:Ce,note:ke,showNoteOption:we,inlineCartOfferInfoText:Ee,inlineCartOfferInfoRedirectLink:Se,cartOfferTermsAndConditionsText:Te,showEditOptionOnProducts:$e,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Ie,originalCartSubtotal:Ne,currentTier:De,freebieProductsInCart:_e,cartOffersCarousalData:bt,showFreebieClaim:Pe,addFreebieToCart:Oe,freebiesInCart:Fe,effectiveQuantityForProgressBar:Ae,productPercentageOffMapping:Me,removeFreebieFromCart:Re,postalCodeList:Le,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:Ve,showDeleteOnFreebies:We,freebieCouponTemplates:He,freebieFlowCheckpoints:qe,freebieClaimData:Ue,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Ze,deliveryHeaderTitle:Xe,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:ot,productRecsCardLayout:it,productRecsCardListVariant:lt,showCartTimer:ct,showFreebieMilestone:st,freebieMilestoneData:ut,cartTimerCustomText:ft,cartTimerInMinutes:mt,imageAspectSelector:gt,cartComponentsCornerType:xt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:wt,noteSectionTitle:Ct,checkoutSectionMessage:kt,checkoutSectionMessageRedirectLink:Et,checkoutSectionMessageDisplay:St,showVariantSelectionDropdownInProductClaim:Tt,loyaltyDiscount:$t,getProductDetailsByVariantId:Be,brandTokenName:Bt,showDiscountOnMRP:zt??!0,prefixMessageText:It,suffixMessageText:Nt,successMessageText:Dt,toggleDecimal:_t,cartOffersCarouselHeight:Pt,disableCheckoutButton:Ot,showEmptyCartRecommendations:Ft,emptyProductRecsTitleText:At,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,showCheckoutButtonPaymentIcons:Wt}),Qe&&Ye&&s&&t.createElement(Kp,{showStickyCart:Qe,stickyCartCustomizationData:yt,product:Ye,addCartItem:s,onSetLoading:ze,themeColor:ce,themeTextColor:se,cartData:v,isCartOpen:F,setIsCartOpen:A,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:at,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt,checkoutFunction:vt,backgroundColor:g,primaryTextColor:ne,comboBundleData:en,comboBundleAddToCartFunction:tn}),rn&&Qt.open&&t.createElement(wu,{backgroundColor:g,ref:nn,isDev:M,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Be,themeColor:ce,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt,removeFreebieFromCart:Re,freebieClaimAddToCart:Oe,productClaimCtaButtonText:Ue?.productClaimCtaButtonText,backgroundSubdued:x??"#F5F5F5",primaryTextColor:ne}),!rn&&Qt.open&&t.createElement(Cu,{ref:nn,isDev:M,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Be,themeColor:ce,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt,backgroundColor:g,removeFreebieFromCart:Re,freebieClaimAddToCart:Oe,productClaimCtaButtonText:Ue?.productClaimCtaButtonText,backgroundSubdued:x??"#F5F5F5",primaryTextColor:ne})),!rn&&dt&&t.createElement(ku,{isCartOpen:F,setIsCartOpen:A,cartCheckpoints:V,customCartProgressBarCriteria:K,floatingCartData:pt,effectiveQuantityForProgressBar:Ae,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt}))};q('@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 Su=h.div`
|
|
2872
|
+
`,wu=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:x},h)=>{const[y,b]=un(En),v=dn(mn),w=o(null),[C,k]=c(null),[E,S]=c(!1),[T,$]=c({}),[B,z]=c(y?.variantId),[I,N]=c(y?.quantity||1),[D,_]=c(!1),P=Ba();l(()=>{y?.open?setTimeout(()=>{_(!0)},10):_(!1)},[y?.open]);l(()=>{(async()=>{if(!C&&r&&y?.variantId&&y?.handle){const e=await r(y.handle,y.variantId);if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),$(n)}else z(void 0),$({})}k(e)}})()},[C,r,y]);const F=(e,t)=>{const n={...T,[e]:t};$(n);const r=C?.variants?.find(e=>C.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&z(String(r.id))}},O=C?.variants?.find(e=>String(e.id)===String(B)),A=Nn(v,v?.currency),M=i(()=>{const e={};if(!C)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(r=>{const o=C.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const o=T[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,T,y]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{_(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(Jp,{ref:h,className:"yt-variant-selection-popup"},t.createElement(tu,{ref:w,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(eu,null,"Unlocked Freebie"),t.createElement(ru,null,t.createElement(ou,null,t.createElement(au,null,t.createElement(iu,{src:O?.featured_image?.src??C?.featured_image,alt:O?.featured_image?.alt??C?.title})),t.createElement(lu,null,t.createElement(cu,{$themeColor:a,$primaryTextColor:x,href:`${C?.url}?variant=${O?.id}`},C?.title),t.createElement(yu,null,t.createElement(su,null,t.createElement(du,{$primaryTextColor:x},A,zn(O?.price,v?.currency??"INR")),null!=O?.compare_at_price&&null!=O?.price&&O.compare_at_price>O.price&&t.createElement(pu,null,A,zn(O?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(wa,{value:I,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&N(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),C?.options?.map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(mu,{key:e.name},t.createElement(gu,null,t.createElement("span",null,"Select ",e.name),T[e.name]&&t.createElement(xu,null,T[e.name])),t.createElement(hu,null,M[e.name]?.map(r=>{const o=T[e.name]===r,i=$a(n,r);return"color"===n?.type&&i?.value?t.createElement(bu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>F(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(vu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>F(e.name,r),$imageUrl:i.value}):t.createElement(fu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>F(e.name,r)},r)})))})),t.createElement(uu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if(B&&n){S(!0);try{await n(B,I,"product-recommendation-variant-selector",!1,y.handle),b({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 t=!!y?.lineItemKey,r=String(B)!==String(y?.variantId);if(!t||r){S(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m(B,y.allowedVariantIds):n&&B&&await n(B,I,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||E},E?t.createElement(da,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Jp,{ref:h},t.createElement(tu,{style:{backgroundColor:p||"white"}},t.createElement(nu,null,t.createElement(fa,{color:a||"#868E96"}))))});wu.displayName="DesktopVariantPopup";const Cu=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:x},h)=>{const[y,b]=un(En),v=dn(mn),[w,C]=c(null),[k,E]=c(!1),[S,T]=c({}),[$,B]=c(y?.variantId),[z,I]=c(y?.quantity||1),N=o(null),D=Ba(),[_,P]=c(!1);l(()=>{y?.open?setTimeout(()=>{P(!0)},10):P(!1)},[y?.open]);l(()=>{(async()=>{if(!w&&r&&y?.variantId&&y?.handle)try{const e=await r(y.handle,y.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){B(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),T(n)}else B(void 0),T({})}C(e)}catch(e){}})()},[w,r,y]),l(()=>{},[p,e,n,r]);const F=(e,t)=>{const n={...S,[e]:t};T(n);const r=w?.variants?.find(e=>w.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&B(String(r.id))}},O=w?.variants?.find(e=>String(e.id)===String($)),A=Nn(v,v?.currency),M=i(()=>{const e={};if(!w)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return w.options.forEach(n=>{e[n.name]=n.values.filter(e=>w.variants.filter(r=>{const o=w.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!w.options.every((e,t)=>{if(e.name===n.name)return!0;const o=S[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[w,S,y]);return w?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(Jp,{ref:h,className:"yt-variant-selection-popup"},t.createElement(tu,{ref:N,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(eu,null,"Unlocked Freebie"),t.createElement(ru,null,t.createElement(ou,null,t.createElement(au,null,t.createElement(iu,{src:O?.featured_image?.src??w?.featured_image,alt:O?.featured_image?.alt??w?.title})),t.createElement(lu,null,t.createElement(cu,{$themeColor:a,$primaryTextColor:x,href:`${w?.url}?variant=${O?.id}`},w?.title),t.createElement(yu,null,t.createElement(su,null,t.createElement(du,{$primaryTextColor:x},A,zn(O?.price,v?.currency??"INR")),null!=O?.compare_at_price&&null!=O?.price&&O.compare_at_price>O.price&&t.createElement(pu,null,A,zn(O?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(wa,{value:z,handleItemQuantityIncrement:async()=>{I(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&I(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),w?.options?.map(e=>{const n=D?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(mu,{key:e.name},t.createElement(gu,null,t.createElement("span",null,"Select ",e.name,":"),S[e.name]&&t.createElement(xu,null,S[e.name])),t.createElement(hu,null,M[e.name]?.map(r=>{const o=S[e.name]===r,i=$a(n,r);return"color"===n?.type&&i?.value?t.createElement(bu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>F(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(vu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>F(e.name,r),$imageUrl:i.value}):t.createElement(fu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>F(e.name,r)},r)})))})),t.createElement(uu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if($&&n){E(!0);try{await n($,z,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}E(!1)}}:async()=>{if(!$)return;const t=!!y?.lineItemKey,r=String($)!==String(y?.variantId);if(!t||r){E(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m($,y.allowedVariantIds):n&&$&&await n($,z,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}E(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||k},k?t.createElement(da,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(Jp,{ref:h},t.createElement(tu,{style:{backgroundColor:p||"white"}},t.createElement(nu,null,t.createElement(fa,{color:a||"#868E96"}))))});const ku=({setIsCartOpen:e,isCartOpen:n,cartCheckpoints:r,customCartProgressBarCriteria:o,floatingCartData:a,effectiveQuantityForProgressBar:i,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=dn(mn),d=a?.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 r=t.toLowerCase(),o=r.endsWith("/")?r:`${r}/`;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 o.includes(n)})}catch{return!1}})(a),m=s?.item_count??0,f=zn(s?.items_subtotal_price??0,s?.currency??"INR"),g=Nn(s),x=function(e,t,n,r,o){if(!e||0===e.length)return{deltaValue:0,show:!1};const a=(t??"minimum_order_value").toLowerCase(),i="quantity_threshold"===a?"number"==typeof o?o:r:n,l=[...e].sort((e,t)=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===a?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)>i);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===a?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-i);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===a}}(r,o,f,m,i),h="sharp"===l?0:c??12,y=a?.textColor??"#111",b=a?.backgroundColor??"#FF7E6E",v=a?.bannerBackgroundColor??"#FFE0DC",w=a?.buttonColor??"#E8513F",C=t.useRef(null);t.useEffect(()=>{Ln(C.current)},[w]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},E={background:"#FFFFFF",color:y,padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:y,borderRadius:h,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},T={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:v,color:y,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},$={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:b},B={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:y},z={fontSize:12,color:y,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},I={padding:"5px 10px",background:w,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!x.show)return null;const e=x.isQuantity?`${x.deltaValue} more items to get freebie`:`Add items worth ${g}${jn(x.deltaValue.toFixed(0))} to get freebie`;return t.createElement("div",{style:k},t.createElement("div",{style:E},t.createElement(W,{"aria-hidden":!0}),t.createElement("span",null,e)))}const N=1===m?"1 item":`${m} items`,D=x.show?x.isQuantity?`${x.deltaValue} more items to get freebie`:`Add items worth ${g}${jn(x.deltaValue.toFixed(0))} more to get freebie`:"";return t.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},t.createElement("div",{style:{position:"relative"}},x.show&&t.createElement("div",{style:T},t.createElement(W,{"aria-hidden":!0,style:{marginBottom:7}}),t.createElement("span",{style:{display:"inline-block",marginBottom:7}},D)),t.createElement("div",{style:S},t.createElement("div",{style:$},t.createElement(mt,{width:24,height:24,color:y}),t.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},t.createElement("div",{style:B},t.createElement("span",null,g,jn(f.toFixed(0))),t.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?t.createElement("span",{style:z,title:d},d):null),t.createElement("button",{ref:C,style:I,onClick:()=>e(!0),"aria-label":"View Cart"},"View Cart")))))},Eu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,cartTitle:d,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:f,backgroundColor:g,backgroundSubdued:x,tertiaryColor:h,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:S,pointsToBeUsed:T,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:z,applyDiscount:I,discountApplied:N,checkoutFunction:D,joinNowFunction:_,guestLoyaltyPercentage:P,showToggleButton:F,isOpen:O,setIsOpen:A,isDev:M,switchWidthVariant:R,recProductsList:L,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:U,discountAmountApplied:Q,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:Z,handleCheckpointCrossed:X,customCartProgressBarCriteria:K,checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:oe,secondaryTextColor:ae,showProductRecsOnDesktop:ie,showProductRecsOnMobile:le,themeColor:ce,themeTextColor:se,companyName:de,gstNumber:pe,showGSTOption:ue,applyGSTToCart:me,showMOVForProgressTiers:fe,freeProduct:ge,showLoyaltyCta:xe,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ye,signinCTAButtonVisible:be,cartSigninCTAMainText:ve,showNoteOption:we,applyNoteToCart:Ce,note:ke,inlineCartOfferInfoText:Ee,inlineCartOfferInfoRedirectLink:Se,cartOfferTermsAndConditionsText:Te,showEditOptionOnProducts:$e,getProductDetailsByVariantId:Be,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Ie,originalCartSubtotal:Ne,currentTier:De,freebieProductsInCart:_e,showFreebieClaim:Pe,addFreebieToCart:Fe,freebiesInCart:Oe,effectiveQuantityForProgressBar:Ae,productPercentageOffMapping:Me,removeFreebieFromCart:Re,postalCodeList:Le,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:Ve,showDeleteOnFreebies:We,freebieCouponTemplates:He,freebieFlowCheckpoints:qe,freebieClaimData:Ue,showStickyAddToCart:Qe,stickyCartLineItem:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Ze,deliveryHeaderTitle:Xe,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,enableCustomCartOnCartPage:nt,isCartPage:rt,progressBarFreeProductIconType:ot,addToStickyCart:at,productRecsCardLayout:it,productRecsCardListVariant:lt,showCartTimer:ct,showFreebieMilestone:st,showFloatingCart:dt,floatingCartData:pt,freebieMilestoneData:ut,cartTimerInMinutes:mt,cartTimerCustomText:ft,imageAspectSelector:gt,cartComponentsCornerType:xt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:yt,cartOffersCarousalData:bt,stickyBarBuyNowFunction:vt,gstSectionCustomizationData:wt,noteSectionTitle:Ct,checkoutSectionMessage:kt,checkoutSectionMessageRedirectLink:Et,checkoutSectionMessageDisplay:St,showVariantSelectionDropdownInProductClaim:Tt,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,prefixMessageText:It,suffixMessageText:Nt,successMessageText:Dt,toggleDecimal:_t,cartOffersCarouselHeight:Pt,disableCheckoutButton:Ft,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:At,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt=!0,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,showCheckoutButtonPaymentIcons:Wt=!0,comboBundleData:Ht,comboBundleAddToCartFunction:qt})=>{const Ut=pn(mn),[Qt,Yt]=un(En),[Gt,Zt]=un(ul),Xt=()=>A(!O),[Kt,Jt]=c(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});l(()=>{const e=e=>{const t=e.detail;Jt({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const en=Kt.comboBundleData??Ht,tn=Kt.comboBundleAddToCartFunction??qt;m(()=>{v&&Ut(v)},[v]);const nn=o(null);l(()=>{function e(e){nn.current&&!nn.current.contains(e.target)&&(Yt({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),Zt({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[rn,on]=c(!1);return l(()=>{const e=()=>{on(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:nt&&rt?"relative":"absolute",width:"100%",display:nt&&rt?"flex":"block",alignItems:"center",justifyContent:"center"}},F&&!(nt&&rt)&&t.createElement("button",{style:{margin:"16px"},onClick:Xt},O?"Close Drawer":"Open Drawer"),O&&b&&!(nt&&rt)&&t.createElement("div",{onClick:Xt,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%"}},""),t.createElement(_p,{isCartPage:rt,enableCustomCartOnCartPage:nt,isOpen:O,setIsOpen:A,backgroundColor:g,backgroundSubdued:x??"#F5F5F5",tertiaryColor:h,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:d,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,emptyCartTitle:p,emptyCartButtons:f,emptyCartDescription:u,showBundle:C,isUserSignedIn:w,bundleProducts:k,discountAmountOff:E,loyaltyIcon:S,pointsToBeUsed:T,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:z,applyDiscount:I,discountApplied:N,checkoutFunction:D,joinNowFunction:_,guestLoyaltyPercentage:P,isDev:M,switchWidthVariant:R,recProductsList:L,showMultiStepProgressBar:j,cartCheckpoints:V,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:U,discountAmountApplied:Q,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:Z,handleCheckpointCrossed:X,customCartProgressBarCriteria:K??"minimum_order_value",checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:oe,secondaryTextColor:ae,showProductRecsOnDesktop:ie,showProductRecsOnMobile:le,themeColor:ce,themeTextColor:se,companyName:de,gstNumber:pe,showGSTOption:ue,applyGSTToCart:me,showMOVForProgressTiers:fe,freeProduct:ge,showLoyaltyCta:xe,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ye,signinCTAButtonVisible:be,cartSigninCTAMainText:ve,applyNoteToCart:Ce,note:ke,showNoteOption:we,inlineCartOfferInfoText:Ee,inlineCartOfferInfoRedirectLink:Se,cartOfferTermsAndConditionsText:Te,showEditOptionOnProducts:$e,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Ie,originalCartSubtotal:Ne,currentTier:De,freebieProductsInCart:_e,cartOffersCarousalData:bt,showFreebieClaim:Pe,addFreebieToCart:Fe,freebiesInCart:Oe,effectiveQuantityForProgressBar:Ae,productPercentageOffMapping:Me,removeFreebieFromCart:Re,postalCodeList:Le,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:Ve,showDeleteOnFreebies:We,freebieCouponTemplates:He,freebieFlowCheckpoints:qe,freebieClaimData:Ue,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Ze,deliveryHeaderTitle:Xe,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:ot,productRecsCardLayout:it,productRecsCardListVariant:lt,showCartTimer:ct,showFreebieMilestone:st,freebieMilestoneData:ut,cartTimerCustomText:ft,cartTimerInMinutes:mt,imageAspectSelector:gt,cartComponentsCornerType:xt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:wt,noteSectionTitle:Ct,checkoutSectionMessage:kt,checkoutSectionMessageRedirectLink:Et,checkoutSectionMessageDisplay:St,showVariantSelectionDropdownInProductClaim:Tt,loyaltyDiscount:$t,getProductDetailsByVariantId:Be,brandTokenName:Bt,showDiscountOnMRP:zt??!0,prefixMessageText:It,suffixMessageText:Nt,successMessageText:Dt,toggleDecimal:_t,cartOffersCarouselHeight:Pt,disableCheckoutButton:Ft,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:At,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,showCheckoutButtonPaymentIcons:Wt}),Qe&&Ye&&s&&t.createElement(Kp,{showStickyCart:Qe,stickyCartCustomizationData:yt,product:Ye,addCartItem:s,onSetLoading:ze,themeColor:ce,themeTextColor:se,cartData:v,isCartOpen:O,setIsCartOpen:A,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:at,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt,checkoutFunction:vt,backgroundColor:g,primaryTextColor:ne,comboBundleData:en,comboBundleAddToCartFunction:tn}),rn&&Qt.open&&t.createElement(wu,{backgroundColor:g,ref:nn,isDev:M,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Be,themeColor:ce,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt,removeFreebieFromCart:Re,freebieClaimAddToCart:Fe,productClaimCtaButtonText:Ue?.productClaimCtaButtonText,backgroundSubdued:x??"#F5F5F5",primaryTextColor:ne}),!rn&&Qt.open&&t.createElement(Cu,{ref:nn,isDev:M,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Be,themeColor:ce,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt,backgroundColor:g,removeFreebieFromCart:Re,freebieClaimAddToCart:Fe,productClaimCtaButtonText:Ue?.productClaimCtaButtonText,backgroundSubdued:x??"#F5F5F5",primaryTextColor:ne})),!rn&&dt&&t.createElement(ku,{isCartOpen:O,setIsCartOpen:A,cartCheckpoints:V,customCartProgressBarCriteria:K,floatingCartData:pt,effectiveQuantityForProgressBar:Ae,cartComponentsCornerRadius:ht,cartComponentsCornerType:xt}))};q('@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 Su=h.div`
|
|
2873
2873
|
display: flex;
|
|
2874
2874
|
flex-direction: row;
|
|
2875
2875
|
height: 100%;
|
|
@@ -3024,7 +3024,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3024
3024
|
align-items: center;
|
|
3025
3025
|
justify-content: center;
|
|
3026
3026
|
cursor: default;
|
|
3027
|
-
`,
|
|
3027
|
+
`,Fu=h.div`
|
|
3028
3028
|
width: 25%;
|
|
3029
3029
|
background-color: #111;
|
|
3030
3030
|
display: flex;
|
|
@@ -3033,7 +3033,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3033
3033
|
border-left: 1px solid #fff;
|
|
3034
3034
|
height: 100%;
|
|
3035
3035
|
cursor: pointer;
|
|
3036
|
-
`,
|
|
3036
|
+
`,Ou=h.div`
|
|
3037
3037
|
display: flex;
|
|
3038
3038
|
flex-direction: row;
|
|
3039
3039
|
flex-wrap: wrap;
|
|
@@ -3319,7 +3319,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3319
3319
|
text-align: center;
|
|
3320
3320
|
display: flex;
|
|
3321
3321
|
flex-shrink: 0;
|
|
3322
|
-
`,mm=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>t.createElement(t.Fragment,null,e.map((a,d)=>{const p=a.minimumQuantity-(r[d]?.length??0),u=o?.filter(e=>r[d]?.includes(e.variantId));return Math.min(r[d]?.length/a.minimumQuantity*100,100),t.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},t.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},t.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(e=>{const o=e.product.variants?.edges?.find(t=>t.node.id===e.variantId),p=r[d]?.filter(e=>e===o?.node.id).length||0;return i?t.createElement(pm,{className:"yt-byob-tracker-detailed-product-item",key:e.variantId},t.createElement(Yu,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.isFree&&t.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",t.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 ")),e?.quantity>1&&t.createElement(qu,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},e.quantity,"x")),t.createElement(Zu,{className:"yt-byob-tracker-info-block"},t.createElement(Xu,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(Ku,{className:"yt-byob-tracker-product-price"},s,eh(o?.node?.price)),t.createElement(Uu,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(e.variantId,d),style:{...1===a.minimumQuantity&&1===a.products.length&&1===r[d]?.length?{display:"none"}:{}}},t.createElement(ei,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(dm,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},e?.isFree&&t.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"}},t.createElement(qo,null),t.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&&t.createElement(qu,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),t.createElement(Uu,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(e.variantId,d),style:{...1===a.minimumQuantity&&1===a.products.length&&1===r[d]?.length?{display:"none"}:{}}},t.createElement(ht,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((e,r)=>t.createElement(em,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:r},t.createElement(yo,{size:40,color:"#A0A0A0"}))))),d<e.length-1&&t.createElement(um,{className:"yt-byob-tracker-plus-icon-container"},t.createElement(yo,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),fm=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:o,showProductDetailsInTracker:a,loading:i,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:f,dealAmount:g,isMobile:x=!1,themeColor:h,cornerRadiusType:y,primaryTextColorCta:b,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[k,E]=c(!1),[S,T]=c(0),[$,B]=c([]),[z,I]=c(0),[N,D]=c(0),[_,P]=c(!1),[O,F]=c(null),A=u?.price||0,M=e?.type,R=e=>{if(e<0||!$[e])return A;const t=$[e].discountValue??0;return d?A*(1-t/100):g?t:m?A-t:A};l(()=>{if(e&&"none"!==e.type)if("productTier"===M&&e.productTier){const t=e.productTier||[];B(t);let n=0;e.productTier.map(e=>{n+=e.minimumQuantity}),D(n-p)}else if($.length)z>0&&p<$[z-1]?.minimumQuantity?(I(z-1),F(z-1)):p<$[z]?.minimumQuantity&&F(z-1),T(R(z));else{const t=e.offerTier||[];B(t),I(0),D(t[0]?.minimumQuantity-p||r-p)}else B([]),D(r-p),I(0)},[e,r,p]),l(()=>{$.length&&"productTier"!=M?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===M)for(let r=0;r<$.length&&(n+=$[r].minimumQuantity,p>=n);r++)t=r,e=r+1<$.length?r+1:r;if(I(e),F(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),E(!0),T(R(t))}else P(!1),E(!1),T(A);const r=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;D(r)})():p===r?(E(!0),T(d?A*(1-d/100):g||(m?A-m:A)),P(!0)):(P(!1),E(!1))},[p,$]);const L=k?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=k?S.toFixed(2):u?.price?.toFixed(2),V=L&&j?(L-Number(j)).toFixed(2):0,W=e&&"none"!==M&&e.offerTier?"offerTier"===M?Math.min(p/(p+N)*100,100):void 0:p/r*100;l(()=>{if(k&&f.byob.enableConfetti){console.log("remainingItems",N);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,r=(t.top+t.height/2)/window.innerHeight;ro({particleCount:100,spread:70,origin:{x:n,y:r},zIndex:9999})}},[k,f]),z>=0&&z<$.length&&$[z].tier;const H="number"==typeof O?$[O]?.customText:void 0,q="string"==typeof H&&""!==H.trim();return t.createElement(Fu,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(x?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:x,style:{justifyContent:f.byob.selectedProductsVisibility&&!x?"space-between":"center"}},"offerTier"==M&&null!==O&&O>=0&&t.createElement(Au,{className:"yt-byob-tracker-offer-tier-tag"},q?t.createElement(t.Fragment,null,H," unlocked"):t.createElement(t.Fragment,null,t.createElement(t.Fragment,null,"Buy"," ",$.slice(0,O+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||g?t.createElement(t.Fragment,null," ",th(f.general.currencySymbol,C)):""," ",eh($[O]?.discountValue),d?t.createElement(t.Fragment,null,"% "):eh(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied"))),x&&N>=1&&!_&&"offerTier"!==M?t.createElement(Mu,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},"Select ",N," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==M&&t.createElement(Ru,{className:"yt-byob-tracker-tier-progress-container"},t.createElement(Lu,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==M&&$.length>0&&z>=0&&N>0&&t.createElement(t.Fragment,null,q?t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," more to unlock"," ",null!==O&&($[O+1]?.customText||$[O]?.customText||"")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+N," at",m||g?t.createElement(t.Fragment,null,th(f.general.currencySymbol,C)):""," ",eh($[z]?.discountValue),d?t.createElement(t.Fragment,null,"% "):eh(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):"")))),t.createElement(ju,{className:"yt-byob-tracker-progress-bar-bg"},t.createElement(Vu,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:h??f?.general.primaryColor}," "))),f.byob.selectedProductsVisibility&&t.createElement(Wu,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(x?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:M??"",isMobile:x},"productTier"===M?t.createElement(mm,{tiers:$,isMobile:x,selectedProductsByTier:w??{},selectedProducts:o,themeColor:f.general.primaryColor,showProductDetailsInTracker:a,handleRemoveItemProductTier:v,cornerRadius:f.byob.borderRadius,currencySymbol:th(f.general.currencySymbol,C)}):t.createElement(t.Fragment,null,o?.map?.(e=>{const n=e.product.variants?.edges?.find(t=>t.node.id===e.variantId);return a?t.createElement(Qu,{className:"yt-byob-tracker-detailed-item-container",borderRadius:f.byob.borderRadius,key:e.variantId},t.createElement(Yu,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement(Gu,{className:"yt-byob-tracker-badge"},e.quantity,"x")),t.createElement(Zu,{className:"yt-byob-tracker-info-block"},t.createElement(Xu,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(Ku,{className:"yt-byob-tracker-product-price"},f.general.currencySymbol,n?.node?.price),t.createElement(Ju,{className:"yt-byob-tracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(ei,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(sm,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:x,borderRadius:f.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url},e?.quantity>1&&t.createElement(qu,{className:"yt-byob-tracker-quantity-badge",borderRadius:f.byob.borderRadius},e.quantity,"x"),t.createElement(Uu,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(e.variantId)},t.createElement(ht,{fontSize:"12px"}))))}),N>=1&&[...Array(N)].map((e,n)=>t.createElement(em,{className:"yt-byob-tracker-placeholder-box",isMobile:x,borderRadius:f.byob.borderRadius,key:n},t.createElement(yo,{size:40,color:"#A0A0A0"}))))),(!x||_)&&t.createElement(Hu,{className:"yt-byob-tracker-summary-container bundle-summary "+(x?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:x},Number(j)>0&&t.createElement(tm,{className:"yt-byob-tracker-summary-info summary-info"},t.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},x?t.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},t.createElement(nm,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&t.createElement(rm,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",th(f.general.currencySymbol,C),eh(V))):t.createElement(t.Fragment,null,t.createElement(nm,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!x&&t.createElement(rm,{className:"yt-byob-tracker-save-label"},"Save:"," ",th(f.general.currencySymbol,C),eh(V)))),t.createElement(om,{className:"yt-byob-tracker-subtotal-row"},t.createElement(am,{className:"yt-byob-tracker-final-price"},th(f.general.currencySymbol,C),Number(j)>=0?eh(Number(j).toFixed(2)):0),L&&f.byob.compareAtPriceVisibility&&Number(L)>Number(j)&&t.createElement(im,{className:"yt-byob-tracker-line-through-price"},th(f.general.currencySymbol,C),eh(Number(L).toFixed(2))))),t.createElement(lm,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:_,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:f.general.ctaBackgroundColor,ctaBorderColor:f.general.ctaBorderColor,ctaHoverBackgroundColor:f.general.ctaHoverBackgroundColor,ctaHoverTextColor:f.general.ctaHoverTextColor},borderRadius:f.general.ctaBorderRadius,disabled:!_&&N>=1,onClick:e=>{i||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},i?t.createElement(da,{color:"white",loading:i,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!_?t.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:f.general.primaryColor}},"Add ",N," More Item(s)"):t.createElement(cm,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:f.general.ctaTextColor,ctaHoverTextColor:b??f.general.ctaHoverTextColor},f.byob.checkoutCTAText??"Checkout"))))},gm={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"}}},xm={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},hm=e=>{const[n,r]=c(!1);l(()=>{const e=()=>{r(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const o="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,a=((e,t=!1)=>{const n=e&&gm[e]?gm[e]:{},r={...xm,...n};return t&&n.mobile?{...r,...n.mobile}:r})(String(o),n);e.renderingOnPage||(a.position="static",a.zIndex=0);const i={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 ",...a};return t.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(n?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...i,width:n?"100%":a.width,...!e.styles.byob.selectedProductsVisibility&&{width:n?"96%":"fit-content",paddingInline:"10px"},...n&&{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%)"===a.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=a.transform||"translateY(0)"}},t.createElement(fm,{...e,isMobile:n}))},ym=Kt(void 0);function bm(e){return bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bm(e)}function vm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wm(e,t){return wm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wm(e,t)}function Cm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=km(e);if(t){var o=km(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===bm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},km(e)}var Em=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wm(e,t)}(o,x);var e,t,n,r=Cm(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,t=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}],t&&vm(e.prototype,t),n&&vm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),Sm=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},Tm=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},$m=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},Bm=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},zm=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},Im=function(){return t.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),t.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},Nm=function(){return t.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),t.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var Dm=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then(function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then(function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()})}).catch(function(t){console.error(t),console.error("Failed to download image from "+e)}))}},_m=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,s=e.enableZoom,d=e.enableRotate;return t.createElement("div",{className:"__react_modal_image__header"},t.createElement("span",{className:"__react_modal_image__icon_menu"},c&&t.createElement("a",{href:n,download:!0,onClick:Dm(n)},t.createElement(Bm,null)),s&&t.createElement("a",{onClick:a},o?t.createElement($m,null):t.createElement(Tm,null)),d&&t.createElement("a",{onClick:i},t.createElement(Nm,null)),t.createElement("a",{onClick:l},t.createElement(zm,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Pm(e){return Pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pm(e)}function Om(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fm(e,t){return Fm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fm(e,t)}function Am(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=Rm(e);if(t){var o=Rm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Pm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mm(e)}(this,n)}}function Mm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rm(e){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rm(e)}function Lm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fm(e,t)}(a,x);var e,n,r,o=Am(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Lm(Mm(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),Lm(Mm(e),"handleOnLoad",function(){e.setState({loading:!1})}),Lm(Mm(e),"handleOnContextMenu",function(t){!e.props.contextMenu&&t.preventDefault()}),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.id,r=e.className,o=e.src,a=e.style,i=e.handleDoubleClick;return t.createElement("div",null,this.state.loading&&t.createElement(Im,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&Om(e.prototype,n),r&&Om(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Vm(e){return Vm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vm(e)}function Wm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hm(e,t){return Hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hm(e,t)}function qm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=Qm(e);if(t){var o=Qm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Vm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Um(e)}(this,n)}}function Um(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qm(e){return Qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qm(e)}function Ym(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hm(e,t)}(a,x);var e,n,r,o=qm(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ym(Um(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Ym(Um(e),"handleKeyDown",function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()}),Ym(Um(e),"getCoordinatesIfOverImg",function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var r=e.contentEl.getBoundingClientRect();return{x:n.clientX-r.left,y:n.clientY-r.top}}}),Ym(Um(e),"handleMouseDownOrTouchStart",function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState(function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}})}}),Ym(Um(e),"handleMouseMoveOrTouchMove",function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState(function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}})}}),Ym(Um(e),"handleMouseUpOrTouchEnd",function(t){e.setState({moveStart:void 0})}),Ym(Um(e),"toggleZoom",function(t){t.preventDefault(),e.setState(function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}})}),Ym(Um(e),"toggleRotate",function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState(function(e){return{rotationDeg:e.rotationDeg+=90}}):e.setState({rotationDeg:90})}),e}return e=a,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,n=this.props,r=n.medium,o=n.large,a=n.alt,i=n.onClose,l=n.hideDownload,c=n.hideZoom,s=n.showRotate,d=n.imageBackgroundColor,p=void 0===d?"black":d,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(Em,{name:"__react_modal_image__lightbox",css:Sm({imageBackgroundColor:p})}),t.createElement("div",{className:"__react_modal_image__modal_container"},t.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},f&&t.createElement(jm,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||r,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)")},handleDoubleClick:this.toggleZoom}),!f&&t.createElement(jm,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:r||o,handleDoubleClick:this.toggleZoom,contextMenu:!r,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)")}})),t.createElement(_m,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!s})))}}])&&Wm(e.prototype,n),r&&Wm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Zm(e){return Zm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zm(e)}function Xm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Km(e,t){return Km=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Km(e,t)}function Jm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=tf(e);if(t){var o=tf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Zm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ef(e)}(this,n)}}function ef(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tf(e){return tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tf(e)}function nf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rf=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Km(e,t)}(a,x);var e,n,r,o=Jm(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nf(ef(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),nf(ef(e),"toggleModal",function(){e.setState(function(e){return{modalOpen:!e.modalOpen}})}),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.className,r=e.small,o=e.smallSrcSet,a=e.medium,i=e.large,l=e.alt,c=e.hideDownload,s=e.hideZoom,d=e.showRotate,p=e.imageBackgroundColor,u=this.state.modalOpen;return t.createElement("div",null,t.createElement("img",{className:n,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:r,srcSet:o,alt:l}),u&&t.createElement(Gm,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:s,showRotate:d,imageBackgroundColor:p}))}}],n&&Xm(e.prototype,n),r&&Xm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const of=h.div`
|
|
3322
|
+
`,mm=({tiers:e,isMobile:n=!1,selectedProductsByTier:r,selectedProducts:o,themeColor:a,showProductDetailsInTracker:i,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>t.createElement(t.Fragment,null,e.map((a,d)=>{const p=a.minimumQuantity-(r[d]?.length??0),u=o?.filter(e=>r[d]?.includes(e.variantId));return Math.min(r[d]?.length/a.minimumQuantity*100,100),t.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},t.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},t.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(e=>{const o=e.product.variants?.edges?.find(t=>t.node.id===e.variantId),p=r[d]?.filter(e=>e===o?.node.id).length||0;return i?t.createElement(pm,{className:"yt-byob-tracker-detailed-product-item",key:e.variantId},t.createElement(Yu,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.isFree&&t.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",t.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 ")),e?.quantity>1&&t.createElement(qu,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},e.quantity,"x")),t.createElement(Zu,{className:"yt-byob-tracker-info-block"},t.createElement(Xu,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(Ku,{className:"yt-byob-tracker-product-price"},s,eh(o?.node?.price)),t.createElement(Uu,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(e.variantId,d),style:{...1===a.minimumQuantity&&1===a.products.length&&1===r[d]?.length?{display:"none"}:{}}},t.createElement(ei,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(dm,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:o?.node.image?.url&&o?.node.image?.url?.length>0?o?.node.image.url:e.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},e?.isFree&&t.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"}},t.createElement(qo,null),t.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&&t.createElement(qu,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),t.createElement(Uu,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(e.variantId,d),style:{...1===a.minimumQuantity&&1===a.products.length&&1===r[d]?.length?{display:"none"}:{}}},t.createElement(ht,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((e,r)=>t.createElement(em,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:r},t.createElement(yo,{size:40,color:"#A0A0A0"}))))),d<e.length-1&&t.createElement(um,{className:"yt-byob-tracker-plus-icon-container"},t.createElement(yo,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),fm=({builderTiers:e,handleAddToCart:n,minimumQuantity:r,selectedProducts:o,showProductDetailsInTracker:a,loading:i,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:f,dealAmount:g,isMobile:x=!1,themeColor:h,cornerRadiusType:y,primaryTextColorCta:b,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[k,E]=c(!1),[S,T]=c(0),[$,B]=c([]),[z,I]=c(0),[N,D]=c(0),[_,P]=c(!1),[F,O]=c(null),A=u?.price||0,M=e?.type,R=e=>{if(e<0||!$[e])return A;const t=$[e].discountValue??0;return d?A*(1-t/100):g?t:m?A-t:A};l(()=>{if(e&&"none"!==e.type)if("productTier"===M&&e.productTier){const t=e.productTier||[];B(t);let n=0;e.productTier.map(e=>{n+=e.minimumQuantity}),D(n-p)}else if($.length)z>0&&p<$[z-1]?.minimumQuantity?(I(z-1),O(z-1)):p<$[z]?.minimumQuantity&&O(z-1),T(R(z));else{const t=e.offerTier||[];B(t),I(0),D(t[0]?.minimumQuantity-p||r-p)}else B([]),D(r-p),I(0)},[e,r,p]),l(()=>{$.length&&"productTier"!=M?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===M)for(let r=0;r<$.length&&(n+=$[r].minimumQuantity,p>=n);r++)t=r,e=r+1<$.length?r+1:r;if(I(e),O(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),E(!0),T(R(t))}else P(!1),E(!1),T(A);const r=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;D(r)})():p===r?(E(!0),T(d?A*(1-d/100):g||(m?A-m:A)),P(!0)):(P(!1),E(!1))},[p,$]);const L=k?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,j=k?S.toFixed(2):u?.price?.toFixed(2),V=L&&j?(L-Number(j)).toFixed(2):0,W=e&&"none"!==M&&e.offerTier?"offerTier"===M?Math.min(p/(p+N)*100,100):void 0:p/r*100;l(()=>{if(k&&f.byob.enableConfetti){console.log("remainingItems",N);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,r=(t.top+t.height/2)/window.innerHeight;ro({particleCount:100,spread:70,origin:{x:n,y:r},zIndex:9999})}},[k,f]),z>=0&&z<$.length&&$[z].tier;const H="number"==typeof F?$[F]?.customText:void 0,q="string"==typeof H&&""!==H.trim();return t.createElement(Ou,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(x?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:x,style:{justifyContent:f.byob.selectedProductsVisibility&&!x?"space-between":"center"}},"offerTier"==M&&null!==F&&F>=0&&t.createElement(Au,{className:"yt-byob-tracker-offer-tier-tag"},q?t.createElement(t.Fragment,null,H," unlocked"):t.createElement(t.Fragment,null,t.createElement(t.Fragment,null,"Buy"," ",$.slice(0,F+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||g?t.createElement(t.Fragment,null," ",th(f.general.currencySymbol,C)):""," ",eh($[F]?.discountValue),d?t.createElement(t.Fragment,null,"% "):eh(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):""),t.createElement("span",{style:{fontStyle:"italic"}}," applied"))),x&&N>=1&&!_&&"offerTier"!==M?t.createElement(Mu,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},"Select ",N," more item(s)"):t.createElement(t.Fragment,null),"productTier"!==M&&t.createElement(Ru,{className:"yt-byob-tracker-tier-progress-container"},t.createElement(Lu,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==M&&$.length>0&&z>=0&&N>0&&t.createElement(t.Fragment,null,q?t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," more to unlock"," ",null!==F&&($[F+1]?.customText||$[F]?.customText||"")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",N," More Item(s)",t.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+N," at",m||g?t.createElement(t.Fragment,null,th(f.general.currencySymbol,C)):""," ",eh($[z]?.discountValue),d?t.createElement(t.Fragment,null,"% "):eh(g)?t.createElement(t.Fragment,null):"",d||m?t.createElement(t.Fragment,null," Off"):"")))),t.createElement(ju,{className:"yt-byob-tracker-progress-bar-bg"},t.createElement(Vu,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:h??f?.general.primaryColor}," "))),f.byob.selectedProductsVisibility&&t.createElement(Wu,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(x?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:M??"",isMobile:x},"productTier"===M?t.createElement(mm,{tiers:$,isMobile:x,selectedProductsByTier:w??{},selectedProducts:o,themeColor:f.general.primaryColor,showProductDetailsInTracker:a,handleRemoveItemProductTier:v,cornerRadius:f.byob.borderRadius,currencySymbol:th(f.general.currencySymbol,C)}):t.createElement(t.Fragment,null,o?.map?.(e=>{const n=e.product.variants?.edges?.find(t=>t.node.id===e.variantId);return a?t.createElement(Qu,{className:"yt-byob-tracker-detailed-item-container",borderRadius:f.byob.borderRadius,key:e.variantId},t.createElement(Yu,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url})`}},e?.quantity>1&&t.createElement(Gu,{className:"yt-byob-tracker-badge"},e.quantity,"x")),t.createElement(Zu,{className:"yt-byob-tracker-info-block"},t.createElement(Xu,{className:"yt-byob-tracker-product-title"},e.product.title),t.createElement(Ku,{className:"yt-byob-tracker-product-price"},f.general.currencySymbol,n?.node?.price),t.createElement(Ju,{className:"yt-byob-tracker-remove-link",onClick:()=>s(e.variantId)},t.createElement(ei,null),t.createElement("span",null,"Remove")))):t.createElement("div",{className:"yt-byob-tracker-product-item",key:e.variantId},t.createElement(sm,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:x,borderRadius:f.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:e.product.featuredMedia?.preview?.image?.url},e?.quantity>1&&t.createElement(qu,{className:"yt-byob-tracker-quantity-badge",borderRadius:f.byob.borderRadius},e.quantity,"x"),t.createElement(Uu,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(e.variantId)},t.createElement(ht,{fontSize:"12px"}))))}),N>=1&&[...Array(N)].map((e,n)=>t.createElement(em,{className:"yt-byob-tracker-placeholder-box",isMobile:x,borderRadius:f.byob.borderRadius,key:n},t.createElement(yo,{size:40,color:"#A0A0A0"}))))),(!x||_)&&t.createElement(Hu,{className:"yt-byob-tracker-summary-container bundle-summary "+(x?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:x},Number(j)>0&&t.createElement(tm,{className:"yt-byob-tracker-summary-info summary-info"},t.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},x?t.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},t.createElement(nm,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&t.createElement(rm,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",th(f.general.currencySymbol,C),eh(V))):t.createElement(t.Fragment,null,t.createElement(nm,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(V)>0&&!x&&t.createElement(rm,{className:"yt-byob-tracker-save-label"},"Save:"," ",th(f.general.currencySymbol,C),eh(V)))),t.createElement(om,{className:"yt-byob-tracker-subtotal-row"},t.createElement(am,{className:"yt-byob-tracker-final-price"},th(f.general.currencySymbol,C),Number(j)>=0?eh(Number(j).toFixed(2)):0),L&&f.byob.compareAtPriceVisibility&&Number(L)>Number(j)&&t.createElement(im,{className:"yt-byob-tracker-line-through-price"},th(f.general.currencySymbol,C),eh(Number(L).toFixed(2))))),t.createElement(lm,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:_,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:f.general.ctaBackgroundColor,ctaBorderColor:f.general.ctaBorderColor,ctaHoverBackgroundColor:f.general.ctaHoverBackgroundColor,ctaHoverTextColor:f.general.ctaHoverTextColor},borderRadius:f.general.ctaBorderRadius,disabled:!_&&N>=1,onClick:e=>{i||console.log("saving"),n(e.target??e.currentTarget)},id:"checkoutButton"},i?t.createElement(da,{color:"white",loading:i,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):N>=1&&!_?t.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:f.general.primaryColor}},"Add ",N," More Item(s)"):t.createElement(cm,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:f.general.ctaTextColor,ctaHoverTextColor:b??f.general.ctaHoverTextColor},f.byob.checkoutCTAText??"Checkout"))))},gm={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"}}},xm={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},hm=e=>{const[n,r]=c(!1);l(()=>{const e=()=>{r(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const o="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,a=((e,t=!1)=>{const n=e&&gm[e]?gm[e]:{},r={...xm,...n};return t&&n.mobile?{...r,...n.mobile}:r})(String(o),n);e.renderingOnPage||(a.position="static",a.zIndex=0);const i={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 ",...a};return t.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(n?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...i,width:n?"100%":a.width,...!e.styles.byob.selectedProductsVisibility&&{width:n?"96%":"fit-content",paddingInline:"10px"},...n&&{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%)"===a.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=a.transform||"translateY(0)"}},t.createElement(fm,{...e,isMobile:n}))},ym=Kt(void 0);function bm(e){return bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bm(e)}function vm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wm(e,t){return wm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wm(e,t)}function Cm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=km(e);if(t){var o=km(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===bm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},km(e)}var Em=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wm(e,t)}(o,x);var e,t,n,r=Cm(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return e=o,t=[{key:"componentDidMount",value:function(){!function(e,t){if(!document.head.querySelector("#"+e)){var n=document.createElement("style");n.textContent=t,n.type="text/css",n.id=e,document.head.appendChild(n)}}(this.props.name,this.props.css)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById(this.props.name);e.parentNode.removeChild(e)}},{key:"render",value:function(){return null}}],t&&vm(e.prototype,t),n&&vm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(),Sm=function(e){var t=e.imageBackgroundColor;return"\n body {\n overflow: hidden;\n }\n\n .__react_modal_image__modal_container {\n position: fixed;\n z-index: 5000;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.8);\n touch-action: none;\n overflow: hidden;\n }\n\n .__react_modal_image__modal_content {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .__react_modal_image__modal_content img, \n .__react_modal_image__modal_content svg {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate3d(-50%, -50%, 0);\n -webkit-transform: translate3d(-50%, -50%, 0);\n -ms-transform: translate3d(-50%, -50%, 0);\n overflow: hidden;\n }\n\n .__react_modal_image__medium_img {\n max-width: 98%;\n max-height: 98%;\n background-color: ".concat(t,";\n }\n\n .__react_modal_image__large_img {\n cursor: move;\n background-color: ").concat(t,"\n }\n\n .__react_modal_image__icon_menu a {\n display: inline-block;\n font-size: 40px;\n cursor: pointer;\n line-height: 40px;\n box-sizing: border-box;\n border: none;\n padding: 0px 5px 0px 5px;\n margin-left: 10px;\n color: white;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .__react_modal_image__icon_menu {\n display: inline-block;\n float: right;\n }\n\n .__react_modal_image__caption {\n display: inline-block;\n color: white;\n font-size: 120%;\n padding: 10px;\n margin: 0;\n }\n\n .__react_modal_image__header {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.7);\n overflow: hidden;\n }\n")},Tm=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))},$m=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))},Bm=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},zm=function(){return t.createElement("svg",{fill:"#ffffff",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))},Im=function(){return t.createElement("svg",{fill:"#ffffff",height:"48",viewBox:"0 0 24 24",width:"48",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z"}),t.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}))},Nm=function(){return t.createElement("svg",{fill:"#ffffff",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0z"}),t.createElement("path",{d:"M7.47 21.49C4.2 19.93 1.86 16.76 1.5 13H0c.51 6.16 5.66 11 11.95 11 .23 0 .44-.02.66-.03L8.8 20.15l-1.33 1.34zM12.05 0c-.23 0-.44.02-.66.04l3.81 3.81 1.33-1.33C19.8 4.07 22.14 7.24 22.5 11H24c-.51-6.16-5.66-11-11.95-11zM16 14h2V8c0-1.11-.9-2-2-2h-6v2h6v6zm-8 2V4H6v2H4v2h2v8c0 1.1.89 2 2 2h8v2h2v-2h2v-2H8z"}))};var Dm=function(e){return function(t){(function(e){return document.location.hostname!==new URL(e,document.location).hostname})(e)&&(t.preventDefault(),fetch(e).then(function(t){return t.ok||console.error("Failed to download image, HTTP status "+t.status+" from "+e),t.blob().then(function(t){var n=document.createElement("a");n.setAttribute("download",e.split("/").pop()),n.href=URL.createObjectURL(t),n.click()})}).catch(function(t){console.error(t),console.error("Failed to download image from "+e)}))}},_m=function(e){var n=e.image,r=e.alt,o=e.zoomed,a=e.toggleZoom,i=e.toggleRotate,l=e.onClose,c=e.enableDownload,s=e.enableZoom,d=e.enableRotate;return t.createElement("div",{className:"__react_modal_image__header"},t.createElement("span",{className:"__react_modal_image__icon_menu"},c&&t.createElement("a",{href:n,download:!0,onClick:Dm(n)},t.createElement(Bm,null)),s&&t.createElement("a",{onClick:a},o?t.createElement($m,null):t.createElement(Tm,null)),d&&t.createElement("a",{onClick:i},t.createElement(Nm,null)),t.createElement("a",{onClick:l},t.createElement(zm,null))),r&&t.createElement("span",{className:"__react_modal_image__caption"},r))};function Pm(e){return Pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pm(e)}function Fm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Om(e,t){return Om=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Om(e,t)}function Am(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=Rm(e);if(t){var o=Rm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Pm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Mm(e)}(this,n)}}function Mm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rm(e){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rm(e)}function Lm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Om(e,t)}(a,x);var e,n,r,o=Am(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Lm(Mm(e=o.call.apply(o,[this].concat(n))),"state",{loading:!0}),Lm(Mm(e),"handleOnLoad",function(){e.setState({loading:!1})}),Lm(Mm(e),"handleOnContextMenu",function(t){!e.props.contextMenu&&t.preventDefault()}),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.id,r=e.className,o=e.src,a=e.style,i=e.handleDoubleClick;return t.createElement("div",null,this.state.loading&&t.createElement(Im,null),t.createElement("img",{id:n,className:r,src:o,style:a,onLoad:this.handleOnLoad,onDoubleClick:i,onContextMenu:this.handleOnContextMenu}))}}],n&&Fm(e.prototype,n),r&&Fm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Vm(e){return Vm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vm(e)}function Wm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hm(e,t){return Hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hm(e,t)}function qm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=Qm(e);if(t){var o=Qm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Vm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Um(e)}(this,n)}}function Um(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qm(e){return Qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qm(e)}function Ym(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gm=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hm(e,t)}(a,x);var e,n,r,o=qm(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ym(Um(e=o.call.apply(o,[this].concat(n))),"state",{move:{x:0,y:0},moveStart:void 0,zoomed:!1,rotationDeg:0}),Ym(Um(e),"handleKeyDown",function(t){27!==t.keyCode&&13!==t.keyCode||e.props.onClose()}),Ym(Um(e),"getCoordinatesIfOverImg",function(t){var n=t.changedTouches?t.changedTouches[0]:t;if("react-modal-image-img"===n.target.id){var r=e.contentEl.getBoundingClientRect();return{x:n.clientX-r.left,y:n.clientY-r.top}}}),Ym(Um(e),"handleMouseDownOrTouchStart",function(t){if(t.preventDefault(),!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n||e.props.onClose(),e.state.zoomed&&e.setState(function(e){return{moveStart:{x:n.x-e.move.x,y:n.y-e.move.y}}})}}),Ym(Um(e),"handleMouseMoveOrTouchMove",function(t){if(t.preventDefault(),e.state.zoomed&&e.state.moveStart&&!(t.touches&&t.touches.length>1)){var n=e.getCoordinatesIfOverImg(t);n&&e.setState(function(e){return{move:{x:n.x-e.moveStart.x,y:n.y-e.moveStart.y}}})}}),Ym(Um(e),"handleMouseUpOrTouchEnd",function(t){e.setState({moveStart:void 0})}),Ym(Um(e),"toggleZoom",function(t){t.preventDefault(),e.setState(function(e){return{zoomed:!e.zoomed,move:e.zoomed?{x:0,y:0}:e.move}})}),Ym(Um(e),"toggleRotate",function(t){t.preventDefault(),360!==e.state.rotationDeg?e.setState(function(e){return{rotationDeg:e.rotationDeg+=90}}):e.setState({rotationDeg:90})}),e}return e=a,(n=[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown,!1)}},{key:"render",value:function(){var e=this,n=this.props,r=n.medium,o=n.large,a=n.alt,i=n.onClose,l=n.hideDownload,c=n.hideZoom,s=n.showRotate,d=n.imageBackgroundColor,p=void 0===d?"black":d,u=this.state,m=u.move,f=u.zoomed,g=u.rotationDeg;return t.createElement("div",null,t.createElement(Em,{name:"__react_modal_image__lightbox",css:Sm({imageBackgroundColor:p})}),t.createElement("div",{className:"__react_modal_image__modal_container"},t.createElement("div",{className:"__react_modal_image__modal_content",onMouseDown:this.handleMouseDownOrTouchStart,onMouseUp:this.handleMouseUpOrTouchEnd,onMouseMove:this.handleMouseMoveOrTouchMove,onTouchStart:this.handleMouseDownOrTouchStart,onTouchEnd:this.handleMouseUpOrTouchEnd,onTouchMove:this.handleMouseMoveOrTouchMove,ref:function(t){e.contentEl=t}},f&&t.createElement(jm,{id:"react-modal-image-img",className:"__react_modal_image__large_img",src:o||r,style:{transform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) translate3d(".concat(m.x,"px, ").concat(m.y,"px, 0) rotate(").concat(g,"deg)")},handleDoubleClick:this.toggleZoom}),!f&&t.createElement(jm,{id:"react-modal-image-img",className:"__react_modal_image__medium_img",src:r||o,handleDoubleClick:this.toggleZoom,contextMenu:!r,style:{transform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),WebkitTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)"),MsTransform:"translate3d(-50%, -50%, 0) rotate(".concat(g,"deg)")}})),t.createElement(_m,{image:o||r,alt:a,zoomed:f,toggleZoom:this.toggleZoom,toggleRotate:this.toggleRotate,onClose:i,enableDownload:!l,enableZoom:!c,enableRotate:!!s})))}}])&&Wm(e.prototype,n),r&&Wm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();function Zm(e){return Zm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zm(e)}function Xm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Km(e,t){return Km=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Km(e,t)}function Jm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=tf(e);if(t){var o=tf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Zm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ef(e)}(this,n)}}function ef(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tf(e){return tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tf(e)}function nf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rf=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Km(e,t)}(a,x);var e,n,r,o=Jm(a);function a(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nf(ef(e=o.call.apply(o,[this].concat(n))),"state",{modalOpen:!1}),nf(ef(e),"toggleModal",function(){e.setState(function(e){return{modalOpen:!e.modalOpen}})}),e}return e=a,n=[{key:"render",value:function(){var e=this.props,n=e.className,r=e.small,o=e.smallSrcSet,a=e.medium,i=e.large,l=e.alt,c=e.hideDownload,s=e.hideZoom,d=e.showRotate,p=e.imageBackgroundColor,u=this.state.modalOpen;return t.createElement("div",null,t.createElement("img",{className:n,style:{cursor:"pointer",maxWidth:"100%",maxHeight:"100%"},onClick:this.toggleModal,src:r,srcSet:o,alt:l}),u&&t.createElement(Gm,{medium:a,large:i,alt:l,onClose:this.toggleModal,hideDownload:c,hideZoom:s,showRotate:d,imageBackgroundColor:p}))}}],n&&Xm(e.prototype,n),r&&Xm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),a}();const of=h.div`
|
|
3323
3323
|
position: absolute;
|
|
3324
3324
|
top: 0px;
|
|
3325
3325
|
right: 0px;
|
|
@@ -3538,7 +3538,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3538
3538
|
font-size: 1em;
|
|
3539
3539
|
justify-content: center;
|
|
3540
3540
|
align-items: center;
|
|
3541
|
-
`;const sf=n((e,n)=>{const[r,o]=un(ym),a=i(()=>t=>{const n=e?.customVariantsQuantity?.find(e=>e.variantId===t?.id)?.quantity;return void 0!==n?n:e?.bundleProductsCustomQuantity?e?.bundleProductsCustomQuantity:t?r?.tracksInventory&&t.inventoryItem?.tracked?t.inventoryQuantity>0?t.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0},[r?.tracksInventory,e?.customVariantsQuantity,e?.bundleProductsCustomQuantity]),s=r?.variants.edges?.filter(e=>a(e.node)>0)||[],[d,p]=c(s?.[0]?.node),[u,m]=c(0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=600),[x,h]=c(1),[y,b]=c("idle"),[w,C]=c(null),[k,E]=c(null);l(()=>{if(r){const e=r.variants.edges?.filter(e=>a(e.node)>0);p(r?.selectedVariant??e[0]?.node)}},[r,a]),l(()=>{const t=e.selectedProducts.find(e=>e.variantId===d?.id);h(t?t.quantity:0)},[x,e.selectedProducts,d]);const S=()=>{d?.id&&r&&(b("check"),e.handleAddToBundle(d?.id,r,1),setTimeout(()=>{b("idle"),o(void 0)},500))};if(l(()=>{const e=()=>g(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!r)return null;const{title:T,descriptionHtml:$,media:B,variants:z}=r,I=B.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0);l(()=>{if(r&&d?.image?.url&&Array.isArray(I)){const e=I.findIndex(e=>e?.url===d?.image?.url);-1!==e&&e!==u&&m(e)}},[d]);const N=e=>{const t=e.target.value,n=s?.find(e=>e.node.id===t)?.node;n&&a(n)>0&&p(n)};l(()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[r,o]);const D=e=>{C(e.targetTouches[0].clientX),E(null)},_=e=>{E(e.targetTouches[0].clientX)},P=()=>{if(null!==w&&null!==k&&I.length>1){const e=w-k,t=50;e>t?m(e=>e<I.length-1?e+1:0):e<-t&&m(e=>e>0?e-1:I.length-1)}C(null),E(null)},O=e.selectedProducts.filter(e=>e.variantId===d?.id).reduce((e,t)=>e+t.quantity,0),F=e.customVariantsQuantity?.find(e=>e.variantId===d?.id)?.quantity??e.bundleProductsCustomQuantity??1/0,A=F!==1/0&&O>=F,M=e.hideAddToBundle||!d||a(d)<=0||A||"idle"!==y||e?.disableQuantitySelector&&1===x,R=t.createElement(af,{className:"yt-byob-modal-desktop-overlay"},t.createElement(lf,{$isSmallScreen:f,ref:n},t.createElement(cf,{ref:n,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},t.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement(of,{className:"yt-byob-modal-desktop-close",onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(ft,{size:"25"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-image-swipe",onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(rf,{small:nh(I[u]?.url),medium:nh(I[u]?.url),large:nh(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-desktop-main-image main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},I.length>1&&I.filter(e=>e?.url.length>0).map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-desktop-gallery-thumb "+(u===r?"active":""),src:nh(n?.url),alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>m(r),style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.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"}},t.createElement("h2",{className:"yt-byob-modal-desktop-title"},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-desktop-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-desktop-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(mr,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-desktop-variant-selector"},t.createElement("div",{className:"yt-byob-modal-desktop-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-desktop-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-desktop-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Eo,null)))),t.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:"baseline",gap:"6px"}},e?.isFreebieTier&&!e.showFreebieTierProductPrices?t.createElement(t.Fragment,null,t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price)),t.createElement("span",{className:"yt-byob-current-price",style:{color:e.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price))),d?.compareAtPrice&&parseFloat(d.compareAtPrice)>parseFloat(d?.price)&&t.createElement("div",{className:"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.compareAtPrice)))),t.createElement("div",{className:"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:"80%"}},t.createElement("button",{className:"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:M?.5:1,cursor:M?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:M},e.styles.byob.addToBundleCTAText??"Add to bundle")))),t.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"}},t.createElement("span",null)),t.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:$}})))))),L=t.createElement(af,{className:"yt-byob-modal-mobile-overlay"},t.createElement(lf,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:n},t.createElement(cf,{ref:n,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},t.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:()=>{o(void 0)}},t.createElement(So,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},t.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-mobile-image-swipe",style:{position:"relative"},onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(rf,{small:nh(I[u]?.url),medium:nh(I[u]?.url),large:nh(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-mobile-main-image main-image",imageBackgroundColor:"#000"}),t.createElement("div",{className:"yt-byob-modal-mobile-image-indicators",style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},I.length>1&&I.map((e,n)=>t.createElement("span",{key:n,className:"yt-byob-modal-mobile-indicator "+(u===n?"active":""),style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}})))),t.createElement("div",{className:"yt-byob-modal-mobile-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},I.length>1&&I.map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-mobile-gallery-thumb "+(u===r?"active":""),src:nh(n?.url),alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>m(r),style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:"120px"}},t.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-mobile-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-mobile-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(mr,{className:"yt-byob-modal-mobile-verified-icon",style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},t.createElement("span",null)),t.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:$}})))),t.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",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}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-mobile-variant-selector"},t.createElement("div",{className:"yt-byob-modal-mobile-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-mobile-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-mobile-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Eo,null)))),t.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-mobile-price",style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"row",paddingRight:"10px",alignItems:"center"}},e?.isFreebieTier&&!e.showFreebieTierProductPrices?t.createElement(t.Fragment,null,t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price)),t.createElement("span",{className:"yt-byob-current-price",style:{color:e.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):t.createElement(t.Fragment,null,d?.compareAtPrice&&t.createElement("div",{className:"yt-byob-modal-mobile-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-mobile-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price))))),t.createElement("div",{className:"yt-byob-modal-mobile-atc-wrapper",style:{width:"100%"}},t.createElement("button",{className:"yt-byob-modal-mobile-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:M?.5:1,cursor:M?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:M},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(f?L:R,document.body)}),df=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map(e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name);return"image"===o?t.createElement("img",{src:Wn(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name)})(e,n?.name===e.name))})),pf=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:s})=>{const d=i(()=>t=>t?e?.tracksInventory&&t?.inventoryItem?.tracked?t.inventoryQuantity>0?t?.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0,[e?.tracksInventory]),p=i(()=>{const t=e.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map(e=>e.values[0])||[]},[e,d]),[u,m]=c(p),[f,g]=c(window.innerWidth<1024);l(()=>{const e=()=>g(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n,r]);const x=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,h=x?.image?.url||e.featuredMedia?.preview?.image?.url,y=Wn(h,150,85,"webp"),b=e=>{if(!o?.options)return"text";const t=o.options.find(t=>t.name===e);return t?.type||"text"},w=e=>{if(!o?.options)return e.values.map(e=>({name:e,value:e}));const t=o.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}})},C=(e,t)=>{const n=u[t];if(!n)return null;return w(e).find(e=>e.name===n)||null};if(!n)return null;const k=t.createElement("div",{onClick:r,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"},t.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"}}},t.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"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},t.createElement("img",{src:y,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},e.title))),t.createElement("div",{style:{padding:"20px"}},e.options.map((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(n,r)?.name||n.values[0])),t.createElement(df,{options:w(n),selectedValue:C(n,r),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(r,e)},type:b(n.name),isOptionAvailable:t=>((t,n)=>{const r=[...u];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find(e=>e.node.title===o)?.node;return!!a&&d(a)>0})(r,t),isMobile:f}))))),t.createElement("button",{onClick:()=>{const t=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,n=!!t&&d(t)>0;if(t?.id&&n)s(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const t=e.variants.edges.find(e=>d(e.node)>0)?.node.id;t&&(s(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.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 v.createPortal(k,document.body)},uf=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{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}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map(({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""}).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",s=i(c,800)||c,d=[];if(n&&n!==e){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(d.length>0?d.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},d,t.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function mf({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,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=e<s;return t.createElement(Su,{className:"yt-byob-quantity-selector-container"},t.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:d},"-"),t.createElement(Tu,{className:"yt-byob-quantity-display"},e," added"),t.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1,s);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const ff=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),s=i(()=>nh(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||"",[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),d=i(()=>e?.media?.edges?.map(e=>nh(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[e?.media?.edges]),p=i(()=>d?.[1]??s??"",[d,s]);l(()=>{if(s){(new Image).src=s}},[s]);const u=i(()=>s||d?.[0],[s,d]);return t.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:e.title})))},gf=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:i,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:f,currentProductTier:g,showFreebieTierProductPrices:x})=>{const h=pn(ym),y=n.customizations,b=y?.byob?.variantSelectorType,[v,w]=c(!1),C=y.general?.variantTitleSuffix?e?.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 r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}})})(e?.variants?.edges);if(!C||!C.length)return t.createElement(t.Fragment,null);const k=a(t=>{const r=f?.find(e=>e.variantId===t)?.quantity;if(void 0!==r)return r;if(n?.customProductsQuantity)return n?.customProductsQuantity;const o=C?.find(e=>e.node.id===t),a=o?.node;return a?e.tracksInventory&&a.inventoryItem?.tracked?a.inventoryQuantity>0?a.inventoryQuantity:a.inventoryQuantity<=0&&"continue"===a.inventoryPolicy?1/0:0:1/0:0},[C,f,e.tracksInventory]),E=C?.find(e=>k(e.node.id)>0)?.node?.id;if(!E&&!y.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[S,T]=c(C?.find(e=>k(e.node.id)>0)?.node?.id||C[0]?.node?.id),[$,B]=c(0),[z,I]=c(window.innerWidth<450),[N,D]=c("normal"),_=C?.find(e=>e?.node?.id===S)?.node,P=k(S||"");l(()=>{const e=m.find(e=>e.variantId===S);B(e?e.quantity:0)},[$,m,S]),l(()=>{const e=()=>{I(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{CSS.supports("font-weight","500")?D("500"):CSS.supports("font-weight","400")?D("400"):CSS.supports("font-weight","600")&&D("600")},[]),l(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",N)},[N]),l(()=>{if(S&&!C?.some(e=>e.node.id===S)){const e=C.find(e=>k(e.node.id)>0)?.node.id||C[0]?.node?.id;e&&T(e)}},[S,C,k]);const O=e.variants&&e.variants.edges?.length>1&&"customOptions"!==b,F="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,A="53933408435"===F,M="75851235630"===F,L=(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[]})(e),j=L.length>0;return t.createElement(t.Fragment,null,t.createElement(zu,{borderRadius:y?.byob.borderRadius,borderColor:y?.byob.borderColor,shadowType:y?.byob.shadowType,backgroundColor:y?.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(P<=0)return;const t={...e,variants:{...e.variants,edges:C},selectedVariant:_};h(t)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent"}},t.createElement(Iu,{className:"yt-byob-image-wrapper"},t.createElement(ff,{product:e,styles:y,selectedVariant:_}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:y?.general.primaryColor||"#111",color:y?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:y.byob.borderRadius}},n.productCardBadgeText),O&&t.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},t.createElement(Nu,{className:"yt-byob-variant-selector",isCoralHaze:A,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:S||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),T(e.target.value)}},C?.map(e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)})),t.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(R,null)))),t.createElement("div",{className:"yt-byob-product-content"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&j&&t.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},L.slice(0,2).map((e,n)=>t.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1))),L.length>2&&t.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"}},"+",L.length-2," more"))),t.createElement(Du,{isMobile:z,showBorder:n?.showBorder??!0,style:{...!y?.byob.productsPriceVisibility&&{padding:"8px"},...y?.byob.productTitleFontSize&&{fontSize:y?.byob.productTitleFontSize}},className:"yt-byob-product-title-wrapper"},t.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(_?.displayName).replace("- Default Title",""):e.title,_?.commonSuffix?" -"+_?.commonSuffix:""))),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(mr,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),y?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},g?.isFreebieTier&&!x?t.createElement(t.Fragment,null,t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},th(y.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",eh(_?.price)),t.createElement("span",{className:"yt-byob-current-price",style:{color:y.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(_?.price??"0")>0?t.createElement("span",{className:"yt-byob-current-price"},th(y.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",eh(_?.price)):t.createElement("span",{className:"yt-byob-free-price"},"Free"),(!g?.isFreebieTier||x)&&_?.compareAtPrice&&y?.byob.compareAtPriceVisibility&&parseFloat(_.compareAtPrice)>parseFloat(_?.price)&&t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},th(y.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",eh(_.compareAtPrice))),(P>0||P===1/0)&&t.createElement(_u,{borderRadius:y?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===$||void 0===$)&&t.createElement($u,{style:{...!o&&{backgroundColor:y?.general.primaryColor||"#111",color:y?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),B(1),(()=>{if(!S)return;"customOptions"===b&&C.length>1?w(!0):r(S,e,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},y?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&$>0&&S&&t.createElement(Bu,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},t.createElement(mf,{remainingQuantity:i,setQuantity:B,quantity:$,handleAddToBundle:r,variantId:S,product:e,handleRemoveItem:d,hideAddToBundle:o,selectedVariantInventoryQty:P})),n?.disableQuantitySelector&&$>0&&S&&t.createElement($u,{style:{backgroundColor:"#747474",color:y?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},t.createElement(Pu,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),t.createElement(Ou,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,$-1);B(t),d&&S&&d(S,1)}},t.createElement(vo,{style:{color:"#fff",fontSize:"20px"}})))),P<=0&&P!==1/0&&t.createElement($u,{style:{backgroundColor:y.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},y?.general.outOfStockLabel||"Out of Stock")),"customOptions"===b&&v&&C.length>1&&t.createElement(pf,{product:e,isOpen:v,onClose:()=>w(!1),variantOptions:n.variantOptions,cta:{textColor:y.general.ctaTextColor,backgroundColor:y.general.primaryColor},onConfirm:t=>{T(t),r(t,e,1)}}))},xf=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>t.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((c,d)=>{const p=d+1,u=o[d].minimumQuantity-(i[d]?.length??0)===0,m=d===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},t.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.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"}}),t.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),t.createElement("div",{className:"yt-byob-stepper-title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),hf=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,s]=c(!1),[d,p]=c(r);return l(()=>{const e=setTimeout(()=>{n(d)},300);return()=>clearTimeout(e)},[d,n]),t.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(bo,{className:"yt-byob-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>s(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:d,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(bo,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>s(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},yf=({styles:e,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(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"===e?.byob?.categoryFilterOnPage?t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},t.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",...r].map(r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},t.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",...r].map(r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1)))))},bf=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:s,renderingOnPage:d,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal:m})=>{const[f,g]=c(void 0),[x,h]=c(window.innerWidth<450),[y,b]=c(0),[v,w]=c({}),C=e.builderTiers?.type,k=e.customizations,E=e.builderTiers?.productTier??[],S=e.builderTiers?.offerTier??[],[T,$]=c([]),[B,z]=c(!1),[I,N]=c("All"),[D,_]=c(0),P=o(null);l(()=>{const t=new Set;let n=!1;e?.products?.forEach(e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach(e=>t.add(e)))}}),$(Array.from(t)),z(n)},[e.products]);const O=((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}))(e.products.filter(e=>"active"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status),I),F="productTier"===C?E.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===C?S.reduce((e,t)=>e+t.minimumQuantity,0):e.minimumQuantity,[A,M]=c(""),[R,L]=c(""),j=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(O,A),V=((e,t)=>[...e].sort((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}}))(j,R),W=((e,t,n,r,o)=>(e[o]?.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 o=t.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))),a=t.find(e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0])));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(a?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}}))(E,V,A,R,y),[H,q]=un(ym),[U,Q]=c(!1),Y="productTier"===C?W:V,G=Y.slice(0,20*(D+1));l(()=>{setTimeout(()=>{Q(!0)},100)},[]);const Z=o(null);l(()=>{const e=()=>{h(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{if(e.coverImageUrl){const t=new Image;t.src=nh(e.coverImageUrl)??"",t.onload=()=>{g(t.width/t.height)}}},[e.coverImageUrl]),l(()=>{Q(!1),setTimeout(()=>Q(!0),100)},[y]);const X=(e,t)=>{if("productTier"===C){let n={...v},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=E.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}w(n);const o=E.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==o&&b(o)}u(e)},K=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};l(()=>{if("productTier"===C){const e=Object.fromEntries(E.map(e=>[e.tier,[]]));w(e)}},[e]),l(()=>{if("productTier"!==C||!E[y])return;if(F===p)return;const e=E.findIndex((e,t)=>{const n=v[t]||[];return t>=y&&n.length<e.minimumQuantity});-1!==e&&e!==y&&(b(e),K())},[v,E,C]),l(()=>{M("")},[y]),l(()=>{function e(e){if(!Z.current||!e.target)return;!Z.current.contains(e.target)&&q(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const J=(e,t,o)=>{var a;"productTier"===C&&(a=e,w(e=>{const t={...e},n=E.findIndex((e,n)=>{const r=t[n]||[];return n>=y&&r.length<e.minimumQuantity});return-1!==n&&b(n),t[n]||(t[n]=[]),t[n].push(a),t}));const i=!0===E[y]?.isFreebieTier;rh(e,t,o,n,r,i)},ee=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map(e=>{a+=e.minimumQuantity}),a})(),te=x&&e.mobileCoverImageUrl?nh(e.mobileCoverImageUrl):nh(e.coverImageUrl??"")||null,ne=e.customStoreDetails?.fixedInventoryDetails,re=a((e,t)=>{const n=ne?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0},[ne]),oe=a(e=>{const t=k?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,r=n?.variants?.edges||[];if(ne){if(r.some(e=>ne.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>re(n,e.node.id)>0)},[k?.general?.showOutOfStockProducts,ne,re]);l(()=>{if("productTier"!==C)return;const t=E[y];if(!t)return;if(1!==t.minimumQuantity)return;if(1!==t.products.length)return;const n=t.products[0],r=e.products.find(e=>e.productId===n.productId)?.productDetails;if(!r)return;if(r.variants?.edges?.length>1)return;const o=r.variants?.edges?.find(e=>re(r,e.node.id)>0)?.node;if(!o)return;const a=o.id,i=v[y]?.includes(a);i||(J(a,r,1),y<E.length-1&&(b(y+1),K()))},[C,E,y,e.products,v,re,J]);const ae="bundles"==e.appName?e.pageHeader?.title:e?.title,ie="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l(()=>{_(0)},[A,R,I,y]);const le=a(()=>{G.length<Y.length&&_(e=>e+1)},[G.length,Y.length]);return l(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&le()},{threshold:.1});return P.current&&e.observe(P.current),()=>{P.current&&e.unobserve(P.current)}},[le]),t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:k.byob.sectionBackgroundColor,..."transparent"!==k.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},te?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}}},te&&t.createElement(uf,{coverImageUrl:te,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),t.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)"}},t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:k?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},ae),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},ie))):(ae||ie)&&t.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},ae&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:k?.byob?.titleBackgroundColor??"transparent"}},ae),ie&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"}},ie)),t.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(xf,{currentStep:y,totalSteps:E.length,tiers:E,isMobile:x,primaryColor:k?.general?.primaryColor,primaryTextColorCta:k?.general?.primaryContrastColor,setCurrentProductTier:b,selectedProductsByTier:v,tierNavigation:k.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"}},e?.enableSortAndFilter&&t.createElement(hf,{isMobile:x,searchTerm:A,setSearchTerm:M,setSortBy:L,styles:k}),e?.customizations?.byob?.enableProductCategories&&B&&t.createElement("div",null,t.createElement(yf,{styles:k,isMobile:x,categories:T,activeCategory:I,onCategoryChange:e=>{N(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display"},0===Y?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===C&&E.length>0?G.filter(e=>oe(V.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))).map((r,o)=>{const a=(E[y]?.minimumQuantity??0)>(v[y]?.length??0),i=V.find(e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0])));return i?t.createElement(gf,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:J,hideAddToBundle:!a,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>X(e,y),selecteditems:n,transitionActive:U,customVariantsQuantity:ne,currentProductTier:E[y],showFreebieTierProductPrices:e?.customStoreDetails?.showFreebieTierProductPrices}):null}):G.filter(oe).map((r,o)=>t.createElement(gf,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:J,hideAddToBundle:p>=ee,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:U,customVariantsQuantity:ne})),G.length<Y.length&&t.createElement("div",{ref:P,style:{height:"1px",width:"100%",display:"block"}})),!d&&t.createElement(hm,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:F,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:X,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:s,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d})),d&&t.createElement(hm,{handleAddToCart:i,minimumQuantity:F,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:s,handleRemoveItem:u,handleRemoveItemProductTier:X,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:k.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d}),H&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=p<S.reduce((e,t)=>e+t.minimumQuantity,0)),t.createElement(sf,{handleAddToBundle:J,ref:Z,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,selectedProducts:n,selectedProductsByTier:v,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:k?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none",customVariantsQuantity:ne,bundleProductsCustomQuantity:e?.customProductsQuantity,isFreebieTier:E?.[y]?.isFreebieTier,showFreebieTierProductPrices:e?.customStoreDetails?.showFreebieTierProductPrices})})())},vf=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:s,storeCurrencyCode:d})=>{const p=i(()=>t=>{const n=e?.productDetails?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e.productDetails]),u=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;p(n);const m=i(()=>{if(u?.title&&e.productDetails.options){const t=u.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map(e=>e.values[0])||[]},[u,e.productDetails.options]),f=e=>{r(e)};return c?t.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"}},t.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:nh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},e?.productDetails?.variants?.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.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"}},t.createElement(R,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},th(o.general.currencySymbol,d),eh((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-vertical",style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},th(o.general.currencySymbol,d),eh(u?.compareAtPrice?u?.compareAtPrice:u?.price))))):t.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"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.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"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},t.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:nh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),t.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",e?.productDetails?.title," "),"dropdown"!==o.comboBundle.comboVariantTypeSelector&&e.productDetails.variants.edges.length>1&&s&&m&&t.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"}},m.length>1?m.join(" / "):m)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},th(o.general.currencySymbol,d),eh((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},th(o.general.currencySymbol,d),eh(u?.compareAtPrice?u?.compareAtPrice:u?.price))),e.productDetails.variants.edges.length>1&&("dropdown"===o.comboBundle.comboVariantTypeSelector?t.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},e.productDetails.variants.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.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"}},t.createElement(R,null))):e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map((n,r)=>t.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"}},e.productDetails.options.length>1&&n?.values?.length>1&&t.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(a=>{const i=[...m];i[r]=a;const l=e.productDetails.options.length>0?i.join(" / "):i[r],c=e.productDetails.variants.edges.find(e=>e.node.title===l)?.node,d=0===(c?p(c.id):0),u=m[r]===a,g=s&&s?.options?.find(e=>e.name===n.name);return g&&"color"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-color ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"}},g?.values.find(e=>e.name===a)?.value?t.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",borderRadius:"50%",backgroundColor:g?.values.find(e=>e.name===a)?.value}},t.createElement("span",null)):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):g&&"image"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-image ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u&&!d?"#F7F7F7":"transparent",cursor:d?"not-allowed":"pointer",padding:"0px",width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",overflow:"hidden",opacity:d?.5:1}},g?.values.find(e=>e.name===a)?.value?t.createElement("img",{className:"yt-comboBundle-product-option-image",src:nh(g?.values.find(e=>e.name===a)?.value||"/placeholder.svg"),alt:a,style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-text ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",cursor:d?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:d?.5:1}},a)}))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map(e=>{const r=0===p(e?.node?.id);return t.createElement("button",{key:e?.node?.id,className:`yt-comboBundle-product-variant-button ${n===e?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>f(e?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},e?.node?.title)}))))))},wf=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786);l(()=>(n&&(window.ytComboBundle={bundle:e,addToCart:n},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}))}),[e,n]);const d=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[p,u]=c(()=>{const t={};return e.products.forEach((e,n)=>{const r=e.productDetails?.variants?.edges?.find(t=>d(e.productDetails,t?.node?.id)>0)?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id}),t}),m=e.products?.every((e,t)=>{const n=p[t];return d(e.productDetails,n)>0}),f=(e,t)=>{u(n=>({...n,[e]:t}))},{originalPrice:g,dealPrice:x,offerValue:h}=i(()=>{const{price:t,compareAtPrice:n}=Object.entries(p).reduce((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find(e=>e.node.id===r)?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t},{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}},[p,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l(()=>{const e=()=>{s(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},th(y.general.currencySymbol,e.storeCurrencyCode),eh(x)),t.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},th(y.general.currencySymbol,e.storeCurrencyCode),eh(g)),t.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"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(e?.amountOff)} Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(h)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(a?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map((n,r)=>{const o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===p[r])?.node;return o?t.createElement(vf,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:x,selectedVariantId:p[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null})):t.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(a?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map((n,r)=>t.createElement(vf,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:x,selectedVariantId:p[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions})))),t.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${m?"":"yt-comboBundle-bundle-cta-button-disabled"} ${a?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void o(!1);const t=Object.entries(p).map(([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find(e=>e.node.id===n)?.node;return o?{variantId:n,price:Number(o.price)}:null}).filter(e=>null!==e),r=Object.values(p);await n(Number(g),r,Number(x),t)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}o(!1)}},r?t.createElement(da,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},t.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},Cf=h.div`
|
|
3541
|
+
`;const sf=n((e,n)=>{const[r,o]=un(ym),a=i(()=>t=>{const n=e?.customVariantsQuantity?.find(e=>e.variantId===t?.id)?.quantity;return void 0!==n?n:e?.bundleProductsCustomQuantity?e?.bundleProductsCustomQuantity:t?r?.tracksInventory&&t.inventoryItem?.tracked?t.inventoryQuantity>0?t.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0},[r?.tracksInventory,e?.customVariantsQuantity,e?.bundleProductsCustomQuantity]),s=r?.variants.edges?.filter(e=>a(e.node)>0)||[],[d,p]=c(s?.[0]?.node),[u,m]=c(0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=600),[x,h]=c(1),[y,b]=c("idle"),[w,C]=c(null),[k,E]=c(null);l(()=>{if(r){const e=r.variants.edges?.filter(e=>a(e.node)>0);p(r?.selectedVariant??e[0]?.node)}},[r,a]),l(()=>{const t=e.selectedProducts.find(e=>e.variantId===d?.id);h(t?t.quantity:0)},[x,e.selectedProducts,d]);const S=()=>{d?.id&&r&&(b("check"),e.handleAddToBundle(d?.id,r,1),setTimeout(()=>{b("idle"),o(void 0)},500))};if(l(()=>{const e=()=>g(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!r)return null;const{title:T,descriptionHtml:$,media:B,variants:z}=r,I=B.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0);l(()=>{if(r&&d?.image?.url&&Array.isArray(I)){const e=I.findIndex(e=>e?.url===d?.image?.url);-1!==e&&e!==u&&m(e)}},[d]);const N=e=>{const t=e.target.value,n=s?.find(e=>e.node.id===t)?.node;n&&a(n)>0&&p(n)};l(()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[r,o]);const D=e=>{C(e.targetTouches[0].clientX),E(null)},_=e=>{E(e.targetTouches[0].clientX)},P=()=>{if(null!==w&&null!==k&&I.length>1){const e=w-k,t=50;e>t?m(e=>e<I.length-1?e+1:0):e<-t&&m(e=>e>0?e-1:I.length-1)}C(null),E(null)},F=e.selectedProducts.filter(e=>e.variantId===d?.id).reduce((e,t)=>e+t.quantity,0),O=e.customVariantsQuantity?.find(e=>e.variantId===d?.id)?.quantity??e.bundleProductsCustomQuantity??1/0,A=O!==1/0&&F>=O,M=e.hideAddToBundle||!d||a(d)<=0||A||"idle"!==y||e?.disableQuantitySelector&&1===x,R=t.createElement(af,{className:"yt-byob-modal-desktop-overlay"},t.createElement(lf,{$isSmallScreen:f,ref:n},t.createElement(cf,{ref:n,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},t.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},t.createElement(of,{className:"yt-byob-modal-desktop-close",onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(ft,{size:"25"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-image-swipe",onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(rf,{small:nh(I[u]?.url),medium:nh(I[u]?.url),large:nh(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-desktop-main-image main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"yt-byob-modal-desktop-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},I.length>1&&I.filter(e=>e?.url.length>0).map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-desktop-gallery-thumb "+(u===r?"active":""),src:nh(n?.url),alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>m(r),style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.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"}},t.createElement("h2",{className:"yt-byob-modal-desktop-title"},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-desktop-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-desktop-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(mr,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-desktop-variant-selector"},t.createElement("div",{className:"yt-byob-modal-desktop-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-desktop-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-desktop-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Eo,null)))),t.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:"baseline",gap:"6px"}},e?.isFreebieTier&&!e.showFreebieTierProductPrices?t.createElement(t.Fragment,null,t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price)),t.createElement("span",{className:"yt-byob-current-price",style:{color:e.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-desktop-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price))),d?.compareAtPrice&&parseFloat(d.compareAtPrice)>parseFloat(d?.price)&&t.createElement("div",{className:"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.compareAtPrice)))),t.createElement("div",{className:"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:"80%"}},t.createElement("button",{className:"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:M?.5:1,cursor:M?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:M},e.styles.byob.addToBundleCTAText??"Add to bundle")))),t.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"}},t.createElement("span",null)),t.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:$}})))))),L=t.createElement(af,{className:"yt-byob-modal-mobile-overlay"},t.createElement(lf,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:n},t.createElement(cf,{ref:n,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},t.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:()=>{o(void 0)}},t.createElement(So,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},t.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-byob-modal-mobile-image-swipe",style:{position:"relative"},onTouchStart:D,onTouchMove:_,onTouchEnd:P},t.createElement(rf,{small:nh(I[u]?.url),medium:nh(I[u]?.url),large:nh(I[u]?.url),hideDownload:!0,className:"yt-byob-modal-mobile-main-image main-image",imageBackgroundColor:"#000"}),t.createElement("div",{className:"yt-byob-modal-mobile-image-indicators",style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},I.length>1&&I.map((e,n)=>t.createElement("span",{key:n,className:"yt-byob-modal-mobile-indicator "+(u===n?"active":""),style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}})))),t.createElement("div",{className:"yt-byob-modal-mobile-image-gallery image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},I.length>1&&I.map((n,r)=>t.createElement("img",{key:r,className:"yt-byob-modal-mobile-gallery-thumb "+(u===r?"active":""),src:nh(n?.url),alt:n.altText||`${T} - Image ${r+1}`,onClick:()=>m(r),style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...u===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"}))))),t.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:"120px"}},t.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},s.length>1?d?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-mobile-rating",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-modal-mobile-rating-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(mr,{className:"yt-byob-modal-mobile-verified-icon",style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},t.createElement("span",null)),t.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:$}})))),t.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",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}},s.length>1&&t.createElement("div",{className:"yt-byob-modal-mobile-variant-selector"},t.createElement("div",{className:"yt-byob-modal-mobile-variant-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},d?.title)),t.createElement("select",{className:"yt-byob-modal-mobile-variant-select",value:d?.id||"",onChange:N,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}},s.map(({node:e})=>t.createElement("option",{key:e.id,value:e.id,disabled:0===a(e)},e.title))),t.createElement("span",{className:"yt-byob-modal-mobile-variant-chevron",style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(Eo,null)))),t.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{className:"yt-byob-modal-mobile-price",style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"row",paddingRight:"10px",alignItems:"center"}},e?.isFreebieTier&&!e.showFreebieTierProductPrices?t.createElement(t.Fragment,null,t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price)),t.createElement("span",{className:"yt-byob-current-price",style:{color:e.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):t.createElement(t.Fragment,null,d?.compareAtPrice&&t.createElement("div",{className:"yt-byob-modal-mobile-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.compareAtPrice)),t.createElement("div",{className:"yt-byob-modal-mobile-current-price"},t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},th(e.styles.general.currencySymbol,e.styles.general.currencySymbol),eh(d?.price))))),t.createElement("div",{className:"yt-byob-modal-mobile-atc-wrapper",style:{width:"100%"}},t.createElement("button",{className:"yt-byob-modal-mobile-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:M?.5:1,cursor:M?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),S()},disabled:M},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(f?L:R,document.body)}),df=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map(e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name);return"image"===o?t.createElement("img",{src:Wn(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name)})(e,n?.name===e.name))})),pf=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:s})=>{const d=i(()=>t=>t?e?.tracksInventory&&t?.inventoryItem?.tracked?t.inventoryQuantity>0?t?.inventoryQuantity:t.inventoryQuantity<=0&&"continue"===t.inventoryPolicy?1/0:0:1/0:0,[e?.tracksInventory]),p=i(()=>{const t=e.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map(e=>e.values[0])||[]},[e,d]),[u,m]=c(p),[f,g]=c(window.innerWidth<1024);l(()=>{const e=()=>g(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n,r]);const x=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,h=x?.image?.url||e.featuredMedia?.preview?.image?.url,y=Wn(h,150,85,"webp"),b=e=>{if(!o?.options)return"text";const t=o.options.find(t=>t.name===e);return t?.type||"text"},w=e=>{if(!o?.options)return e.values.map(e=>({name:e,value:e}));const t=o.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}})},C=(e,t)=>{const n=u[t];if(!n)return null;return w(e).find(e=>e.name===n)||null};if(!n)return null;const k=t.createElement("div",{onClick:r,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"},t.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"}}},t.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"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},t.createElement("img",{src:y,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},e.title))),t.createElement("div",{style:{padding:"20px"}},e.options.map((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},C(n,r)?.name||n.values[0])),t.createElement(df,{options:w(n),selectedValue:C(n,r),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(r,e)},type:b(n.name),isOptionAvailable:t=>((t,n)=>{const r=[...u];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find(e=>e.node.title===o)?.node;return!!a&&d(a)>0})(r,t),isMobile:f}))))),t.createElement("button",{onClick:()=>{const t=e.variants.edges.find(t=>t.node.title===(e.options?.length>0?u.join(" / "):u[0]))?.node,n=!!t&&d(t)>0;if(t?.id&&n)s(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const t=e.variants.edges.find(e=>d(e.node)>0)?.node.id;t&&(s(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.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 v.createPortal(k,document.body)},uf=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{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}],i=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map(({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""}).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",s=i(c,800)||c,d=[];if(n&&n!==e){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(d.length>0?d.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},d,t.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function mf({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,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=e<s;return t.createElement(Su,{className:"yt-byob-quantity-selector-container"},t.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:d},"-"),t.createElement(Tu,{className:"yt-byob-quantity-display"},e," added"),t.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1,s);n(l),o&&a&&i&&o(a,i,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const ff=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),s=i(()=>nh(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||"",[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),d=i(()=>e?.media?.edges?.map(e=>nh(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[e?.media?.edges]),p=i(()=>d?.[1]??s??"",[d,s]);l(()=>{if(s){(new Image).src=s}},[s]);const u=i(()=>s||d?.[0],[s,d]);return t.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:e.title})))},gf=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:i,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:f,currentProductTier:g,showFreebieTierProductPrices:x})=>{const h=pn(ym),y=n.customizations,b=y?.byob?.variantSelectorType,[v,w]=c(!1),C=y.general?.variantTitleSuffix?e?.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 r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}})})(e?.variants?.edges);if(!C||!C.length)return t.createElement(t.Fragment,null);const k=a(t=>{const r=f?.find(e=>e.variantId===t)?.quantity;if(void 0!==r)return r;if(n?.customProductsQuantity)return n?.customProductsQuantity;const o=C?.find(e=>e.node.id===t),a=o?.node;return a?e.tracksInventory&&a.inventoryItem?.tracked?a.inventoryQuantity>0?a.inventoryQuantity:a.inventoryQuantity<=0&&"continue"===a.inventoryPolicy?1/0:0:1/0:0},[C,f,e.tracksInventory]),E=C?.find(e=>k(e.node.id)>0)?.node?.id;if(!E&&!y.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[S,T]=c(C?.find(e=>k(e.node.id)>0)?.node?.id||C[0]?.node?.id),[$,B]=c(0),[z,I]=c(window.innerWidth<450),[N,D]=c("normal"),_=C?.find(e=>e?.node?.id===S)?.node,P=k(S||"");l(()=>{const e=m.find(e=>e.variantId===S);B(e?e.quantity:0)},[$,m,S]),l(()=>{const e=()=>{I(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{CSS.supports("font-weight","500")?D("500"):CSS.supports("font-weight","400")?D("400"):CSS.supports("font-weight","600")&&D("600")},[]),l(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",N)},[N]),l(()=>{if(S&&!C?.some(e=>e.node.id===S)){const e=C.find(e=>k(e.node.id)>0)?.node.id||C[0]?.node?.id;e&&T(e)}},[S,C,k]);const F=e.variants&&e.variants.edges?.length>1&&"customOptions"!==b,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,A="53933408435"===O,M="75851235630"===O,L=(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[]})(e),j=L.length>0;return t.createElement(t.Fragment,null,t.createElement(zu,{borderRadius:y?.byob.borderRadius,borderColor:y?.byob.borderColor,shadowType:y?.byob.shadowType,backgroundColor:y?.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(P<=0)return;const t={...e,variants:{...e.variants,edges:C},selectedVariant:_};h(t)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent"}},t.createElement(Iu,{className:"yt-byob-image-wrapper"},t.createElement(ff,{product:e,styles:y,selectedVariant:_}),n?.productCardBadgeText&&t.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:y?.general.primaryColor||"#111",color:y?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:y.byob.borderRadius}},n.productCardBadgeText),F&&t.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},t.createElement(Nu,{className:"yt-byob-variant-selector",isCoralHaze:A,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:S||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),T(e.target.value)}},C?.map(e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)})),t.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(R,null)))),t.createElement("div",{className:"yt-byob-product-content"},"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&j&&t.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},t.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},L.slice(0,2).map((e,n)=>t.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1))),L.length>2&&t.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"}},"+",L.length-2," more"))),t.createElement(Du,{isMobile:z,showBorder:n?.showBorder??!0,style:{...!y?.byob.productsPriceVisibility&&{padding:"8px"},...y?.byob.productTitleFontSize&&{fontSize:y?.byob.productTitleFontSize}},className:"yt-byob-product-title-wrapper"},t.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(_?.displayName).replace("- Default Title",""):e.title,_?.commonSuffix?" -"+_?.commonSuffix:""))),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(so,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(mr,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),y?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},g?.isFreebieTier&&!x?t.createElement(t.Fragment,null,t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},th(y.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",eh(_?.price)),t.createElement("span",{className:"yt-byob-current-price",style:{color:y.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(_?.price??"0")>0?t.createElement("span",{className:"yt-byob-current-price"},th(y.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",eh(_?.price)):t.createElement("span",{className:"yt-byob-free-price"},"Free"),(!g?.isFreebieTier||x)&&_?.compareAtPrice&&y?.byob.compareAtPriceVisibility&&parseFloat(_.compareAtPrice)>parseFloat(_?.price)&&t.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},th(y.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",eh(_.compareAtPrice))),(P>0||P===1/0)&&t.createElement(_u,{borderRadius:y?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===$||void 0===$)&&t.createElement($u,{style:{...!o&&{backgroundColor:y?.general.primaryColor||"#111",color:y?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),B(1),(()=>{if(!S)return;"customOptions"===b&&C.length>1?w(!0):r(S,e,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},y?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&$>0&&S&&t.createElement(Bu,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},t.createElement(mf,{remainingQuantity:i,setQuantity:B,quantity:$,handleAddToBundle:r,variantId:S,product:e,handleRemoveItem:d,hideAddToBundle:o,selectedVariantInventoryQty:P})),n?.disableQuantitySelector&&$>0&&S&&t.createElement($u,{style:{backgroundColor:"#747474",color:y?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},t.createElement(Pu,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),t.createElement(Fu,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,$-1);B(t),d&&S&&d(S,1)}},t.createElement(vo,{style:{color:"#fff",fontSize:"20px"}})))),P<=0&&P!==1/0&&t.createElement($u,{style:{backgroundColor:y.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},y?.general.outOfStockLabel||"Out of Stock")),"customOptions"===b&&v&&C.length>1&&t.createElement(pf,{product:e,isOpen:v,onClose:()=>w(!1),variantOptions:n.variantOptions,cta:{textColor:y.general.ctaTextColor,backgroundColor:y.general.primaryColor},onConfirm:t=>{T(t),r(t,e,1)}}))},xf=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>t.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map((c,d)=>{const p=d+1,u=o[d].minimumQuantity-(i[d]?.length??0)===0,m=d===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},t.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.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"}}),t.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),t.createElement("div",{className:"yt-byob-stepper-title",style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),hf=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,s]=c(!1),[d,p]=c(r);return l(()=>{const e=setTimeout(()=>{n(d)},300);return()=>clearTimeout(e)},[d,n]),t.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(bo,{className:"yt-byob-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>s(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:d,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(bo,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>s(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},yf=({styles:e,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(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"===e?.byob?.categoryFilterOnPage?t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},t.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",...r].map(r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):t.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},t.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",...r].map(r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1)))))},bf=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:s,renderingOnPage:d,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal:m})=>{const[f,g]=c(void 0),[x,h]=c(window.innerWidth<450),[y,b]=c(0),[v,w]=c({}),C=e.builderTiers?.type,k=e.customizations,E=e.builderTiers?.productTier??[],S=e.builderTiers?.offerTier??[],[T,$]=c([]),[B,z]=c(!1),[I,N]=c("All"),[D,_]=c(0),P=o(null);l(()=>{const t=new Set;let n=!1;e?.products?.forEach(e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach(e=>t.add(e)))}}),$(Array.from(t)),z(n)},[e.products]);const F=((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}))(e.products.filter(e=>"active"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status),I),O="productTier"===C?E.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===C?S.reduce((e,t)=>e+t.minimumQuantity,0):e.minimumQuantity,[A,M]=c(""),[R,L]=c(""),j=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(F,A),V=((e,t)=>[...e].sort((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}}))(j,R),W=((e,t,n,r,o)=>(e[o]?.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 o=t.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))),a=t.find(e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0])));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(a?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}}))(E,V,A,R,y),[H,q]=un(ym),[U,Q]=c(!1),Y="productTier"===C?W:V,G=Y.slice(0,20*(D+1));l(()=>{setTimeout(()=>{Q(!0)},100)},[]);const Z=o(null);l(()=>{const e=()=>{h(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{if(e.coverImageUrl){const t=new Image;t.src=nh(e.coverImageUrl)??"",t.onload=()=>{g(t.width/t.height)}}},[e.coverImageUrl]),l(()=>{Q(!1),setTimeout(()=>Q(!0),100)},[y]);const X=(e,t)=>{if("productTier"===C){let n={...v},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=E.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}w(n);const o=E.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==o&&b(o)}u(e)},K=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};l(()=>{if("productTier"===C){const e=Object.fromEntries(E.map(e=>[e.tier,[]]));w(e)}},[e]),l(()=>{if("productTier"!==C||!E[y])return;if(O===p)return;const e=E.findIndex((e,t)=>{const n=v[t]||[];return t>=y&&n.length<e.minimumQuantity});-1!==e&&e!==y&&(b(e),K())},[v,E,C]),l(()=>{M("")},[y]),l(()=>{function e(e){if(!Z.current||!e.target)return;!Z.current.contains(e.target)&&q(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const J=(e,t,o)=>{var a;"productTier"===C&&(a=e,w(e=>{const t={...e},n=E.findIndex((e,n)=>{const r=t[n]||[];return n>=y&&r.length<e.minimumQuantity});return-1!==n&&b(n),t[n]||(t[n]=[]),t[n].push(a),t}));const i=!0===E[y]?.isFreebieTier;rh(e,t,o,n,r,i)},ee=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map(e=>{a+=e.minimumQuantity}),a})(),te=x&&e.mobileCoverImageUrl?nh(e.mobileCoverImageUrl):nh(e.coverImageUrl??"")||null,ne=e.customStoreDetails?.fixedInventoryDetails,re=a((e,t)=>{const n=ne?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const r=(e.variants?.edges||[]).find(e=>e.node.id===t),o=r?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?1/0:0:1/0:0},[ne]),oe=a(e=>{const t=k?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,r=n?.variants?.edges||[];if(ne){if(r.some(e=>ne.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return r.some(e=>re(n,e.node.id)>0)},[k?.general?.showOutOfStockProducts,ne,re]);l(()=>{if("productTier"!==C)return;const t=E[y];if(!t)return;if(1!==t.minimumQuantity)return;if(1!==t.products.length)return;const n=t.products[0],r=e.products.find(e=>e.productId===n.productId)?.productDetails;if(!r)return;if(r.variants?.edges?.length>1)return;const o=r.variants?.edges?.find(e=>re(r,e.node.id)>0)?.node;if(!o)return;const a=o.id,i=v[y]?.includes(a);i||(J(a,r,1),y<E.length-1&&(b(y+1),K()))},[C,E,y,e.products,v,re,J]);const ae="bundles"==e.appName?e.pageHeader?.title:e?.title,ie="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l(()=>{_(0)},[A,R,I,y]);const le=a(()=>{G.length<Y.length&&_(e=>e+1)},[G.length,Y.length]);return l(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&le()},{threshold:.1});return P.current&&e.observe(P.current),()=>{P.current&&e.unobserve(P.current)}},[le]),t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:k.byob.sectionBackgroundColor,..."transparent"!==k.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},te?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}}},te&&t.createElement(uf,{coverImageUrl:te,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),t.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)"}},t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:k?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},ae),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},ie))):(ae||ie)&&t.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},ae&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:k?.byob?.titleBackgroundColor??"transparent"}},ae),ie&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"}},ie)),t.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(xf,{currentStep:y,totalSteps:E.length,tiers:E,isMobile:x,primaryColor:k?.general?.primaryColor,primaryTextColorCta:k?.general?.primaryContrastColor,setCurrentProductTier:b,selectedProductsByTier:v,tierNavigation:k.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"}},e?.enableSortAndFilter&&t.createElement(hf,{isMobile:x,searchTerm:A,setSearchTerm:M,setSortBy:L,styles:k}),e?.customizations?.byob?.enableProductCategories&&B&&t.createElement("div",null,t.createElement(yf,{styles:k,isMobile:x,categories:T,activeCategory:I,onCategoryChange:e=>{N(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display"},0===Y?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===C&&E.length>0?G.filter(e=>oe(V.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))).map((r,o)=>{const a=(E[y]?.minimumQuantity??0)>(v[y]?.length??0),i=V.find(e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0])));return i?t.createElement(gf,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:J,hideAddToBundle:!a,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>X(e,y),selecteditems:n,transitionActive:U,customVariantsQuantity:ne,currentProductTier:E[y],showFreebieTierProductPrices:e?.customStoreDetails?.showFreebieTierProductPrices}):null}):G.filter(oe).map((r,o)=>t.createElement(gf,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:J,hideAddToBundle:p>=ee,remainingQuantity:ee-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:U,customVariantsQuantity:ne})),G.length<Y.length&&t.createElement("div",{ref:P,style:{height:"1px",width:"100%",display:"block"}})),!d&&t.createElement(hm,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:O,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:X,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:s,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d})),d&&t.createElement(hm,{handleAddToCart:i,minimumQuantity:O,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:s,handleRemoveItem:u,handleRemoveItemProductTier:X,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:k.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d}),H&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=p<S.reduce((e,t)=>e+t.minimumQuantity,0)),t.createElement(sf,{handleAddToBundle:J,ref:Z,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,selectedProducts:n,selectedProductsByTier:v,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:k?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none",customVariantsQuantity:ne,bundleProductsCustomQuantity:e?.customProductsQuantity,isFreebieTier:E?.[y]?.isFreebieTier,showFreebieTierProductPrices:e?.customStoreDetails?.showFreebieTierProductPrices})})())},vf=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:s,storeCurrencyCode:d})=>{const p=i(()=>t=>{const n=e?.productDetails?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.productDetails.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e.productDetails]),u=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;p(n);const m=i(()=>{if(u?.title&&e.productDetails.options){const t=u.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map(e=>e.values[0])||[]},[u,e.productDetails.options]),f=e=>{r(e)};return c?t.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"}},t.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:nh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},e?.productDetails?.variants?.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.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"}},t.createElement(R,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},th(o.general.currencySymbol,d),eh((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-vertical",style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},th(o.general.currencySymbol,d),eh(u?.compareAtPrice?u?.compareAtPrice:u?.price))))):t.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"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.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"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},t.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:nh(u?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),t.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",e?.productDetails?.title," "),"dropdown"!==o.comboBundle.comboVariantTypeSelector&&e.productDetails.variants.edges.length>1&&s&&m&&t.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"}},m.length>1?m.join(" / "):m)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},th(o.general.currencySymbol,d),eh((Number(u?.compareAtPrice?Number(u?.compareAtPrice):u?.price)/Number(a)*Number(l)).toFixed(2))),u?.compareAtPrice&&t.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},th(o.general.currencySymbol,d),eh(u?.compareAtPrice?u?.compareAtPrice:u?.price))),e.productDetails.variants.edges.length>1&&("dropdown"===o.comboBundle.comboVariantTypeSelector?t.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>f(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},e.productDetails.variants.edges.map(e=>{const n=p(e?.node?.id);return t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},e?.node?.title)})),t.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"}},t.createElement(R,null))):e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map((n,r)=>t.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"}},e.productDetails.options.length>1&&n?.values?.length>1&&t.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(a=>{const i=[...m];i[r]=a;const l=e.productDetails.options.length>0?i.join(" / "):i[r],c=e.productDetails.variants.edges.find(e=>e.node.title===l)?.node,d=0===(c?p(c.id):0),u=m[r]===a,g=s&&s?.options?.find(e=>e.name===n.name);return g&&"color"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-color ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:d?.5:1,cursor:d?"not-allowed":"pointer"}},g?.values.find(e=>e.name===a)?.value?t.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",borderRadius:"50%",backgroundColor:g?.values.find(e=>e.name===a)?.value}},t.createElement("span",null)):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):g&&"image"===g?.type?t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-image ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u&&!d?"#F7F7F7":"transparent",cursor:d?"not-allowed":"pointer",padding:"0px",width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",overflow:"hidden",opacity:d?.5:1}},g?.values.find(e=>e.name===a)?.value?t.createElement("img",{className:"yt-comboBundle-product-option-image",src:nh(g?.values.find(e=>e.name===a)?.value||"/placeholder.svg"),alt:a,style:{width:u&&!d?"26px":"24px",height:u&&!d?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,className:`yt-comboBundle-product-option-button-text ${u?"yt-comboBundle-product-option-button-selected":""} ${d?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!d&&c&&f(c.id)},disabled:d,style:{padding:"4px 8px",border:u&&!d?`1px solid ${o.general?.ctaBackgroundColor}`:d?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u&&!d?"#F7F7F7":"transparent",color:d?"#ccc":"#707070",cursor:d?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:d?.5:1}},a)}))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map(e=>{const r=0===p(e?.node?.id);return t.createElement("button",{key:e?.node?.id,className:`yt-comboBundle-product-variant-button ${n===e?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${r?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>f(e?.node?.id),disabled:r,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:r?"#ccc":"#707070",cursor:r?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:r?.5:1}},e?.node?.title)}))))))},wf=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786);l(()=>(n&&(window.ytComboBundle={bundle:e,addToCart:n},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}))}),[e,n]);const d=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[p,u]=c(()=>{const t={};return e.products.forEach((e,n)=>{const r=e.productDetails?.variants?.edges?.find(t=>d(e.productDetails,t?.node?.id)>0)?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id}),t}),m=e.products?.every((e,t)=>{const n=p[t];return d(e.productDetails,n)>0}),f=(e,t)=>{u(n=>({...n,[e]:t}))},{originalPrice:g,dealPrice:x,offerValue:h}=i(()=>{const{price:t,compareAtPrice:n}=Object.entries(p).reduce((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find(e=>e.node.id===r)?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t},{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}},[p,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l(()=>{const e=()=>{s(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===y.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},th(y.general.currencySymbol,e.storeCurrencyCode),eh(x)),t.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},th(y.general.currencySymbol,e.storeCurrencyCode),eh(g)),t.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"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(e?.amountOff)} Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(h)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(a?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map((n,r)=>{const o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===p[r])?.node;return o?t.createElement(vf,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:x,selectedVariantId:p[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null})):t.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(a?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map((n,r)=>t.createElement(vf,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:x,selectedVariantId:p[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions})))),t.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${m?"":"yt-comboBundle-bundle-cta-button-disabled"} ${a?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void o(!1);const t=Object.entries(p).map(([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find(e=>e.node.id===n)?.node;return o?{variantId:n,price:Number(o.price)}:null}).filter(e=>null!==e),r=Object.values(p);await n(Number(g),r,Number(x),t)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}o(!1)}},r?t.createElement(da,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},t.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},Cf=h.div`
|
|
3542
3542
|
max-width: 800px;
|
|
3543
3543
|
container-type: inline-size;
|
|
3544
3544
|
margin-top: ${e=>e.verticalMargin||"0px"};
|
|
@@ -3667,7 +3667,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3667
3667
|
}
|
|
3668
3668
|
`,Pf=h.div`
|
|
3669
3669
|
text-align: right;
|
|
3670
|
-
`,
|
|
3670
|
+
`,Ff=h.span`
|
|
3671
3671
|
font-size: 16px;
|
|
3672
3672
|
font-weight: 600;
|
|
3673
3673
|
color: #111;
|
|
@@ -3680,7 +3680,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3680
3680
|
font-size: 12px;
|
|
3681
3681
|
margin-left: 4px;
|
|
3682
3682
|
}
|
|
3683
|
-
`,
|
|
3683
|
+
`,Of=h.span`
|
|
3684
3684
|
font-size: 12px;
|
|
3685
3685
|
color: #666;
|
|
3686
3686
|
text-decoration: line-through;
|
|
@@ -3884,7 +3884,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3884
3884
|
scrollbar-width: none;
|
|
3885
3885
|
|
|
3886
3886
|
-ms-overflow-style: none;
|
|
3887
|
-
`,Xf=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function Kf({bundle:e,addToCartFunction:n,currentProductId:r}){const s=i(()=>{if(r){const t="gid://shopify/Product/"+r,n=e.products?.some(e=>e.productId===t);return n?t:e.products?.[0]?.productId}return e.products?.[0]?.productId},[r,e.products]),d=i(()=>Xf(s,e.products),[s,e.products]),p=o(null),u=o(null),m=o({});document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[f,g]=c(0),[x,h]=c(""),y=e.customizations??{},b=!1===y?.general?.showDecimalsInBundlePricing,v=i(()=>d?.productDetails?.tracksInventory??!0,[d?.productDetails?.tracksInventory]),w=a(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?1/0:0},[v]),C=(i(()=>d?.productDetails?.variants?.edges?.reduce((e,{node:t})=>w(t)>0?e+1:e,0),[d,w]),i(()=>Xf(s,e.products)?.id,[s,e.products]));i(()=>C?Xf(s,e.products):void 0,[s,e.products,C]),i(()=>e.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[e.products]),y.volumeBundle;const k=i(()=>e?.volumeTiers||[],[e?.volumeTiers]),E=k.findIndex(e=>e.isDefault),[S,T]=c(-1!==E?k[E].tier:k?.[0]?.tier||1),[$,B]=c(d?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||d?.productDetails?.variants?.edges?.[0]?.node?.id||""),[z,I]=c({}),[N,D]=c(k.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>d?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[_,P]=c(!1),[O,F]=c(window.innerWidth<550),[A,M]=c(null),[R,L]=c(null);o([]);const j=o([]),V=o(S);l(()=>{const e=()=>{F(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{const e=e=>{A&&j.current[A.index]&&j.current[A.index][A.optionIndex]&&!j.current[A.index][A.optionIndex]?.contains(e.target)&&M(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[A]);const W=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,r=d?.productDetails?.variants?.edges||[];for(const e of r){const t=e.node;if(w(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const o=[],a={},i=[...r].sort((e,t)=>{const n=w(e.node),r=w(t.node);return n===1/0&&r===1/0?0:n===1/0?-1:r===1/0?1:r-n});for(let e=0;e<n&&o.length<n;e++){let e=!1;for(const t of i){const n=t.node,r=a[n.id]||0;if(w(n)>r&&n.availableForSale){const t=n.title.split(" / ");o.push(t),a[n.id]=r+1,e=!0;break}}if(!e)return null}return o.length===n?o:null},[d,k,w]),H=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=d?.productDetails?.variants?.edges||[];let o=0;for(const e of r){const t=w(e.node);if(t===1/0){o=1/0;break}o+=t}return o>=n},[k,d,w]);l(()=>{const e={},t=d?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||d?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&k.forEach(n=>{e[n.tier]={};for(let r=0;r<n.minimumQuantity;r++)e[n.tier][r]=t}),I(e)},[d?.id,k?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),w]),l(()=>{if(!m.current[S]){const e=W(S);if(e){const t=S-1;D(n=>({...n,[t]:e}));const n={};e.forEach((e,t)=>{const r=e.join(" / "),o=d?.productDetails?.variants?.edges?.find(e=>e.node.title===r)?.node.id||$;n[t]=o}),I(e=>({...e,[S]:n}))}m.current[S]=!0}},[S,d,$,W]);const q=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,U=a((e,t,n,r,o)=>{const a=k.find(t=>t.tier===e);if(!a)return!1;const i=a.minimumQuantity,l=[...n];l[r]=o;const c=l.join(" / "),s=d?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===w(s))return!1;const p={},u=z[e]||{};for(let e=0;e<i;e++){let n;if(e===t)n=s.id;else{const t=u[e]||$,r=q(d,t);if(!r)return!1;n=r.id}p[n]=(p[n]||0)+1}for(const[e,t]of Object.entries(p)){const n=q(d,e),r=w(n);if(r!==1/0&&t>r)return!1}return!0},[k,d,N,N,z,$,w]),Q=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=e-1,o={};for(let e=0;e<n;e++){const t=(N[r]?.[e]||d.productDetails.options.map(e=>e.values[0])).join(" / "),n=d?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const a=n.node.id;o[a]=(o[a]||0)+1}for(const[e,t]of Object.entries(o)){const n=q(d,e),r=w(n);if(r!==1/0&&t>r)return!1}return!0},[k,d,N,w]);l(()=>{g(e=>e+1)},[z]);const Y=(e,t,n)=>{I(r=>({...r,[e]:{...r[e]||{},[t]:n}}))},G=a(()=>d?.productDetails?.variants?.edges?.find(e=>w(e.node)>0)?.node||d?.productDetails?.variants?.edges?.[0]?.node,[d,w]),Z=a(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);l(()=>{V.current=S},[S]),l(()=>{R?(L(null),X()):X()},[S]),l(()=>{if(e){const e=G();if(e)h(e.id),B(e.id);else{const e=d?.productDetails?.variants?.edges?.[0]?.node?.id||"";h(e),B(e)}}},[e,d,G]);const X=()=>{const e=Z();if(e){const t=d?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),g(e=>e+1);else{const e=G();e&&(B(String(e.id)),n=e),g(e=>e+1)}if(n){0===w(n)?(L(null),setTimeout(()=>{L({tier:V.current,index:0,optionIndex:0,value:n.title})},0)):R&&L(null)}}};l(()=>{X();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",X),()=>{t=!1,window.removeEventListener("urlChange",X),window.history.pushState=n,window.history.replaceState=r}},[Z,d?.id,G,w]);const K=t=>{const n=k.find(e=>e.tier===t);if(!n)return{original:0,discounted:0};let r=0,o=0;const a=z[t]||{};for(let e=0;e<n.minimumQuantity;e++){const t=a[e]||$,n=q(d,t);n&&(n.compareAtPrice?r+=Number.parseFloat(n.compareAtPrice):r+=Number.parseFloat(n.price),o+=Number.parseFloat(n.price))}return"percentOff"===e?.discountType?o*=1-n.discountValue/100:"amountOff"===e?.discountType&&(o-=n.discountValue),o<0&&(o=0),{original:r,discounted:o,discountValue:n.discountValue}},J=(e,t,n,r)=>{let o=q(e,t);if(r){const a=z[r]?.[n||0]||t;o=q(e,a)}return o?.image?.url?o.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""};function ee(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}l(()=>{const e=()=>{if("shopify_atc_button"!==y.volumeBundle?.addtoCartMethod&&"06cf02-81.myshopify.com"!==window.ytBundleApp?.storeDomain)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let n=1;t&&t.value&&(n=parseInt(t.value,10)||1);const r=k.find(e=>e.tier===S);if(!r)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"]').forEach(e=>e.remove());const o=r.minimumQuantity;let a={};const i=Math.max(o,n);if("vertical"===y.volumeBundle.cardStyle){const e=x||$;if(!e)return;a[e]=i}else if(n>o){const e=x||$;if(!e)return;a[e]=i}else{const e=z[r.tier]||{};for(let t=0;t<o;t++){let n=e[t];n||(n=$),n&&(a[n]=(a[n]||0)+1)}}const l=K(r.tier),c=Object.fromEntries(Object.entries(a).map(([e,t])=>[ee(e),Math.round(t)])),s=(t,n,r="bundle-input-field")=>{const o=document.createElement("input");o.type="hidden",o.name=t,o.value=n,o.className=r,e.appendChild(o)};if(n>o){const e=x||$;e&&s("id",ee(e))}s("properties[_bundle_price]",String(l.original)),s("properties[_bundle_tier]",String(r.tier)),s("properties[_bundle_items]",JSON.stringify(c));let d=0;Object.entries(c).forEach(([e,t])=>{t>0&&(s(`items[${d}][id]`,e),s(`items[${d}][quantity]`,String(t)),d++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),r=e.querySelector('[name="checkout"]'),a=e.querySelector(".noti-btn-main-wrap"),i=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const r=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");r&&(r.textContent=n)};n<=o&&(R?(i(t,!0,"Sold out"),i(r,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),a&&(a.style.display="block",a.classList.remove("hidden"),a.classList.add("block"))):(i(t,!1,"Add to cart"),i(r,!1,"Buy it now"),t&&t.classList.remove("btn--sold-out","hidden"),a&&(a.style.display="none",a.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()=>{}},[S,JSON.stringify(z),$,y.volumeBundle?.cardStyle,r,x,R]);const te=i(()=>k.find(e=>e.tier===S),[k,S]),ne=i(()=>te?K(te.tier):null,[te,z,$]),re=i(()=>{if(!te||!ne)return;const e=z[te.tier]||{},t={};for(let n=0;n<te.minimumQuantity;n++){const r=e[n]||$;t[r]=(t[r]||0)+1}return t},[te?.minimumQuantity,$,z,ne]),oe=i(()=>Object.entries(re??{}).map(([e,t])=>({variantId:e,quantity:t})),[re]);if(l(()=>{if(!te||!ne)return;const e={tier:S,items:te.minimumQuantity,discountedPrice:ne.discounted,originalPrice:ne.original,variants:oe,productId:d?.id??null,tierMeta:{title:te.title,subtitle:te.subtitle,badgeTitle:te.badgeTitle},productData:d,tierData:te},t=u.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(p.current&&clearTimeout(p.current),p.current=window.setTimeout(()=>{u.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t)},50),()=>{p.current&&clearTimeout(p.current)})},[S,te?.tier,te?.minimumQuantity,ne?.discounted,ne?.original,d?.id,JSON.stringify(oe)]),l(()=>{if(!$||!te)return;const e=q(d,$);if(!e)return;const t={};for(let e=0;e<te.minimumQuantity;e++)t[e]=$;I(e=>({...e,[S]:{...t}}));const n=e.title.split(" / "),r=Array.from({length:te.minimumQuantity},()=>[...n]);D(e=>({...e,[S-1]:r}))},[$,S,d,te]),!n)return t.createElement(t.Fragment,null);const ae=y.volumeBundle?.cardStyle,ie=y.general?.primaryColor,le=y.general?.secondaryColor,ce=y.general.primaryContrastColor,se=y.general.secondaryContrastColor,de="high"===e.cornerRadiusType?"20px":"medium"===e.cornerRadiusType?"6px":"0px",pe="bundles"==e.appName?e.pageHeader?.title:e?.title,ue="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return l(()=>{Q(S)&&R?.tier===S&&L(null)},[S,oe,Q,R]),t.createElement(Cf,{verticalMargin:y.volumeBundle?.verticalMargin,$backgroundColor:y.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},t.createElement(kf,{className:"yt-bundle-header"},pe&&pe.trim().length>0&&t.createElement(Ef,{fontSize:y.volumeBundle?.titleFontSize,$backgroundColor:y.volumeBundle?.titleBackgroundColor,textColor:y.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},pe),t.createElement(Sf,{className:"yt-bundle-header-subtitle",fontSize:y.volumeBundle?.subtitleFontSize},ue)),"vertical"===ae?t.createElement("div",{style:{display:"grid",gridTemplateColumns:O||4===k.length?"repeat(2, 1fr)":k.length>4?"repeat(3, 1fr)":`repeat(${k.length}, 1fr)`,justifyItems:"center",gap:O?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},k.map(n=>{const r=K(n.tier),o=r.original-r.discounted,a=S===n.tier,i=!H(n.tier);return t.createElement(t.Fragment,{key:n.tier},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:de||"24px",...a?{border:`2px solid ${ie}`}:{border:`1px solid ${le}`},boxShadow:`6px 6px 0px -1px ${a?ie:le}20`,...n.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 "+(a?"yt-volume-vertical-tier-item-active":""),"data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType,"data-minimum-quantity":n.minimumQuantity,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2),onClick:()=>!i&&T(n.tier)},n.badgeTitle&&t.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:a?ie:le,color:a?ce:se,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:a?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":n.tier,"data-badge-title":n.badgeTitle},n.badgeTitle),t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},0!==r.discountValue&&t.createElement(t.Fragment,null,O&&o>0&&!!r?.discountValue&&"Enabled"===y.volumeBundle?.discountBadgeVisibility&&t.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},t.createElement(If,{primaryBackgroundColorCta:a?ie:le,isSelected:a,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:a?ce:se},className:"yt-volume-vertical-tier-save-badge","data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType}," ","percentOff"===e?.discountType?`${r.discountValue}% Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(r.discountValue)}`))),n.imageUrl&&t.createElement("img",{src:nh(n.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"})),t.createElement("div",{style:{padding:"8px",paddingTop:"0"}},t.createElement(Nf,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},t.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},t.createElement(Df,{style:{fontSize:O?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},n.title?n.title:t.createElement(t.Fragment,null,"Buy ",n.minimumQuantity,", Get"," ",n.discountValue,"% Off")),!O&&o>0&&!!r?.discountValue&&"Enabled"===y.volumeBundle?.discountBadgeVisibility&&t.createElement(If,{primaryBackgroundColorCta:a?ie:le,isSelected:a,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:a?ce:se},className:"yt-volume-vertical-tier-save-badge","data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType}," ","percentOff"===e?.discountType?`${r.discountValue}% Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(r.discountValue)}`),a&&n.imageUrl&&t.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},t.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:ce,padding:"2px"}},t.createElement(ho,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),t.createElement(_f,{style:{lineHeight:"normal",fontSize:O?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},n.subtitle?n.subtitle:t.createElement(t.Fragment,null))),H(n.tier)?t.createElement(Pf,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":n.tier,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2),"data-savings":o.toFixed(b?0:2)},t.createElement(Of,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.discounted.toFixed(b?0:2))),o>0?t.createElement(Ff,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.original.toFixed(b?0:2))):""):t.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),a&&!n.imageUrl&&t.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},t.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:ce,padding:"2px"}},t.createElement(ho,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):t.createElement(t.Fragment,null,k.map(n=>{const r=K(n.tier),o=r.original-r.discounted,a=!H(n.tier);return t.createElement(t.Fragment,{key:n.tier},n.badgeTitle&&t.createElement(Tf,{primaryTextColorCta:ce,primaryBackgroundColorCta:ie,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-badge","data-tier":n.tier,"data-badge-title":n.badgeTitle},n.badgeTitle),t.createElement($f,{cornerRadiusType:e?.cornerRadiusType??"",key:n.tier,primaryBackgroundColorCta:ie??"",isSelected:S===n.tier,onClick:()=>T(n.tier),style:{borderRadius:de,cursor:"pointer",backgroundColor:a?"#f5f5f5":"white",opacity:a?.6:1},className:"yt-volume-horizontal-tier-container "+(S===n.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType,"data-minimum-quantity":n.minimumQuantity,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2)},t.createElement(Bf,{cornerRadiusType:e?.cornerRadiusType??"",style:{borderRadius:de,borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},className:"yt-volume-horizontal-tier-header"},t.createElement(zf,{className:"yt-volume-horizontal-tier-info"},t.createElement(jf,{"data-active":S===n.tier,accentColor:ie,className:"yt-volume-horizontal-tier-radio-wrapper"},t.createElement(Vf,{name:"tier",checked:S===n.tier,onChange:()=>!a&&T(n.tier),disabled:a,className:"yt-volume-horizontal-tier-radio-hidden"}),t.createElement(Wf,{accentColor:ie,className:"yt-volume-horizontal-tier-radio-custom"})),t.createElement(Nf,{className:"yt-volume-horizontal-tier-details"},t.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},t.createElement(Df,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},n.title?n.title:t.createElement(t.Fragment,null,"Buy ",n.minimumQuantity,", Get"," ",n.discountValue,"% Off")),o>0&&r?.discountValue&&"Enabled"===y.volumeBundle?.discountBadgeVisibility?t.createElement(If,{primaryBackgroundColorCta:ie,isSelected:S===n.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType}," ","percentOff"===e?.discountType?`${r.discountValue}% Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(r.discountValue)}`):""),t.createElement(_f,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},n.subtitle?n.subtitle:t.createElement(t.Fragment,null)))),H(n.tier)?t.createElement(Pf,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":n.tier,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2),"data-savings":o.toFixed(0)},o>0?t.createElement(Ff,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.original.toFixed(b?0:2))):"",t.createElement(Of,{className:"yt-volume-horizontal-tier-discounted-price"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.discounted.toFixed(b?0:2)))):t.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},t.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),S===n.tier&&t.createElement(Af,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:d.productDetails.variants.edges.length<=1?"0":"10px 15px",gap:d.productDetails.variants.edges.length<=1?"0":"10px"}},Array.from({length:n.minimumQuantity}).map((r,o)=>{const i=n.tier-1,l=(N[i]||[])[o]||d.productDetails.options?.map(e=>e.values[0])||[],c=d?.productDetails?.options.some(e=>e.values.length>1);return t.createElement("div",{key:o,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&t.createElement(Hf,{src:nh(J(d,$,o,n.tier)),alt:d?.productDetails?.title||"Product",className:"yt-volume-horizontal-tier-product-image"}),"auto"===y?.volumeBundle?.variantSelectorType?t.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},d?.productDetails?.options?.map((r,s)=>{if(!c)return null;const p=A?.tier===n.tier&&A?.index===o&&A?.optionIndex===s,u=e?.variantOptions?.options?.find(e=>e.name===r.name);let m="";return"color"===u?.type&&(m=u?.values?.find(e=>e.name===l[s])?.value||""),t.createElement(Yf,{key:s,ref:e=>{j.current[o]||(j.current[o]=[]),j.current[o][s]=e},style:{zIndex:p?1e3:"auto",display:"flex"},isActive:p},t.createElement(Gf,{onClick:e=>{e.stopPropagation(),M(p?null:{tier:n.tier,index:o,optionIndex:s})},isActive:p,disabled:a},"color"===u?.type&&m&&t.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[s],t.createElement(lo,null)),p&&t.createElement(Zf,{style:{zIndex:1001}},r.values.map((e,r)=>{const c=[...l];c[s]=e;const p=!U(n.tier,o,l,s,e)||a;d.productDetails.variants.edges.find(({node:e})=>e.title===c.join(" / "));const m=t=>{if(t.preventDefault(),t.stopPropagation(),D(e=>{const t={...e},n=[...t[i]||[]];return n[o]=c,t[i]=n,t}),p){L({tier:S,index:o,optionIndex:s,value:e}),M(null);const t=c.join(" / "),r=d.productDetails.variants.edges.find(e=>e.node.title===t)?.node.id||$;return void Y(n.tier,o,r)}const r=c.join(" / "),a=d.productDetails.variants.edges.find(e=>e.node.title===r)?.node.id||$;Y(n.tier,o,a),M(null)},f=u?.values.find(t=>t.name===e);return"image"===u?.type&&f?.value?t.createElement(qf,{key:e,onClick:m,style:{cursor:"pointer"}},t.createElement(Uf,{src:f.value,alt:e}),e):"color"===u?.type&&f?.value?t.createElement(qf,{key:e,onClick:m,style:{cursor:"pointer"}},t.createElement(Qf,{style:{backgroundColor:f.value}}),e):t.createElement(qf,{key:e,onClick:m,style:{cursor:"pointer"}},e)})))})):t.createElement(Mf,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},d?.productDetails?.options.map((r,c)=>{if(!(r.values.length>1))return null;const s=e.variantOptions?.options?.find(e=>e.name===r.name)||null;return t.createElement("div",{key:r.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},r.values.map(e=>{const r=l[c]===e,p=!U(n.tier,o,l,c,e)||a,u=s?.values.find(t=>t.name===e),m=t=>{if(t.preventDefault(),t.stopPropagation(),p)return;const r=[...l];r[c]=e,D(e=>{const t={...e},n=[...t[i]||[]];return n[o]=r,t[i]=n,t});const a=r.join(" / "),s=d.productDetails.variants.edges.find(e=>e.node.title===a)?.node.id||$;Y(n.tier,o,s)},f={opacity:p?.5:1,cursor:p?"not-allowed":"pointer"};return"color"===s?.type&&u?.value?t.createElement("button",{key:e,onClick:m,style:{...f,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:r?`1px solid ${y.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button",disabled:p},t.createElement("div",{style:{width:r?"24px":"20px",height:r?"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"}},t.createElement("span",null))):"image"===s?.type&&u?.value?t.createElement("button",{key:e,onClick:m,style:{...f,border:r?`1px solid ${y.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:r?"#F7F7F7":"transparent",padding:"0px",width:r?"20px":"18px",height:r?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button",disabled:p},t.createElement("img",{src:u.value,alt:e,style:{width:r?"26px":"24px",height:r?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):t.createElement(Rf,{key:e,isSelected:r,onClick:m,style:{...f,padding:"4px 8px",border:r?`1px solid ${y.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:r?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default",disabled:p},e)})))})))})),R&&R.tier===n.tier&&t.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.")))})),e?.showCta&&(!y.volumeBundle?.addtoCartMethod||"shopify_atc_button"!==y.volumeBundle?.addtoCartMethod)&&!("devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"06cf02-81.myshopify.com"===window.ytBundleApp?.storeDomain)&&t.createElement("div",{style:{position:"relative"}},t.createElement(Lf,{bgColor:Q(S)?y.general?.ctaBackgroundColor:"#ccc",textColor:Q(S)?y.general?.ctaTextColor:"#666",border:`1px solid ${Q(S)?y.general?.ctaBorderColor||"#121212":"#999"}`,shadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Q(S)&&y.general?.customizeHoverState,backgroundColor:y.general?.ctaHoverBackgroundColor,textColor:y.general?.ctaHoverTextColor},onClick:async()=>{if(Q(S))try{P(!0);const e=k.find(e=>e.tier===S);if(!e)return;const t={},r=z[e.tier]||{};for(let n=0;n<e.minimumQuantity;n++){const e=r[n]||$;t[e]?t[e].quantity+=1:t[e]={quantity:1}}const o=K(e.tier),a=Array.from({length:e.minimumQuantity},(e,t)=>r[t]||$);n&&await n(o.original,a)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{P(!1)}else console.error("Selected tier is out of stock")},borderRadius:y.general.ctaBorderRadius??"",disabled:_||!Q(S),className:"yt-volume-add-to-cart-button"},Q(S)?t.createElement(t.Fragment,null,_?t.createElement(da,{color:"white",loading:_,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},t.createElement("span",null,y.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",t.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const n=K(S);return t.createElement(t.Fragment,null,th(y.general.currencySymbol,e.storeCurrencyCode),eh(n.discounted.toFixed(b?0:2))," ",n?.original!==n.discounted&&t.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},th(y.general.currencySymbol,e.storeCurrencyCode),eh(n?.original.toFixed(b?0:2))," "))})()))):t.createElement(t.Fragment,null,"Out of Stock"))))}const Jf=h.div`
|
|
3887
|
+
`,Xf=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function Kf({bundle:e,addToCartFunction:n,currentProductId:r}){const s=i(()=>{if(r){const t="gid://shopify/Product/"+r,n=e.products?.some(e=>e.productId===t);return n?t:e.products?.[0]?.productId}return e.products?.[0]?.productId},[r,e.products]),d=i(()=>Xf(s,e.products),[s,e.products]),p=o(null),u=o(null),m=o({});document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[f,g]=c(0),[x,h]=c(""),y=e.customizations??{},b=!1===y?.general?.showDecimalsInBundlePricing,v=i(()=>d?.productDetails?.tracksInventory??!0,[d?.productDetails?.tracksInventory]),w=a(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?1/0:0},[v]),C=(i(()=>d?.productDetails?.variants?.edges?.reduce((e,{node:t})=>w(t)>0?e+1:e,0),[d,w]),i(()=>Xf(s,e.products)?.id,[s,e.products]));i(()=>C?Xf(s,e.products):void 0,[s,e.products,C]),i(()=>e.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[e.products]),y.volumeBundle;const k=i(()=>e?.volumeTiers||[],[e?.volumeTiers]),E=k.findIndex(e=>e.isDefault),[S,T]=c(-1!==E?k[E].tier:k?.[0]?.tier||1),[$,B]=c(d?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||d?.productDetails?.variants?.edges?.[0]?.node?.id||""),[z,I]=c({}),[N,D]=c(k.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>d?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[_,P]=c(!1),[F,O]=c(window.innerWidth<550),[A,M]=c(null),[R,L]=c(null);o([]);const j=o([]),V=o(S);l(()=>{const e=()=>{O(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),l(()=>{const e=e=>{A&&j.current[A.index]&&j.current[A.index][A.optionIndex]&&!j.current[A.index][A.optionIndex]?.contains(e.target)&&M(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[A]);const W=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,r=d?.productDetails?.variants?.edges||[];for(const e of r){const t=e.node;if(w(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const o=[],a={},i=[...r].sort((e,t)=>{const n=w(e.node),r=w(t.node);return n===1/0&&r===1/0?0:n===1/0?-1:r===1/0?1:r-n});for(let e=0;e<n&&o.length<n;e++){let e=!1;for(const t of i){const n=t.node,r=a[n.id]||0;if(w(n)>r&&n.availableForSale){const t=n.title.split(" / ");o.push(t),a[n.id]=r+1,e=!0;break}}if(!e)return null}return o.length===n?o:null},[d,k,w]),H=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=d?.productDetails?.variants?.edges||[];let o=0;for(const e of r){const t=w(e.node);if(t===1/0){o=1/0;break}o+=t}return o>=n},[k,d,w]);l(()=>{const e={},t=d?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||d?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&k.forEach(n=>{e[n.tier]={};for(let r=0;r<n.minimumQuantity;r++)e[n.tier][r]=t}),I(e)},[d?.id,k?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),w]),l(()=>{if(!m.current[S]){const e=W(S);if(e){const t=S-1;D(n=>({...n,[t]:e}));const n={};e.forEach((e,t)=>{const r=e.join(" / "),o=d?.productDetails?.variants?.edges?.find(e=>e.node.title===r)?.node.id||$;n[t]=o}),I(e=>({...e,[S]:n}))}m.current[S]=!0}},[S,d,$,W]);const q=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,U=a((e,t,n,r,o)=>{const a=k.find(t=>t.tier===e);if(!a)return!1;const i=a.minimumQuantity,l=[...n];l[r]=o;const c=l.join(" / "),s=d?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===w(s))return!1;const p={},u=z[e]||{};for(let e=0;e<i;e++){let n;if(e===t)n=s.id;else{const t=u[e]||$,r=q(d,t);if(!r)return!1;n=r.id}p[n]=(p[n]||0)+1}for(const[e,t]of Object.entries(p)){const n=q(d,e),r=w(n);if(r!==1/0&&t>r)return!1}return!0},[k,d,N,N,z,$,w]),Q=a(e=>{const t=k.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,r=e-1,o={};for(let e=0;e<n;e++){const t=(N[r]?.[e]||d.productDetails.options.map(e=>e.values[0])).join(" / "),n=d?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const a=n.node.id;o[a]=(o[a]||0)+1}for(const[e,t]of Object.entries(o)){const n=q(d,e),r=w(n);if(r!==1/0&&t>r)return!1}return!0},[k,d,N,w]);l(()=>{g(e=>e+1)},[z]);const Y=(e,t,n)=>{I(r=>({...r,[e]:{...r[e]||{},[t]:n}}))},G=a(()=>d?.productDetails?.variants?.edges?.find(e=>w(e.node)>0)?.node||d?.productDetails?.variants?.edges?.[0]?.node,[d,w]),Z=a(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);l(()=>{V.current=S},[S]),l(()=>{R?(L(null),X()):X()},[S]),l(()=>{if(e){const e=G();if(e)h(e.id),B(e.id);else{const e=d?.productDetails?.variants?.edges?.[0]?.node?.id||"";h(e),B(e)}}},[e,d,G]);const X=()=>{const e=Z();if(e){const t=d?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),g(e=>e+1);else{const e=G();e&&(B(String(e.id)),n=e),g(e=>e+1)}if(n){0===w(n)?(L(null),setTimeout(()=>{L({tier:V.current,index:0,optionIndex:0,value:n.title})},0)):R&&L(null)}}};l(()=>{X();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,r=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(r.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",X),()=>{t=!1,window.removeEventListener("urlChange",X),window.history.pushState=n,window.history.replaceState=r}},[Z,d?.id,G,w]);const K=t=>{const n=k.find(e=>e.tier===t);if(!n)return{original:0,discounted:0};let r=0,o=0;const a=z[t]||{};for(let e=0;e<n.minimumQuantity;e++){const t=a[e]||$,n=q(d,t);n&&(n.compareAtPrice?r+=Number.parseFloat(n.compareAtPrice):r+=Number.parseFloat(n.price),o+=Number.parseFloat(n.price))}return"percentOff"===e?.discountType?o*=1-n.discountValue/100:"amountOff"===e?.discountType&&(o-=n.discountValue),o<0&&(o=0),{original:r,discounted:o,discountValue:n.discountValue}},J=(e,t,n,r)=>{let o=q(e,t);if(r){const a=z[r]?.[n||0]||t;o=q(e,a)}return o?.image?.url?o.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""};function ee(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}l(()=>{const e=()=>{if("shopify_atc_button"!==y.volumeBundle?.addtoCartMethod&&"06cf02-81.myshopify.com"!==window.ytBundleApp?.storeDomain)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let n=1;t&&t.value&&(n=parseInt(t.value,10)||1);const r=k.find(e=>e.tier===S);if(!r)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"]').forEach(e=>e.remove());const o=r.minimumQuantity;let a={};const i=Math.max(o,n);if("vertical"===y.volumeBundle.cardStyle){const e=x||$;if(!e)return;a[e]=i}else if(n>o){const e=x||$;if(!e)return;a[e]=i}else{const e=z[r.tier]||{};for(let t=0;t<o;t++){let n=e[t];n||(n=$),n&&(a[n]=(a[n]||0)+1)}}const l=K(r.tier),c=Object.fromEntries(Object.entries(a).map(([e,t])=>[ee(e),Math.round(t)])),s=(t,n,r="bundle-input-field")=>{const o=document.createElement("input");o.type="hidden",o.name=t,o.value=n,o.className=r,e.appendChild(o)};if(n>o){const e=x||$;e&&s("id",ee(e))}s("properties[_bundle_price]",String(l.original)),s("properties[_bundle_tier]",String(r.tier)),s("properties[_bundle_items]",JSON.stringify(c));let d=0;Object.entries(c).forEach(([e,t])=>{t>0&&(s(`items[${d}][id]`,e),s(`items[${d}][quantity]`,String(t)),d++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),r=e.querySelector('[name="checkout"]'),a=e.querySelector(".noti-btn-main-wrap"),i=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const r=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");r&&(r.textContent=n)};n<=o&&(R?(i(t,!0,"Sold out"),i(r,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),a&&(a.style.display="block",a.classList.remove("hidden"),a.classList.add("block"))):(i(t,!1,"Add to cart"),i(r,!1,"Buy it now"),t&&t.classList.remove("btn--sold-out","hidden"),a&&(a.style.display="none",a.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()=>{}},[S,JSON.stringify(z),$,y.volumeBundle?.cardStyle,r,x,R]);const te=i(()=>k.find(e=>e.tier===S),[k,S]),ne=i(()=>te?K(te.tier):null,[te,z,$]),re=i(()=>{if(!te||!ne)return;const e=z[te.tier]||{},t={};for(let n=0;n<te.minimumQuantity;n++){const r=e[n]||$;t[r]=(t[r]||0)+1}return t},[te?.minimumQuantity,$,z,ne]),oe=i(()=>Object.entries(re??{}).map(([e,t])=>({variantId:e,quantity:t})),[re]);if(l(()=>{if(!te||!ne)return;const e={tier:S,items:te.minimumQuantity,discountedPrice:ne.discounted,originalPrice:ne.original,variants:oe,productId:d?.id??null,tierMeta:{title:te.title,subtitle:te.subtitle,badgeTitle:te.badgeTitle},productData:d,tierData:te},t=u.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(p.current&&clearTimeout(p.current),p.current=window.setTimeout(()=>{u.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t)},50),()=>{p.current&&clearTimeout(p.current)})},[S,te?.tier,te?.minimumQuantity,ne?.discounted,ne?.original,d?.id,JSON.stringify(oe)]),l(()=>{if(!$||!te)return;const e=q(d,$);if(!e)return;const t={};for(let e=0;e<te.minimumQuantity;e++)t[e]=$;I(e=>({...e,[S]:{...t}}));const n=e.title.split(" / "),r=Array.from({length:te.minimumQuantity},()=>[...n]);D(e=>({...e,[S-1]:r}))},[$,S,d,te]),!n)return t.createElement(t.Fragment,null);const ae=y.volumeBundle?.cardStyle,ie=y.general?.primaryColor,le=y.general?.secondaryColor,ce=y.general.primaryContrastColor,se=y.general.secondaryContrastColor,de="high"===e.cornerRadiusType?"20px":"medium"===e.cornerRadiusType?"6px":"0px",pe="bundles"==e.appName?e.pageHeader?.title:e?.title,ue="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return l(()=>{Q(S)&&R?.tier===S&&L(null)},[S,oe,Q,R]),t.createElement(Cf,{verticalMargin:y.volumeBundle?.verticalMargin,$backgroundColor:y.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},t.createElement(kf,{className:"yt-bundle-header"},pe&&pe.trim().length>0&&t.createElement(Ef,{fontSize:y.volumeBundle?.titleFontSize,$backgroundColor:y.volumeBundle?.titleBackgroundColor,textColor:y.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},pe),t.createElement(Sf,{className:"yt-bundle-header-subtitle",fontSize:y.volumeBundle?.subtitleFontSize},ue)),"vertical"===ae?t.createElement("div",{style:{display:"grid",gridTemplateColumns:F||4===k.length?"repeat(2, 1fr)":k.length>4?"repeat(3, 1fr)":`repeat(${k.length}, 1fr)`,justifyItems:"center",gap:F?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},k.map(n=>{const r=K(n.tier),o=r.original-r.discounted,a=S===n.tier,i=!H(n.tier);return t.createElement(t.Fragment,{key:n.tier},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:de||"24px",...a?{border:`2px solid ${ie}`}:{border:`1px solid ${le}`},boxShadow:`6px 6px 0px -1px ${a?ie:le}20`,...n.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 "+(a?"yt-volume-vertical-tier-item-active":""),"data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType,"data-minimum-quantity":n.minimumQuantity,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2),onClick:()=>!i&&T(n.tier)},n.badgeTitle&&t.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:a?ie:le,color:a?ce:se,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:a?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":n.tier,"data-badge-title":n.badgeTitle},n.badgeTitle),t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},0!==r.discountValue&&t.createElement(t.Fragment,null,F&&o>0&&!!r?.discountValue&&"Enabled"===y.volumeBundle?.discountBadgeVisibility&&t.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},t.createElement(If,{primaryBackgroundColorCta:a?ie:le,isSelected:a,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:a?ce:se},className:"yt-volume-vertical-tier-save-badge","data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType}," ","percentOff"===e?.discountType?`${r.discountValue}% Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(r.discountValue)}`))),n.imageUrl&&t.createElement("img",{src:nh(n.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"})),t.createElement("div",{style:{padding:"8px",paddingTop:"0"}},t.createElement(Nf,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},t.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},t.createElement(Df,{style:{fontSize:F?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},n.title?n.title:t.createElement(t.Fragment,null,"Buy ",n.minimumQuantity,", Get"," ",n.discountValue,"% Off")),!F&&o>0&&!!r?.discountValue&&"Enabled"===y.volumeBundle?.discountBadgeVisibility&&t.createElement(If,{primaryBackgroundColorCta:a?ie:le,isSelected:a,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:a?ce:se},className:"yt-volume-vertical-tier-save-badge","data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType}," ","percentOff"===e?.discountType?`${r.discountValue}% Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(r.discountValue)}`),a&&n.imageUrl&&t.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},t.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:ce,padding:"2px"}},t.createElement(ho,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),t.createElement(_f,{style:{lineHeight:"normal",fontSize:F?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},n.subtitle?n.subtitle:t.createElement(t.Fragment,null))),H(n.tier)?t.createElement(Pf,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":n.tier,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2),"data-savings":o.toFixed(b?0:2)},t.createElement(Ff,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.discounted.toFixed(b?0:2))),o>0?t.createElement(Of,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.original.toFixed(b?0:2))):""):t.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),a&&!n.imageUrl&&t.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},t.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:ce,padding:"2px"}},t.createElement(ho,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):t.createElement(t.Fragment,null,k.map(n=>{const r=K(n.tier),o=r.original-r.discounted,a=!H(n.tier);return t.createElement(t.Fragment,{key:n.tier},n.badgeTitle&&t.createElement(Tf,{primaryTextColorCta:ce,primaryBackgroundColorCta:ie,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-badge","data-tier":n.tier,"data-badge-title":n.badgeTitle},n.badgeTitle),t.createElement($f,{cornerRadiusType:e?.cornerRadiusType??"",key:n.tier,primaryBackgroundColorCta:ie??"",isSelected:S===n.tier,onClick:()=>T(n.tier),style:{borderRadius:de,cursor:"pointer",backgroundColor:a?"#f5f5f5":"white",opacity:a?.6:1},className:"yt-volume-horizontal-tier-container "+(S===n.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType,"data-minimum-quantity":n.minimumQuantity,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2)},t.createElement(Bf,{cornerRadiusType:e?.cornerRadiusType??"",style:{borderRadius:de,borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},className:"yt-volume-horizontal-tier-header"},t.createElement(zf,{className:"yt-volume-horizontal-tier-info"},t.createElement(jf,{"data-active":S===n.tier,accentColor:ie,className:"yt-volume-horizontal-tier-radio-wrapper"},t.createElement(Vf,{name:"tier",checked:S===n.tier,onChange:()=>!a&&T(n.tier),disabled:a,className:"yt-volume-horizontal-tier-radio-hidden"}),t.createElement(Wf,{accentColor:ie,className:"yt-volume-horizontal-tier-radio-custom"})),t.createElement(Nf,{className:"yt-volume-horizontal-tier-details"},t.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},t.createElement(Df,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},n.title?n.title:t.createElement(t.Fragment,null,"Buy ",n.minimumQuantity,", Get"," ",n.discountValue,"% Off")),o>0&&r?.discountValue&&"Enabled"===y.volumeBundle?.discountBadgeVisibility?t.createElement(If,{primaryBackgroundColorCta:ie,isSelected:S===n.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":n.tier,"data-discount-value":r.discountValue,"data-discount-type":e?.discountType}," ","percentOff"===e?.discountType?`${r.discountValue}% Off`:`Save ${th(y.general.currencySymbol,e.storeCurrencyCode)}${eh(r.discountValue)}`):""),t.createElement(_f,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},n.subtitle?n.subtitle:t.createElement(t.Fragment,null)))),H(n.tier)?t.createElement(Pf,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":n.tier,"data-original-price":r.original.toFixed(b?0:2),"data-discounted-price":r.discounted.toFixed(b?0:2),"data-savings":o.toFixed(0)},o>0?t.createElement(Of,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.original.toFixed(b?0:2))):"",t.createElement(Ff,{className:"yt-volume-horizontal-tier-discounted-price"},th(y.general.currencySymbol,e.storeCurrencyCode),eh(r.discounted.toFixed(b?0:2)))):t.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},t.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),S===n.tier&&t.createElement(Af,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:d.productDetails.variants.edges.length<=1?"0":"10px 15px",gap:d.productDetails.variants.edges.length<=1?"0":"10px"}},Array.from({length:n.minimumQuantity}).map((r,o)=>{const i=n.tier-1,l=(N[i]||[])[o]||d.productDetails.options?.map(e=>e.values[0])||[],c=d?.productDetails?.options.some(e=>e.values.length>1);return t.createElement("div",{key:o,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&t.createElement(Hf,{src:nh(J(d,$,o,n.tier)),alt:d?.productDetails?.title||"Product",className:"yt-volume-horizontal-tier-product-image"}),"auto"===y?.volumeBundle?.variantSelectorType?t.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"}},d?.productDetails?.options?.map((r,s)=>{if(!c)return null;const p=A?.tier===n.tier&&A?.index===o&&A?.optionIndex===s,u=e?.variantOptions?.options?.find(e=>e.name===r.name);let m="";return"color"===u?.type&&(m=u?.values?.find(e=>e.name===l[s])?.value||""),t.createElement(Yf,{key:s,ref:e=>{j.current[o]||(j.current[o]=[]),j.current[o][s]=e},style:{zIndex:p?1e3:"auto",display:"flex"},isActive:p},t.createElement(Gf,{onClick:e=>{e.stopPropagation(),M(p?null:{tier:n.tier,index:o,optionIndex:s})},isActive:p,disabled:a},"color"===u?.type&&m&&t.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[s],t.createElement(lo,null)),p&&t.createElement(Zf,{style:{zIndex:1001}},r.values.map((e,r)=>{const c=[...l];c[s]=e;const p=!U(n.tier,o,l,s,e)||a;d.productDetails.variants.edges.find(({node:e})=>e.title===c.join(" / "));const m=t=>{if(t.preventDefault(),t.stopPropagation(),D(e=>{const t={...e},n=[...t[i]||[]];return n[o]=c,t[i]=n,t}),p){L({tier:S,index:o,optionIndex:s,value:e}),M(null);const t=c.join(" / "),r=d.productDetails.variants.edges.find(e=>e.node.title===t)?.node.id||$;return void Y(n.tier,o,r)}const r=c.join(" / "),a=d.productDetails.variants.edges.find(e=>e.node.title===r)?.node.id||$;Y(n.tier,o,a),M(null)},f=u?.values.find(t=>t.name===e);return"image"===u?.type&&f?.value?t.createElement(qf,{key:e,onClick:m,style:{cursor:"pointer"}},t.createElement(Uf,{src:f.value,alt:e}),e):"color"===u?.type&&f?.value?t.createElement(qf,{key:e,onClick:m,style:{cursor:"pointer"}},t.createElement(Qf,{style:{backgroundColor:f.value}}),e):t.createElement(qf,{key:e,onClick:m,style:{cursor:"pointer"}},e)})))})):t.createElement(Mf,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},d?.productDetails?.options.map((r,c)=>{if(!(r.values.length>1))return null;const s=e.variantOptions?.options?.find(e=>e.name===r.name)||null;return t.createElement("div",{key:r.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},r.values.map(e=>{const r=l[c]===e,p=!U(n.tier,o,l,c,e)||a,u=s?.values.find(t=>t.name===e),m=t=>{if(t.preventDefault(),t.stopPropagation(),p)return;const r=[...l];r[c]=e,D(e=>{const t={...e},n=[...t[i]||[]];return n[o]=r,t[i]=n,t});const a=r.join(" / "),s=d.productDetails.variants.edges.find(e=>e.node.title===a)?.node.id||$;Y(n.tier,o,s)},f={opacity:p?.5:1,cursor:p?"not-allowed":"pointer"};return"color"===s?.type&&u?.value?t.createElement("button",{key:e,onClick:m,style:{...f,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:r?`1px solid ${y.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button",disabled:p},t.createElement("div",{style:{width:r?"24px":"20px",height:r?"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"}},t.createElement("span",null))):"image"===s?.type&&u?.value?t.createElement("button",{key:e,onClick:m,style:{...f,border:r?`1px solid ${y.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:r?"#F7F7F7":"transparent",padding:"0px",width:r?"20px":"18px",height:r?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button",disabled:p},t.createElement("img",{src:u.value,alt:e,style:{width:r?"26px":"24px",height:r?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):t.createElement(Rf,{key:e,isSelected:r,onClick:m,style:{...f,padding:"4px 8px",border:r?`1px solid ${y.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:r?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default",disabled:p},e)})))})))})),R&&R.tier===n.tier&&t.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.")))})),e?.showCta&&(!y.volumeBundle?.addtoCartMethod||"shopify_atc_button"!==y.volumeBundle?.addtoCartMethod)&&!("devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"06cf02-81.myshopify.com"===window.ytBundleApp?.storeDomain)&&t.createElement("div",{style:{position:"relative"}},t.createElement(Lf,{bgColor:Q(S)?y.general?.ctaBackgroundColor:"#ccc",textColor:Q(S)?y.general?.ctaTextColor:"#666",border:`1px solid ${Q(S)?y.general?.ctaBorderColor||"#121212":"#999"}`,shadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Q(S)&&y.general?.customizeHoverState,backgroundColor:y.general?.ctaHoverBackgroundColor,textColor:y.general?.ctaHoverTextColor},onClick:async()=>{if(Q(S))try{P(!0);const e=k.find(e=>e.tier===S);if(!e)return;const t={},r=z[e.tier]||{};for(let n=0;n<e.minimumQuantity;n++){const e=r[n]||$;t[e]?t[e].quantity+=1:t[e]={quantity:1}}const o=K(e.tier),a=Array.from({length:e.minimumQuantity},(e,t)=>r[t]||$);n&&await n(o.original,a)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{P(!1)}else console.error("Selected tier is out of stock")},borderRadius:y.general.ctaBorderRadius??"",disabled:_||!Q(S),className:"yt-volume-add-to-cart-button"},Q(S)?t.createElement(t.Fragment,null,_?t.createElement(da,{color:"white",loading:_,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},t.createElement("span",null,y.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",t.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const n=K(S);return t.createElement(t.Fragment,null,th(y.general.currencySymbol,e.storeCurrencyCode),eh(n.discounted.toFixed(b?0:2))," ",n?.original!==n.discounted&&t.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},th(y.general.currencySymbol,e.storeCurrencyCode),eh(n?.original.toFixed(b?0:2))," "))})()))):t.createElement(t.Fragment,null,"Out of Stock"))))}const Jf=h.div`
|
|
3888
3888
|
container-type: inline-size;
|
|
3889
3889
|
border-radius: ${e=>e.borderRadius?e.borderRadius:"8px"};
|
|
3890
3890
|
max-width: 800px;
|
|
@@ -4408,7 +4408,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
4408
4408
|
font-size: 11px;
|
|
4409
4409
|
padding: 4px 8px;
|
|
4410
4410
|
}
|
|
4411
|
-
`,Ng=({bundle:e,addToCartFunction:n})=>{const[r,a]=c({}),[s,d]=c(!1),[p,u]=c(0),[m,f]=c(0),[g,x]=c(""),[h,y]=c([]),[b,v]=c({}),[C,k]=c(!1),[E,S]=c(window.innerWidth<450),T=e.builderTiers?.productTier||[],$=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),{originalPrice:B,dealPrice:z,offerValue:I}=i(()=>{const t=[];let n=0;Object.values(r).forEach(e=>{e.productId&&e.variantId&&(t.push({productId:e.productId,variantId:e.variantId}),n++)});let o=0,a=0;for(const{productId:n,variantId:r}of t){const t=e.products.find(e=>e.productId===n);if(!t)continue;const i=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===r)?.node;if(!i)continue;const l=Number.parseFloat(i?.price||"0"),c=Number.parseFloat(i?.compareAtPrice||"0");o+=l,a+=c>0?c:l}let i=o;(n===T.length||e?.dealAmount)&&(e?.percentageOff?i=o*(1-e.percentageOff/100):e?.dealAmount?i=e.dealAmount:e?.amountOff&&e.amountOff<o&&(i=o-e.amountOff));const l=a||o,c=l-i;return{originalPrice:l.toFixed(2),dealPrice:i.toFixed(2),offerValue:c.toFixed(2)}},[e,r,T.length]);l(()=>{u(T.length-Object.keys(r).length)},[r]),l(()=>{const e={};let t=!1;T.forEach((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o?.variantIds?.[0]||D(o?.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}}),t&&a(t=>({...t,...e}))},[T]),l(()=>{if(null===m||0===T.length)return;const t=T[m].products.map(e=>e.productId),n=new Map;e.products.forEach(e=>{t.includes(e.productId)&&!n.has(e.productId)&&n.set(e.productId,e)});let r=Array.from(n.values());if(""!==g.trim()){const e=g.toLowerCase();r=r.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)))}y(r)},[g,e.products,m,T]);const N=t=>{const n=e.products.find(e=>e.productId===t);return n?.productDetails},D=t=>{const n=e.products.find(e=>e.productId===t);if(!n||!n.productDetails?.variants?.edges?.length)return"";const r=n.productDetails.variants.edges.find(e=>$(n.productDetails,e.node.id)>0)?.node;return r?r.id:n.productDetails.variants.edges[0].node.id},_=(t,n)=>{if(null==m)return;const r=n||D(t),o=e.products.find(e=>e.productId===t);if(o){if(0===$(o.productDetails,r))return void console.log("Cannot select out of stock variant")}a(e=>({...e,[m]:{productId:t,variantId:r}})),d(!1),x("")},P=e=>{a(t=>{const n={...t};return delete n[e],n}),v({})},O=t=>{const n=T[t];if(n.isFixed)return;f(t),d(!0),x("");const r=n.products.map(e=>e.productId),o=e.products.filter(e=>r.includes(e.productId)),a=new Map;o.forEach(e=>{a.has(e.productId)||a.set(e.productId,e)}),y(Array.from(a.values()))};l(()=>{const e=()=>{S(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const F=e.customizations,A=E,M="bundles"===e.appName?e.pageHeader?.title:e?.title,R="bundles"===e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(t.Fragment,null,t.createElement(Jf,{verticalMargin:F.comboBundle.verticalMargin,borderRadius:"20px"},F.comboBundle.embedContentVisibility&&t.createElement(eg,null,F.comboBundle?.embedContentVisibility&&F.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:F.comboBundle.infoAlignment||"left"}},t.createElement("h2",{style:{fontSize:"28px",color:F.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},M)),F.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(z)>1&&t.createElement(t.Fragment,null,t.createElement(tg,{infoAlignment:F.comboBundle.infoAlignment},t.createElement(ng,null,th(F.general.currencySymbol,e.storeCurrencyCode),eh(z)),Number(z)<Number(B)&&t.createElement(rg,{style:{minWidth:"fit-content"}},th(F.general.currencySymbol,e.storeCurrencyCode)," ",eh(B)),t.createElement(og,{style:{minWidth:"fit-content"}},"In Stock")),t.createElement(ag,{style:{textAlign:F.comboBundle.infoAlignment||"left",fontSize:F.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),t.createElement(ig,{gridSize:T.length,isHorizontal:A},T.map((e,n)=>{const a=(e=>!!r[e]&&!!r[e].productId)(n),{product:i,variantId:c}=(e=>{const t=r?.[e];return t?{product:N(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(n),s=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(i,c):null,d=e.isFixed,p=o(null);return l(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")},[s?.displayName,s?.title]),a&&i?t.createElement(lg,{key:`tier-${n}`,onClick:()=>!d&&O(n),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:A,infoAlignment:F.comboBundle.infoAlignment},!d&&t.createElement(mg,{onClick:e=>{e.stopPropagation(),P(n)}},"×"),t.createElement(sg,{src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,style:{aspectRatio:F?.general.imageAspectRatio||"1/1"},isHorizontal:A}),t.createElement(dg,{style:{color:"#1e1e1e",textAlign:"center",...A&&"right"===F.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...A&&"left"===F.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!A&&"left"===F.comboBundle.infoAlignment&&{padding:"0 10px"},...A&&"center"===F.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:A},t.createElement(ug,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},t.createElement("span",null,i?.title," - ",s?.title)))):t.createElement(cg,{key:`tier-${n}`,onClick:()=>!d&&O(n),isHorizontal:A,infoAlignment:F.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?t.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),t.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},e.title||`Product ${n+1}`)):t.createElement(t.Fragment,null,t.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},t.createElement(fg,null,"+")),t.createElement(pg,{style:{fontSize:"15px",fontWeight:"600",color:F.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:A,infoAlignment:F.comboBundle.infoAlignment},t.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e.title?`${e.title}`:`Select Product ${n+1}`))))})),t.createElement(gg,{hoverProperties:{customizeHoverState:F.general.customizeHoverState,backgroundColor:F.general.ctaHoverBackgroundColor,textColor:F.general.ctaHoverTextColor},borderRadius:F.general.ctaBorderRadius,primaryBgColor:F.general.ctaBackgroundColor,onClick:async()=>{k(!0);try{if(p>0)return console.log("Please select all products"),void k(!1);const t=Object.values(r).map(e=>e.variantId),o=Object.values(r).map(t=>{const n=e.products.find(e=>e.productId===t.productId);if(!n)return null;const r=n?.productDetails?.variants?.edges?.find(e=>e.node.id===t.variantId)?.node;return r?{variantId:t.variantId,price:Number(r.price)}:null}).filter(Boolean);await n(t.length,t,Number(z),o)}catch(e){console.log("Add to cart error:",e)}finally{k(!1)}},textColor:F.general.ctaTextColor,borderColor:F.general.ctaBorderColor},0===p?C?t.createElement(da,{color:"white",loading:C,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,F.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${p} more item(s)`),F.comboBundle?.embedContentVisibility&&F.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:F.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:F.general.primaryColor+"20",textAlign:F.comboBundle.infoAlignment||"left"}},"Description"),t.createElement("div",{style:{fontSize:F.comboBundle.productDescriptionFontSize||"16px",color:F.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:F.general.primaryColor+"08",textAlign:F.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:R}}))),s&&w(t.createElement(xg,{onClick:()=>d(!1)},t.createElement(hg,{onClick:e=>e.stopPropagation()},t.createElement(yg,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},t.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},t.createElement(bg,{placeholder:"Search",value:g,onChange:e=>{x(e.target.value)}}),t.createElement(vg,{onClick:()=>d(!1)},"Cancel")),t.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),t.createElement("div",{style:{marginBottom:E?"20px":"5px",flex:1,minHeight:0,overflow:"scroll"}},t.createElement(wg,{style:{height:"auto",flex:"unset"}},h?.length>0?h?.map(n=>{const o=n?.productDetails;if(!o)return null;const a=(e=>{if(null==m)return!1;const t=r?.[m];return!!t&&t.productId===e})(n.productId),i=D(n.productId);let l=i||"";return l=a&&null!==m?r?.[m]?.variantId||l:b[n.productId]||i,t.createElement(Cg,{className:"mixAndMatch-product-item",primaryBgColor:F.general.primaryColor||"#1e1e1e",key:o.id,isSelected:a,onClick:()=>{_(n.productId,l)}},t.createElement(kg,{className:"mixAndMatch-vendor-image",src:o.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:o.title}),t.createElement(Eg,{className:"mixAndMatch-vendor-info"},t.createElement(Sg,{className:"mixAndMatch-vendor-name"},o.title),t.createElement(zg,{className:"mixAndMatch-variant-options"},o.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:e})=>{const r=0===$(o,e.id);return t.createElement(Ig,{className:"mixAndMatch-variant-button "+(l===e.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:F.general?.primaryColor,disabled:!!a||r,key:e.id,isSelected:l===e.id,tierHasProductId:!!a,onClick:t=>{var o,a;t.stopPropagation(),r||(o=n.productId,a=e.id,v(e=>({...e,[o]:a})))},style:{opacity:r?.5:1,cursor:r?"not-allowed":"pointer"}},e.title)}))),t.createElement(Tg,{cornerRadiusType:e?.cornerRadiusType??"",primaryBgColor:F.general?.primaryColor||"#1e1e1e",onClick:()=>a?P(m||0):_(n.productId,l)},a?t.createElement($g,null,"Added"):" + Add"))}):t.createElement(Bg,null,'No products found matching "',g,'"'))))),document.body))},Dg=h.div`
|
|
4411
|
+
`,Ng=({bundle:e,addToCartFunction:n})=>{const[r,a]=c({}),[s,d]=c(!1),[p,u]=c(0),[m,f]=c(0),[g,x]=c(""),[h,y]=c([]),[b,v]=c({}),[C,k]=c(!1),[E,S]=c(window.innerWidth<450),T=e.builderTiers?.productTier||[],$=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),{originalPrice:B,dealPrice:z,offerValue:I}=i(()=>{const t=[];let n=0;Object.values(r).forEach(e=>{e.productId&&e.variantId&&(t.push({productId:e.productId,variantId:e.variantId}),n++)});let o=0,a=0;for(const{productId:n,variantId:r}of t){const t=e.products.find(e=>e.productId===n);if(!t)continue;const i=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===r)?.node;if(!i)continue;const l=Number.parseFloat(i?.price||"0"),c=Number.parseFloat(i?.compareAtPrice||"0");o+=l,a+=c>0?c:l}let i=o;(n===T.length||e?.dealAmount)&&(e?.percentageOff?i=o*(1-e.percentageOff/100):e?.dealAmount?i=e.dealAmount:e?.amountOff&&e.amountOff<o&&(i=o-e.amountOff));const l=a||o,c=l-i;return{originalPrice:l.toFixed(2),dealPrice:i.toFixed(2),offerValue:c.toFixed(2)}},[e,r,T.length]);l(()=>{u(T.length-Object.keys(r).length)},[r]),l(()=>{const e={};let t=!1;T.forEach((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o?.variantIds?.[0]||D(o?.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}}),t&&a(t=>({...t,...e}))},[T]),l(()=>{if(null===m||0===T.length)return;const t=T[m].products.map(e=>e.productId),n=new Map;e.products.forEach(e=>{t.includes(e.productId)&&!n.has(e.productId)&&n.set(e.productId,e)});let r=Array.from(n.values());if(""!==g.trim()){const e=g.toLowerCase();r=r.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)))}y(r)},[g,e.products,m,T]);const N=t=>{const n=e.products.find(e=>e.productId===t);return n?.productDetails},D=t=>{const n=e.products.find(e=>e.productId===t);if(!n||!n.productDetails?.variants?.edges?.length)return"";const r=n.productDetails.variants.edges.find(e=>$(n.productDetails,e.node.id)>0)?.node;return r?r.id:n.productDetails.variants.edges[0].node.id},_=(t,n)=>{if(null==m)return;const r=n||D(t),o=e.products.find(e=>e.productId===t);if(o){if(0===$(o.productDetails,r))return void console.log("Cannot select out of stock variant")}a(e=>({...e,[m]:{productId:t,variantId:r}})),d(!1),x("")},P=e=>{a(t=>{const n={...t};return delete n[e],n}),v({})},F=t=>{const n=T[t];if(n.isFixed)return;f(t),d(!0),x("");const r=n.products.map(e=>e.productId),o=e.products.filter(e=>r.includes(e.productId)),a=new Map;o.forEach(e=>{a.has(e.productId)||a.set(e.productId,e)}),y(Array.from(a.values()))};l(()=>{const e=()=>{S(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const O=e.customizations,A=E,M="bundles"===e.appName?e.pageHeader?.title:e?.title,R="bundles"===e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(t.Fragment,null,t.createElement(Jf,{verticalMargin:O.comboBundle.verticalMargin,borderRadius:"20px"},O.comboBundle.embedContentVisibility&&t.createElement(eg,null,O.comboBundle?.embedContentVisibility&&O.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:O.comboBundle.infoAlignment||"left"}},t.createElement("h2",{style:{fontSize:"28px",color:O.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},M)),O.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(z)>1&&t.createElement(t.Fragment,null,t.createElement(tg,{infoAlignment:O.comboBundle.infoAlignment},t.createElement(ng,null,th(O.general.currencySymbol,e.storeCurrencyCode),eh(z)),Number(z)<Number(B)&&t.createElement(rg,{style:{minWidth:"fit-content"}},th(O.general.currencySymbol,e.storeCurrencyCode)," ",eh(B)),t.createElement(og,{style:{minWidth:"fit-content"}},"In Stock")),t.createElement(ag,{style:{textAlign:O.comboBundle.infoAlignment||"left",fontSize:O.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),t.createElement(ig,{gridSize:T.length,isHorizontal:A},T.map((e,n)=>{const a=(e=>!!r[e]&&!!r[e].productId)(n),{product:i,variantId:c}=(e=>{const t=r?.[e];return t?{product:N(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(n),s=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(i,c):null,d=e.isFixed,p=o(null);return l(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")},[s?.displayName,s?.title]),a&&i?t.createElement(lg,{key:`tier-${n}`,onClick:()=>!d&&F(n),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:A,infoAlignment:O.comboBundle.infoAlignment},!d&&t.createElement(mg,{onClick:e=>{e.stopPropagation(),P(n)}},"×"),t.createElement(sg,{src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,style:{aspectRatio:O?.general.imageAspectRatio||"1/1"},isHorizontal:A}),t.createElement(dg,{style:{color:"#1e1e1e",textAlign:"center",...A&&"right"===O.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...A&&"left"===O.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!A&&"left"===O.comboBundle.infoAlignment&&{padding:"0 10px"},...A&&"center"===O.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:A},t.createElement(ug,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},t.createElement("span",null,i?.title," - ",s?.title)))):t.createElement(cg,{key:`tier-${n}`,onClick:()=>!d&&F(n),isHorizontal:A,infoAlignment:O.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?t.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),t.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},e.title||`Product ${n+1}`)):t.createElement(t.Fragment,null,t.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},t.createElement(fg,null,"+")),t.createElement(pg,{style:{fontSize:"15px",fontWeight:"600",color:O.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:A,infoAlignment:O.comboBundle.infoAlignment},t.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e.title?`${e.title}`:`Select Product ${n+1}`))))})),t.createElement(gg,{hoverProperties:{customizeHoverState:O.general.customizeHoverState,backgroundColor:O.general.ctaHoverBackgroundColor,textColor:O.general.ctaHoverTextColor},borderRadius:O.general.ctaBorderRadius,primaryBgColor:O.general.ctaBackgroundColor,onClick:async()=>{k(!0);try{if(p>0)return console.log("Please select all products"),void k(!1);const t=Object.values(r).map(e=>e.variantId),o=Object.values(r).map(t=>{const n=e.products.find(e=>e.productId===t.productId);if(!n)return null;const r=n?.productDetails?.variants?.edges?.find(e=>e.node.id===t.variantId)?.node;return r?{variantId:t.variantId,price:Number(r.price)}:null}).filter(Boolean);await n(t.length,t,Number(z),o)}catch(e){console.log("Add to cart error:",e)}finally{k(!1)}},textColor:O.general.ctaTextColor,borderColor:O.general.ctaBorderColor},0===p?C?t.createElement(da,{color:"white",loading:C,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,O.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${p} more item(s)`),O.comboBundle?.embedContentVisibility&&O.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:O.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:O.general.primaryColor+"20",textAlign:O.comboBundle.infoAlignment||"left"}},"Description"),t.createElement("div",{style:{fontSize:O.comboBundle.productDescriptionFontSize||"16px",color:O.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:O.general.primaryColor+"08",textAlign:O.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:R}}))),s&&w(t.createElement(xg,{onClick:()=>d(!1)},t.createElement(hg,{onClick:e=>e.stopPropagation()},t.createElement(yg,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},t.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},t.createElement(bg,{placeholder:"Search",value:g,onChange:e=>{x(e.target.value)}}),t.createElement(vg,{onClick:()=>d(!1)},"Cancel")),t.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),t.createElement("div",{style:{marginBottom:E?"20px":"5px",flex:1,minHeight:0,overflow:"scroll"}},t.createElement(wg,{style:{height:"auto",flex:"unset"}},h?.length>0?h?.map(n=>{const o=n?.productDetails;if(!o)return null;const a=(e=>{if(null==m)return!1;const t=r?.[m];return!!t&&t.productId===e})(n.productId),i=D(n.productId);let l=i||"";return l=a&&null!==m?r?.[m]?.variantId||l:b[n.productId]||i,t.createElement(Cg,{className:"mixAndMatch-product-item",primaryBgColor:O.general.primaryColor||"#1e1e1e",key:o.id,isSelected:a,onClick:()=>{_(n.productId,l)}},t.createElement(kg,{className:"mixAndMatch-vendor-image",src:o.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:o.title}),t.createElement(Eg,{className:"mixAndMatch-vendor-info"},t.createElement(Sg,{className:"mixAndMatch-vendor-name"},o.title),t.createElement(zg,{className:"mixAndMatch-variant-options"},o.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:e})=>{const r=0===$(o,e.id);return t.createElement(Ig,{className:"mixAndMatch-variant-button "+(l===e.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:O.general?.primaryColor,disabled:!!a||r,key:e.id,isSelected:l===e.id,tierHasProductId:!!a,onClick:t=>{var o,a;t.stopPropagation(),r||(o=n.productId,a=e.id,v(e=>({...e,[o]:a})))},style:{opacity:r?.5:1,cursor:r?"not-allowed":"pointer"}},e.title)}))),t.createElement(Tg,{cornerRadiusType:e?.cornerRadiusType??"",primaryBgColor:O.general?.primaryColor||"#1e1e1e",onClick:()=>a?P(m||0):_(n.productId,l)},a?t.createElement($g,null,"Added"):" + Add"))}):t.createElement(Bg,null,'No products found matching "',g,'"'))))),document.body))},Dg=h.div`
|
|
4412
4412
|
border-radius: 8px;
|
|
4413
4413
|
container-type: inline-size;
|
|
4414
4414
|
`,_g=h.div`
|
|
@@ -4426,13 +4426,13 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
4426
4426
|
font-size: 16px;
|
|
4427
4427
|
margin: 8px 0;
|
|
4428
4428
|
line-height: normal;
|
|
4429
|
-
`,
|
|
4429
|
+
`,Fg=h.div`
|
|
4430
4430
|
display: flex;
|
|
4431
4431
|
flex-direction: column;
|
|
4432
4432
|
gap: 5px;
|
|
4433
4433
|
margin: 10px 0px;
|
|
4434
4434
|
padding: 5px
|
|
4435
|
-
`,
|
|
4435
|
+
`,Og=h.div`
|
|
4436
4436
|
display: flex;
|
|
4437
4437
|
border: 1px solid #eee;
|
|
4438
4438
|
border-radius: 8px;
|
|
@@ -5020,7 +5020,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
5020
5020
|
margin: 0;
|
|
5021
5021
|
border: none;
|
|
5022
5022
|
border-top: 1px solid #d3d3d3;
|
|
5023
|
-
`,
|
|
5023
|
+
`,Fx=h.span`
|
|
5024
5024
|
font-size: 10px;
|
|
5025
5025
|
color: #777;
|
|
5026
5026
|
margin-left: 4px;
|
|
@@ -5030,7 +5030,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
5030
5030
|
font-weight: 600;
|
|
5031
5031
|
border: 1px solid lightgray;
|
|
5032
5032
|
border-radius: 10px;
|
|
5033
|
-
`,
|
|
5033
|
+
`,Ox=h.div`
|
|
5034
5034
|
display: flex;
|
|
5035
5035
|
flex-wrap: wrap;
|
|
5036
5036
|
gap: 6px;
|
|
@@ -5081,4 +5081,4 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
5081
5081
|
}
|
|
5082
5082
|
`,Lx=h.span`
|
|
5083
5083
|
font-size: 12px;
|
|
5084
|
-
`,jx=({productsWithIndices:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[f,g]=c({}),[x,h]=c({});l(()=>{const t={},n={};e?.forEach(({product:e,index:r})=>{let o,a=[];if(e.productId===p&&u){const t=e?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;t&&m(e.productDetails,t.id)>0&&(a=t.title.split(" / "),o=t)}if(!a.length){const t=e.productDetails.variants.edges.find(t=>m(e.productDetails,t?.node?.id)>0)?.node||e?.productDetails?.variants?.edges?.[0]?.node;t?(a=t.title.split(" / "),o=t):a=e?.productDetails?.options?.map(e=>e.values[0]??"")}t[r]=a,o&&(n[r]={node:o},s(r,o.id))}),g(t),h(n)},[e,p,u,s,m]),l(()=>{if(!p||!u)return;const t=e?.find(({product:e})=>e?.productId===p);if(!t)return;const{product:n,index:r}=t,o=n?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(n.productDetails,o.id)>0){const e=o.title.split(" / ");g(t=>({...t,[r]:e})),h(e=>({...e,[r]:{node:o}})),s(r,o.id)}},[u,p,e,s,m]);const y=(e,t,n,r)=>{const o=[...f[e]||[]];o[t]=n;const a=o.join(" / "),i=r.productDetails.variants.edges.find(e=>e.node.title===a)?.node;return!!i&&m(r.productDetails,i.id)>0},b=(t,n,r)=>{const{product:o}=e?.find(e=>e.index===t)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!y(t,r,n,o))return;const a={...f};a[t][r]=n,g(a);const i=o?.productDetails?.variants?.edges?.find(e=>e.node.title===a[t].join(" / "))?.node;i&&(s(t,i.id),h(e=>({...e,[t]:{node:i}})))};if(!n)return null;const w=t.createElement(Tx,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement($x,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(Bx,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(({product:n,index:r},o)=>t.createElement(t.Fragment,null,t.createElement(Ix,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(Nx,{className:"yt-fixedBundle-variant-modal_thumbnail",src:x[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(Dx,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(_x,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(Ox,{className:"yt-fixedBundle-variant-modal_selected-value"},f[r]?.join(" / "))),n.productDetails.options.map((e,o)=>{const i=a&&a?.options?.find(t=>t.name===e.name);return e.values.length<=1?t.createElement(t.Fragment,null):i&&"color"===i?.type?t.createElement(Fx,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Lx,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i.values.find(t=>t.name===e)?.value?t.createElement(Ax,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(t=>t.name===e)?.value||e,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},t.createElement("span",null)):t.createElement(Mx,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):i&&"image"===i?.type?t.createElement(Fx,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Lx,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i?.values.find(t=>t.name===e)?.value?t.createElement(Rx,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)},src:i.values.find(t=>t.name===e)?.value},t.createElement("span",null)):t.createElement(Mx,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):t.createElement(Fx,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Lx,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const i=!y(r,o,e,n);return t.createElement(Mx,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:i,onClick:()=>{b(r,e,o)}},e)}))}))),o<e.length-1&&t.createElement(Px,{className:"yt-fixedBundle-variant-modal_divider"}))),t.createElement(zx,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:d},"Add bundle to cart")));return v.createPortal(w,document.body)},Vx=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=e=>"color"===a?t.createElement(hx,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(yx,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(dx,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(px,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(ux,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(mx,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(fx,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map(e=>t.createElement(gx,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(xx,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name)))))},Wx=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l(()=>{if(a&&e.variants.edges.some(e=>e.node.id.includes(a))){const t=e.variants.edges.find(e=>e.node.id.includes(a))?.node;if(t){const e=t.title.split(" / ");p(e)}}},[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map(e=>({name:e,value:e}));const r=n.options.find(t=>t.name===e.name);return e.values.map(e=>{const t=r?.values?.find(t=>t.name===e);return{name:e,value:t?.value||e}})},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find(e=>e.name===n)||null};return t.createElement(bx,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map((n,r)=>t.createElement(vx,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(Vx,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find(n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t]))?.node.id;o(a||"")})(r,t)},type:u(n.name)}))))},Hx=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:s,onCheckChange:d,isMobile:p,isHorizontal:u,index:m,variantOptions:f,productsLength:g,handleOpenModal:x,storeCurrencyCode:h,primaryProductId:y,variantId:b})=>{const v=i(()=>t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e]),[w,C]=c(e?.variants?.edges.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node),[k]=c(e?.options?.map(e=>e?.values?.[0])||[]),E=e?.id===y;l(()=>{if(b&&e.id===y){const t=e?.variants?.edges?.find(e=>e?.node?.id?.includes(b))?.node;t&&v(t.id)>0&&(C(t),s(t.id))}else{const t=e?.variants?.edges?.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node;C(t)}},[e,y,n,b,s,v]);const S="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,T=w?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,u?t.createElement("div",{className:""+(e.id===y?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(Ex,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(Cx,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(kx,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,null))),t.createElement(Fg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Ag,{className:"yt-fixedBundle-product-card-horizontal_image",src:nh(T),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(Mg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(Rg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Lg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(jg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},th(a.general.currencySymbol,h)," ",eh(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Vg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},th(a.general.currencySymbol,h),eh(w?.compareAtPrice))),t.createElement(Wx,{product:e,variantOptions:f,selectedVariants:k,onVariantChange:t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t)?.node;n&&v(t)>0&&s(t)},variantId:b,primaryProductId:y})))):t.createElement(t.Fragment,null,t.createElement(Xg,{className:""+(e.id===y?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:g,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...S&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(Sx,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:S},t.createElement(Cx,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(kx,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Kg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Jg,{className:"yt-fixedBundle-product-card_image--vertical",src:nh(T),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(ex,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(tx,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(nx,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(rx,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(ox,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(ax,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(lx,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(ix,{className:"yt-fixedBundle-product-card-vertical_price--new"},th(a.general.currencySymbol,h),eh(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Vg,{className:"yt-fixedBundle-product-card-vertical_price--old"},th(a.general.currencySymbol,h),eh(w.compareAtPrice))))),(g<=3||!p)&&m<g-1&&t.createElement(cx,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(sx,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},qx=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[s,d]=c(window.innerWidth<786),[p,u]=c(null),[m,f]=c(!1),g="undefined"!=typeof window?window.location.href:null,x=e?.products?.find(e=>e.productDetails?.handle===g?.split("/").pop()?.split("?")[0]),h=x?.productId,y=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[b,v]=c(Object.fromEntries(e?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>y(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),w="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),C=e?.showIndividualProductSelector||!0,[k,E]=c(new Set(e.products.reduce((e,t,n)=>(w&&t?.productId!==h&&!C||e.push(n),e),[])));l(()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");u(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};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)}},[]),l(()=>{p&&h&&v(t=>{const n={...t};return e?.products?.forEach((e,t)=>{e.productId===h&&(n[t.toString()]=p)}),n})},[p,h,e?.products]),l(()=>{const e=()=>{d(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const S=a((e,t)=>{v(n=>({...n,[e.toString()]:t}))},[]),T=(t,n)=>{const r=e.products[n].productId;w&&C&&r===h||E(e=>{const r=new Set(e);return t?r.add(n):r.delete(n),r})},$=i(()=>(e,t)=>y(e.productDetails,t)>0,[y]),B=i(()=>e.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[e.products,k]),{originalPrice:z,dealPrice:I,offerValue:N}=i(()=>{const{price:t,compareAtPrice:n}=e.products.reduce((e,t,n)=>{if(!k.has(n))return e;const r=b[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);k.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}},[e.products,b,k,e.percentageOff,e.dealAmount,e.amountOff]),D=i(()=>e.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[e.products,k]),_=D.every(({product:e,index:t})=>$(e,b[t.toString()])),P=async e=>{if(_){e.preventDefault(),e.stopPropagation(),o(!0),f(!1);try{const e=Object.entries(b).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);n&&await n(Number(z),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)}};if(!n)return t.createElement(t.Fragment,null);const O=e.customizations,F=O.fixedBundle?.cardLayoutStyle||"auto",A="horizontal"===F||"auto"===F&&s,M="bundles"==e.appName?e.pageHeader?.title:e?.title,R="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(Dg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:O.fixedBundle.sectionBackgroundColor,..."transparent"!==O.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&t.createElement(_g,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:O.fixedBundle?.titleBackgroundColor||"none",color:O.fixedBundle?.titleTextColor||"black",textAlign:O.fixedBundle.infoAlignment??"center",fontSize:O.fixedBundle?.titleFontSize,..."transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"===O.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),R&&t.createElement(Pg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:O.fixedBundle?.subtitleFontSize,textAlign:O.fixedBundle.infoAlignment??"center",..."left"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"===O.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},R),A?t.createElement(Og,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map((n,r)=>t.createElement(t.Fragment,{key:`${n.productId}-${r}`},t.createElement(Hx,{isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:O,onVariantChange:e=>S(r,e),onCheckChange:e=>{T(e,r)},isMobile:s,index:r,isHorizontal:A,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:h,variantId:p||void 0})))):t.createElement(Gg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Zg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===O.fixedBundle.infoAlignment?"flex-start":"right"===O.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map((n,r)=>t.createElement(Hx,{key:`${n.productId}-${r}`,isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:O,onVariantChange:e=>S(r,e),onCheckChange:e=>T(e,r),isMobile:s,index:r,isHorizontal:A,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:h,variantId:p||void 0})),B&&t.createElement(jx,{productsWithIndices:D,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:O.general.ctaTextColor,backgroundColor:O.general.ctaBackgroundColor},onVariantChange:S,handleAddToCart:P,primaryProductId:h,variantId:p||void 0}))),t.createElement(Wg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===O.fixedBundle.infoAlignment?"flex-start":"right"===O.fixedBundle.infoAlignment?"flex-end":"center"}},Number(z)>0&&Number(N)>0&&O.fixedBundle.compareAtPriceVisibility&&t.createElement(Hg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Ug,{className:"yt-fixedBundle-summary_price"},th(O.general.currencySymbol,e?.storeCurrencyCode),eh(z))),0!==k.size&&t.createElement(qg,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Ug,{className:"yt-fixedBundle-summary_price"},th(O.general.currencySymbol,e?.storeCurrencyCode),eh(I))," ",Number(N)>0&&t.createElement(Qg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",th(O.general.currencySymbol,e?.storeCurrencyCode),eh(N)))),t.createElement(Yg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),A||!B?P(e):f(!0)},disabled:k.size<1||r||!_,style:{backgroundColor:O.general?.ctaBackgroundColor||"#121212",color:O.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${O.general?.ctaBackgroundColor||"#121212"}`,boxShadow:O.general.ctaShadowType,paddingTop:O.general?.ctaPadding,paddingBottom:O.general?.ctaPadding,borderRadius:O.general.ctaBorderRadius,width:O.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{O.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=O.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=O.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{O.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=O.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=O.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(da,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?t.createElement(t.Fragment,null,O.fixedBundle?.ctaTitle??"Add Bundle to cart"):t.createElement(t.Fragment,null,"Out of Stock")))},Ux=()=>t.createElement(t.Fragment,null,t.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),t.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"}})),Qx=({product:e,tierIdx:n,isOpen:r,onClose:o,onAddToBundle:a,canAdd:i,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=c(0),[f,g]=c(e.variants[0].id.toString()),x=e.variants.find(e=>e.id.toString()===f)||e.variants[0],h=e.images.filter(Boolean);if(l(()=>(r&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[r]),l(()=>{if(x&&x?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image");e?.setAttribute("src",x?.featured_image?.src)}},[x]),!r)return null;const y=t.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:o},t.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()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,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"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px"}},h.length>0&&t.createElement("img",{className:"yt-collection-bundle-modal-image",src:nh(h[u]||e.images[0]),alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px"}}),h.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},h.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer",display:"block"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},e?.options?.join(" & "),":"," ",t.createElement("strong",null,x.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(x.price/100).toFixed(0),x.compare_at_price&&x.compare_at_price>x.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(x.compare_at_price/100).toFixed(0))),t.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!x.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:x.available?s||!i?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:i&&x.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":x.available?"Add to Box":"Out of Stock")),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),b=t.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:o},t.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()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,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"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},h.length>0&&t.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative"}},t.createElement("img",{className:"yt-collection-bundle-modal-image",src:x.featured_image?.src||h[u]||e.images[0],alt:e.title,style:{width:"100%",display:"block",maxHeight:"50vh",objectFit:"cover",objectPosition:"center"}}),h.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},h.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},"Variant: ",t.createElement("strong",null,x.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(x.price/100).toFixed(0),x.compare_at_price&&x.compare_at_price>x.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(x.compare_at_price/100).toFixed(0))),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}}))),t.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)"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!x.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&i&&x.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:i&&x.available?"pointer":"not-allowed"}},s?"Added to Box":x.available?"Add to Box":"Out of Stock"))));return v.createPortal(p?b:y,document.body)},Yx=({title:e,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return t.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},t.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},e),i&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},t.createElement(Ux,null)," Uploading ",n?.name,"...")),l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:a,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!i&&!l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},t.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),t.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:o,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:r,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},Gx=({config:e,bundleAddToCartLoading:n,addCustomBundleToCart:r})=>{const[i,s]=c(1),[d,p]=c([]),[u,m]=c(null),[f,g]=c({}),[x,h]=c(window.innerWidth<640),[y,b]=c({}),v=o(new Map),[w,C]=c(!1),k=o(null),E=o(new Map),[S,T]=c(160),$=x?8:20,{customizations:B}=e,z=e.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),I=!!e.config.form,N=z.length+(I?1:0),D=B.hideSelectedProducts,_=B.allowMultipleQty,P=B.hideOutOfStockProducts,O=e=>z[e-1]?.products||[],F=a(e=>{const t=O(e),n=P?t.filter(e=>e.available).length:t.length;b(t=>{const r=t[e]||0,o=Math.min(r+8,n);return o<=r?t:{...t,[e]:o}})},[8,P]);l(()=>(k.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===i&&F(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[F,i]),l(()=>{if(I&&i===N)return;const e=i,t=O(e);if(0===t.length)return;const n=P?t.filter(e=>e.available).length:t.length;if(0===(y[e]||0)){const t=Math.min($,n);b(n=>({...n,[e]:t}))}},[i,$,P,y]),l(()=>{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 A=a(e=>{T(e+10)},[]),M=d.reduce((e,t)=>e+t.quantity,0),R=d.reduce((e,t)=>e+t.price*t.quantity,0)/100,L=d.reduce((e,t)=>{const n=z.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/100,j=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},V=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const r=n.dataset.selectedVariant||e.variants[0].id.toString(),o=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());p(n=>{const a=`${e.id}-${r}-${t}`,i=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===a);if(i)return n.filter(e=>e!==i);const l=q[t],c=W(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]})},W=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},H=(e,t)=>{const n=W(t);if(n===1/0)return!0;const r=q[t],o=d.some(n=>n.productId===e.id.toString()&&n.tierIndex===t);return!!o||r<n},q=z.map((e,t)=>d.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),U=(e,t,n)=>{const r=W(n);if(r===1/0)return!0;return q[n]<r},Q=e=>{if(!v.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");g(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),C(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw C(!1),alert("Upload failed. Try again."),e}finally{C(!1)}})(n);g(r=>({...r,[e]:{url:t,name:n.name}}))}catch{g(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),v.current.set(e,t)}return v.current.get(e)},Y=I&&i===N,G=(Y?null:z[i-1])?W(i-1):0,Z=z.map((e,t)=>{const n=d.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]);return{tier:e,items:n,count:q[t]}});return t.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},B.headerImage&&!B.headerImage.includes("Liquid error")&&t.createElement("img",{className:"yt-collection-bundle-header-img",src:B.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),B.showTierSteps&&t.createElement("div",{style:{paddingTop:B.headerImage&&!B.headerImage.includes("Liquid error")?"20px":"0"}},t.createElement(Zx,{totalSteps:N,isFormStep:Y,currentStep:i,getStepTitle:e=>I&&e===N?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:x,formTitle:e?.config?.form?.title,hasForm:I,onStepClick:e=>{if(e>1&&!d.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:N},(e,t)=>t+1).map(n=>{const r=I&&n===N,o=r?[]:O(n),a=P?o.filter(e=>e.available):o,l=n-1,c=a.slice(0,y[n]||0);return t.createElement("div",{key:n,className:"yt-collection-bundle-step-content "+(i===n?"yt-collection-bundle-step-content-active":""),style:{display:i===n?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},r&&e.config.form?t.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${S}px`}},e?.config?.form?.sections?.map((e,n)=>t.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},t.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},e?.title),"text"===e.type&&t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n;return t.createElement("textarea",{key:r,className:"yt-collection-bundle-textarea",placeholder:e?.title,rows:3,maxLength:500,onChange:e=>g(t=>({...t,[r]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===e.type&&t.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},t.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n,o=f[r];return t.createElement(Yx,{key:r,title:e?.title,uploadState:o,onUpload:()=>Q(r).click(),onRemove:()=>g(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>Q(r).click()})})))))):t.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:x?"grid":"flex",gridTemplateColumns:x?"repeat(2,1fr)":"",flexWrap:x?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${S}px`}},c.map(e=>t.createElement(Xx,{key:e.id,product:e,tierIdx:l,customizations:B,isMobile:x,hoveredCard:u,setHoveredCard:m,selectedProducts:d,handleAddToBundle:V,canAddProduct:H,allowMultipleQty:_,handleVariantChange:j,canIncrement:U,setSelectedProducts:p})),i===n&&(y[n]||0)<a.length&&t.createElement("div",{ref:e=>{const t=E.current.get(n);t&&k.current?.unobserve(t),e?(E.current.set(n,e),k.current?.observe(e)):E.current.delete(n)},"data-sentinel-step":n.toString(),style:{height:"20px",width:"100%",display:"block"}})))}),t.createElement(Kx,{config:e,selectedProducts:d,selectedByTier:Z,totalItems:M,totalPrice:R,totalCompareAtPrice:L,currentStep:i,totalSteps:N,currentTierMax:G,tierSelectedCounts:q,isMobile:x,bundleAddToCartLoading:n,isUploading:w,hoveredCard:u,setHoveredCard:m,hideSelectedProducts:D,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return I?N:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{p(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},handleCheckout:async()=>{if(i!==N||!d.length)return;const e={};I&&Object.entries(f).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)});const t=d.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));r(t)},hasForm:I,onHeightChange:A}))},Zx=({totalSteps:e,isFormStep:n,currentStep:r,getStepTitle:o,isMobile:a,formTitle:i,hasForm:l,onStepClick:c})=>t.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"}},t.createElement("div",{className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:"center",gap:a?"0":"2rem",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:e},(e,t)=>t+1).map(n=>t.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:"120px",cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>c(n)},t.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"}},l&&n===e?t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.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"})):t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),t.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},o(n))))),i&&l&&n&&t.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},i)),Xx=({product:e,tierIdx:n,customizations:r,isMobile:o,hoveredCard:a,setHoveredCard:i,selectedProducts:l,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:f})=>{const[g,x]=c(!1),h=document.querySelector(`[data-product-id="${e.id}"]`),y=h?.dataset.selectedVariant||e.variants[0].id.toString(),b=e.variants.find(e=>e.id.toString()===y)||e.variants[0],v=l.some(t=>t.productId===e.id.toString()&&t.variantId===y&&t.tierIndex===n),w=a===e.id,C=l.filter(t=>t.productId===e.id.toString()&&t.variantId===b.id.toString()&&t.tierIndex===n).reduce((e,t)=>e+t.quantity,0);return t.createElement(t.Fragment,null,t.createElement("div",{key:e.id,className:"yt-collection-bundle-product-item","data-product-id":e.id,"data-selected-variant":b.id,"data-current-price":b.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:o?0:"250px",maxWidth:o?"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:o?"100%":""}},t.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:()=>x(!0),onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null)},t.createElement("img",{src:nh(e.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:e.title}),t.createElement("img",{src:nh(e.images[1]||e.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:e.title}),e.variants.length>1&&t.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:t=>u(e,t.target.value),defaultValue:b.id,onClick:e=>{e.stopPropagation()}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},t.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:o?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:1}},e.title),t.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},t.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:o?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(b.price/100).toFixed(0)),b.compare_at_price&&b.compare_at_price>b.price&&t.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(b.compare_at_price/100).toFixed(0)))),p&&C>0?t.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o&&o.quantity>1?t.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?t.filter(e=>e!==o):t})}},"-"),t.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},C),t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{b.available&&m(e,b.id.toString(),n)&&f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o?t.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...t,{productId:e.id.toString(),variantId:b.id.toString(),price:b.price,quantity:1,tierIndex:n}]})},disabled:!b.available||!m(e,b.id.toString(),n)},"+")):t.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(e,n)&&b.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:o?"6px":"12px",fontSize:o?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:b.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{b.available&&d(e,n)&&s(e,n)},disabled:!b.available||!d(e,n)},v?"Added":b.available?"ADD TO BOX":"Out of Stock")),g&&t.createElement(Qx,{product:e,tierIdx:n,isOpen:g,onClose:()=>x(!1),onAddToBundle:(e,t)=>{s(e,t),x(!1)},canAdd:d(e,n),isSelected:v,customizations:r,isMobile:o}))},Kx=e=>{const{config:n,selectedProducts:r,selectedByTier:a,totalItems:i,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:f,isMobile:g,bundleAddToCartLoading:x,isUploading:h,hoveredCard:y,setHoveredCard:b,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:k,hasForm:E,onHeightChange:S}=e,{customizations:T}=n,[$,B]=c(!1),z=o(null),I=a.filter(({count:e})=>e>0).map(({tier:e,count:t})=>((e,t)=>{const n=e.discountData;if(!n||!n.tiers?.length)return null;const r=[...n.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),o=r.filter(e=>t>=e.minimumQuantity),a=[];if(o.length>0){const e=o.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t).discountValue,{type:t}=n;let r;switch(t){case"percentage_discount_coupon":r=`${e}% OFF`;break;case"amount_discount_coupon":r=`₹${e} OFF`;break;case"fixed_price_collection":r=`Fixed ₹${e}`;break;case"dummy_coupon":r="Discount Applied";break;default:r=null}r&&a.push(r)}const i=r.find(e=>e.minimumQuantity>t);if(i){const e=i.minimumQuantity-t,r=i.discountValue,{type:o}=n;let l;switch(o){case"percentage_discount_coupon":l=`${r}% OFF`;break;case"amount_discount_coupon":l=`₹${r} OFF`;break;case"fixed_price_collection":l=`Fixed ₹${r}`;break;case"dummy_coupon":l="Discount";break;default:l=null}l&&a.push(`Add ${e} more item${1!==e?"s":""} to get ${l}`)}return a.length>0?a.join(" + "):null})(e,t)).filter(Boolean);return l(()=>{const e=m!==1/0&&f[p-1]===m-2&&m>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,f,p]),l(()=>{if(z.current&&S){const e=z.current.offsetHeight;S(e)}},[g,S,r]),t.createElement("div",{ref:z,className:"yt-collection-bundle-bar",style:{background:T?.bundleBg||"#fff",color:T?.bundleText||"#333",border:T?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"compact"==T.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:T?.borderRadius||"8px",overflow:"hidden"}},I.length>0&&t.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},I.join(" + ")),t.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&t.createElement(t.Fragment,null,t.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 "),t.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:T?.atcBg||"#007bff",color:T?.atcText||"#fff",padding:"4px 8px",borderRadius:T?.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"," ",t.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),r.length>0&&t.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:T?.borderRadius||"8px"}},t.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"}},a.filter(({count:e})=>e>0).map(({items:e},r,o)=>t.createElement(t.Fragment,{key:r},t.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},t.createElement("div",{style:{display:"flex",gap:"4px"}},e.map((e,o)=>{const a=n.config.builderTiers.collectionTier.flatMap(e=>e.products).find(t=>t.id.toString()===e.productId);if(!a)return null;const i=v(e.productId),l=p===i;return t.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},t.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${T?.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(i)},t.createElement("img",{src:nh(a.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${T?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),e.quantity>1&&t.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",e.quantity),t.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:t=>{t.stopPropagation(),C(e.productId,e.variantId,r)}},"×")))}))),r<o.length-1&&o[r+1].count>0&&t.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},t.createElement(ut,null)))))),g?t.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:i>0&&(E||n?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:i>0?"10px":"0",background:"#dbdbdb",borderRadius:T?.borderRadius||"8px",overflow:"hidden"}},t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",...0!==i&&{paddingInline:"6px"},alignItems:"center",borderRadius:T?.borderRadius||"8px"}},t.createElement(t.Fragment,null,0===i&&t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===i&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:T?.borderRadius||"8px"}}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px",width:"100%",justifyContent:"center"}},t.createElement("div",{style:{fontSize:"14px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"14px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"14px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`)))),t.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.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:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||h?"yt-collection-bundle-next-btn-disabled":""),style:{background:T?.btnPrimaryBg||"#28a745",color:T?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===i||h?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||x||h},x?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ux,null)):p===u?"Checkout":"Next"))):t.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:T?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.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===y&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===i&&{padding:"12px 24px"}}},0===i&&t.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"16px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"15px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"16px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`))),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||h?"yt-collection-bundle-next-btn-disabled":""),style:{background:T?.btnPrimaryBg||"#28a745",color:T?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===i||h?.6:1,...-2===y&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||x||h,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},x?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ux,null)):p===u?"Checkout":"Next")))},Jx=window?.Shopify?.currency||{rate:1,active:"INR"},eh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Jx.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},th=(e,t)=>t==Jx.active?e:Bn(Jx.active)||Jx.active,nh=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},rh=(e,t,n,r,o,a)=>{const i=r.findIndex(t=>t.variantId===e);o(0===n?e=>e.filter((e,t)=>t!==i):-1===i?r=>[...r,{product:t,variantId:e,quantity:n,isFree:a}]:e=>e.map((e,t)=>t===i?{...e,quantity:e.quantity+n,isFree:a}:e))},oh=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(bf,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(wf,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(Ng,{bundle:e,addToCartFunction:r}):"collection"===e.type?t.createElement(Gx,{config:e,addCustomBundleToCart:o,bundleAddToCartLoading:l}):t.createElement(Kf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(qx,{addToCartFunction:r,bundle:e});q(".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 ah=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},""))))),ih=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.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:o},t.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()},t.createElement("img",{src:"https://feature-products-offers.shopify-product-blocks.pages.dev/assets/confetti.jpg",alt:"confetti",style:{width:"100%",height:"clamp(150px, 20vh, 230px)",objectFit:"cover",objectPosition:"top",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",marginBottom:"10px",flexShrink:0}}),t.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"clamp(-150px, -20vh, -200px)",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},n.name),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),t.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"}}),t.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},t.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),t.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e)))),t.createElement("button",{onClick:o,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 w(i,document.body)},lh=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.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:o},t.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 "),t.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()},t.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),t.createElement("div",{style:{overflowY:"auto",flex:1}},t.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},t.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},n.name),t.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage)),t.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},t.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),t.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},t.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e))))),t.createElement("button",{onClick:o,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 w(i,document.body)},ch=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:a,setShowPopup:i})=>{const s=o(null),[d,p]=c(!1),[u,m]=c(!0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=768),x=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};l(()=>{x();const e=s.current;if(e)return e.addEventListener("scroll",x),()=>e.removeEventListener("scroll",x)},[e]),l(()=>{const e=()=>{g(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=e=>{if(s.current){const t=f?280:365,n=16,r="right"===e?t+n:-(t+n);s.current.scrollBy({left:r,behavior:"smooth"})}};return t.createElement("div",{style:{position:"relative"}},t.createElement("svg",{style:{position:"absolute",width:0,height:0}},t.createElement("defs",null,t.createElement("mask",{id:"coupon-cut-mask-desktop"},t.createElement("rect",{width:"365",height:"138",fill:"white"}),t.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),t.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),t.createElement("mask",{id:"coupon-cut-mask-mobile"},t.createElement("rect",{width:"280",height:"120",fill:"white"}),t.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),t.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&t.createElement("button",{onClick:()=>h("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"}},t.createElement(M,{size:20})),u&&t.createElement("button",{onClick:()=>h("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"}},t.createElement(j,{size:20})),t.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:f?"110px":"128px"}},e?.map(e=>t.createElement("div",{key:e.discountId,style:{flexShrink:0,width:f?"280px":"365px",minWidth:f?"280px":"365px",minHeight:f?"110px":"128px",backgroundColor:"transparent",borderRadius:`${n?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},t.createElement("div",{style:{width:f?"60px":"80px",minHeight:f?"110px":"128px",backgroundColor:n?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:f?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${n?.roundness||0}px`,borderBottomLeftRadius:`${n?.roundness||0}px`}},t.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),n?.iconVisibility&&t.createElement("div",{style:{position:"absolute",left:f?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:f?"32px":"40px",height:f?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:f?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===e.couponType?t.createElement(W,null):t.createElement(wo,null)),t.createElement("div",{style:{flex:1,padding:f?"12px 12px":"15px 15px",paddingLeft:f?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${n?.roundness||0}px`,borderBottomRightRadius:`${n?.roundness||0}px`,overflow:"hidden",backgroundColor:n?.cardBackgroundColor||"#ffffff",minWidth:0}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:f?"4px":"6px",lineHeight:"normal"}},t.createElement("div",{style:{fontSize:f?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===e.couponType?"Free Gift":"Special Deal"),t.createElement("div",{style:{fontSize:f?"13px":"15px",fontWeight:"600",color:n?.textColor||"#2c3e50"}},e.name),t.createElement("div",{style:{fontSize:f?"11px":"12px",color:n?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:f?"28px":"32px"}},r(e))),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},t.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a(e),i(!0)},style:{fontSize:f?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},n?.viewDetailsTitle||"View Details")))))),t.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 "))},sh=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:o,setShowPopup:a})=>{const[i,s]=c("undefined"!=typeof window&&window.innerWidth<=768);return l(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement("div",{style:{borderRadius:`${n?.roundness||8}px`}},e?.map((l,c)=>t.createElement("div",{key:l.discountId,style:{display:"flex",alignItems:"flex-start",gap:i?"8px":"12px",padding:i?"12px 0":"16px 0",paddingLeft:i?"10px":"20px",backgroundColor:!0===n?.cardBackgroundTransparent||"true"===String(n?.cardBackgroundTransparent)?"transparent":n?.cardBackgroundColor||"#ffffff",borderBottom:c<(e?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${n?.roundness||0}px`}},n?.iconVisibility&&t.createElement("div",{style:{width:i?"40px":"50px",height:i?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:i?"20px":"25px",marginTop:i?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===l.couponType?t.createElement(W,null):t.createElement(wo,null)),t.createElement("div",{style:{flex:1}},t.createElement("div",{style:{fontSize:i?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},l.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",t.createElement("span",{style:{fontWeight:600,color:n?.textColor||"#34495e"}},l.name)),t.createElement("div",{style:{fontSize:i?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},r(l)),t.createElement("div",{style:{fontSize:i?"11px":"12px",color:"#000000"}},"offer auto applied",t.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),o(l),a(!0)},style:{color:n?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},n?.viewDetailsTitle||"T&C"))))))},dh=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 r=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?r.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&r.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&r.push("Combines with other order discounts"),t||r.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:r}},ph=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",uh=({offersConfig:e,offers:n})=>{const[r,a]=c(!1),[i,s]=c(null),[d,p]=c(null),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=768),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=450),x=o(null);l(()=>{const e=()=>{m(window.innerWidth<=768),g(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{x.current&&Ln(x.current)},[e?.sectionBgContrastColor]);const h=(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",r=-1;Object.keys(t).forEach(e=>{t[e]>r&&(r=t[e],n=e)});const o=e.map((e,t)=>({o:e,idx:t})),a=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 o.sort((e,t)=>{const r=e.o.customCartProgressBarCriteria===n,o=t.o.customCartProgressBarCriteria===n;if(r&&o){const n=a(e.o),r=a(t.o);return n!==r?n-r:e.idx-t.idx}return r&&!o?-1:!r&&o?1:e.idx-t.idx}),o.map(e=>e.o)})(n||[]);return t.createElement("div",null,t.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===e?.sectionType?`${e?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:e?.sectionBackgroundColor||"#fff"}},t.createElement("div",{style:{border:"coupon"===e?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=e?.cardPadding?`${e.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===e?.sectionType?`${e?.roundness||8}px`:"0px"}},t.createElement("span",{ref:x,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"right"===e?.alignment?"auto":"50%",right:"right"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===e?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:e?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},e?.sectionTitle||"Available Deals and Offers"),(()=>{const n=e?.sectionType;return"list"===n?t.createElement(sh,{offersToShow:h,offersConfig:e||{},getOfferCardMessage:ph,setSelectedOffer:e=>{s(e),e&&p(dh(e))},setShowPopup:a}):"coupon"===n?t.createElement(ch,{offersToShow:h,offersConfig:e||{},getOfferCardMessage:ph,setSelectedOffer:e=>{s(e),e&&p(dh(e))},setShowPopup:a}):null})(),f?t.createElement(lh,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}):t.createElement(ih,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}))))};export{oh as Bundle,ah as BundleLoader,Eu as Cart,Xe as Nudge,uh as ProductOffers,ot as SpinnerWheel};
|
|
5084
|
+
`,jx=({productsWithIndices:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[f,g]=c({}),[x,h]=c({});l(()=>{const t={},n={};e?.forEach(({product:e,index:r})=>{let o,a=[];if(e.productId===p&&u){const t=e?.productDetails?.variants?.edges.find(e=>e?.node?.id?.includes(u))?.node;t&&m(e.productDetails,t.id)>0&&(a=t.title.split(" / "),o=t)}if(!a.length){const t=e.productDetails.variants.edges.find(t=>m(e.productDetails,t?.node?.id)>0)?.node||e?.productDetails?.variants?.edges?.[0]?.node;t?(a=t.title.split(" / "),o=t):a=e?.productDetails?.options?.map(e=>e.values[0]??"")}t[r]=a,o&&(n[r]={node:o},s(r,o.id))}),g(t),h(n)},[e,p,u,s,m]),l(()=>{if(!p||!u)return;const t=e?.find(({product:e})=>e?.productId===p);if(!t)return;const{product:n,index:r}=t,o=n?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(o&&m(n.productDetails,o.id)>0){const e=o.title.split(" / ");g(t=>({...t,[r]:e})),h(e=>({...e,[r]:{node:o}})),s(r,o.id)}},[u,p,e,s,m]);const y=(e,t,n,r)=>{const o=[...f[e]||[]];o[t]=n;const a=o.join(" / "),i=r.productDetails.variants.edges.find(e=>e.node.title===a)?.node;return!!i&&m(r.productDetails,i.id)>0},b=(t,n,r)=>{const{product:o}=e?.find(e=>e.index===t)||{product:{productDetails:{variants:{edges:[]}}}};if(!o?.productDetails)return;if(!y(t,r,n,o))return;const a={...f};a[t][r]=n,g(a);const i=o?.productDetails?.variants?.edges?.find(e=>e.node.title===a[t].join(" / "))?.node;i&&(s(t,i.id),h(e=>({...e,[t]:{node:i}})))};if(!n)return null;const w=t.createElement(Tx,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement($x,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(Bx,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(({product:n,index:r},o)=>t.createElement(t.Fragment,null,t.createElement(Ix,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(Nx,{className:"yt-fixedBundle-variant-modal_thumbnail",src:x[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(Dx,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(_x,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(Fx,{className:"yt-fixedBundle-variant-modal_selected-value"},f[r]?.join(" / "))),n.productDetails.options.map((e,o)=>{const i=a&&a?.options?.find(t=>t.name===e.name);return e.values.length<=1?t.createElement(t.Fragment,null):i&&"color"===i?.type?t.createElement(Ox,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Lx,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i.values.find(t=>t.name===e)?.value?t.createElement(Ax,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(t=>t.name===e)?.value||e,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},t.createElement("span",null)):t.createElement(Mx,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):i&&"image"===i?.type?t.createElement(Ox,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Lx,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const l=!y(r,o,e,n);return t.createElement(t.Fragment,null,i?.values.find(t=>t.name===e)?.value?t.createElement(Rx,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)},src:i.values.find(t=>t.name===e)?.value},t.createElement("span",null)):t.createElement(Mx,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:l,onClick:()=>{b(r,e,o)}},e))})):t.createElement(Ox,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Lx,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map((e,a)=>{const i=!y(r,o,e,n);return t.createElement(Mx,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:f[r]?.[o]==e,disabled:i,onClick:()=>{b(r,e,o)}},e)}))}))),o<e.length-1&&t.createElement(Px,{className:"yt-fixedBundle-variant-modal_divider"}))),t.createElement(zx,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:d},"Add bundle to cart")));return v.createPortal(w,document.body)},Vx=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=e=>"color"===a?t.createElement(hx,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(yx,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(dx,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(px,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(ux,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(mx,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(fx,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map(e=>t.createElement(gx,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(xx,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name)))))},Wx=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l(()=>{if(a&&e.variants.edges.some(e=>e.node.id.includes(a))){const t=e.variants.edges.find(e=>e.node.id.includes(a))?.node;if(t){const e=t.title.split(" / ");p(e)}}},[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map(e=>({name:e,value:e}));const r=n.options.find(t=>t.name===e.name);return e.values.map(e=>{const t=r?.values?.find(t=>t.name===e);return{name:e,value:t?.value||e}})},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find(e=>e.name===n)||null};return t.createElement(bx,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map((n,r)=>t.createElement(vx,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(Vx,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find(n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t]))?.node.id;o(a||"")})(r,t)},type:u(n.name)}))))},Hx=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:s,onCheckChange:d,isMobile:p,isHorizontal:u,index:m,variantOptions:f,productsLength:g,handleOpenModal:x,storeCurrencyCode:h,primaryProductId:y,variantId:b})=>{const v=i(()=>t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[e]),[w,C]=c(e?.variants?.edges.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node),[k]=c(e?.options?.map(e=>e?.values?.[0])||[]),E=e?.id===y;l(()=>{if(b&&e.id===y){const t=e?.variants?.edges?.find(e=>e?.node?.id?.includes(b))?.node;t&&v(t.id)>0&&(C(t),s(t.id))}else{const t=e?.variants?.edges?.find(e=>v(e?.node?.id)>0)?.node||e?.variants?.edges?.[0]?.node;C(t)}},[e,y,n,b,s,v]);const S="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,T=w?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,u?t.createElement("div",{className:""+(e.id===y?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(Ex,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(Cx,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(kx,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,null))),t.createElement(Og,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Ag,{className:"yt-fixedBundle-product-card-horizontal_image",src:nh(T),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(Mg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(Rg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Lg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(jg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},th(a.general.currencySymbol,h)," ",eh(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Vg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},th(a.general.currencySymbol,h),eh(w?.compareAtPrice))),t.createElement(Wx,{product:e,variantOptions:f,selectedVariants:k,onVariantChange:t=>{const n=e?.variants?.edges?.find(e=>e.node.id===t)?.node;n&&v(t)>0&&s(t)},variantId:b,primaryProductId:y})))):t.createElement(t.Fragment,null,t.createElement(Xg,{className:""+(e.id===y?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:g,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...S&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(Sx,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:S},t.createElement(Cx,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${m}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:E}),t.createElement(kx,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}-${m}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(ct,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Kg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Jg,{className:"yt-fixedBundle-product-card_image--vertical",src:nh(T),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(ex,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(tx,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(nx,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(rx,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(ox,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(ax,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(lx,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(ix,{className:"yt-fixedBundle-product-card-vertical_price--new"},th(a.general.currencySymbol,h),eh(w?.price)),a.fixedBundle.compareAtPriceVisibility&&w?.compareAtPrice&&parseFloat(w.compareAtPrice)>parseFloat(w?.price)&&t.createElement(Vg,{className:"yt-fixedBundle-product-card-vertical_price--old"},th(a.general.currencySymbol,h),eh(w.compareAtPrice))))),(g<=3||!p)&&m<g-1&&t.createElement(cx,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(sx,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},qx=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[s,d]=c(window.innerWidth<786),[p,u]=c(null),[m,f]=c(!1),g="undefined"!=typeof window?window.location.href:null,x=e?.products?.find(e=>e.productDetails?.handle===g?.split("/").pop()?.split("?")[0]),h=x?.productId,y=i(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?1/0:0:1/0:0},[]),[b,v]=c(Object.fromEntries(e?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>y(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),w="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),C=e?.showIndividualProductSelector||!0,[k,E]=c(new Set(e.products.reduce((e,t,n)=>(w&&t?.productId!==h&&!C||e.push(n),e),[])));l(()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");u(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};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)}},[]),l(()=>{p&&h&&v(t=>{const n={...t};return e?.products?.forEach((e,t)=>{e.productId===h&&(n[t.toString()]=p)}),n})},[p,h,e?.products]),l(()=>{const e=()=>{d(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const S=a((e,t)=>{v(n=>({...n,[e.toString()]:t}))},[]),T=(t,n)=>{const r=e.products[n].productId;w&&C&&r===h||E(e=>{const r=new Set(e);return t?r.add(n):r.delete(n),r})},$=i(()=>(e,t)=>y(e.productDetails,t)>0,[y]),B=i(()=>e.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[e.products,k]),{originalPrice:z,dealPrice:I,offerValue:N}=i(()=>{const{price:t,compareAtPrice:n}=e.products.reduce((e,t,n)=>{if(!k.has(n))return e;const r=b[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e},{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);k.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}},[e.products,b,k,e.percentageOff,e.dealAmount,e.amountOff]),D=i(()=>e.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[e.products,k]),_=D.every(({product:e,index:t})=>$(e,b[t.toString()])),P=async e=>{if(_){e.preventDefault(),e.stopPropagation(),o(!0),f(!1);try{const e=Object.entries(b).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);n&&await n(Number(z),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)}};if(!n)return t.createElement(t.Fragment,null);const F=e.customizations,O=F.fixedBundle?.cardLayoutStyle||"auto",A="horizontal"===O||"auto"===O&&s,M="bundles"==e.appName?e.pageHeader?.title:e?.title,R="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(Dg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:F.fixedBundle.sectionBackgroundColor,..."transparent"!==F.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&t.createElement(_g,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:F.fixedBundle?.titleBackgroundColor||"none",color:F.fixedBundle?.titleTextColor||"black",textAlign:F.fixedBundle.infoAlignment??"center",fontSize:F.fixedBundle?.titleFontSize,..."transparent"!==F.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===F.fixedBundle.infoAlignment&&"transparent"!==F.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===F.fixedBundle.infoAlignment&&"transparent"!==F.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===F.fixedBundle.infoAlignment&&"transparent"===F.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),R&&t.createElement(Pg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:F.fixedBundle?.subtitleFontSize,textAlign:F.fixedBundle.infoAlignment??"center",..."left"===F.fixedBundle.infoAlignment&&"transparent"!==F.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===F.fixedBundle.infoAlignment&&"transparent"!==F.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===F.fixedBundle.infoAlignment&&"transparent"===F.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},R),A?t.createElement(Fg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map((n,r)=>t.createElement(t.Fragment,{key:`${n.productId}-${r}`},t.createElement(Hx,{isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:F,onVariantChange:e=>S(r,e),onCheckChange:e=>{T(e,r)},isMobile:s,index:r,isHorizontal:A,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:h,variantId:p||void 0})))):t.createElement(Gg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Zg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===F.fixedBundle.infoAlignment?"flex-start":"right"===F.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map((n,r)=>t.createElement(Hx,{key:`${n.productId}-${r}`,isChecked:k.has(r),product:n.productDetails,selectedVariantId:b[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:F,onVariantChange:e=>S(r,e),onCheckChange:e=>T(e,r),isMobile:s,index:r,isHorizontal:A,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:h,variantId:p||void 0})),B&&t.createElement(jx,{productsWithIndices:D,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:F.general.ctaTextColor,backgroundColor:F.general.ctaBackgroundColor},onVariantChange:S,handleAddToCart:P,primaryProductId:h,variantId:p||void 0}))),t.createElement(Wg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===F.fixedBundle.infoAlignment?"flex-start":"right"===F.fixedBundle.infoAlignment?"flex-end":"center"}},Number(z)>0&&Number(N)>0&&F.fixedBundle.compareAtPriceVisibility&&t.createElement(Hg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Ug,{className:"yt-fixedBundle-summary_price"},th(F.general.currencySymbol,e?.storeCurrencyCode),eh(z))),0!==k.size&&t.createElement(qg,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Ug,{className:"yt-fixedBundle-summary_price"},th(F.general.currencySymbol,e?.storeCurrencyCode),eh(I))," ",Number(N)>0&&t.createElement(Qg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",th(F.general.currencySymbol,e?.storeCurrencyCode),eh(N)))),t.createElement(Yg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),A||!B?P(e):f(!0)},disabled:k.size<1||r||!_,style:{backgroundColor:F.general?.ctaBackgroundColor||"#121212",color:F.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${F.general?.ctaBackgroundColor||"#121212"}`,boxShadow:F.general.ctaShadowType,paddingTop:F.general?.ctaPadding,paddingBottom:F.general?.ctaPadding,borderRadius:F.general.ctaBorderRadius,width:F.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{F.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=F.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=F.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{F.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=F.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=F.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(da,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?t.createElement(t.Fragment,null,F.fixedBundle?.ctaTitle??"Add Bundle to cart"):t.createElement(t.Fragment,null,"Out of Stock")))},Ux=()=>t.createElement(t.Fragment,null,t.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),t.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"}})),Qx=({product:e,tierIdx:n,isOpen:r,onClose:o,onAddToBundle:a,canAdd:i,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=c(0),[f,g]=c(e.variants[0].id.toString()),x=e.variants.find(e=>e.id.toString()===f)||e.variants[0],h=e.images.filter(Boolean);if(l(()=>(r&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[r]),l(()=>{if(x&&x?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image");e?.setAttribute("src",x?.featured_image?.src)}},[x]),!r)return null;const y=t.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:o},t.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()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,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"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px"}},h.length>0&&t.createElement("img",{className:"yt-collection-bundle-modal-image",src:nh(h[u]||e.images[0]),alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px"}}),h.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},h.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer",display:"block"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},e?.options?.join(" & "),":"," ",t.createElement("strong",null,x.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(x.price/100).toFixed(0),x.compare_at_price&&x.compare_at_price>x.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(x.compare_at_price/100).toFixed(0))),t.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!x.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:x.available?s||!i?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:i&&x.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":x.available?"Add to Box":"Out of Stock")),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),b=t.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:o},t.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()},t.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:o,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"}},t.createElement(ft,{size:22})),t.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},h.length>0&&t.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative"}},t.createElement("img",{className:"yt-collection-bundle-modal-image",src:x.featured_image?.src||h[u]||e.images[0],alt:e.title,style:{width:"100%",display:"block",maxHeight:"50vh",objectFit:"cover",objectPosition:"center"}}),h.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-image-dots",style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},h.map((e,n)=>t.createElement("div",{key:n,className:"yt-collection-bundle-modal-image-dot",onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer"}})))),t.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},t.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},t.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},"Variant: ",t.createElement("strong",null,x.title)),t.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(x.price/100).toFixed(0),x.compare_at_price&&x.compare_at_price>x.price&&t.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(x.compare_at_price/100).toFixed(0))),e.description&&t.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}}))),t.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)"}},t.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!i?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>a(e,n),disabled:!i||!x.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&i&&x.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:i&&x.available?"pointer":"not-allowed"}},s?"Added to Box":x.available?"Add to Box":"Out of Stock"))));return v.createPortal(p?b:y,document.body)},Yx=({title:e,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return t.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},t.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},e),i&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},t.createElement(Ux,null)," Uploading ",n?.name,"...")),l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:a,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!i&&!l&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},t.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),t.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:o,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),t.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:r,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},Gx=({config:e,bundleAddToCartLoading:n,addCustomBundleToCart:r})=>{const[i,s]=c(1),[d,p]=c([]),[u,m]=c(null),[f,g]=c({}),[x,h]=c(window.innerWidth<640),[y,b]=c({}),v=o(new Map),[w,C]=c(!1),k=o(null),E=o(new Map),[S,T]=c(160),$=x?8:20,{customizations:B}=e,z=e.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),I=!!e.config.form,N=z.length+(I?1:0),D=B.hideSelectedProducts,_=B.allowMultipleQty,P=B.hideOutOfStockProducts,F=e=>z[e-1]?.products||[],O=a(e=>{const t=F(e),n=P?t.filter(e=>e.available).length:t.length;b(t=>{const r=t[e]||0,o=Math.min(r+8,n);return o<=r?t:{...t,[e]:o}})},[8,P]);l(()=>(k.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===i&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[O,i]),l(()=>{if(I&&i===N)return;const e=i,t=F(e);if(0===t.length)return;const n=P?t.filter(e=>e.available).length:t.length;if(0===(y[e]||0)){const t=Math.min($,n);b(n=>({...n,[e]:t}))}},[i,$,P,y]),l(()=>{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 A=a(e=>{T(e+10)},[]),M=d.reduce((e,t)=>e+t.quantity,0),R=d.reduce((e,t)=>e+t.price*t.quantity,0)/100,L=d.reduce((e,t)=>{const n=z.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/100,j=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},V=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const r=n.dataset.selectedVariant||e.variants[0].id.toString(),o=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());p(n=>{const a=`${e.id}-${r}-${t}`,i=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===a);if(i)return n.filter(e=>e!==i);const l=q[t],c=W(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]})},W=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},H=(e,t)=>{const n=W(t);if(n===1/0)return!0;const r=q[t],o=d.some(n=>n.productId===e.id.toString()&&n.tierIndex===t);return!!o||r<n},q=z.map((e,t)=>d.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),U=(e,t,n)=>{const r=W(n);if(r===1/0)return!0;return q[n]<r},Q=e=>{if(!v.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");g(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),C(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw C(!1),alert("Upload failed. Try again."),e}finally{C(!1)}})(n);g(r=>({...r,[e]:{url:t,name:n.name}}))}catch{g(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),v.current.set(e,t)}return v.current.get(e)},Y=I&&i===N,G=(Y?null:z[i-1])?W(i-1):0,Z=z.map((e,t)=>{const n=d.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]);return{tier:e,items:n,count:q[t]}});return t.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},B.headerImage&&!B.headerImage.includes("Liquid error")&&t.createElement("img",{className:"yt-collection-bundle-header-img",src:B.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),B.showTierSteps&&t.createElement("div",{style:{paddingTop:B.headerImage&&!B.headerImage.includes("Liquid error")?"20px":"0"}},t.createElement(Zx,{totalSteps:N,isFormStep:Y,currentStep:i,getStepTitle:e=>I&&e===N?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:x,formTitle:e?.config?.form?.title,hasForm:I,onStepClick:e=>{if(e>1&&!d.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:N},(e,t)=>t+1).map(n=>{const r=I&&n===N,o=r?[]:F(n),a=P?o.filter(e=>e.available):o,l=n-1,c=a.slice(0,y[n]||0);return t.createElement("div",{key:n,className:"yt-collection-bundle-step-content "+(i===n?"yt-collection-bundle-step-content-active":""),style:{display:i===n?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},r&&e.config.form?t.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${S}px`}},e?.config?.form?.sections?.map((e,n)=>t.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},t.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},e?.title),"text"===e.type&&t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n;return t.createElement("textarea",{key:r,className:"yt-collection-bundle-textarea",placeholder:e?.title,rows:3,maxLength:500,onChange:e=>g(t=>({...t,[r]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===e.type&&t.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},t.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),t.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},e.fields.map((e,n)=>{const r=e?.title??"Field "+n,o=f[r];return t.createElement(Yx,{key:r,title:e?.title,uploadState:o,onUpload:()=>Q(r).click(),onRemove:()=>g(e=>{const{[r]:t,...n}=e;return n}),onRetry:()=>Q(r).click()})})))))):t.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:x?"grid":"flex",gridTemplateColumns:x?"repeat(2,1fr)":"",flexWrap:x?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${S}px`}},c.map(e=>t.createElement(Xx,{key:e.id,product:e,tierIdx:l,customizations:B,isMobile:x,hoveredCard:u,setHoveredCard:m,selectedProducts:d,handleAddToBundle:V,canAddProduct:H,allowMultipleQty:_,handleVariantChange:j,canIncrement:U,setSelectedProducts:p})),i===n&&(y[n]||0)<a.length&&t.createElement("div",{ref:e=>{const t=E.current.get(n);t&&k.current?.unobserve(t),e?(E.current.set(n,e),k.current?.observe(e)):E.current.delete(n)},"data-sentinel-step":n.toString(),style:{height:"20px",width:"100%",display:"block"}})))}),t.createElement(Kx,{config:e,selectedProducts:d,selectedByTier:Z,totalItems:M,totalPrice:R,totalCompareAtPrice:L,currentStep:i,totalSteps:N,currentTierMax:G,tierSelectedCounts:q,isMobile:x,bundleAddToCartLoading:n,isUploading:w,hoveredCard:u,setHoveredCard:m,hideSelectedProducts:D,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return I?N:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{p(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},handleCheckout:async()=>{if(i!==N||!d.length)return;const e={};I&&Object.entries(f).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)});const t=d.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));r(t)},hasForm:I,onHeightChange:A}))},Zx=({totalSteps:e,isFormStep:n,currentStep:r,getStepTitle:o,isMobile:a,formTitle:i,hasForm:l,onStepClick:c})=>t.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"}},t.createElement("div",{className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:"center",gap:a?"0":"2rem",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:e},(e,t)=>t+1).map(n=>t.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:"120px",cursor:"pointer",opacity:r===n?1:.5,transition:"opacity 0.2s"},onClick:()=>c(n)},t.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"}},l&&n===e?t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.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"})):t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===n?"#fff":"#999"}},t.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),t.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},o(n))))),i&&l&&n&&t.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000",lineHeight:"normal"}},i)),Xx=({product:e,tierIdx:n,customizations:r,isMobile:o,hoveredCard:a,setHoveredCard:i,selectedProducts:l,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:f})=>{const[g,x]=c(!1),h=document.querySelector(`[data-product-id="${e.id}"]`),y=h?.dataset.selectedVariant||e.variants[0].id.toString(),b=e.variants.find(e=>e.id.toString()===y)||e.variants[0],v=l.some(t=>t.productId===e.id.toString()&&t.variantId===y&&t.tierIndex===n),w=a===e.id,C=l.filter(t=>t.productId===e.id.toString()&&t.variantId===b.id.toString()&&t.tierIndex===n).reduce((e,t)=>e+t.quantity,0);return t.createElement(t.Fragment,null,t.createElement("div",{key:e.id,className:"yt-collection-bundle-product-item","data-product-id":e.id,"data-selected-variant":b.id,"data-current-price":b.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:o?0:"250px",maxWidth:o?"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:o?"100%":""}},t.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:()=>x(!0),onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null)},t.createElement("img",{src:nh(e.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:e.title}),t.createElement("img",{src:nh(e.images[1]||e.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:e.title}),e.variants.length>1&&t.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:t=>u(e,t.target.value),defaultValue:b.id,onClick:e=>{e.stopPropagation()}},e.variants.map(e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)")))),t.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},t.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:o?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:"normal",color:"#333",flexGrow:1}},e.title),t.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},t.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:o?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(b.price/100).toFixed(0)),b.compare_at_price&&b.compare_at_price>b.price&&t.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(b.compare_at_price/100).toFixed(0)))),p&&C>0?t.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o&&o.quantity>1?t.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?t.filter(e=>e!==o):t})}},"-"),t.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},C),t.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{b.available&&m(e,b.id.toString(),n)&&f(t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r);return o?t.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...t,{productId:e.id.toString(),variantId:b.id.toString(),price:b.price,quantity:1,tierIndex:n}]})},disabled:!b.available||!m(e,b.id.toString(),n)},"+")):t.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(e,n)&&b.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:o?"6px":"12px",fontSize:o?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:b.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{b.available&&d(e,n)&&s(e,n)},disabled:!b.available||!d(e,n)},v?"Added":b.available?"ADD TO BOX":"Out of Stock")),g&&t.createElement(Qx,{product:e,tierIdx:n,isOpen:g,onClose:()=>x(!1),onAddToBundle:(e,t)=>{s(e,t),x(!1)},canAdd:d(e,n),isSelected:v,customizations:r,isMobile:o}))},Kx=e=>{const{config:n,selectedProducts:r,selectedByTier:a,totalItems:i,totalPrice:s,totalCompareAtPrice:d,currentStep:p,totalSteps:u,currentTierMax:m,tierSelectedCounts:f,isMobile:g,bundleAddToCartLoading:x,isUploading:h,hoveredCard:y,setHoveredCard:b,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:k,hasForm:E,onHeightChange:S}=e,{customizations:T}=n,[$,B]=c(!1),z=o(null),I=a.filter(({count:e})=>e>0).map(({tier:e,count:t})=>((e,t)=>{const n=e.discountData;if(!n||!n.tiers?.length)return null;const r=[...n.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),o=r.filter(e=>t>=e.minimumQuantity),a=[];if(o.length>0){const e=o.reduce((e,t)=>e.minimumQuantity>t.minimumQuantity?e:t).discountValue,{type:t}=n;let r;switch(t){case"percentage_discount_coupon":r=`${e}% OFF`;break;case"amount_discount_coupon":r=`₹${e} OFF`;break;case"fixed_price_collection":r=`Fixed ₹${e}`;break;case"dummy_coupon":r="Discount Applied";break;default:r=null}r&&a.push(r)}const i=r.find(e=>e.minimumQuantity>t);if(i){const e=i.minimumQuantity-t,r=i.discountValue,{type:o}=n;let l;switch(o){case"percentage_discount_coupon":l=`${r}% OFF`;break;case"amount_discount_coupon":l=`₹${r} OFF`;break;case"fixed_price_collection":l=`Fixed ₹${r}`;break;case"dummy_coupon":l="Discount";break;default:l=null}l&&a.push(`Add ${e} more item${1!==e?"s":""} to get ${l}`)}return a.length>0?a.join(" + "):null})(e,t)).filter(Boolean);return l(()=>{const e=m!==1/0&&f[p-1]===m-2&&m>1;let t=null;return e?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,f,p]),l(()=>{if(z.current&&S){const e=z.current.offsetHeight;S(e)}},[g,S,r]),t.createElement("div",{ref:z,className:"yt-collection-bundle-bar",style:{background:T?.bundleBg||"#fff",color:T?.bundleText||"#333",border:T?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"compact"==T.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:T?.borderRadius||"8px",overflow:"hidden"}},I.length>0&&t.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},I.join(" + ")),t.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&t.createElement(t.Fragment,null,t.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 "),t.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:T?.atcBg||"#007bff",color:T?.atcText||"#fff",padding:"4px 8px",borderRadius:T?.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"," ",t.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),r.length>0&&t.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:T?.borderRadius||"8px"}},t.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"}},a.filter(({count:e})=>e>0).map(({items:e},r,o)=>t.createElement(t.Fragment,{key:r},t.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},t.createElement("div",{style:{display:"flex",gap:"4px"}},e.map((e,o)=>{const a=n.config.builderTiers.collectionTier.flatMap(e=>e.products).find(t=>t.id.toString()===e.productId);if(!a)return null;const i=v(e.productId),l=p===i;return t.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},t.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${T?.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(i)},t.createElement("img",{src:nh(a.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${T?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),e.quantity>1&&t.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",e.quantity),t.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:t=>{t.stopPropagation(),C(e.productId,e.variantId,r)}},"×")))}))),r<o.length-1&&o[r+1].count>0&&t.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},t.createElement(ut,null)))))),g?t.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:i>0&&(E||n?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:i>0?"10px":"0",background:"#dbdbdb",borderRadius:T?.borderRadius||"8px",overflow:"hidden"}},t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",...0!==i&&{paddingInline:"6px"},alignItems:"center",borderRadius:T?.borderRadius||"8px"}},t.createElement(t.Fragment,null,0===i&&t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===i&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:T?.borderRadius||"8px"}}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px",width:"100%",justifyContent:"center"}},t.createElement("div",{style:{fontSize:"14px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"14px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"14px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`)))),t.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.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:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||h?"yt-collection-bundle-next-btn-disabled":""),style:{background:T?.btnPrimaryBg||"#28a745",color:T?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===i||h?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||x||h},x?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ux,null)):p===u?"Checkout":"Next"))):t.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:T?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(n?.config?.builderTiers?.collectionTier?.length>1||E)&&i>0&&t.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===y&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===i&&{padding:"12px 24px"}}},0===i&&t.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),i>0&&t.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"16px",color:"#000000",fontWeight:600,lineHeight:"normal"}},"₹",s.toLocaleString()),d>s&&t.createElement("div",{style:{fontSize:"15px",color:"#787878",fontWeight:500,textDecoration:"line-through",lineHeight:"normal"}},"₹",d.toLocaleString()),i>0&&t.createElement("span",{style:{fontSize:"16px",color:"#000000",fontWeight:500,lineHeight:"normal"}},`(${i} Added)`))),i>0&&t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||h?"yt-collection-bundle-next-btn-disabled":""),style:{background:T?.btnPrimaryBg||"#28a745",color:T?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===i||h?.6:1,...-2===y&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?k:()=>w(p+1),disabled:p===u&&0===i||x||h,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},x?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ux,null)):p===u?"Checkout":"Next")))},Jx=window?.Shopify?.currency||{rate:1,active:"INR"},eh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Jx.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},th=(e,t)=>t==Jx.active?e:Bn(Jx.active)||Jx.active,nh=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},rh=(e,t,n,r,o,a)=>{const i=r.findIndex(t=>t.variantId===e);o(0===n?e=>e.filter((e,t)=>t!==i):-1===i?r=>[...r,{product:t,variantId:e,quantity:n,isFree:a}]:e=>e.map((e,t)=>t===i?{...e,quantity:e.quantity+n,isFree:a}:e))},oh=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(bf,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(wf,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(Ng,{bundle:e,addToCartFunction:r}):"collection"===e.type?t.createElement(Gx,{config:e,addCustomBundleToCart:o,bundleAddToCartLoading:l}):t.createElement(Kf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(qx,{addToCartFunction:r,bundle:e});q(".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 ah=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},""))))),ih=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.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:o},t.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()},t.createElement("img",{src:"https://feature-products-offers.shopify-product-blocks.pages.dev/assets/confetti.jpg",alt:"confetti",style:{width:"100%",height:"clamp(150px, 20vh, 230px)",objectFit:"cover",objectPosition:"top",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",marginBottom:"10px",flexShrink:0}}),t.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"clamp(-150px, -20vh, -200px)",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},n.name),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),t.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"}}),t.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},t.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),t.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e)))),t.createElement("button",{onClick:o,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 w(i,document.body)},lh=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.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:o},t.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 "),t.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()},t.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),t.createElement("div",{style:{overflowY:"auto",flex:1}},t.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},t.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),t.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},n.name),t.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage)),t.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},t.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),t.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},t.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e))))),t.createElement("button",{onClick:o,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 w(i,document.body)},ch=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:a,setShowPopup:i})=>{const s=o(null),[d,p]=c(!1),[u,m]=c(!0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=768),x=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};l(()=>{x();const e=s.current;if(e)return e.addEventListener("scroll",x),()=>e.removeEventListener("scroll",x)},[e]),l(()=>{const e=()=>{g(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=e=>{if(s.current){const t=f?280:365,n=16,r="right"===e?t+n:-(t+n);s.current.scrollBy({left:r,behavior:"smooth"})}};return t.createElement("div",{style:{position:"relative"}},t.createElement("svg",{style:{position:"absolute",width:0,height:0}},t.createElement("defs",null,t.createElement("mask",{id:"coupon-cut-mask-desktop"},t.createElement("rect",{width:"365",height:"138",fill:"white"}),t.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),t.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),t.createElement("mask",{id:"coupon-cut-mask-mobile"},t.createElement("rect",{width:"280",height:"120",fill:"white"}),t.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),t.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&t.createElement("button",{onClick:()=>h("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"}},t.createElement(M,{size:20})),u&&t.createElement("button",{onClick:()=>h("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"}},t.createElement(j,{size:20})),t.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:f?"110px":"128px"}},e?.map(e=>t.createElement("div",{key:e.discountId,style:{flexShrink:0,width:f?"280px":"365px",minWidth:f?"280px":"365px",minHeight:f?"110px":"128px",backgroundColor:"transparent",borderRadius:`${n?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},t.createElement("div",{style:{width:f?"60px":"80px",minHeight:f?"110px":"128px",backgroundColor:n?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:f?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${n?.roundness||0}px`,borderBottomLeftRadius:`${n?.roundness||0}px`}},t.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),n?.iconVisibility&&t.createElement("div",{style:{position:"absolute",left:f?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:f?"32px":"40px",height:f?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:f?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===e.couponType?t.createElement(W,null):t.createElement(wo,null)),t.createElement("div",{style:{flex:1,padding:f?"12px 12px":"15px 15px",paddingLeft:f?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${n?.roundness||0}px`,borderBottomRightRadius:`${n?.roundness||0}px`,overflow:"hidden",backgroundColor:n?.cardBackgroundColor||"#ffffff",minWidth:0}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:f?"4px":"6px",lineHeight:"normal"}},t.createElement("div",{style:{fontSize:f?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===e.couponType?"Free Gift":"Special Deal"),t.createElement("div",{style:{fontSize:f?"13px":"15px",fontWeight:"600",color:n?.textColor||"#2c3e50"}},e.name),t.createElement("div",{style:{fontSize:f?"11px":"12px",color:n?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:f?"28px":"32px"}},r(e))),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},t.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a(e),i(!0)},style:{fontSize:f?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},n?.viewDetailsTitle||"View Details")))))),t.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 "))},sh=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:o,setShowPopup:a})=>{const[i,s]=c("undefined"!=typeof window&&window.innerWidth<=768);return l(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement("div",{style:{borderRadius:`${n?.roundness||8}px`}},e?.map((l,c)=>t.createElement("div",{key:l.discountId,style:{display:"flex",alignItems:"flex-start",gap:i?"8px":"12px",padding:i?"12px 0":"16px 0",paddingLeft:i?"10px":"20px",backgroundColor:!0===n?.cardBackgroundTransparent||"true"===String(n?.cardBackgroundTransparent)?"transparent":n?.cardBackgroundColor||"#ffffff",borderBottom:c<(e?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${n?.roundness||0}px`}},n?.iconVisibility&&t.createElement("div",{style:{width:i?"40px":"50px",height:i?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:i?"20px":"25px",marginTop:i?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===l.couponType?t.createElement(W,null):t.createElement(wo,null)),t.createElement("div",{style:{flex:1}},t.createElement("div",{style:{fontSize:i?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},l.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",t.createElement("span",{style:{fontWeight:600,color:n?.textColor||"#34495e"}},l.name)),t.createElement("div",{style:{fontSize:i?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},r(l)),t.createElement("div",{style:{fontSize:i?"11px":"12px",color:"#000000"}},"offer auto applied",t.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),o(l),a(!0)},style:{color:n?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},n?.viewDetailsTitle||"T&C"))))))},dh=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 r=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?r.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&r.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&r.push("Combines with other order discounts"),t||r.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:r}},ph=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",uh=({offersConfig:e,offers:n})=>{const[r,a]=c(!1),[i,s]=c(null),[d,p]=c(null),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=768),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=450),x=o(null);l(()=>{const e=()=>{m(window.innerWidth<=768),g(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l(()=>{x.current&&Ln(x.current)},[e?.sectionBgContrastColor]);const h=(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",r=-1;Object.keys(t).forEach(e=>{t[e]>r&&(r=t[e],n=e)});const o=e.map((e,t)=>({o:e,idx:t})),a=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 o.sort((e,t)=>{const r=e.o.customCartProgressBarCriteria===n,o=t.o.customCartProgressBarCriteria===n;if(r&&o){const n=a(e.o),r=a(t.o);return n!==r?n-r:e.idx-t.idx}return r&&!o?-1:!r&&o?1:e.idx-t.idx}),o.map(e=>e.o)})(n||[]);return t.createElement("div",null,t.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===e?.sectionType?`${e?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:e?.sectionBackgroundColor||"#fff"}},t.createElement("div",{style:{border:"coupon"===e?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=e?.cardPadding?`${e.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===e?.sectionType?`${e?.roundness||8}px`:"0px"}},t.createElement("span",{ref:x,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"right"===e?.alignment?"auto":"50%",right:"right"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===e?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:e?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},e?.sectionTitle||"Available Deals and Offers"),(()=>{const n=e?.sectionType;return"list"===n?t.createElement(sh,{offersToShow:h,offersConfig:e||{},getOfferCardMessage:ph,setSelectedOffer:e=>{s(e),e&&p(dh(e))},setShowPopup:a}):"coupon"===n?t.createElement(ch,{offersToShow:h,offersConfig:e||{},getOfferCardMessage:ph,setSelectedOffer:e=>{s(e),e&&p(dh(e))},setShowPopup:a}):null})(),f?t.createElement(lh,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}):t.createElement(ih,{selectedOffer:i,selectedOfferTerms:d,showPopup:r,offersConfig:e,onClose:()=>{a(!1),s(null),p(null)}}))))};export{oh as Bundle,ah as BundleLoader,Eu as Cart,Xe as Nudge,uh as ProductOffers,ot as SpinnerWheel};
|