\n
\n
\n '+(FGSECOMAPP[$(278)][$(645)]??$(623))+$(314)+t()+$(357)+x()+$(318),e[$(416)][$(204)]($(508)),l++}},f=($,x)=>{let t=_0x232bc1;return $[t(465)]($=>t(225)+($.thumbnail??x)+t(479)+$[t(628)]+'" data-original-id="'+$[t(174)]+'"\n data-price="'+u($)+t(160)+b($)+'">\n '+$[t(269)]+t(584))[t(338)](" \n")},u=$=>{let x=_0x232bc1;return FGSECOMAPP[x(494)][x(373)](y($?.[x(229)]))},b=$=>{let x=_0x232bc1,t=FGSECOMAPP?.[x(611)]?.[x(458)]===x(364)?$?.[x(264)]??$?.[x(438)]:$?.[x(438)];return FGSECOMAPP.formatter[x(373)](y(t??0))},p=($,x)=>{let t=_0x232bc1;return h(Shopify?.[t(157)][$])?x??"#":Shopify?.[t(157)][$][t(393)]},g=($,x)=>{let t=_0x232bc1;return FGSECOMAPP[t(278)][t(431)]?h(Shopify?.[t(157)][$])?x.replace("\xbb","")[t(355)](/\(\d*% off\)/,"")??"":Shopify?.[t(157)][$][t(532)]:""},h=$=>{let x=_0x232bc1;if(0===$)return!0;if(typeof $==x(597)||typeof $==x(238))return!1;if(typeof $==x(310)||null===$)return!0;if(typeof $[x(643)]!=x(310))return 0===$[x(643)];let t=0;for(let e in $)$[x(354)](e)&&t++;return 0===t},m=$=>{let x=_0x232bc1;try{let t={...FGSECOMAPP[x(552)]},e=t[$];if(e=e?e[x(576)]():null,!h(e)&&e.length>0)try{return document[x(617)](e),", "+e}catch(a){}return""}catch(i){return""}},v=()=>{let $=_0x232bc1;try{FGSECOMAPP[$(494)]=new Intl[$(444)](Shopify?.sca_locale??Shopify?.[$(539)],{style:$(422),currency:Shopify?.currency?.active??$(214)})}catch(x){FGSECOMAPP.formatter=new Intl[$(444)]($(381),{style:$(422),currency:Shopify?.[$(422)]?.[$(232)]??$(214)})}},y=$=>{let x=_0x232bc1;$=$??0;let t=Shopify?.[x(422)]?.[x(638)]??1;return 1===parseFloat(t)?$:($*t)[x(472)](Shopify?.[x(247)]??2)},w=$=>{let x=_0x232bc1;return $.filter($=>void 0===$[x(244)]||!0===$[x(244)])[x(252)](($,t)=>$+t[x(600)]*(t[x(337)]??t[x(229)]),0)/100},k=$=>{let x=_0x232bc1;return $.filter($=>void 0===$.cal_gift_for_other_rules||$.cal_gift_for_other_rules)[x(252)](($,t)=>$+t[x(600)],0)},C=($,x,t)=>{let e=_0x232bc1,a=x.product_narrow;return t?.is_only&&($=$.filter($=>o($))),h(a)?$:$[e(219)]($=>{let x=e;return!a[x(465)](t=>{let e=x;switch(t[e(513)]){case e(475):return Object[e(299)](t.value)[e(465)]($=>$[e(236)])[e(257)]().map($=>$.id)[e(231)]($[e(533)]);case e(460):return Object[e(454)](t[e(339)]).includes($.product_type);case"product_vendors":return Object[e(454)](t[e(339)]).includes($[e(259)]);case"product_collections":let a=Object[e(454)](t.value),i=$.collections?.[e(465)]($=>$.id+"")?.[e(219)]($=>a[e(231)]($));return!h(i);default:return!1}})[x(231)](!1)})},A=($,x)=>$?.map($=>{let t=_0x3133;if(typeof $.cal_gift_for_other_rules!==t(310)){let e=FGSECOMAPP[t(545)]?.[t(219)](x=>x[t(548)]===$[t(533)]),a=e?.[t(252)](($,x)=>$+x[t(600)],0);if(a===$.quantity){let i=e?.[t(219)](e=>{let a=t;if(e[a(566)]?.[a(304)]()===x[a(304)]())return!1;let i=FGSECOMAPP[a(578)]?.[a(201)]($=>$.id?.[a(304)]()===e[a(566)]?.[a(304)]()),r=i[a(432)]??{};return r[a(244)]&&$[a(337)]>0})?.[t(252)](($,x)=>$+x.quantity,0);return{...$,cal_gift_for_other_rules:i>0,quantity:i??0}}return{...$,cal_gift_for_other_rules:!1,quantity:0}}return{...$}})??[],S=($,x,t,e)=>{let a=_0x232bc1,i=0,r=C(x,$,e);r=A(r,$[a(224)]);let _;return $[a(327)]===a(497)?_=w(r):$[a(327)]===a(186)&&(_=k(r)),_>=$.min_amount&&(null===$[a(292)]||_<=$[a(292)])&&(i=t[a(556)],$[a(606)]&&(i=Math[a(246)](_/$.min_amount)*i)),i},T=($,x,t,e)=>{let a=_0x232bc1,i={},r=[],_=0;return x[a(465)](x=>{let i=a,c=S(x,$,t,e);0!==c&&(_=c),r[i(179)](c>0)}),i.max_gifts_can_get=_,i.condition_result=r,i},q=($,x)=>{let t=_0x232bc1,e=!1;return 1===$[t(643)]?e=$[0]:2===$[t(643)]&&("and"===x&&(e=$[0]&&$[1]),"or"===x&&(e=$[0]||$[1])),e},E=($,x)=>{let t=_0x232bc1,e=$?.[t(465)]($=>$[t(533)]);FGSECOMAPP[t(545)]=FGSECOMAPP[t(545)][t(219)]($=>e?.[t(231)]($[t(548)]));let a=x[t(262)].map($=>$[t(628)]),i=FGSECOMAPP.arrOfferAdded[t(219)]($=>$[t(566)]?.[t(304)]()===x.id?.toString())?.[t(465)]($=>$.variantId),r=$[t(219)]($=>{let x=t;return n($)&&($[x(244)]=!1),a.includes($[x(533)])&&i.includes($[x(533)])}),_=r.map($=>{let e=t,a=x[e(432)];$[e(244)]=a[e(244)],$[e(566)]=x.id?.[e(304)]();let i=FGSECOMAPP[e(545)]?.[e(219)](t=>t[e(566)]?.[e(304)]()!==x.id?.[e(304)]()&&$[e(533)]===t[e(548)])?.[e(252)](($,x)=>$+x[e(600)],0);return{...$,quantity:$.quantity-i}});return _[t(219)]($=>{let e=t;return $.belongs_to_offer?.[e(304)]()===x.id?.[e(304)]()})},L=$=>{let x=_0x232bc1,t=$[x(353)][x(219)](t=>t[x(566)]?.toString()!==$.id?.toString()).map($=>$[x(395)]);return Object[x(299)]($[x(317)])[x(219)]($=>!t[x(231)]($[x(218)]))},P=($,x)=>{let t=_0x232bc1,e=E($,x),a=T($,x[t(220)],x[t(432)],x[t(595)]?.[t(632)]),i=q(a[t(546)],x[t(235)]);if(i){let r=e[t(219)]($=>$[t(566)]?.[t(304)]()===x.id?.[t(304)]()).reduce(($,x)=>$+x.quantity,0);a[t(624)]=a[t(624)]-r,x[t(353)]=e,x[t(518)]=a[t(624)]}else x[t(353)]=e,x[t(518)]=0;return"number"==typeof FGSECOMAPP[t(551)]&&x.priority>FGSECOMAPP[t(551)]&&(i=!1),i||!x[t(162)]||FGSECOMAPP[t(551)]!==x.priority||h(e)||(FGSECOMAPP[t(551)]=null),x[t(567)]=i,x.stop_lower_priority&&i&&(null==FGSECOMAPP[t(551)]||x[t(159)]<=FGSECOMAPP[t(551)])&&FGSECOMAPP[t(551)]!==x.priority&&(FGSECOMAPP[t(551)]=x[t(159)]),x},I=$=>{let x=_0x232bc1,t=$+"=",e=document[x(409)][x(401)](";");for(let a=0;a{let t=_0x232bc1,e=!0,a=!0,i=!0,r=!0;if(!h($.sub_conditions?.[t(515)])){let _=I("sca_fg_codes");e=_&&JSON[t(478)](_)[t(231)]($.sub_conditions.specific_link_address)}if(!h($[t(595)]?.customer_tags)){let{customer_tags:c}=$.sub_conditions,n=c?.[t(169)]?.some($=>x[t(163)].tags?.[t(231)]($));a=c?.[t(349)]===t(582)?n:!n}if(!h($[t(595)]?.[t(176)])){let{customer_locations:o}=$.sub_conditions,s=o?.[t(375)]?.[t(231)](FGSECOMAPP.customerLocation);r=o?.[t(483)]===t(582)?s:!s}if(!h($[t(595)]?.[t(308)])){let l=!0,d=$[t(595)][t(308)],f=x[t(163)][t(553)]??[];if(d[t(580)]){let u=Date.parse(d[t(580)])/1e3;f=f[t(219)]($=>$.created_at>=u)}if(!h(d?.[t(575)])&&(0!==d.total_spend_on_order_history.min_amount||0!==d.total_spend_on_order_history[t(292)])){let b=d.total_spend_on_order_history.min_amount,p=d[t(502)][t(292)],g=f[t(252)](($,x)=>$+x[t(441)],0)/100;l&=(g>=b||!b)&&(g<=p||!p)}if(!h(d?.[t(165)])&&(0!==d[t(165)].min_amount||0!==d[t(165)].max_amount)){let m=x.customer[t(550)]/100,v=d.total_spent_on_last_order.min_amount,y=d[t(165)][t(292)];l&=(m>=v||!v)&&(m<=y||!y)}if(!h(d?.number_of_order)){let w=!(0!==d[t(612)][t(344)]||0!==d[t(612)][t(292)]),k=f[t(643)],C=d[t(612)][t(344)],A=d[t(612)][t(292)];l&=w?h(f):(k>=C||!C)&&(k<=A||!A)}if(d?.have_not_got_gift_from_this_offer){let S=x[t(163)][t(591)]??[],T=$[t(262)]?.[t(371)]($=>S.includes($.variant_shopify_id))||$[t(262)]?.[t(371)]($=>S[t(231)]($[t(174)]+"_"+($[t(438)]-$[t(229)])*100));l&=!T}i=l}return e&&a&&i&&r},M=($,x,t)=>{let e=_0x232bc1,a=[],i=[],r=[],_=[];for(let c of x){let o=P($,c);if(!o.isReachConditions){o[e(353)][e(643)]>0&&o[e(353)].forEach($=>{let x=e;i[x(179)]({variant_id:$[x(533)],quantity:$[x(600)],offer_id:c.id})});continue}if(o.giftsAvailable<0){o[e(353)].forEach($=>{let x=e;i[x(179)]({variant_id:$[x(533)],quantity:$[x(600)],offer_id:c.id})});continue}0!==o.giftsAvailable&&(c[e(595)]?F(c,SECOMAPP)&&a[e(179)](c):a.push(c))}if($?.[e(325)]($=>{let x=e;h($[x(566)])&&n($)&&i.push({variant_id:$[x(533)],quantity:$[x(600)],offer_id:$.belongs_to_offer?.[x(304)]()})}),t||h(i)){let s=a[e(465)]($=>{let x=e;return{id:$.id,offerName:$[x(172)],offerPriority:$[x(159)],stopLowerPriority:$[x(162)],gifts:L($),giftsAvailable:$.giftsAvailable,giftsAdded:$[x(353)],isReachConditions:$[x(567)]}});if(!h(s)){let l={};for(let d of s){let f=H(FGSECOMAPP.fgSettings,d);f?.[e(643)]>0?r=r[e(369)]([...f]):d[e(442)][e(465)]($=>{let x=e;l[$[x(218)]]={...$,belongs_to_offer:d.id?.[x(304)]()}})}_=Object[e(299)](l)??[]}}return{arrGiftsAdd:r,arrGiftsRemove:i,arrGiftsData:_}},O=($,x)=>{let t=_0x232bc1,e=new Set;return $?.[t(325)]($=>e[t(204)]($[t(224)])),e[t(325)]($=>{let x=t,e=FGSECOMAPP[x(578)]?.find(t=>t.id?.[x(304)]()===$?.[x(304)]());if(h(e)||!e.isReachConditions){FGSECOMAPP[x(545)]=FGSECOMAPP[x(545)]?.[x(219)](t=>t[x(566)]?.[x(304)]()!==$?.toString());return}if(e[x(518)]>=0)return;let a=[],i=FGSECOMAPP[x(545)]?.[x(219)](t=>t[x(566)]?.[x(304)]()===$?.[x(304)]())??[];if(e?.gift_settings?.[x(459)])a=a[x(369)]([...i]),e[x(518)]=0;else for(let r of i){if(e[x(518)]>=0)break;e[x(518)]+=r.quantity,e[x(518)]<=0?a.push({...r}):(r[x(600)]=e.giftsAvailable,e[x(518)]=0)}a?.[x(325)]($=>{let t=x;FGSECOMAPP[t(545)]=FGSECOMAPP.arrOfferAdded?.filter(x=>$[t(548)]!==x[t(548)]||$[t(566)]?.[t(304)]()!==x[t(566)]?.toString())})}),x?.[t(219)]($=>{let x=t;return n($)&&($[x(600)]=FGSECOMAPP.arrOfferAdded?.[x(219)](t=>$[x(533)]===t.variantId)?.[x(252)](($,t)=>$+t[x(600)],0)??0),$[x(600)]>0})??[]},G=async($,x)=>{let t=_0x232bc1,{arrGiftsAdd:e,arrGiftsRemove:a,arrGiftsData:i}=M($,x,!1),_=O(a,$);if(!h(a)){let c=M(_,x,!0);O(c?.[t(200)],$),e=c?.[t(392)],a=a?.concat(c?.arrGiftsRemove)??[],i=c?.arrGiftsData}return await s(e,a),r()[t(622)](),i},H=($,x)=>{let t=_0x232bc1,e=[];if($[t(285)]){let a=x[t(442)],i=a.reduce(($,x)=>$+x[t(155)][t(643)],0),r=FGSECOMAPP[t(578)][t(219)]($=>$.id===x.id),_=r[0][t(432)][t(459)],c=r[0][t(402)];if(1===i||_||c[t(275)]){if($[t(510)]&&!N(a)||$?.[t(473)]&&!z(a))return!1;if(c[t(275)]){if(c[t(513)]===t(236)){let n=FGSECOMAPP[t(440)];n=n.filter($=>{let x=t;return $[x(395)]===a[0][x(209)]});let o=a[0][t(155)][t(219)]($=>{let x=t;return n[0][x(533)]===$[x(174)]})[0];if(0===o.price)return e.push({variant_id:o[t(628)],quantity:x.giftsAvailable,offer_id:x.id}),e}else if(_){let s=a?.reduce(($,x)=>($+x?.[t(155)]?.[t(643)])??0,0);if(!s)return!1;let l=(x?.[t(518)]??0)/s;for(let d of a)for(let f of d[t(155)])e[t(179)]({variant_id:f.variant_shopify_id,quantity:l,offer_id:x.id});return e}}else{if(_){let u=a?.[t(252)](($,x)=>($+x?.[t(155)]?.[t(643)])??0,0);if(!u)return!1;let b=(x?.giftsAvailable??0)/u;for(let p of a)for(let g of p[t(155)])e[t(179)]({variant_id:g.variant_shopify_id,quantity:b,offer_id:x.id});return e}{let h=a[0].variants[0];if(0===h.price)return console[t(535)](t(426)+a[0][t(155)][0][t(628)]+" "+a[0].variants[0][t(269)]),e[t(179)]({variant_id:h.variant_shopify_id,quantity:x.giftsAvailable,offer_id:x.id}),e}}}}return!1},R=$=>{let x=_0x232bc1;return $===x(350)},D=$=>{let x=_0x232bc1;try{let t=Shopify[x(387)]??FGSECOMAPP[x(242)]?.[x(618)]?.[x(512)]?.gift_img_size??x(543),e=new URL($),a=new URLSearchParams(t);return a[x(325)](($,t)=>e[x(222)][x(362)](t,$)),e.toString()}catch(i){return $}},j=$=>{let x=_0x232bc1,t=$;if(FGSECOMAPP[x(278)].show_gift_for_customer===x(309))for(let e of(t=[],$)){let a=e.variants;a&&a.length&&a[x(325)]($=>t[x(179)]({...e,thumbnail:$[x(428)],variants:[$]}))}let i=document[x(457)](x(323));i&&(i[x(505)]=t[x(465)]($=>{let t=x,e=$?.[t(155)][0]??{};return t(477)+p($[t(209)],$[t(329)])+t(321)+D($[t(428)])+t(579)+g($[t(209)],$[t(532)])+"\n "+(FGSECOMAPP.fgAppearanceGiftSlider[t(192)]===t(309)&&FGSECOMAPP.fgAppearanceGiftSlider[t(345)]?t(621)+(1===$[t(155)][t(643)]?t(423)+(R(e[t(269)])?t(646):"")+t(647)+e[t(269)]+t(474):t(604)+(FGSECOMAPP[t(278)][t(182)]??"Select variant")+t(300))+t(541):"")+t(453)+b(e)+'\n \n '+u(e)+t(390)+(FGSECOMAPP[t(278)][t(192)]!==t(309)?t(306)+(1===$[t(155)][t(643)]?t(423)+(R(e[t(269)])?"sca-d-none":"")+'">'+e.variant_title+t(300):''+(FGSECOMAPP[t(278)][t(182)]??t(563))+"")+'\n \n
\n \n
":"")+t(549)+$[t(566)]+'"\n data-variant="'+(1===$.variants.length?e.variant_shopify_id:"")+t(641)+(FGSECOMAPP[t(278)].add_to_cart_btn_title??t(560))+"\n \n