\n
✕ \n
\n '+(FGSECOMAPP[$(633)][$(537)]??$(430))+$(579)+e()+$(778)+x()+$(406),t[$(843)][$(507)]($(472)),s++}},f=($,x)=>{let e=_0x2e6852;return $.map($=>e(796)+($[e(764)]??x)+e(790)+$[e(531)]+e(412)+$[e(748)]+e(710)+_($)+e(498)+u($)+e(728)+$[e(705)]+e(444))[e(704)](" \n")},_=$=>{let x=_0x2e6852;return FGSECOMAPP.formatter[x(678)](v($?.[x(750)]))},u=$=>{let x=_0x2e6852,e=FGSECOMAPP?.[x(425)]?.[x(567)]===x(454)?$?.[x(742)]:$?.[x(696)];return FGSECOMAPP[x(857)][x(678)](v(e??0))},g=($,x)=>{let e=_0x2e6852;return b(Shopify?.[e(781)][$])?x??"#":Shopify?.[e(781)][$][e(478)]},p=($,x)=>{let e=_0x2e6852;return FGSECOMAPP[e(633)].show_product_title?b(Shopify?.[e(781)][$])?x[e(445)]("\xbb","").replace(/\(\d*% off\)/,"")??"":Shopify?.[e(781)][$][e(792)]:""},b=$=>{let x=_0x2e6852;if(0===$)return!0;if(typeof $==x(649)||typeof $==x(451))return!1;if(typeof $==x(747)||null===$)return!0;if(typeof $[x(532)]!=x(747))return 0===$[x(532)];let e=0;for(let t in $)$[x(713)](t)&&e++;return 0===e},h=$=>{let x=_0x2e6852;try{let e={...FGSECOMAPP[x(752)]},t=e[$];if(t=t?t[x(734)]():null,!b(t)&&t[x(532)]>0)try{return document.querySelector(t),", "+t}catch(a){}return""}catch(i){return""}},m=()=>{let $=_0x2e6852;try{FGSECOMAPP[$(857)]=new Intl[$(860)](Shopify?.[$(621)]??Shopify?.locale,{style:"currency",currency:Shopify?.[$(613)]?.[$(824)]??$(693)})}catch(x){FGSECOMAPP[$(857)]=new Intl[$(860)]($(786),{style:"currency",currency:Shopify?.[$(613)]?.active??$(693)})}},v=$=>{let x=_0x2e6852;$=$??0;let e=Shopify?.currency?.[x(664)]??1;return 1===parseFloat(e)?$:($*e).toFixed(Shopify?.[x(555)]??2)},y=$=>{let x=_0x2e6852;return $[x(611)]($=>void 0===$.cal_gift_for_other_rules||!0===$[x(617)])[x(568)](($,e)=>$+e.quantity*(e[x(489)]??e[x(750)]),0)/100},w=$=>{let x=_0x2e6852;return $[x(611)]($=>void 0===$[x(617)]||$[x(617)])[x(568)](($,e)=>$+e[x(746)],0)},k=($,x)=>{let e=_0x2e6852,t=x[e(647)];return b(t)?$:$[e(611)]($=>{let x=e;return!t[x(690)](e=>{let t=x;switch(e.type){case"variants_ids":return Object[t(508)](e.value)[t(690)]($=>$[t(672)])[t(616)]()[t(690)]($=>$.id)[t(540)]($[t(736)]);case t(789):return Object[t(714)](e.value).includes($[t(485)]);case t(810):return Object[t(714)](e[t(629)])[t(540)]($[t(524)]);case t(676):let a=Object.keys(e[t(629)]),i=$[t(712)]?.map($=>$.id+"")?.filter($=>a.includes($));return!b(i);default:return!1}})[x(540)](!1)})},A=($,x)=>$?.map($=>{let e=_0x4220;if(typeof $[e(617)]!==e(747)){let t=FGSECOMAPP.arrOfferAdded?.filter(x=>x.variantId===$.variant_id),a=t?.[e(568)](($,x)=>$+x[e(746)],0);if(a===$[e(746)]){let i=FGSECOMAPP[e(467)]?.[e(611)]($=>{let t=e;if($.belongs_to_offer?.[t(618)]()===x[t(618)]())return!1;let a=FGSECOMAPP[t(719)]?.find(x=>x.id?.[t(618)]()===$[t(715)]?.[t(618)]()),i=a[t(558)]??{};return i[t(617)]&&100!==parseInt(i[t(559)])})?.[e(568)](($,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{...$}})??[],C=($,x,e)=>{let t=_0x2e6852,a=0,i=k(x,$);i=A(i,$[t(835)]);let r;return $.unit===t(870)?r=y(i):$[t(413)]===t(497)&&(r=w(i)),r>=$.min_amount&&(null===$[t(756)]||r<=$[t(756)])&&(a=e[t(814)],$[t(578)]&&(a=Math[t(701)](r/$[t(743)])*a)),a},S=($,x,e)=>{let t=_0x2e6852,a={},i=[],r=0;return x[t(690)](x=>{let a=t,c=C(x,$,e);0!==c&&(r=c),i[a(566)](c>0)}),a.max_gifts_can_get=r,a[t(563)]=i,a},T=($,x)=>{let e=_0x2e6852,t=!1;return 1===$[e(532)]?t=$[0]:2===$[e(532)]&&(x===e(435)&&(t=$[0]&&$[1]),"or"===x&&(t=$[0]||$[1])),t},q=($,x)=>{let e=_0x2e6852,t=$?.[e(690)]($=>$[e(736)]);FGSECOMAPP[e(467)]=FGSECOMAPP[e(467)][e(611)]($=>t?.includes($[e(651)]));let a=x[e(800)].map($=>$.variant_shopify_id),i=FGSECOMAPP.arrOfferAdded[e(611)]($=>$[e(715)]?.[e(618)]()===x.id?.[e(618)]())?.map($=>{let x=e;return $[x(651)]}),r=$[e(611)]($=>{let x=e;return o($)&&($[x(617)]=!1),a[x(540)]($[x(736)])&&i.includes($[x(736)])}),c=r[e(690)]($=>{let t=e,a=x[t(558)];$.cal_gift_for_other_rules=a[t(617)],$[t(715)]=x.id?.[t(618)]();let i=FGSECOMAPP[t(467)]?.[t(611)](e=>e[t(715)]?.[t(618)]()!==x.id?.[t(618)]()&&$[t(736)]===e.variantId)?.[t(568)](($,x)=>$+x[t(746)],0);return{...$,quantity:$[t(746)]-i}});return c[e(611)]($=>{let t=e;return $[t(715)]?.toString()===x.id?.[t(618)]()})},E=$=>{let x=_0x2e6852,e=$[x(658)][x(611)](e=>e.belongs_to_offer?.toString()!==$.id?.[x(618)]())[x(690)]($=>$[x(665)]);return Object.values($[x(657)])[x(611)]($=>!e[x(540)]($[x(836)]))},P=($,x)=>{let e=_0x2e6852,t=q($,x),a=S($,x[e(630)],x[e(558)]),i=T(a[e(563)],x[e(869)]);if(i){let r=t[e(611)]($=>$[e(715)]?.[e(618)]()===x.id?.[e(618)]())[e(568)](($,x)=>$+x[e(746)],0);a.max_gifts_can_get=a[e(724)]-r,x[e(658)]=t,x.giftsAvailable=a[e(724)]}else x[e(658)]=t,x[e(844)]=0;return"number"==typeof FGSECOMAPP[e(553)]&&x.priority>FGSECOMAPP[e(553)]&&(i=!1),i||!x.stop_lower_priority||FGSECOMAPP.maxOfferPriority!==x[e(767)]||b(t)||(FGSECOMAPP.maxOfferPriority=null),x.isReachConditions=i,x.stop_lower_priority&&i&&(null==FGSECOMAPP[e(553)]||x.priority<=FGSECOMAPP[e(553)])&&FGSECOMAPP[e(553)]!==x[e(767)]&&(FGSECOMAPP[e(553)]=x[e(767)]),x},I=$=>{let x=_0x2e6852,e=$+"=",t=decodeURIComponent(document[x(513)])[x(656)](";");for(let a=0;a{let e=_0x2e6852,t=!0,a=!0,i=!0;if(!b($.sub_conditions?.[e(848)])){let r=I(e(608));t=r&&JSON[e(457)](r)[e(540)]($.sub_conditions[e(848)])}if(!b($[e(717)]?.[e(641)])){let{customer_tags:c}=$[e(717)],n=c?.value_customer_tags?.[e(488)]($=>x[e(666)][e(759)]?.includes($));a=c?.[e(638)]===e(595)?n:!n}if(!b($[e(717)]?.customer_order_history)){let o=!0,l=$[e(717)][e(794)],s=x.customer.orders??[];if(l.order_created_from){let d=Date.parse(l[e(474)])/1e3;s=s.filter($=>$.created_at>=d)}if(!b(l?.totarrCustomerOrderal_spend_on_order_history)&&(0!==l[e(744)][e(743)]||0!==l[e(744)][e(756)])){let f=l.total_spend_on_order_history.min_amount,_=l[e(744)][e(756)],u=s.reduce(($,x)=>$+x.total_price,0)/100;o&=(u>=f||!f)&&(u<=_||!_)}if(!b(l?.total_spent_on_last_order)&&(0!==l[e(863)][e(743)]||0!==l.total_spent_on_last_order[e(756)])){let g=x.customer.last_total/100,p=l.total_spent_on_last_order.min_amount,h=l[e(863)][e(756)];o&=(g>=p||!p)&&(g<=h||!h)}if(!b(l?.[e(849)])){let m=!(0!==l[e(849)][e(743)]||0!==l[e(849)][e(756)]),v=s[e(532)],y=l[e(849)].min_amount,w=l.number_of_order.max_amount;o&=m?b(s):(v>=y||!y)&&(v<=w||!w)}if(l?.[e(702)]){let k=x[e(666)][e(460)]??[],A=$[e(800)]?.[e(488)]($=>k[e(540)]($[e(531)]))||$[e(800)]?.[e(488)]($=>k[e(540)]($.original_variant_shopify_id+"_"+($.original_price-$.price)*100));o&=!A}i=o}return t&&a&&i},G=($,x,e)=>{let t=_0x2e6852,a=[],i=[],r=[],c=[];for(let n of x){let l=P($,n);if(!l[t(536)]){l[t(658)][t(532)]>0&&l[t(658)].forEach($=>{let x=t;i[x(566)]({variant_id:$.variant_id,quantity:$.quantity,offer_id:n.id})});continue}if(l.giftsAvailable<0){l[t(658)][t(560)]($=>{let x=t;i[x(566)]({variant_id:$[x(736)],quantity:$[x(746)],offer_id:n.id})});continue}0!==l.giftsAvailable&&(n[t(717)]?L(n,SECOMAPP)&&a[t(566)](n):a[t(566)](n))}if($?.[t(560)]($=>{let x=t;b($.belongs_to_offer)&&o($)&&i[x(566)]({variant_id:$[x(736)],quantity:$[x(746)],offer_id:$[x(715)]?.[x(618)]()})}),e||b(i)){let s=a[t(690)]($=>{let x=t;return{id:$.id,offerName:$.offer_name,offerPriority:$[x(767)],stopLowerPriority:$[x(670)],gifts:E($),giftsAvailable:$.giftsAvailable,giftsAdded:$.giftsAdded,isReachConditions:$.isReachConditions}});if(!b(s)){let d={};for(let f of s){let _=M(FGSECOMAPP[t(425)],f);_?.[t(532)]>0?r=r.concat([..._]):f[t(822)].map($=>{let x=t;d[$[x(836)]]={...$,belongs_to_offer:f.id?.[x(618)]()}})}c=Object.values(d)??[]}}return{arrGiftsAdd:r,arrGiftsRemove:i,arrGiftsData:c}},O=($,x)=>{let e=_0x2e6852,t=new Set;return $?.[e(560)]($=>t.add($[e(835)])),t.forEach($=>{let x=e,t=FGSECOMAPP[x(719)]?.[x(493)](x=>x.id?.toString()===$?.toString());if(b(t)||!t[x(536)]){FGSECOMAPP[x(467)]=FGSECOMAPP.arrOfferAdded?.[x(611)](e=>e[x(715)]?.[x(618)]()!==$?.[x(618)]());return}if(t[x(844)]>=0)return;let a=[],i=FGSECOMAPP[x(467)]?.[x(611)](e=>e[x(715)]?.toString()===$?.toString())??[];if(t?.[x(558)]?.auto_add_all_gifts)a=a.concat([...i]),t[x(844)]=0;else for(let r of i){if(t[x(844)]>=0)break;t[x(844)]+=r[x(746)],t.giftsAvailable<=0?a[x(566)]({...r}):(r[x(746)]=t.giftsAvailable,t.giftsAvailable=0)}a?.forEach($=>{let e=x;FGSECOMAPP.arrOfferAdded=FGSECOMAPP[e(467)]?.filter(x=>$[e(651)]!==x[e(651)]||$[e(715)]?.[e(618)]()!==x[e(715)]?.[e(618)]())})}),x?.[e(611)]($=>{let x=e;return o($)&&($[x(746)]=FGSECOMAPP[x(467)]?.[x(611)](e=>$[x(736)]===e.variantId)?.reduce(($,e)=>$+e[x(746)],0)??0),$[x(746)]>0})??[]},F=async($,x)=>{let e=_0x2e6852,{arrGiftsAdd:t,arrGiftsRemove:a,arrGiftsData:i}=G($,x,!1),c=O(a,$);if(!b(a)){let n=G(c,x,!0);O(n?.arrGiftsRemove,$),t=n?.arrGiftsAdd,a=a?.[e(791)](n?.[e(518)])??[],i=n?.arrGiftsData}return await l(t,a),await r(),i},M=($,x)=>{let e=_0x2e6852,t=[];if($[e(834)]){let a=x.gifts,i=a[e(568)](($,x)=>$+x.variants[e(532)],0),r=FGSECOMAPP[e(719)][e(611)]($=>$.id===x.id),c=r[0][e(558)].auto_add_all_gifts,n=r[0].gift_should_the_same;if(1===i||c||n[e(856)]){if($[e(821)]&&!D(a)||$?.[e(450)]&&!B(a))return!1;if(n[e(856)]){if("variant"===n.type){let o=FGSECOMAPP[e(652)];o=o[e(611)]($=>$.product_id===a[0].original_product_shopify_id);let l=a[0].variants[e(611)]($=>{let x=e;return o[0][x(736)]===$.original_variant_shopify_id})[0];if(0===l.price&&100===parseInt(l[e(559)]))return t[e(566)]({variant_id:l.variant_shopify_id,quantity:x.giftsAvailable,offer_id:x.id}),t}else if(c){let s=a?.[e(568)](($,x)=>($+x?.variants?.[e(532)])??0,0);if(!s)return!1;let d=(x?.giftsAvailable??0)/s;for(let f of a)for(let _ of f[e(677)])t.push({variant_id:_.variant_shopify_id,quantity:d,offer_id:x.id});return t}}else{if(c){let u=a?.[e(568)](($,x)=>($+x?.variants?.[e(532)])??0,0);if(!u)return!1;let g=(x?.[e(844)]??0)/u;for(let p of a)for(let b of p[e(677)])t[e(566)]({variant_id:b[e(531)],quantity:g,offer_id:x.id});return t}{let h=a[0][e(677)][0];if(0===h[e(750)]&&100===parseInt(h[e(559)]))return console.log(e(782)+a[0][e(677)][0][e(531)]+" "+a[0][e(677)][0][e(705)]),t[e(566)]({variant_id:h[e(531)],quantity:x.giftsAvailable,offer_id:x.id}),t}}}}return!1},H=$=>{let x=_0x2e6852;return $===x(754)},j=$=>{let x=_0x2e6852,e=$;if(FGSECOMAPP[x(633)][x(654)]===x(466))for(let t of(e=[],$)){let a=t[x(677)];a&&a[x(532)]&&a[x(560)]($=>e[x(566)]({...t,thumbnail:$[x(764)],variants:[$]}))}let i=document[x(495)](x(646));i&&(i.innerHTML=e[x(690)]($=>{let e=x,t=$?.variants[0]??{};return e(480)+g($.original_product_shopify_id,$[e(674)])+e(545)+$.thumbnail+e(433)+p($[e(585)],$[e(792)])+e(691)+(FGSECOMAPP.fgAppearanceGiftSlider[e(654)]===e(466)&&FGSECOMAPP.fgAppearanceGiftSlider[e(542)]?e(424)+(1===$.variants.length?e(554)+(H(t[e(705)])?e(645):"")+e(600)+t[e(705)]+e(831):e(659)+(FGSECOMAPP[e(633)][e(723)]??e(603))+"")+"\n ":"")+e(855)+u(t)+e(420)+_(t)+"\n
\n "+("by_variants"!==FGSECOMAPP[e(633)].show_gift_for_customer?e(741)+(1===$[e(677)][e(532)]?'
'+t[e(705)]+e(437):e(659)+(FGSECOMAPP[e(633)][e(723)]??e(603))+e(437))+e(732)+f($[e(677)],$.thumbnail)+e(683):"")+'\n {let $=_0x2e6852;try{let x=window[$(625)]?.[$(719)]??[];for(let e in Shopify?.[$(781)])b(Shopify?.products[e]?.id)&&delete Shopify?.[$(781)][e];let t=[];return x[$(560)](x=>{let e=$,a=JSON[e(457)](JSON[e(875)](x));if(x[e(443)][e(856)]){let i=x.offer_conditions[0][e(647)],r=i[0].value,c=[...a[e(800)]],n=[...a[e(657)]];if("variant"===x.gift_should_the_same.type)for(let o in r){let l=r[o]?.[e(672)]??[];for(let s of l){a[e(630)][0][e(647)]=[{type:i[0][e(801)],value:{[o]:{...r[o],variant:[{...s}]}}}],a.gift_items=c[e(611)]($=>$[e(585)]+""===o&&s.id===$[e(748)]),a[e(657)]=n.filter($=>$[e(585)]+""===o),a[e(657)][0][e(677)]=[...a[e(800)]];let d=a[e(558)][e(814)],f=a.gift_settings.auto_add_all_gifts;a[e(558)].auto_add_all_gifts&&(d=a[e(800)][e(532)]),1===a.gift_items.length&&0===a[e(800)][0][e(750)]&&(f=!0),t.push(JSON[e(457)](JSON[e(875)]({...a,gift_settings:{...a[e(558)],number_of_gift_can_receive:d,auto_add_all_gifts:f},id:a.id+"_"+r[o][e(478)]+"_"+s.id})))}}else if(x[e(443)][e(801)]===e(783))for(let _ in r){a[e(630)][0][e(647)]=[{type:i[0][e(801)],value:{[_]:r[_]}}],a.gift_items=c.filter($=>$[e(585)]+""===_),a[e(657)]=n.filter($=>$[e(585)]+""===_);let u=a.gift_settings.number_of_gift_can_receive,g=a[e(558)][e(826)];a[e(558)][e(826)]&&(u=a[e(800)][e(532)]),1===a[e(800)].length&&0===a.gift_items[0][e(750)]&&(g=!0),t[e(566)](JSON.parse(JSON.stringify({...a,gift_settings:{...a.gift_settings,number_of_gift_can_receive:u,auto_add_all_gifts:g},id:a.id+"_"+r[_].handle})))}}}),(x=(x=(x=x?.[$(611)](x=>!x?.[$(443)]?.[$(856)])?.concat(t))?.map(x=>{let e=$;return{...x,id:x.id[e(618)]()}}))?.filter(x=>{let e=$;if(!W(x[e(868)],x[e(837)]))return!1;let t=!b(x.sub_conditions?.customer_order_history||x[e(717)]?.[e(641)]);if(x[e(717)]&&(!L(x,SECOMAPP)||t&&b(SECOMAPP[e(666)][e(534)])))return!1;let a={...Shopify?.[e(781)]},i=!1;if(FGSECOMAPP[e(425)][e(864)]===e(609)){x[e(800)]=x?.[e(800)][e(611)]($=>{let x=e,t=a[$.original_product_shopify_id]?.[x(504)]??{};return t[$[x(748)]]>0})??[];let r=x[e(800)]?.[e(690)]($=>$[e(531)]);x[e(657)]=x?.[e(657)]?.[e(611)]($=>{let x=e;return $[x(677)]=$?.[x(677)]?.[x(611)]($=>{let e=x;return r?.[e(540)]($[e(531)])}),$?.[x(677)]?.[x(532)]>0}),i=!0}else if(FGSECOMAPP[e(425)].manual_input_inventory){x[e(800)]=x?.[e(800)][e(611)]($=>{let x=e,t=a[$[x(836)]]?.[x(504)]??{};return t[$[x(531)]]>0});let c=x[e(800)]?.[e(690)]($=>$[e(531)]);x[e(657)]=x?.gift_products?.[e(611)]($=>{let x=e;return $[x(677)]=$?.variants?.filter($=>{let e=x;return c?.[e(540)]($[e(531)])}),$?.[x(677)]?.[x(532)]>0}),i=!0}return i&&x[e(558)]?.[e(826)]&&(x[e(558)][e(814)]=x[e(800)]?.[e(532)]),!i||x.gift_items&&x[e(800)][e(532)]>0}))?.[$(690)](x=>{let e=$,t=x.gift_items[e(690)]($=>$.original_product_shopify_id);return x[e(657)]=x.gift_products?.filter($=>{let x=e;return t.includes($[x(585)])}),x[e(630)]?.forEach($=>{let x=e;$[x(413)]===x(870)&&($[x(743)]=v($[x(743)]),$[x(756)]=b($.max_amount)?$[x(756)]:v($[x(756)]))}),x})}catch(a){return console[$(408)](a),[]}},D=$=>{let x=_0x2e6852;for(let e of FGSECOMAPP.cartItems){let t=e[x(665)];if($[0][x(585)]===t)return!1}return!0},B=$=>{let x=_0x2e6852;for(let e of FGSECOMAPP[x(652)]){let t=$[0][x(677)][0].original_price;if(FGSECOMAPP[x(425)][x(450)]===x(454)&&(t=$[0][x(677)][0][x(742)]),t>e[x(750)]/100)return!1}return!0},N=async()=>{let $=_0x2e6852;try{let x=[];window.fgData?.[$(719)]?.[$(560)](e=>{let t=$,a=[];e.gift_products[t(560)]($=>{let x=t;a.push($[x(452)],$[x(674)])}),x=[...x,...a]}),await $o(x=(x=[...new Set(x)])[$(611)](x=>b(FGSECOMAPP[$(521)][x]))),Object.values(FGSECOMAPP.productsInPage)?.[$(560)]($=>{let{info:x}=$;b(x)||b(x?.id)||(Shopify.products[x.id]={...x})})}catch(e){console[$(408)](e)}},z=async $=>{let x=_0x2e6852;m(),FGSECOMAPP.fetchCheckoutEvents(),FGSECOMAPP?.fgSettings?.[x(864)]===x(609)||FGSECOMAPP?.fgSettings?.manual_input_inventory?await N():N().then(),FGSECOMAPP[x(719)]=R(),FGSECOMAPP[x(833)](),a();try{b($)?(FGSECOMAPP.arrOfferAdded=[],localStorage[x(853)](x(733),LZString[x(604)](JSON[x(875)](FGSECOMAPP[x(467)])))):FGSECOMAPP[x(467)]=JSON[x(457)](LZString[x(550)](localStorage[x(530)]("sca_offers_added")))}catch(e){FGSECOMAPP.arrOfferAdded=[],localStorage[x(853)](x(733),LZString[x(604)](JSON[x(875)](FGSECOMAPP[x(467)])))}let t={};FGSECOMAPP.offers?.[x(560)]($=>{let e=x;t[$.id]=$?.[e(800)]?.map($=>$[e(531)])});let i=Object[x(714)](t);FGSECOMAPP[x(467)]=FGSECOMAPP[x(467)]?.[x(611)]($=>i?.[x(540)]($.belongs_to_offer?.[x(618)]())&&t[$.belongs_to_offer?.toString()][x(540)]($[x(651)]));let r={};FGSECOMAPP[x(467)]?.[x(560)]($=>{let e=x,t=r[$[e(715)]+"_"+$[e(651)]]??{};r[$[e(715)]+"_"+$[e(651)]]={...$,belongs_to_offer:$[e(715)]?.toString(),quantity:(t?.[e(746)]??0)+($?.[e(746)]??0)}}),FGSECOMAPP.arrOfferAdded=Object[x(508)](r),localStorage[x(853)]("sca_offers_added",LZString[x(604)](JSON[x(875)](FGSECOMAPP[x(467)])));let c=await F($,FGSECOMAPP[x(719)]);await X(c),$s(),$d(),$l()},U=function(){let $=_0x2e6852,x=document[$(839)]($(419)),t=document[$(839)]("#freegifts-main-popup-container [data-close]"),a="sca-is-visible-fg",i=document[$(839)]($(851)),r=i[$(532)];for(let c=0;c{let t=$;x[t(551)]===document[t(407)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg")&&(document[t(407)](t(636))[t(843)][t(809)](a),e())}),document[$(577)]($(650),x=>{let t=$;x[t(671)]===t(819)&&document[t(407)](t(636))&&(document[t(407)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg")[t(843)][t(809)](a),e())}),document[$(839)]($(597))[$(560)](x=>x.addEventListener($(602),function(){let x=$;this[x(416)](x(692),1),this[x(503)](),this[x(843)][x(703)]("active"),this.querySelector(x(475))[x(843)][x(703)](x(482))})),document[$(839)]("#fg-gift-items .dropdown").forEach(x=>document[$(577)]($(602),function(e){let t=$,a=x.contains(e[t(551)]);a||(x[t(843)].remove("active"),x[t(407)](t(475))[t(843)][t(809)](t(482))),document.querySelectorAll(t(520))[t(560)]($=>{let x=t;$[x(476)]=!0,$[x(808)][x(459)]=x(528)})})),document[$(839)]($(614)).forEach(x=>{let e=$;x.addEventListener(e(602),function(){let $=e,x=this[$(830)]("id"),t=this.getAttribute("data-img"),a=this.getAttribute($(827)),i=this[$(830)]($(612)),r=this[$(830)]($(624)),c=this[$(707)].parentElement[$(707)][$(707)];c[$(407)]($(599))[$(416)]($(449),t);let n=new URL(c.querySelector($(588)).href);n[$(872)][$(471)]($(672),r),c.querySelector(".gift-original-url")[$(514)]=n[$(618)]();let o=this.parentElement[$(707)][$(707)];o[$(407)]($(765)).textContent=i,o.querySelector(".gift-price")[$(761)]=a;let l=o?.[$(407)]($(862));l.setAttribute($(847),x),l[$(476)]=!1,l[$(808)]="";let s=this[$(707)][$(707)].querySelector($(468));s[$(843)][$(507)]("active"),s[$(799)]=this.innerText})}),document.querySelectorAll("#fg-gift-items .btn-add-to-cart")[$(560)](x=>x.addEventListener($(602),async function(){let x=$,e=this[x(830)](x(847))-0,t=this.getAttribute("data-offer");try{await n(e,1,t);let i=document[x(407)](x(636));i&&(FGSECOMAPP[x(828)]=!0,await new Promise($=>setTimeout($,800)),i[x(843)].remove(a)),window[x(673)][x(514)][x(540)](x(479))?location[x(584)]():typeof Shopify?.[x(446)]===x(627)&&await Shopify?.[x(446)](0===FGSECOMAPP[x(432)][x(532)]?function(){}:FGSECOMAPP[x(432)][0])}catch(r){console[x(408)](r)}}))},W=($,x)=>{let e=_0x2e6852;if($){let t=new Date,a=t.getTime(),i=new Date($).getTime();if(!x)return a>=i;{let r=new Date(x)[e(586)]();return a>=i&&a<=r}}return!1},X=async $=>{let x=_0x2e6852;if(FGSECOMAPP[x(425)]?.[x(793)])for(let e of FGSECOMAPP[x(652)])o(e)&&($=$[x(611)]($=>$[x(836)]!==e[x(665)]));if(FGSECOMAPP[x(425)]?.not_show_gift_if_already_on_cart)for(let t of FGSECOMAPP.cartItems)$=$.filter($=>$[x(585)]!==t.product_id);if(FGSECOMAPP[x(425)]?.[x(450)])for(let a of FGSECOMAPP[x(652)])$=$[x(611)]($=>{let e=x;return $[e(677)]=$[e(677)][e(611)]($=>{let x=e,t=$.original_price;return FGSECOMAPP[x(425)]?.[x(450)]==="compare_at_price"&&(t=$[x(742)]),t<=a[x(750)]/100}),!b($[e(677)])});$&&$[x(532)]>0&&(FGSECOMAPP[x(828)]?(await new Promise($=>setTimeout($,1500)),FGSECOMAPP.isDelayShowAdded=!1,d(),j($)):(d(),j($))),U(),FGSECOMAPP[x(500)](),FGSECOMAPP[x(740)](FGSECOMAPP[x(719)]),J=[]},Y=async $=>{let x=_0x2e6852;J=[];let e=window[x(673)][x(514)],a=await t(e,{method:x(873)});await a[x(529)]()[x(655)]($=>{let e=x,t=new DOMParser,a=t[e(548)]($,"text/html"),i=".fg-secomapp-cart-drawer "+h(e(570)),r=e(576)+h(e(700)),c=document[e(407)](i),n=!1;c&&(n=!0,c[e(799)]=a[e(407)](i)?.innerHTML??c[e(799)]);let o=document.querySelector(r);o||(o=document.querySelector("#shopify-section-header #cart-icon-bubble, .shopify-section.section-header #cart-icon-bubble")),o&&(n=!0,o[e(799)]=a[e(407)](r)?.innerHTML??a[e(407)](e(684))?.innerHTML??o[e(799)]),n||console[e(644)](e(418))}),"function"==typeof FGSECOMAPP?.[x(729)]&&await FGSECOMAPP[x(729)](),setTimeout(function(){X($)},800)},V=async()=>{let $=_0x2e6852;try{await t(SECOMAPP[$(725)],{method:$(873),headers:{"Content-Type":$(795)}})[$(655)](async x=>{let e=$,t=await x[e(708)]();FGSECOMAPP[e(652)]=t?.[e(436)]?.[e(690)]($=>{let x=e;return{...FGSECOMAPP[x(652)]?.[x(493)](x=>x.id===$.id),...$[x(783)],collections:$[x(712)],tags:$[x(759)]}})??[],FGSECOMAPP.SHOPIFY_CART=t?.[e(832)]??{}})[$(838)](async x=>{let e=$;console[e(408)](e(615)+x[e(878)]);let a=await t("/cart.js",{method:e(873),headers:{Accept:"application/json","Content-Type":e(486)}}),i=await a[e(708)](),r=i[e(527)];FGSECOMAPP.SHOPIFY_CART=i,FGSECOMAPP[e(652)]=r?.[e(690)]($=>{let x=e;return{...FGSECOMAPP[x(652)]?.[x(493)](x=>x.id===$.id),...$}})??[]})}catch(x){console[$(408)]($(805),x.message);let e=await t($(788),{method:$(873),headers:{Accept:"application/json","Content-Type":"application/json"}}),a=(await e[$(708)]())[$(527)];FGSECOMAPP.cartItems=a?.[$(690)](x=>{let e=$;return{...FGSECOMAPP[e(652)]?.[e(493)]($=>$.id===x.id),...x}})??[]}},J=[],K=async $=>{let x=_0x2e6852;try{$===x(788)?J[x(566)](x(675)):J.push($[0]),await V();let e=await F(FGSECOMAPP[x(652)],FGSECOMAPP.offers);FGSECOMAPP[x(740)](FGSECOMAPP[x(719)]);let a=!1;$[0][x(405)](x(718))&&JSON.stringify($[1][x(453)]??[]).includes(x(813))?(console.log(x(635),[...J]),await Y(e),a=!0):$[0][x(405)](x(438))&&JSON.stringify($[1][x(453)]??[]).includes("sca_process_gifts")&&(J.includes("/cart/add")||1===J.length)?(console[x(644)](x(689),[...J]),await Y(e),a=!0):(console[x(644)](x(610),[...J]),await X(e)),a&&(window[x(673)][x(514)][x(540)](x(479))||document[x(407)](x(639))?.[x(830)](x(561))===x(591))&&(J=[],location.reload());let i=await t(x(788),{method:x(873),headers:{Accept:x(486),"Content-Type":x(486)}});return await i[x(708)]().then($=>{let e=x;FGSECOMAPP[e(652)]=$[e(527)]?.[e(690)]($=>{let x=e;return{...FGSECOMAPP[x(652)]?.[x(493)](x=>x.id===$.id),...$}})}),FGSECOMAPP[x(652)]}catch(r){console.error(r)}},Q=()=>{let $=_0x2e6852;if(!Shopify?.[$(581)])return;let x=document[$(407)]($(473));if(!x)return;x.innerHTML="";let e=Shopify?.[$(572)]??$(538),t=document.createElement("li");t[$(768)]=$(499),t[$(799)]=$(840)+e+$(753),x[$(686)](t),t[$(410)]=setTimeout(()=>Z(t),3e3),document[$(407)]($(811))?.[$(577)]($(602),()=>Z(t))},Z=$=>{let x=_0x2e6852;$[x(843)].add(x(574)),$[x(410)]&&clearTimeout($[x(410)]),setTimeout(()=>$[x(809)](),500)},$$=($,{value:x,innerHTML:e})=>{let t=_0x2e6852;try{let a=FGSECOMAPP.fgSettings?.[t(428)],i="trigger_body"===a?$[t(551)]:$[t(694)]??$.target;if(i?.[t(557)](t(583))||(i=document[t(407)](t(663))?.[t(515)]),i[t(629)]=x,i[t(799)]=e,i[t(476)]=!1,i[t(483)]("click",$x),i.removeAttribute(t(583)),a===t(720)){i[t(515)][t(407)]("[sca_root_checkout]")[t(602)]();return}a===t(774)&&window.removeEventListener(t(602),$0,!0),i[t(602)]()}catch(r){window[t(673)][t(445)]((Shopify?.[t(469)]?.[t(874)]??"/")+"checkout"),console[t(408)](r.message)}},$x=async $=>{let x=_0x2e6852;try{$[x(731)](),$.stopPropagation(),$[x(434)]();let e=FGSECOMAPP[x(425)]?.[x(428)],a=e===x(774)?$[x(551)]:$[x(694)]??$[x(551)],{form:i}=a,r="",c="";if(a&&(a[x(476)]=!0,r=a[x(799)],c=a[x(629)],"function"==typeof FGSECOMAPP?.[x(711)]?await FGSECOMAPP[x(711)](x(687)):(a[x(629)]=x(541),a[x(799)]=x(623))),FGSECOMAPP.checkIsBlockCheckout)return!1;FGSECOMAPP[x(593)]=!0;try{await t(x(479),{method:"POST",body:new FormData(i)})}catch(n){console.log(x(598))}if(b(FGSECOMAPP[x(719)])&&b(FGSECOMAPP[x(652)]?.find($=>o($))))return console[x(644)](x(462)),$$($,{value:c,innerHTML:r}),!1;let l=await t("/cart.js",{method:x(873),headers:{Accept:x(486),"Content-Type":x(486)}}),s=(await l.json())[x(527)];await V();let d=FGSECOMAPP.cartItems?.map($=>{let e=x;return{...s?.[e(493)](x=>x.id===$.id),collections:$.collections,tags:$[e(759)]}})??[],f=!1;for(let _ of FGSECOMAPP[x(719)])if(_[x(658)]&&_[x(658)].length){let u=P(d,_),g=W(_[x(868)],_[x(837)]);!g&&u[x(658)].length>0&&(f=!0),u.isReachConditions||(f=!0),u[x(844)]<0&&(f=!0),_[x(717)]&&!L(_,SECOMAPP)&&(f=!0)}if(await F(d,FGSECOMAPP.offers),f)location[x(584)]();else try{FGSECOMAPP[x(425)][x(592)]&&!b(FGSECOMAPP[x(652)]?.[x(493)]($=>o($)))?await t(SECOMAPP[x(725)]+x(447)+Shopify?.shop,{method:"GET",headers:{"Content-Type":x(795)}})[x(655)](async $=>{let e=x,a=await $[e(708)]();a.cart=(a[e(436)]??[]).map($=>{let x=e;return $[x(783)][x(712)]=$[x(712)]?.[x(690)]($=>({id:$.id})),$[x(783)][x(759)]=$.tags,{id:$[x(783)].id,variant_id:$[x(783)].variant_id,title:$[x(783)][x(792)],handle:$[x(783)][x(478)],price:$.product.price,quantity:$.product[x(746)],product_type:$[x(783)].product_type,vendor:$[x(783)][x(524)],tags:$.product[x(759)],collections:$[x(783)][x(712)]}}),a[e(871)]={arr_offer_added:FGSECOMAPP[e(467)],secomapp:{customer:SECOMAPP?.customer??{},fg_codes:SECOMAPP?.fg_codes??[],fgSettings:FGSECOMAPP.fgSettings},cookie_fg_code:I(e(608)),shopify_currency:Shopify?.[e(613)]},await t(SECOMAPP[e(725)]+"&data_checkout="+LZString[e(762)](a=JSON[e(875)](a)),{method:e(873),headers:{"Content-Type":e(795)}}).then(async $=>{let x=e,t=await $.json();try{FGSECOMAPP.checkIsBlockCheckout=!1,t[x(423)]&&(window[x(673)][x(514)]=t[x(423)].invoice_url)}catch(a){console.error(a)}})}):(console[x(644)](x(509)),FGSECOMAPP[x(593)]=!1,$$($,{value:c,innerHTML:r}))}catch(p){FGSECOMAPP.checkIsBlockCheckout=!1,$$(p,{value:c,innerHTML:r})}(a=e===x(774)?$[x(551)]:$[x(694)]??$[x(551)])&&(typeof FGSECOMAPP?.[x(711)]===x(627)?await FGSECOMAPP[x(711)](x(660)):(a.value=c,a[x(799)]=r),a.disabled=!1)}catch(h){"function"==typeof FGSECOMAPP?.[x(711)]&&await FGSECOMAPP[x(711)]("end"),console[x(408)](h)}},$0=async $=>{let x=_0x2e6852;$.target?.[x(557)](x(583))&&await $x($)},$e=()=>{let $=_0x2e6852,x=FGSECOMAPP[$(425)]?.[$(428)],e=$(517)+h($(456));document.querySelectorAll(e)[$(560)](e=>{let t=$,a=e[t(557)](t(780)),i=e[t(557)](t(662)),r=e[t(557)]("sca_handle_checkout");if(x===t(720)){if(a)return;if(!i&&!r){let c=e[t(815)](!0);c.addEventListener(t(602),$x),c[t(416)](t(583),""),c[t(416)](t(662),""),e[t(808)].display=t(594),e[t(808)][t(879)]=t(697),e[t(808)][t(709)]="0",e[t(416)](t(780),""),e[t(515)]?.[t(686)](c)}i&&!r&&(e[t(577)](t(602),$x),e.setAttribute(t(583),""))}else x===t(774)?e[t(416)](t(583),""):r||(e[t(577)]("click",$x),e[t(416)](t(583),""));FGSECOMAPP[t(631)]=!0}),"trigger_body"===x&&window[$(577)]($(602),$0,!0)};FGSECOMAPP.fetchCheckoutEvents=()=>{let $=_0x2e6852;FGSECOMAPP[$(525)]=0;let x=setInterval(()=>{let e=$;$e(),FGSECOMAPP.scaCountRenderEventCheckout++,(FGSECOMAPP[e(525)]>10||FGSECOMAPP[e(631)])&&(FGSECOMAPP[e(525)]=0,clearInterval(x))},400)};let $t=$=>{let x=_0x2e6852;try{let e={},t={},a=FGSECOMAPP[x(719)];if(b($)){$=[],b(Shopify?.[x(854)])||$[x(566)]({...Shopify?.[x(854)]});let i={...Shopify?.[x(779)],...Shopify?.[x(829)]?.[x(781)]};Object.values(FGSECOMAPP[x(521)])?.[x(611)]($=>!b($[x(757)])&&(b($?.[x(803)])||$?.[x(803)]&&!$?.position?.classList?.[x(637)](x(494))))?.[x(560)]($=>{let e=x;i[$[e(757)].id]={...$[e(757)]}}),$=$[x(791)]([...Object[x(508)](i)])}for(let r in $?.[x(560)]($=>{let e=x,t=FGSECOMAPP.productsInPage[$.handle];FGSECOMAPP[e(521)][$.handle]={...t,info:{...$},product_has_icon:!!b(a)&&void 0}}),a?.[x(560)](a=>{let i=x,r=a.offer_conditions;if(1===r[i(532)]&&"number_of_products"===r[0][i(413)]&&typeof r[0].is_multiply===i(451)){let c,n=r[0][i(647)];n?.[i(560)](x=>{let e=i;switch(x[e(801)]){case e(699):c=Object[e(508)](x.value);break;case e(789):let t=Object.keys(x.value);t[e(532)]>0&&(c=(void 0===c?$:c)?.[e(611)]($=>t[e(540)]($[e(801)]))??[]);break;case e(810):let a=Object[e(714)](x.value);a[e(532)]>0&&(c=(void 0===c?$:c)?.[e(611)]($=>a.includes($[e(524)]))??[]);break;case e(676):let r=Object[e(714)](x.value);r[e(532)]>0&&(c=(void 0===c?$:c)?.[e(611)]($=>{let x=e,t=$[x(712)]?.[x(690)]($=>$.id+""),a=t?.[x(611)]($=>r[x(540)]($));return!b(a)})??[])}}),c?.[i(560)]($=>{let x=i,r=$[x(478)];if(e[r]){let c=e[r]?.[x(690)]($=>$[x(585)]),n=a[x(657)]?.[x(611)]($=>!c?.[x(540)]($.original_product_shopify_id));e[r]=e[r].concat(n)}else e[r]=a[x(657)];let o=$.variant?.[x(690)]($=>$.id)??[];t[r]=o[x(791)](t[r]??[]),t[r]=[...new Set(t[r])]})}}),e){let c=FGSECOMAPP[x(521)][r];FGSECOMAPP[x(521)][r]={...c,gifts_will_receive:[...e[r]],product_has_icon:!0,variants_has_gift:[...t[r]]}}return Object[x(640)](e)?.[x(532)]?e:{}}catch(n){return console[x(408)](n),null}},$a=$=>{let x=_0x2e6852,e=FGSECOMAPP[x(770)][x(431)]??{};if(!e[x(502)]?.[x(856)])return;let t=x(411)+(e[x(502)]?.[x(792)]??x(549))+' \n \n