window.fgData={"offers":[],"settings":{"gift_format":"same_as_original_products","auto_add_gift":true,"sync_quantity":false,"cal_gift_discount":"current_price","using_draft_order":false,"select_one_gift_price":false,"manual_input_inventory":false,"compare_gift_price_with_product":false,"delete_gift_after_turn_off_offer":true,"not_show_gift_if_already_on_cart":false},"appearance":{"gift_slider":{"general":{"gift_popup_title":"SELECT YOUR FREE GIFT","add_to_cart_btn_title":"ADD TO CART","running_text":"","select_gift_btn":"Select variants","show_product_title":true,"show_variant_title":true,"show_pagination":true,"show_gift_for_customer":"by_variants","number_product_slider":4},"color":{"gift_slider_title_color":"#00358e","product_title_color":"#00358E","original_price_color":"#121212","discounted_price_color":"#121212","add_to_cart_color":"#FFFFFF","add_to_cart_btn_color":"#00358e"},"others":{"hidden_brand_mark":true},"disable_slider_checkbox":{"enable":false,"time":10,"text":"Don't show this offer again"}},"gift_icon":{"gift_icon_path":"images\/fg-icons\/fg-icon-red.png","shopify_gift_icon_path":"fg-icon-red.png","product_page":{"gift_icon":{"status":true,"size":"50"},"gift_thumbnail":{"status":true,"size":"100","title":"Free Gift"}},"collection_page":{"status":true,"size":"50"}},"promotion_message":{"show_on_cart_page":true,"text_color":"#ffffff","background_color":"#F72119"}}};/* END_FG_DATA */ const _0x350916=_0x45a5;function _0x45a5($,x){let t=_0x5d78();return(_0x45a5=function($,x){return t[$-=157]})($,x)}!function($,x){let t=_0x45a5,e=$();for(;;)try{let a=parseInt(t(264))/1+parseInt(t(503))/2*(parseInt(t(539))/3)+-parseInt(t(197))/4*(parseInt(t(308))/5)+parseInt(t(433))/6+-parseInt(t(324))/7*(parseInt(t(288))/8)+parseInt(t(368))/9+-parseInt(t(476))/10*(parseInt(t(501))/11);if(255193===a)break;e.push(e.shift())}catch(i){e.push(e.shift())}}(_0x5d78,255193);try{let $=document.getElementById(_0x350916(363))?.[_0x350916(173)](_0x350916(268));if($===_0x350916(159)){window[_0x350916(355)]?.[_0x350916(537)]?.[_0x350916(353)]?.[_0x350916(603)]&&fgGiftIcon&&(window.fgData[_0x350916(537)][_0x350916(353)][_0x350916(603)]=fgGiftIcon),window[_0x350916(361)]={},FGSECOMAPP[_0x350916(219)]=null,FGSECOMAPP[_0x350916(186)]=Object.values(Shopify?.cartItems??{}),FGSECOMAPP.offers=[],FGSECOMAPP[_0x350916(582)]=window[_0x350916(355)]?.[_0x350916(337)]??{},FGSECOMAPP.fgAppearance=window[_0x350916(355)]?.[_0x350916(537)]??{},FGSECOMAPP[_0x350916(625)]=FGSECOMAPP[_0x350916(274)]?.[_0x350916(635)]?.[_0x350916(166)],FGSECOMAPP.fgAppearanceGiftIcon=FGSECOMAPP[_0x350916(274)]?.gift_icon,FGSECOMAPP.fgAppearancePromotionMessage=FGSECOMAPP.fgAppearance?.[_0x350916(623)],FGSECOMAPP[_0x350916(199)]=[],FGSECOMAPP[_0x350916(611)]=!1,FGSECOMAPP[_0x350916(558)]=[],FGSECOMAPP.scaCountRenderEventCheckout=0,FGSECOMAPP.checkIsBlockCheckout=!1,FGSECOMAPP[_0x350916(221)]={...Shopify?.[_0x350916(221)]},FGSECOMAPP.reRenderCartCustom=Shopify?.[_0x350916(513)]??void 0,FGSECOMAPP[_0x350916(365)]=Shopify?.scaCustomLoadingCheckout??void 0,FGSECOMAPP[_0x350916(259)]={},FGSECOMAPP[_0x350916(436)]=!1,FGSECOMAPP.sections_cart={},FGSECOMAPP.isUpdateCart=!1,FGSECOMAPP[_0x350916(432)]={};let x=()=>{let $=_0x350916,x=FGSECOMAPP[$(274)]?.[$(635)],t=x?.[$(202)]?.[$(281)],e=!b(x)&&void 0!==t&&!t;return e?'\n
\n Powered by\n \n BOGOS: Free Gift & Buy X get Y\n \n \n
\n ':""},t=()=>{let $=_0x350916,x=FGSECOMAPP[$(274)]?.gift_slider,t=x?.[$(642)]??{};return document[$(502)]($(322))?.[$(212)]&&localStorage[$(492)]($(448),""+Date[$(395)]()),t?.[$(231)]?$(239)+t.text+$(621):""},{fetch:e}=window,a=()=>{let $=_0x350916;document.querySelector($(261))?.[$(173)]("data-template")!==$(388)&&(window[$(468)]=async(...x)=>{let t=$;try{if(x[0][t(385)](t(370))){i(x[1]);let a=200,r=await e(...x)[t(390)]($=>{let x=t;return(a=$[x(454)],$[x(334)])?$:$[x(493)]()})[t(291)]($=>{let x=t;console[x(217)]($)});if(x[1][t(552)]?.sca_add_gift&&200!==a){let o=JSON[t(409)](x[1][t(562)])?.id,c=document[t(502)]('.btn-add-to-cart[data-variant="'+o+'"]');return c.innerText=t(598),c.classList[t(208)](t(383))||c[t(249)].add(t(383)),c[t(561)]=!0,c[t(633)].backgroundColor="#82868b",document[t(283)](t(177))[t(478)]($=>{let x=t;parseInt($[x(173)](x(304)))===o||$.classList[x(208)]("sca-fg-out-stock")||($[x(561)]=!1,$.style.backgroundColor=FGSECOMAPP[x(274)]?.[x(635)]?.color?.[x(508)]??"#7367f0")}),!1}return await Z(["/cart/add",...x[t(233)](1)]),await _(x,r),new Response(JSON[t(375)](r))}if(!(x[0][t(385)](t(480))||x[0][t(385)](t(584))))return setTimeout(function(){$d()},1e3),await e(...x);{i(x[1]);let n=200,d=await e(...x)[t(390)]($=>{let x=t;return(n=$[x(454)],$[x(334)])?$:$[x(493)]()}).catch($=>{let x=t;console[x(217)]($)});if(x[1].headers?.[t(190)]&&200!==n)return!1;if(await Z([x[0][t(385)](t(480))?t(480):t(584),...x[t(233)](1)]),x[1]?.[t(552)]?.[t(190)])return new Response(JSON.stringify(d));let s=await e(t(498))[t(390)]($=>{let x=t;return $[x(493)]()});return await _(x,d,s),new Response(JSON[t(375)](s))}}catch(l){return await e(...x)}})};FGSECOMAPP[_0x350916(556)]=()=>{let $=_0x350916;try{if(Shopify?.[$(163)]||"function"!=typeof Shopify?.[$(460)])return;Shopify.getCart=async function(x){let t=$;if(!FGSECOMAPP[t(611)]){FGSECOMAPP[t(611)]=!0,await Z(t(498));let e=await fetch(t(498),{method:"GET",headers:{Accept:"application/json",sca_fetch:t(350),"Content-Type":t(458)}});typeof x===t(183)&&(0>FGSECOMAPP[t(199)].indexOf(x)&&FGSECOMAPP[t(199)][t(500)](x),x(await e[t(493)]())),FGSECOMAPP[t(611)]=!1}FGSECOMAPP[t(469)]()},typeof ShopifyAPI!==$(297)&&void 0!==ShopifyAPI.getCart&&(ShopifyAPI.getCart=Shopify?.[$(460)]),void 0!==Shopify?.[$(614)]&&typeof Shopify?.[$(614)][$(460)]!==$(297)&&(Shopify[$(614)][$(460)]=Shopify?.[$(460)])}catch(x){console.error(x)}};let i=$=>{let x=_0x350916;try{let t=$?.[x(562)];t instanceof FormData?FGSECOMAPP[x(602)]={sections:t.get(x(616)),sections_url:t[x(214)](x(201))}:typeof t===x(586)&&(t=JSON.parse(t),FGSECOMAPP[x(602)]={sections:t?.[x(616)],sections_url:t?.sections_url})}catch(e){FGSECOMAPP[x(602)]={}}},r=async()=>{let $=_0x350916,x={freegift_attributes:""};if(!b(FGSECOMAPP[$(558)])&&!Shopify[$(648)]){let t=["SECOMAPP_FREEGIFT"];for(let a of FGSECOMAPP[$(558)]){let i=FGSECOMAPP.offers.find(x=>x.id===a[$(645)])?.[$(571)]?.[$(402)];b(i)||t[$(500)](i)}x={freegift_attributes:t[$(407)]()}}try{await e("/cart/update",{method:$(392),headers:{"X-Requested-With":$(220),"Content-Type":$(589)},body:JSON[$(375)]({attributes:x})})}catch(r){console.error($(195)+r[$(277)])}},_=async($,x,t)=>{let a=_0x350916;try{if($[1]?.headers?.[a(190)])return;let i={},r=Object[a(471)](x[a(616)]??{})?.[a(549)]($=>b(FGSECOMAPP[a(602)][$]))??[];if(r&&r.length&&FGSECOMAPP[a(262)]&&(i=await e(a(466)+r.join(",")).then($=>$[a(493)]())),FGSECOMAPP[a(262)]=!1,i={...FGSECOMAPP[a(602)],...i},b(i))return;x[a(616)]={...x[a(616)],...i},b(t)||(t.sections={...x.sections})}catch(_){}},o=async($,x,t)=>{let e=_0x350916;t=t?.toString();let a=document[e(283)](e(354));a[e(478)](x=>{let t=e;x[t(561)]=!0;let a=x.getAttribute(t(304))-0;a===$&&(x[t(633)][t(524)]=t(485),x[t(470)]=t(495)),x[t(633)][t(574)]=t(168)});let i=FGSECOMAPP[e(558)].find(x=>t===x[e(645)]?.[e(407)]()&&$===x[e(534)]);i?i.quantity+=x:FGSECOMAPP.arrOfferAdded[e(545)]({variantId:$,belongs_to_offer:t,quantity:x}),localStorage[e(492)](e(399),LZString[e(482)](JSON[e(375)](FGSECOMAPP.arrOfferAdded)));let r=await fetch(e(627),{method:"POST",headers:{Accept:e(458),"Content-Type":e(458),sca_add_gift:e(170)},body:JSON[e(375)]({quantity:x,id:$})}),_=await r[e(493)]();if(r.ok)return a.forEach(x=>{let t=e;x[t(561)]=!0;let a=x[t(173)](t(304))-0;a===$&&(x[t(633)][t(524)]="6px 0",x.innerHTML=t(605)),x[t(633)][t(574)]=""}),J(),_},c=$=>{let x=_0x350916,t=x(198);return!b($)&&(typeof $===x(389)&&($.handle?.[x(385)](t)||$[x(546)]?.includes("freegifts"))||typeof $===x(586)&&$[x(385)](t))},n=async($,x)=>{let t=_0x350916;try{if(b($)&&b(x))return;let e={};if(FGSECOMAPP.cartItems?.filter($=>c($))?.[t(478)]($=>{let x=t;e[$.variant_id]=$[x(167)]}),($=$?.[t(549)]($=>!b($[t(251)])))?.[t(478)]($=>{let x=t;e[$[x(251)]]=(e[$[x(251)]]??0)+($[x(167)]??1)}),Object[t(471)](e)?.[t(478)]($=>{e[$]=e[$]>=0?e[$]:0}),b(Object[t(471)](e)))return;$?.[t(478)]($=>{let x=t,e=FGSECOMAPP[x(558)].find(t=>$[x(330)]?.toString()===t[x(645)]?.[x(407)]()&&$.variant_id===t.variantId);e?e.quantity+=$[x(167)]:FGSECOMAPP[x(558)][x(545)]({variantId:$.variant_id,belongs_to_offer:$[x(330)]?.[x(407)](),quantity:$[x(167)]})}),localStorage[t(492)](t(399),LZString[t(482)](JSON[t(375)](FGSECOMAPP[t(558)]))),FGSECOMAPP[t(262)]=!0,await fetch(t(584),{method:t(392),headers:{Accept:"application/json","Content-Type":"application/json",sca_process_gifts:!0},body:JSON.stringify({updates:e,...FGSECOMAPP[t(602)]})})[t(390)](e=>{let a=t;return e.ok&&$[a(271)]&&!x[a(271)]&&J(),e[a(493)]()})[t(390)]($=>{let x=t;FGSECOMAPP[x(602)]=$[x(616)]}),document.querySelector(t(261))?.[t(173)](t(497))===t(388)&&location.reload()}catch(a){console[t(217)](a)}},d=0,s=()=>{let $=_0x350916,e=document[$(351)]("freegifts-main-page-container");if(e)e[$(470)]=$(538)+(FGSECOMAPP[$(625)][$(318)]??$(398))+$(520)+x()+$(356);else{let a=localStorage[$(585)]("FGSECOMAPP_HIDDEN_GIFT_POPUP")-0,i=FGSECOMAPP[$(274)]?.[$(635)]?.disable_slider_checkbox??{},r=(i?.[$(644)]??0)*6e4,_=!isNaN(a)&&a+r>Date[$(395)]();if(_||(localStorage.removeItem($(448)),!(e=document[$(351)]($(298)))))return;e[$(470)]=$(300)+(FGSECOMAPP[$(625)][$(318)]??$(398))+$(257)+t()+$(367)+x()+$(431),e.classList[$(336)]($(216)),d++}},l=($,x)=>{let t=_0x350916;return $[t(628)]($=>t(450)+($[t(243)]??x)+'" id="'+$[t(176)]+t(519)+$.original_variant_shopify_id+t(424)+f($)+t(175)+u($)+'">\n '+$[t(207)]+t(461))[t(343)](" \n")},f=$=>{let x=_0x350916;return FGSECOMAPP[x(191)].format(v($?.[x(184)]))},u=$=>{let x=_0x350916,t=FGSECOMAPP?.[x(582)]?.cal_gift_discount===x(329)?$?.original_compare_at_price:$?.original_price;return FGSECOMAPP[x(191)][x(456)](v(t??0))},g=($,x)=>{let t=_0x350916;return b(Shopify?.products[$])?x??"#":Shopify?.[t(449)][$][t(591)]},p=($,x)=>{let t=_0x350916;return FGSECOMAPP[t(625)].show_product_title?b(Shopify?.[t(449)][$])?x[t(305)]("\xbb","").replace(/\(\d*% off\)/,"")??"":Shopify?.[t(449)][$][t(609)]:""},b=$=>{let x=_0x350916;if(0===$)return!0;if(typeof $==x(269)||"boolean"==typeof $)return!1;if(typeof $==x(297)||null===$)return!0;if(typeof $[x(271)]!=x(297))return 0===$[x(271)];let t=0;for(let e in $)$[x(312)](e)&&t++;return 0===t},h=$=>{let x=_0x350916;try{let t={...FGSECOMAPP.scaHandleConfigValue},e=t[$];if(e=e?e[x(246)]():null,!b(e)&&e[x(271)]>0)try{return document.querySelector(e),", "+e}catch(a){}return""}catch(i){return""}},m=()=>{let $=_0x350916;try{FGSECOMAPP[$(191)]=new Intl.NumberFormat(Shopify?.[$(512)]??Shopify?.[$(484)],{style:$(639),currency:Shopify?.[$(639)]?.[$(303)]??$(357)})}catch(x){FGSECOMAPP.formatter=new Intl[$(597)]($(380),{style:"currency",currency:Shopify?.currency?.[$(303)]??$(357)})}},v=$=>{let x=_0x350916;$=$??0;let t=Shopify?.[x(639)]?.rate??1;return 1===parseFloat(t)?$:($*t)[x(533)](Shopify?.fg_decimal??2)},y=$=>{let x=_0x350916;return $[x(549)]($=>void 0===$[x(295)]||!0===$.cal_gift_for_other_rules)[x(382)](($,t)=>$+t[x(167)]*(t[x(516)]??t[x(184)]),0)/100},w=$=>{let x=_0x350916;return $[x(549)]($=>void 0===$[x(295)]||$.cal_gift_for_other_rules)[x(382)](($,t)=>$+t[x(167)],0)},k=($,x)=>{let t=_0x350916,e=x[t(250)];return b(e)?$:$[t(549)]($=>{let x=t;return!e[x(628)](t=>{let e=x;switch(t[e(594)]){case"variants_ids":return Object[e(592)](t[e(542)])[e(628)]($=>$[e(610)])[e(528)]()[e(628)]($=>$.id).includes($[e(251)]);case e(544):return Object[e(471)](t.value).includes($[e(479)]);case e(640):return Object[e(471)](t.value)[e(385)]($[e(553)]);case e(267):let a=Object.keys(t[e(542)]),i=$[e(276)]?.[e(628)]($=>$.id+"")?.filter($=>a[e(385)]($));return!b(i);default:return!1}})[x(385)](!1)})},C=($,x)=>{let t=_0x350916;return $?.[t(628)]($=>{let e=t;if(void 0!==$[e(295)]){let a=FGSECOMAPP.arrOfferAdded?.[e(549)](x=>x.variantId===$[e(251)]),i=a?.[e(382)](($,x)=>$+x[e(167)],0);if(i===$.quantity){let r=FGSECOMAPP.arrOfferAdded?.[e(549)]($=>{let t=e;if($[t(645)]?.toString()===x[t(407)]())return!1;let a=FGSECOMAPP.offers?.[t(548)](x=>x.id?.toString()===$.belongs_to_offer?.[t(407)]()),i=a[t(332)]??{};return i[t(295)]&&100!==parseInt(i[t(187)])})?.[e(382)](($,x)=>$+x[e(167)],0);return{...$,cal_gift_for_other_rules:r>0,quantity:r??0}}return{...$,cal_gift_for_other_rules:!1,quantity:0}}return{...$}})??[]},A=($,x,t)=>{let e=_0x350916,a=0,i=k(x,$);i=C(i,$[e(330)]);let r;return $.unit===e(206)?r=y(i):$.unit===e(483)&&(r=w(i)),r>=$[e(435)]&&(null===$.max_amount||r<=$[e(577)])&&(a=t.number_of_gift_can_receive,$[e(228)]&&(a=Math[e(394)](r/$.min_amount)*a)),a},S=($,x,t)=>{let e=_0x350916,a={},i=[],r=0;return x[e(628)](x=>{let a=e,_=A(x,$,t);0!==_&&(r=_),i[a(500)](_>0)}),a[e(541)]=r,a.condition_result=i,a},T=($,x)=>{let t=_0x350916,e=!1;return 1===$[t(271)]?e=$[0]:2===$.length&&(x===t(631)&&(e=$[0]&&$[1]),"or"===x&&(e=$[0]||$[1])),e},q=($,x)=>{let t=_0x350916,e=$?.[t(628)]($=>$.variant_id);FGSECOMAPP[t(558)]=FGSECOMAPP[t(558)][t(549)]($=>e?.includes($.variantId));let a=x[t(646)][t(628)]($=>$[t(176)]),i=FGSECOMAPP.arrOfferAdded[t(549)]($=>$[t(645)]?.[t(407)]()===x.id?.[t(407)]())?.map($=>{let x=t;return $[x(534)]}),r=$[t(549)]($=>{let x=t;return c($)&&($.cal_gift_for_other_rules=!1),a[x(385)]($[x(251)])&&i[x(385)]($[x(251)])}),_=r.map($=>{let e=t,a=x[e(332)];$[e(295)]=a[e(295)],$.belongs_to_offer=x.id?.[e(407)]();let i=FGSECOMAPP[e(558)]?.[e(549)](t=>t.belongs_to_offer?.[e(407)]()!==x.id?.[e(407)]()&&$.variant_id===t.variantId)?.reduce(($,x)=>$+x[e(167)],0);return{...$,quantity:$[e(167)]-i}});return _[t(549)]($=>{let e=t;return $[e(645)]?.[e(407)]()===x.id?.toString()})},I=$=>{let x=_0x350916,t=$[x(442)].filter(t=>t[x(645)]?.[x(407)]()!==$.id?.toString())[x(628)]($=>$[x(569)]);return Object[x(592)]($.gift_products)[x(549)]($=>!t[x(385)]($.product_shopify_id))},L=($,x)=>{let t=_0x350916,e=q($,x),a=S($,x[t(252)],x[t(332)]),i=T(a[t(612)],x[t(226)]);if(i){let r=e[t(549)]($=>$.belongs_to_offer?.[t(407)]()===x.id?.[t(407)]())[t(382)](($,x)=>$+x[t(167)],0);a[t(541)]=a.max_gifts_can_get-r,x.giftsAdded=e,x[t(203)]=a[t(541)]}else x.giftsAdded=e,x[t(203)]=0;return typeof FGSECOMAPP[t(219)]===t(269)&&x[t(320)]>FGSECOMAPP[t(219)]&&(i=!1),i||!x[t(473)]||FGSECOMAPP[t(219)]!==x[t(320)]||b(e)||(FGSECOMAPP[t(219)]=null),x.isReachConditions=i,x[t(473)]&&i&&(null==FGSECOMAPP[t(219)]||x[t(320)]<=FGSECOMAPP[t(219)])&&FGSECOMAPP[t(219)]!==x[t(320)]&&(FGSECOMAPP[t(219)]=x.priority),x},E=$=>{let x=_0x350916,t=$+"=",e=document.cookie[x(504)](";");for(let a=0;a{let t=_0x350916,e=!0,a=!0,i=!0,r=!0;if(!b($[t(571)]?.[t(402)])){let _=E(t(313));e=_&&JSON.parse(_)[t(385)]($[t(571)].specific_link_address)}if(!b($[t(571)]?.[t(565)])){let{customer_tags:o}=$[t(571)],c=o?.[t(174)]?.[t(255)]($=>x[t(446)][t(546)]?.includes($));a=o?.[t(426)]===t(568)?c:!c}if(!b($[t(571)]?.[t(422)])){let{customer_locations:n}=$[t(571)],d=n?.[t(218)]?.[t(385)](FGSECOMAPP.customerLocation);r=n?.[t(371)]===t(568)?d:!d}if(!b($.sub_conditions?.[t(557)])){let s=!0,l=$.sub_conditions[t(557)],f=x[t(446)][t(193)]??[];if(l[t(244)]){let u=Date[t(409)](l[t(244)])/1e3;f=f[t(549)]($=>$[t(523)]>=u)}if(!b(l?.totarrCustomerOrderal_spend_on_order_history)&&(0!==l[t(615)].min_amount||0!==l.total_spend_on_order_history[t(577)])){let g=l[t(615)].min_amount,p=l[t(615)].max_amount,h=f.reduce(($,x)=>$+x[t(488)],0)/100;s&=(h>=g||!g)&&(h<=p||!p)}if(!b(l?.[t(254)])&&(0!==l[t(254)][t(435)]||0!==l[t(254)][t(577)])){let m=x[t(446)][t(302)]/100,v=l.total_spent_on_last_order[t(435)],y=l[t(254)][t(577)];s&=(m>=v||!v)&&(m<=y||!y)}if(!b(l?.[t(624)])){let w=!(0!==l[t(624)][t(435)]||0!==l[t(624)][t(577)]),k=f[t(271)],C=l.number_of_order[t(435)],A=l[t(624)][t(577)];s&=w?b(f):(k>=C||!C)&&(k<=A||!A)}if(l?.[t(315)]){let S=x[t(446)][t(595)]??[],T=$.gift_items?.[t(255)]($=>S[t(385)]($[t(176)]))||$[t(646)]?.[t(255)]($=>S.includes($.original_variant_shopify_id+"_"+($[t(323)]-$[t(184)])*100));s&=!T}i=s}return e&&a&&i&&r},G=($,x,t)=>{let e=_0x350916,a=[],i=[],r=[],_=[];for(let o of x){let n=L($,o);if(!n[e(551)]){n[e(442)][e(271)]>0&&n[e(442)][e(478)]($=>{let x=e;i[x(500)]({variant_id:$.variant_id,quantity:$[x(167)],offer_id:o.id})});continue}if(n.giftsAvailable<0){n[e(442)][e(478)]($=>{let x=e;i[x(500)]({variant_id:$[x(251)],quantity:$[x(167)],offer_id:o.id})});continue}0!==n[e(203)]&&(o[e(571)]?P(o,SECOMAPP)&&a[e(500)](o):a[e(500)](o))}if($?.[e(478)]($=>{let x=e;b($[x(645)])&&c($)&&i[x(500)]({variant_id:$.variant_id,quantity:$[x(167)],offer_id:$[x(645)]?.toString()})}),t||b(i)){let d=a[e(628)]($=>{let x=e;return{id:$.id,offerName:$.offer_name,offerPriority:$[x(320)],stopLowerPriority:$[x(473)],gifts:I($),giftsAvailable:$[x(203)],giftsAdded:$[x(442)],isReachConditions:$.isReachConditions}});if(!b(d)){let s={};for(let l of d){let f=M(FGSECOMAPP[e(582)],l);f?.[e(271)]>0?r=r[e(400)]([...f]):l[e(462)][e(628)]($=>{let x=e;s[$[x(171)]]={...$,belongs_to_offer:l.id?.toString()}})}_=Object.values(s)??[]}}return{arrGiftsAdd:r,arrGiftsRemove:i,arrGiftsData:_}},O=($,x)=>{let t=_0x350916,e=new Set;return $?.forEach($=>e[t(336)]($.offer_id)),e.forEach($=>{let x=t,e=FGSECOMAPP[x(273)]?.[x(548)](t=>t.id?.toString()===$?.[x(407)]());if(b(e)||!e[x(551)]){FGSECOMAPP[x(558)]=FGSECOMAPP[x(558)]?.[x(549)](t=>t.belongs_to_offer?.toString()!==$?.[x(407)]());return}if(e[x(203)]>=0)return;let a=[],i=FGSECOMAPP.arrOfferAdded?.filter(t=>t.belongs_to_offer?.toString()===$?.[x(407)]())??[];if(e?.[x(332)]?.auto_add_all_gifts)a=a[x(400)]([...i]),e.giftsAvailable=0;else for(let r of i){if(e[x(203)]>=0)break;e[x(203)]+=r[x(167)],e[x(203)]<=0?a.push({...r}):(r.quantity=e[x(203)],e[x(203)]=0)}a?.forEach($=>{let t=x;FGSECOMAPP[t(558)]=FGSECOMAPP[t(558)]?.[t(549)](x=>$[t(534)]!==x[t(534)]||$[t(645)]?.[t(407)]()!==x[t(645)]?.[t(407)]())})}),x?.[t(549)]($=>{let x=t;return c($)&&($.quantity=FGSECOMAPP.arrOfferAdded?.[x(549)](t=>$.variant_id===t[x(534)])?.reduce(($,t)=>$+t[x(167)],0)??0),$[x(167)]>0})??[]},F=async($,x)=>{let t=_0x350916,{arrGiftsAdd:e,arrGiftsRemove:a,arrGiftsData:i}=G($,x,!1),_=O(a,$);if(!b(a)){let o=G(_,x,!0);O(o?.arrGiftsRemove,$),e=o?.[t(263)],a=a?.[t(400)](o?.[t(328)])??[],i=o?.arrGiftsData}return await n(e,a),await r(),i},M=($,x)=>{let t=_0x350916,e=[];if($.auto_add_gift){let a=x[t(462)],i=a[t(382)](($,x)=>$+x[t(567)][t(271)],0),r=FGSECOMAPP[t(273)][t(549)]($=>$.id===x.id),_=r[0][t(332)][t(325)],o=r[0][t(290)];if(1===i||_||o.status){if($.not_show_gift_if_already_on_cart&&!D(a)||$?.[t(307)]&&!N(a))return!1;if(o[t(454)]){if("variant"===o[t(594)]){let c=FGSECOMAPP[t(186)];c=c[t(549)]($=>{let x=t;return $[x(569)]===a[0][x(272)]});let n=a[0][t(567)][t(549)]($=>{let x=t;return c[0][x(251)]===$.original_variant_shopify_id})[0];if(0===n[t(184)]&&100===parseInt(n.discount_percentage))return e[t(500)]({variant_id:n[t(176)],quantity:x[t(203)],offer_id:x.id}),e}else if(_){let d=a?.[t(382)](($,x)=>($+x?.[t(567)]?.[t(271)])??0,0);if(!d)return!1;let s=(x?.[t(203)]??0)/d;for(let l of a)for(let f of l[t(567)])e[t(500)]({variant_id:f[t(176)],quantity:s,offer_id:x.id});return e}}else{if(_){let u=a?.[t(382)](($,x)=>($+x?.variants?.[t(271)])??0,0);if(!u)return!1;let g=(x?.[t(203)]??0)/u;for(let p of a)for(let b of p[t(567)])e[t(500)]({variant_id:b[t(176)],quantity:g,offer_id:x.id});return e}{let h=a[0].variants[0];if(0===h.price&&100===parseInt(h[t(187)]))return console.log(t(369)+a[0][t(567)][0][t(176)]+" "+a[0][t(567)][0][t(207)]),e.push({variant_id:h.variant_shopify_id,quantity:x.giftsAvailable,offer_id:x.id}),e}}}}return!1},R=$=>{let x=_0x350916;return $===x(241)},H=$=>{let x=_0x350916;try{let t=Shopify[x(429)]??FGSECOMAPP[x(274)]?.gift_slider?.[x(202)]?.[x(499)]??x(418),e=new URL($),a=new URLSearchParams(t);return a[x(478)](($,t)=>e.searchParams[x(364)](t,$)),e[x(407)]()}catch(i){return $}},j=$=>{let x=_0x350916,t=$;if(FGSECOMAPP.fgAppearanceGiftSlider[x(622)]===x(344))for(let e of(t=[],$)){let a=e[x(567)];a&&a.length&&a[x(478)]($=>t[x(500)]({...e,thumbnail:$.thumbnail,variants:[$]}))}let i=document.getElementById(x(559));i&&(i.innerHTML=t.map($=>{let t=x,e=$?.[t(567)][0]??{};return t(181)+g($.original_product_shopify_id,$[t(420)])+t(636)+H($.thumbnail)+'" alt="">\n

'+p($[t(272)],$[t(609)])+t(162)+(FGSECOMAPP[t(625)][t(622)]===t(344)&&FGSECOMAPP[t(625)][t(511)]?t(437)+(1===$[t(567)].length?t(270)+(R(e[t(207)])?"sca-d-none":"")+t(333)+e[t(207)]+t(397):t(408)+(FGSECOMAPP[t(625)].select_gift_btn??t(423))+t(580))+t(517):"")+t(404)+u(e)+'\n \n '+f(e)+t(439)+(FGSECOMAPP[t(625)][t(622)]!==t(344)?t(555)+(1===$[t(567)][t(271)]?t(270)+(R(e[t(207)])?t(474):"")+'">'+e[t(207)]+t(580):''+(FGSECOMAPP.fgAppearanceGiftSlider[t(401)]??t(423))+"")+t(447)+l($[t(567)],$[t(243)])+"\n \n ":"")+'\n \n \n \n ","#MainContent, #mainContent, #main, .main-content","sca-gift-icon","application/liquid","100%","&width=480&height=480",".sca-promotion-message-layout","original_product_handle",'"\n data-variant="',"customer_locations","Select variant",'"\n data-price="','\n \xab\n \xbb\n ',"type_customer_tags",".sca-promotion-glider","location","customGiftImgSize","height","\n ","SHOPIFY_CART","1935006qSltzw","href","min_amount","hasDoneProcessCheckout",'

\n ',"#close-fg-toast","\n \n ","{{sca_min_quantity}}",'">\n ',"giftsAdded","end_time","sca_link_checkout","sca_amount_fixed","customer",'\n \n \n