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":"#121212","product_title_color":"#000000","original_price_color":"#121212","discounted_price_color":"#ea5455","add_to_cart_color":"#FFFFFF","add_to_cart_btn_color":"#7367f0"},"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 _0x5c4574=_0x4121;!function($,x){let e=_0x4121,t=$();for(;;)try{let a=parseInt(e(595))/1+-parseInt(e(229))/2+parseInt(e(365))/3*(parseInt(e(529))/4)+-parseInt(e(277))/5+parseInt(e(577))/6*(-parseInt(e(296))/7)+parseInt(e(439))/8*(parseInt(e(288))/9)+parseInt(e(602))/10;if(423630===a)break;t.push(t.shift())}catch(i){t.push(t.shift())}}(_0x43e6,423630);try{let $=document[_0x5c4574(157)](_0x5c4574(172))?.getAttribute(_0x5c4574(474));if("3.0"===$){window[_0x5c4574(337)]?.[_0x5c4574(486)]?.[_0x5c4574(589)]?.[_0x5c4574(407)]&&fgGiftIcon&&(window[_0x5c4574(337)][_0x5c4574(486)][_0x5c4574(589)][_0x5c4574(407)]=fgGiftIcon),window[_0x5c4574(249)]={},FGSECOMAPP.maxOfferPriority=null,FGSECOMAPP[_0x5c4574(571)]=Object[_0x5c4574(164)](Shopify?.[_0x5c4574(571)]??{}),FGSECOMAPP.offers=[],FGSECOMAPP[_0x5c4574(408)]=window[_0x5c4574(337)]?.[_0x5c4574(495)]??{},FGSECOMAPP[_0x5c4574(587)]=window[_0x5c4574(337)]?.[_0x5c4574(486)]??{},FGSECOMAPP.fgAppearanceGiftSlider=FGSECOMAPP[_0x5c4574(587)]?.[_0x5c4574(370)]?.[_0x5c4574(355)],FGSECOMAPP[_0x5c4574(381)]=FGSECOMAPP[_0x5c4574(587)]?.[_0x5c4574(589)],FGSECOMAPP[_0x5c4574(233)]=FGSECOMAPP[_0x5c4574(587)]?.promotion_message,FGSECOMAPP.fgCallback=[],FGSECOMAPP[_0x5c4574(501)]=!1,FGSECOMAPP[_0x5c4574(513)]=[],FGSECOMAPP.scaCountRenderEventCheckout=0,FGSECOMAPP[_0x5c4574(498)]=!1,FGSECOMAPP[_0x5c4574(559)]={...Shopify?.[_0x5c4574(559)]},FGSECOMAPP[_0x5c4574(165)]=Shopify?.[_0x5c4574(165)]??void 0,FGSECOMAPP[_0x5c4574(417)]=Shopify?.[_0x5c4574(417)]??void 0,FGSECOMAPP[_0x5c4574(196)]={},FGSECOMAPP[_0x5c4574(289)]=!1,FGSECOMAPP[_0x5c4574(531)]={},FGSECOMAPP[_0x5c4574(537)]=!1,FGSECOMAPP[_0x5c4574(449)]={};let x=()=>{let $=_0x5c4574,x=FGSECOMAPP[$(587)]?.[$(370)],e=x?.[$(582)]?.[$(476)],t=!g(x)&&void 0!==e&&!e;return t?$(396):""},e=()=>{let $=_0x5c4574,x=FGSECOMAPP[$(587)]?.gift_slider,e=x?.[$(328)]??{};return document[$(332)]($(390))?.checked&&localStorage[$(224)]($(170),""+Date[$(416)]()),e?.[$(152)]?$(209)+e[$(475)]+$(329):""},{fetch:t}=window,a=()=>{let $=_0x5c4574;"fg-checkout"!==document[$(332)]($(211))?.getAttribute($(268))&&(window[$(303)]=async(...x)=>{let e=$;try{if(x[0][e(538)]("/cart/add")){i(x[1]);let a=200,r=await t(...x)[e(349)]($=>{let x=e;return a=$[x(445)],$.json()});if(x[1][e(527)]?.[e(153)]&&200!==a){let c=JSON[e(261)](x[1][e(295)])?.id,o=document[e(332)](e(561)+c+'"]');return o[e(330)]=e(579),o[e(420)][e(310)](e(192))||o.classList[e(601)](e(192)),o.disabled=!0,o[e(274)][e(542)]="#82868b",document[e(517)](".btn-add-to-cart").forEach($=>{let x=e;parseInt($[x(206)]("data-variant"))===c||$[x(420)][x(310)](x(192))||($[x(149)]=!1,$[x(274)].backgroundColor=FGSECOMAPP[x(587)]?.gift_slider?.[x(140)]?.[x(563)]??"#7367f0")}),!1}return await V([e(278),...x.slice(1)]),await _(x,r),new Response(JSON[e(600)](r))}if(!(x[0].includes("/cart/change")||x[0][e(538)](e(481))))return setTimeout(function(){$n()},1e3),await t(...x);{i(x[1]);let n=200,s=await t(...x)[e(349)]($=>{let x=e;return n=$[x(445)],$.json()});if(x[1][e(527)]?.sca_process_gifts&&200!==n)return!1;if(await V([x[0].includes(e(573))?e(573):e(481),...x[e(283)](1)]),x[1]?.[e(527)]?.sca_process_gifts)return new Response(JSON[e(600)](s));let l=await t("/cart.js").then($=>{let x=e;return $[x(415)]()});return await _(x,s,l),new Response(JSON.stringify(l))}}catch(f){return await t(...x)}})};FGSECOMAPP[_0x5c4574(533)]=()=>{let $=_0x5c4574;try{if(Shopify?.disableShopify_getCart||typeof Shopify?.getCart!==$(286))return;Shopify[$(385)]=async function(x){let e=$;if(!FGSECOMAPP[e(501)]){FGSECOMAPP[e(501)]=!0,await V(e(382));let t=await fetch(e(382),{method:e(320),headers:{Accept:e(281),sca_fetch:e(592),"Content-Type":e(281)}});typeof x===e(286)&&(0>FGSECOMAPP.fgCallback[e(516)](x)&&FGSECOMAPP[e(282)].push(x),x(await t[e(415)]())),FGSECOMAPP[e(501)]=!1}FGSECOMAPP[e(427)]()},typeof ShopifyAPI!==$(147)&&void 0!==ShopifyAPI[$(385)]&&(ShopifyAPI[$(385)]=Shopify?.[$(385)]),void 0!==Shopify?.[$(158)]&&typeof Shopify?.[$(158)].getCart!==$(147)&&(Shopify[$(158)][$(385)]=Shopify?.[$(385)])}catch(x){console[$(379)](x)}};let i=$=>{let x=_0x5c4574;try{let e=$?.body;e instanceof FormData?FGSECOMAPP[x(531)]={sections:e[x(132)](x(586)),sections_url:e[x(132)](x(130))}:"string"==typeof e&&(e=JSON.parse(e),FGSECOMAPP[x(531)]={sections:e?.[x(586)],sections_url:e?.[x(130)]})}catch(t){FGSECOMAPP[x(531)]={}}},r=async()=>{let $=_0x5c4574;if(!g(FGSECOMAPP.arrOfferAdded)){let x=[$(145)];for(let e of FGSECOMAPP[$(513)]){let a=FGSECOMAPP[$(183)][$(215)](x=>x.id===e[$(392)])?.sub_conditions?.[$(262)];g(a)||x[$(360)](a)}let i={freegift_attributes:x[$(315)]()};try{await t($(481),{method:"POST",headers:{"X-Requested-With":$(241),"Content-Type":$(428)},body:JSON.stringify({attributes:i})})}catch(r){console[$(379)]("Update cart.attributes "+r[$(363)])}}},_=async($,x,e)=>{let a=_0x5c4574;try{if($[1]?.[a(527)]?.[a(494)])return;let i={},r=Object[a(324)](x[a(586)]??{})?.[a(543)]($=>g(FGSECOMAPP[a(531)][$]))??[];if(r&&r[a(190)]&&FGSECOMAPP[a(537)]&&(i=await t("/?sections="+r[a(167)](",")).then($=>$.json())),FGSECOMAPP.isUpdateCart=!1,i={...FGSECOMAPP[a(531)],...i},g(i))return;x.sections={...x[a(586)],...i},g(e)||(e[a(586)]={...x.sections})}catch(_){}},c=async($,x,e)=>{let t=_0x5c4574;e=e?.[t(315)]();let a=document[t(517)]("#fg-gift-items .btn-add-to-cart");a[t(270)](x=>{let e=t;x.disabled=!0;let a=x[e(206)]("data-variant")-0;a===$&&(x.style[e(477)]=e(307),x[e(243)]=e(419)),x[e(274)][e(542)]="#82868b"});let i=FGSECOMAPP[t(513)].find(x=>e===x[t(392)]?.[t(315)]()&&$===x.variantId);i?i[t(280)]+=x:FGSECOMAPP[t(513)].unshift({variantId:$,belongs_to_offer:e,quantity:x}),localStorage.setItem("sca_offers_added",LZString[t(565)](JSON[t(600)](FGSECOMAPP[t(513)])));let r=await fetch(t(350),{method:t(300),headers:{Accept:t(281),"Content-Type":t(281),sca_add_gift:t(153)},body:JSON[t(600)]({quantity:x,id:$})}),_=await r[t(415)]();if(r.ok)return a.forEach(x=>{let e=t;x[e(149)]=!0;let a=x[e(206)](e(348))-0;a===$&&(x.style[e(477)]="6px 0",x.innerHTML=e(422)),x[e(274)][e(542)]=""}),Z(),_},o=$=>{let x=_0x5c4574,e=x(193);return!g($)&&(typeof $===x(344)&&($[x(457)]?.includes(e)||$[x(339)]?.[x(538)](x(248)))||typeof $===x(210)&&$.includes(e))},n=async($,x)=>{let e=_0x5c4574;try{if(g($)&&g(x))return;let t={};if(FGSECOMAPP.cartItems?.[e(543)]($=>o($))?.forEach($=>{let x=e;t[$[x(212)]]=$[x(280)]}),($=$?.[e(543)]($=>!g($[e(212)])))?.forEach($=>{let x=e;t[$[x(212)]]=(t[$[x(212)]]??0)+($[x(280)]??1)}),Object[e(324)](t)?.[e(270)]($=>{t[$]=t[$]>=0?t[$]:0}),g(Object.keys(t)))return;$?.[e(270)]($=>{let x=e,t=FGSECOMAPP[x(513)].find(e=>$.offer_id?.[x(315)]()===e.belongs_to_offer?.[x(315)]()&&$[x(212)]===e[x(461)]);t?t[x(280)]+=$[x(280)]:FGSECOMAPP[x(513)].unshift({variantId:$[x(212)],belongs_to_offer:$.offer_id?.[x(315)](),quantity:$[x(280)]})}),localStorage.setItem(e(413),LZString[e(565)](JSON[e(600)](FGSECOMAPP[e(513)]))),FGSECOMAPP[e(537)]=!0,await fetch(e(481),{method:e(300),headers:{Accept:e(281),"Content-Type":e(281),sca_process_gifts:!0},body:JSON[e(600)]({updates:t,...FGSECOMAPP[e(531)]})})[e(349)](t=>{let a=e;return t.ok&&$[a(190)]&&!x[a(190)]&&Z(),t[a(415)]()})[e(349)]($=>{let x=e;FGSECOMAPP[x(531)]=$[x(586)]}),document[e(332)]("#secomapp_freegifts_version")?.[e(206)](e(268))===e(181)&&location.reload()}catch(a){console[e(379)](a)}},s=0,l=()=>{let $=_0x5c4574,t=document[$(157)]($(522));if(t)t[$(243)]=$(226)+(FGSECOMAPP[$(361)][$(131)]??$(218))+$(362)+x()+$(444);else{let a=localStorage[$(335)]($(170))-0,i=FGSECOMAPP[$(587)]?.[$(370)]?.[$(328)]??{},r=(i?.[$(322)]??0)*6e4,_=!isNaN(a)&&a+r>Date[$(416)]();if(_||(localStorage.removeItem($(170)),!(t=document[$(157)]($(572)))))return;t[$(243)]=$(411)+(FGSECOMAPP.fgAppearanceGiftSlider[$(131)]??$(218))+$(604)+e()+$(371)+x()+$(484),t[$(420)].add("sca-is-visible-fg"),s++}},f=($,x)=>{let e=_0x5c4574;return $.map($=>e(150)+($.thumbnail??x)+'" id="'+$[e(552)]+e(384)+$[e(166)]+e(151)+d($)+'"\n data-original-price="'+u($[e(399)],$[e(166)],$[e(358)]??0)+e(528)+$[e(269)]+e(404))[e(167)](" \n")},d=$=>{let x=_0x5c4574;return FGSECOMAPP[x(605)][x(221)](v($?.price))},u=($,x,e)=>{let t=_0x5c4574;e=v(e);let a=g(Shopify?.products[$])?null:Shopify?.products[$],i=a?.[t(143)],r=i&&Array[t(395)](i)&&i[t(190)]>0?i[0].price??a?.[t(560)]??100*e:100*e;return x&&(r=a?.[t(143)]?.find($=>x===$.id)?.[t(560)]??r),FGSECOMAPP[t(605)].format(r/100)},b=($,x)=>{let e=_0x5c4574;return g(Shopify?.products[$])?x??"#":Shopify?.[e(608)][$][e(457)]},p=($,x)=>{let e=_0x5c4574;if(FGSECOMAPP.fgAppearanceGiftSlider.show_product_title)return g(Shopify?.[e(608)][$])?x[e(437)]("\xbb","")[e(437)](/\(\d*% off\)/,"")??"":Shopify?.[e(608)][$][e(308)]},g=$=>{let x=_0x5c4574;if(0===$)return!0;if(typeof $==x(176)||typeof $==x(227))return!1;if(typeof $==x(147)||null===$)return!0;if(typeof $[x(190)]!=x(147))return 0===$.length;let e=0;for(let t in $)$[x(401)](t)&&e++;return 0===e},h=$=>{let x=_0x5c4574;try{let e={...FGSECOMAPP[x(559)]},t=e[$];if(t=t?t.trim():null,!g(t)&&t[x(190)]>0)try{return document[x(332)](t),", "+t}catch(a){}return""}catch(i){return""}},m=()=>{let $=_0x5c4574;try{FGSECOMAPP[$(605)]=new Intl[$(549)](Shopify?.[$(323)]??Shopify?.[$(546)],{style:$(471),currency:Shopify?.[$(471)]?.[$(512)]??"USD"})}catch(x){FGSECOMAPP[$(605)]=new Intl[$(549)]("en-US",{style:$(471),currency:Shopify?.[$(471)]?.[$(512)]??"USD"})}},v=$=>{let x=_0x5c4574;$=$??0;let e=Shopify?.[x(471)]?.rate??1;return 1===parseFloat(e)?$:($*e).toFixed(Shopify?.[x(472)]??2)},y=$=>{let x=_0x5c4574;return $.filter($=>void 0===$[x(490)]||!0===$.cal_gift_for_other_rules)[x(207)](($,e)=>$+e[x(280)]*(e[x(374)]??e[x(560)]),0)/100},w=$=>{let x=_0x5c4574;return $[x(543)]($=>void 0===$[x(490)]||$.cal_gift_for_other_rules).reduce(($,e)=>$+e[x(280)],0)},k=($,x)=>{let e=_0x5c4574,t=x[e(569)];return g(t)?$:$[e(543)]($=>{let x=e;return!t[x(238)](e=>{let t=x;switch(e[t(342)]){case t(225):return Object[t(164)](e.value)[t(238)]($=>$[t(580)])[t(197)]()[t(238)]($=>$.id)[t(538)]($[t(212)]);case"product_types":return Object[t(324)](e[t(594)])[t(538)]($[t(429)]);case t(426):return Object[t(324)](e[t(594)])[t(538)]($[t(327)]);case t(519):let a=Object[t(324)](e[t(594)]),i=$[t(156)]?.map($=>$.id+"")?.filter($=>a[t(538)]($));return!g(i);default:return!1}})[x(538)](!1)})},A=($,x)=>{let e=_0x5c4574;return $?.[e(238)]($=>{let t=e;if(typeof $[t(490)]!==t(147)){let a=FGSECOMAPP[t(513)]?.filter(x=>x[t(461)]===$[t(212)]),i=a?.[t(207)](($,x)=>$+x[t(280)],0);if(i===$[t(280)]){let r=FGSECOMAPP.arrOfferAdded?.[t(543)]($=>{let e=t;if($[e(392)]?.[e(315)]()===x[e(315)]())return!1;let a=FGSECOMAPP[e(183)]?.[e(215)](x=>x.id?.[e(315)]()===$[e(392)]?.[e(315)]()),i=a.gift_settings??{};return i[e(490)]&&100!==parseInt(i[e(354)])})?.[t(207)](($,x)=>$+x[t(280)],0);return{...$,cal_gift_for_other_rules:r>0,quantity:r??0}}return{...$,cal_gift_for_other_rules:!1,quantity:0}}return{...$}})??[]},C=($,x,e)=>{let t=_0x5c4574,a=0,i=k(x,$);i=A(i,$[t(466)]);let r;return"money"===$[t(366)]?r=y(i):$[t(366)]===t(266)&&(r=w(i)),r>=$[t(480)]&&(null===$[t(220)]||r<=$[t(220)])&&(a=e[t(259)],$[t(219)]&&(a=Math[t(380)](r/$.min_amount)*a)),a},S=($,x,e)=>{let t=_0x5c4574,a={},i=[],r=0;return x[t(238)](x=>{let a=t,_=C(x,$,e);0!==_&&(r=_),i[a(360)](_>0)}),a[t(128)]=r,a[t(389)]=i,a},T=($,x)=>{let e=!1;return 1===$.length?e=$[0]:2===$.length&&("and"===x&&(e=$[0]&&$[1]),"or"===x&&(e=$[0]||$[1])),e},q=($,x)=>{let e=_0x5c4574,t=$?.map($=>$[e(212)]);FGSECOMAPP[e(513)]=FGSECOMAPP[e(513)][e(543)]($=>t?.[e(538)]($[e(461)]));let a=x[e(267)].map($=>$[e(552)]),i=FGSECOMAPP[e(513)][e(543)]($=>$.belongs_to_offer?.[e(315)]()===x.id?.[e(315)]())?.[e(238)]($=>{let x=e;return $[x(461)]}),r=$[e(543)]($=>{let x=e;return o($)&&($[x(490)]=!1),a.includes($[x(212)])&&i[x(538)]($[x(212)])}),_=r[e(238)]($=>{let t=e,a=x[t(359)];$[t(490)]=a[t(490)],$.belongs_to_offer=x.id?.toString();let i=FGSECOMAPP[t(513)]?.filter(e=>e[t(392)]?.[t(315)]()!==x.id?.[t(315)]()&&$[t(212)]===e[t(461)])?.[t(207)](($,x)=>$+x.quantity,0);return{...$,quantity:$[t(280)]-i}});return _[e(543)]($=>{let t=e;return $[t(392)]?.[t(315)]()===x.id?.[t(315)]()})},E=$=>{let x=_0x5c4574,e=$[x(191)][x(543)](e=>e[x(392)]?.[x(315)]()!==$.id?.toString())[x(238)]($=>$[x(507)]);return Object.values($[x(553)])[x(543)]($=>!e[x(538)]($.product_shopify_id))},I=($,x)=>{let e=_0x5c4574,t=q($,x),a=S($,x.offer_conditions,x[e(359)]),i=T(a[e(389)],x[e(263)]);if(i){let r=t[e(543)]($=>$[e(392)]?.[e(315)]()===x.id?.toString())[e(207)](($,x)=>$+x[e(280)],0);a[e(128)]=a[e(128)]-r,x[e(191)]=t,x[e(443)]=a[e(128)]}else x[e(191)]=t,x.giftsAvailable=0;return typeof FGSECOMAPP[e(511)]===e(176)&&x[e(544)]>FGSECOMAPP[e(511)]&&(i=!1),i||!x[e(285)]||FGSECOMAPP[e(511)]!==x[e(544)]||g(t)||(FGSECOMAPP.maxOfferPriority=null),x[e(368)]=i,x[e(285)]&&i&&(null==FGSECOMAPP.maxOfferPriority||x[e(544)]<=FGSECOMAPP[e(511)])&&FGSECOMAPP[e(511)]!==x[e(544)]&&(FGSECOMAPP[e(511)]=x.priority),x},L=$=>{let x=_0x5c4574,e=$+"=",t=decodeURIComponent(document.cookie)[x(566)](";");for(let a=0;a{let e=_0x5c4574,t=!0,a=!0,i=!0;if(!g($[e(515)]?.[e(262)])){let r=L(e(463));t=r&&JSON.parse(r)[e(538)]($.sub_conditions[e(262)])}if(!g($[e(515)]?.[e(373)])){let{customer_tags:_}=$[e(515)],c=_?.[e(607)]?.[e(547)]($=>x[e(421)][e(339)]?.[e(538)]($));a=_?.type_customer_tags===e(319)?c:!c}if(!g($[e(515)]?.[e(473)])){let o=!0,n=$[e(515)][e(473)],s=x[e(421)][e(488)]??[];if(n[e(134)]){let l=Date[e(261)](n.order_created_from)/1e3;s=s.filter($=>$.created_at>=l)}if(!g(n?.totarrCustomerOrderal_spend_on_order_history)&&(0!==n[e(441)][e(480)]||0!==n[e(441)][e(220)])){let f=n.total_spend_on_order_history[e(480)],d=n[e(441)].max_amount,u=s[e(207)](($,x)=>$+x[e(136)],0)/100;o&=(u>=f||!f)&&(u<=d||!d)}if(!g(n?.[e(482)])&&(0!==n.total_spent_on_last_order.min_amount||0!==n[e(482)][e(220)])){let b=x[e(421)].last_total/100,p=n[e(482)][e(480)],h=n[e(482)][e(220)];o&=(b>=p||!p)&&(b<=h||!h)}if(!g(n?.number_of_order)){let m=!(0!==n.number_of_order[e(480)]||0!==n.number_of_order[e(220)]),v=s[e(190)],y=n[e(301)][e(480)],w=n[e(301)][e(220)];o&=m?g(s):(v>=y||!y)&&(v<=w||!w)}if(n?.[e(467)]){let k=x[e(421)].freegifts??[],A=$[e(267)]?.some($=>k[e(538)]($[e(552)]))||$[e(267)]?.[e(547)]($=>k[e(538)]($[e(166)]+"_"+($.original_price-$[e(560)])*100));o&=!A}i=o}return t&&a&&i},G=($,x,e)=>{let t=_0x5c4574,a=[],i=[],r=[],_=[];for(let c of x){let n=I($,c);if(!n[t(368)]){n[t(191)][t(190)]>0&&n[t(191)][t(270)]($=>{let x=t;i[x(360)]({variant_id:$.variant_id,quantity:$.quantity,offer_id:c.id})});continue}if(n.giftsAvailable<0){n[t(191)][t(270)]($=>{let x=t;i[x(360)]({variant_id:$[x(212)],quantity:$[x(280)],offer_id:c.id})});continue}0!==n.giftsAvailable&&(c[t(515)]?P(c,SECOMAPP)&&a[t(360)](c):a[t(360)](c))}if($?.[t(270)]($=>{let x=t;g($[x(392)])&&o($)&&i.push({variant_id:$[x(212)],quantity:$[x(280)],offer_id:$[x(392)]?.[x(315)]()})}),e||g(i)){let s=a[t(238)]($=>{let x=t;return{id:$.id,offerName:$[x(179)],offerPriority:$.priority,stopLowerPriority:$[x(285)],gifts:E($),giftsAvailable:$[x(443)],giftsAdded:$[x(191)],isReachConditions:$.isReachConditions}});if(!g(s)){let l={};for(let f of s){let d=M(FGSECOMAPP.fgSettings,f);d?.[t(190)]>0?r=r[t(535)]([...d]):f[t(182)][t(238)]($=>{let x=t;l[$[x(299)]]={...$,belongs_to_offer:f.id?.toString()}})}_=Object[t(164)](l)??[]}}return{arrGiftsAdd:r,arrGiftsRemove:i,arrGiftsData:_}},j=($,x)=>{let e=_0x5c4574,t=new Set;return $?.[e(270)]($=>t[e(601)]($[e(466)])),t[e(270)]($=>{let x=e,t=FGSECOMAPP[x(183)]?.[x(215)](e=>e.id?.toString()===$?.[x(315)]());if(g(t)||!t[x(368)]){FGSECOMAPP.arrOfferAdded=FGSECOMAPP[x(513)]?.[x(543)](e=>e.belongs_to_offer?.toString()!==$?.[x(315)]());return}if(t.giftsAvailable>=0)return;let a=[],i=FGSECOMAPP[x(513)]?.[x(543)](e=>e[x(392)]?.[x(315)]()===$?.toString())??[];if(t?.[x(359)]?.[x(255)])a=a.concat([...i]),t[x(443)]=0;else for(let r of i){if(t[x(443)]>=0)break;t[x(443)]+=r[x(280)],t.giftsAvailable<=0?a.push({...r}):(r[x(280)]=t[x(443)],t[x(443)]=0)}a?.[x(270)]($=>{let e=x;FGSECOMAPP[e(513)]=FGSECOMAPP[e(513)]?.filter(x=>$.variantId!==x.variantId||$[e(392)]?.toString()!==x[e(392)]?.[e(315)]())})}),x?.[e(543)]($=>{let x=e;return o($)&&($[x(280)]=FGSECOMAPP[x(513)]?.[x(543)](e=>$[x(212)]===e.variantId)?.[x(207)](($,e)=>$+e[x(280)],0)??0),$[x(280)]>0})??[]},F=async($,x)=>{let e=_0x5c4574,{arrGiftsAdd:t,arrGiftsRemove:a,arrGiftsData:i}=G($,x,!1),_=j(a,$);if(!g(a)){let c=G(_,x,!0);j(c?.[e(435)],$),t=c?.[e(353)],a=a?.[e(535)](c?.[e(435)])??[],i=c?.[e(526)]}return await n(t,a),await r(),i},M=($,x)=>{let e=_0x5c4574,t=[];if($[e(377)]){let a=x[e(182)],i=a.reduce(($,x)=>$+x[e(143)].length,0),r=FGSECOMAPP[e(183)].filter($=>$.id===x.id),_=r[0][e(359)][e(255)],c=r[0][e(168)];if(1===i||_||c.status){if($[e(585)]&&!D(a)||$?.compare_gift_price_with_product&&!N(a))return!1;if(c[e(445)]){if(c[e(342)]===e(580)){let o=FGSECOMAPP[e(571)];o=o[e(543)]($=>{let x=e;return $[x(507)]===a[0][x(399)]});let n=a[0][e(143)][e(543)]($=>{let x=e;return o[0][x(212)]===$[x(166)]})[0];if(0===n.price&&100===parseInt(n[e(354)]))return t.push({variant_id:n[e(552)],quantity:x[e(443)],offer_id:x.id}),t}else if(_){let s=a?.[e(207)](($,x)=>($+x?.[e(143)]?.[e(190)])??0,0);if(!s)return!1;let l=(x?.giftsAvailable??0)/s;for(let f of a)for(let d of f[e(143)])t[e(360)]({variant_id:d.variant_shopify_id,quantity:l,offer_id:x.id});return t}}else{if(_){let u=a?.[e(207)](($,x)=>($+x?.[e(143)]?.length)??0,0);if(!u)return!1;let b=(x?.giftsAvailable??0)/u;for(let p of a)for(let g of p[e(143)])t[e(360)]({variant_id:g[e(552)],quantity:b,offer_id:x.id});return t}{let h=a[0].variants[0];if(0===h[e(560)]&&100===parseInt(h.discount_percentage))return console.log("auto add gift: "+a[0][e(143)][0].variant_shopify_id+" "+a[0][e(143)][0][e(269)]),t[e(360)]({variant_id:h[e(552)],quantity:x.giftsAvailable,offer_id:x.id}),t}}}}return!1},O=$=>{let x=_0x5c4574;return $===x(505)},H=$=>{let x=_0x5c4574,e=$;if("by_variants"===FGSECOMAPP[x(361)][x(208)])for(let t of(e=[],$)){let a=t[x(143)];a&&a[x(190)]&&a.forEach($=>e[x(360)]({...t,thumbnail:$.thumbnail,variants:[$]}))}let i=document.getElementById("fg-gift-items");i&&(i.innerHTML=e[x(238)]($=>{let e=x,t=$?.[e(143)][0]??{};return e(228)+b($[e(399)],$[e(186)])+e(213)+$[e(254)]+e(351)+p($[e(399)],$.title)+e(235)+(FGSECOMAPP[e(361)].show_gift_for_customer===e(406)&&FGSECOMAPP[e(361)][e(450)]?e(174)+(1===$[e(143)][e(190)]?e(240)+(O(t[e(269)])?e(584):"")+e(597)+t.variant_title+e(465):e(346)+(FGSECOMAPP[e(361)][e(313)]??e(548))+e(305))+"\n
":"")+e(452)+u($[e(399)],t?.[e(166)],t?.[e(358)])+'\n \n '+d(t)+"\n \n "+(FGSECOMAPP[e(361)].show_gift_for_customer!==e(406)?'\n
\n '+(1===$[e(143)][e(190)]?'
'+t[e(269)]+e(305):''+(FGSECOMAPP.fgAppearanceGiftSlider[e(313)]??e(548))+"")+e(412)+f($[e(143)],$.thumbnail)+e(314):"")+e(343)+$[e(392)]+e(555)+(1===$[e(143)][e(190)]?t[e(552)]:"")+e(325)+(FGSECOMAPP[e(361)][e(256)]??e(525))+e(252)})[x(167)](" \n"),new Glider(document.querySelector("#fg-gift-items"),{slidesToShow:1,slidesToScroll:1,draggable:!1,dots:FGSECOMAPP.fgAppearanceGiftSlider[x(293)]?x(144):null,arrows:{prev:x(502),next:x(434)},responsive:[{breakpoint:1024,settings:{slidesToShow:FGSECOMAPP.fgAppearanceGiftSlider.number_product_slider??4,slidesToScroll:1}},{breakpoint:768,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:576,settings:{slidesToShow:2,slidesToScroll:1}}]}))},R=()=>{let $=_0x5c4574;try{let x=window[$(337)]?.[$(183)]??[];for(let e in Shopify?.[$(608)])g(Shopify?.[$(608)][e]?.id)&&delete Shopify?.[$(608)][e];let t=[];return x[$(270)](x=>{let e=$,a=JSON.parse(JSON[e(600)](x));if(x[e(168)][e(445)]){let i=x[e(178)][0][e(569)],r=i[0][e(594)],_=[...a.gift_items],c=[...a[e(553)]];if(x[e(168)][e(342)]===e(580))for(let o in r){let n=r[o]?.variant??[];for(let s of n){a[e(178)][0].product_narrow=[{type:i[0][e(342)],value:{[o]:{...r[o],variant:[{...s}]}}}],a[e(267)]=_[e(543)]($=>$[e(399)]+""===o&&s.id===$[e(166)]),a[e(553)]=c[e(543)]($=>$[e(399)]+""===o),a.gift_products[0].variants=[...a[e(267)]];let l=a[e(359)].number_of_gift_can_receive,f=a[e(359)][e(255)];a.gift_settings[e(255)]&&(l=a[e(267)].length),1===a[e(267)][e(190)]&&0===a.gift_items[0][e(560)]&&(f=!0),t[e(360)](JSON[e(261)](JSON[e(600)]({...a,gift_settings:{...a[e(359)],number_of_gift_can_receive:l,auto_add_all_gifts:f},id:a.id+"_"+r[o][e(457)]+"_"+s.id})))}}else if(x[e(168)][e(342)]===e(558))for(let d in r){a[e(178)][0].product_narrow=[{type:i[0][e(342)],value:{[d]:r[d]}}],a[e(267)]=_[e(543)]($=>$[e(399)]+""===d),a[e(553)]=c[e(543)]($=>$[e(399)]+""===d);let u=a.gift_settings[e(259)],b=a.gift_settings.auto_add_all_gifts;a[e(359)][e(255)]&&(u=a[e(267)][e(190)]),1===a[e(267)][e(190)]&&0===a[e(267)][0][e(560)]&&(b=!0),t[e(360)](JSON.parse(JSON[e(600)]({...a,gift_settings:{...a.gift_settings,number_of_gift_can_receive:u,auto_add_all_gifts:b},id:a.id+"_"+r[d].handle})))}}}),(x=(x=(x=x?.filter(x=>!x?.[$(168)]?.[$(445)])?.[$(535)](t))?.map($=>({...$,id:$.id.toString()})))?.[$(543)](x=>{let e=$;if(!W(x[e(583)],x[e(223)]))return!1;let t=!g(x.sub_conditions?.customer_order_history||x[e(515)]?.[e(373)]);if(x[e(515)]&&(!P(x,SECOMAPP)||t&&g(SECOMAPP[e(421)][e(356)])))return!1;let a={...Shopify?.[e(608)]},i=!1;if(FGSECOMAPP[e(408)][e(375)]===e(541)){x[e(267)]=x?.[e(267)][e(543)]($=>{let x=e,t=a[$.original_product_shopify_id]?.[x(514)]??{};return t[$[x(166)]]>0})??[];let r=x.gift_items?.map($=>$[e(552)]);x.gift_products=x?.[e(553)]?.[e(543)]($=>{let x=e;return $.variants=$?.[x(143)]?.[x(543)]($=>{let e=x;return r?.[e(538)]($[e(552)])}),$?.variants?.[x(190)]>0}),i=!0}else if(FGSECOMAPP.fgSettings[e(205)]){x.gift_items=x?.[e(267)][e(543)]($=>{let x=e,t=a[$[x(299)]]?.variants_quantity??{};return t[$[x(552)]]>0});let _=x[e(267)]?.[e(238)]($=>$[e(552)]);x.gift_products=x?.gift_products?.[e(543)]($=>{let x=e;return $[x(143)]=$?.[x(143)]?.[x(543)]($=>{let e=x;return _?.[e(538)]($[e(552)])}),$?.[x(143)]?.length>0}),i=!0}return i&&x.gift_settings?.auto_add_all_gifts&&(x[e(359)][e(259)]=x[e(267)]?.[e(190)]),!i||x[e(267)]&&x[e(267)][e(190)]>0}))?.[$(238)](x=>{let e=$,t=x[e(267)][e(238)]($=>$[e(399)]);return x[e(553)]=x[e(553)]?.[e(543)]($=>{let x=e;return t[x(538)]($[x(399)])}),x[e(178)]?.[e(270)]($=>{let x=e;"money"===$.unit&&($[x(480)]=v($[x(480)]),$[x(220)]=g($[x(220)])?$[x(220)]:v($.max_amount))}),x})}catch(a){return console[$(379)](a),[]}},D=$=>{let x=_0x5c4574;for(let e of FGSECOMAPP[x(571)]){let t=e[x(507)];if($[0][x(399)]===t)return!1}return!0},N=$=>{let x=_0x5c4574;for(let e of FGSECOMAPP.cartItems){let t=$[0][x(143)][0][x(358)];if(FGSECOMAPP[x(408)][x(133)]===x(237)&&(t=$[0][x(143)][0][x(188)]),t>e[x(560)]/100)return!1}return!0},B=async()=>{let $=_0x5c4574;try{let x=[];window[$(337)]?.offers?.forEach(e=>{let t=$,a=[];e.gift_products[t(270)]($=>{let x=t;a[x(360)]($[x(279)],$[x(186)])}),x=[...x,...a]}),await $o(x=(x=[...new Set(x)])[$(543)](x=>g(FGSECOMAPP[$(196)][x]))),Object[$(164)](FGSECOMAPP[$(196)])?.forEach(x=>{let e=$,{info:t}=x;g(t)||g(t?.id)||(Shopify[e(608)][t.id]={...t})})}catch(e){console.error(e)}},U=async $=>{let x=_0x5c4574;m(),FGSECOMAPP.fetchCheckoutEvents(),FGSECOMAPP?.[x(408)]?.sync_quantity===x(541)||FGSECOMAPP?.[x(408)]?.[x(205)]?await B():B()[x(349)](),FGSECOMAPP.offers=R(),FGSECOMAPP[x(533)](),a();try{g($)?(FGSECOMAPP.arrOfferAdded=[],localStorage.setItem(x(413),LZString[x(565)](JSON[x(600)](FGSECOMAPP[x(513)])))):FGSECOMAPP[x(513)]=JSON[x(261)](LZString[x(391)](localStorage[x(335)](x(413))))}catch(e){FGSECOMAPP[x(513)]=[],localStorage[x(224)](x(413),LZString.compressToBase64(JSON.stringify(FGSECOMAPP[x(513)])))}let t={};FGSECOMAPP[x(183)]?.[x(270)]($=>{let e=x;t[$.id]=$?.[e(267)]?.[e(238)]($=>$[e(552)])});let i=Object[x(324)](t);FGSECOMAPP[x(513)]=FGSECOMAPP.arrOfferAdded?.[x(543)]($=>i?.[x(538)]($[x(392)]?.[x(315)]())&&t[$[x(392)]?.[x(315)]()][x(538)]($[x(461)]));let r={};FGSECOMAPP[x(513)]?.[x(270)]($=>{let e=x,t=r[$.belongs_to_offer+"_"+$[e(461)]]??{};r[$[e(392)]+"_"+$[e(461)]]={...$,belongs_to_offer:$[e(392)]?.[e(315)](),quantity:(t?.[e(280)]??0)+($?.quantity??0)}}),FGSECOMAPP[x(513)]=Object.values(r),localStorage[x(224)](x(413),LZString.compressToBase64(JSON[x(600)](FGSECOMAPP[x(513)])));let _=await F($,FGSECOMAPP[x(183)]);await X(_),$s(),$l(),$n()},z=function(){let $=_0x5c4574,x=document.querySelectorAll("[data-open]"),t=document.querySelectorAll($(591)),a=$(493),i=document[$(517)]($(290)),r=i[$(190)];for(let _=0;_{let t=$;x[t(503)]===document[t(332)](t(431))&&(document[t(332)](t(431))[t(420)].remove(a),e())}),document[$(376)]("keyup",x=>{let t=$;x[t(311)]===t(163)&&document[t(332)](t(431))&&(document[t(332)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg")[t(420)][t(245)](a),e())}),document[$(517)]($(447))[$(270)](x=>x[$(376)]($(551),function(){let x=$;this[x(232)](x(139),1),this[x(372)](),this.classList[x(292)](x(512)),this[x(332)](".dropdown-menu")[x(420)][x(292)](x(352))})),document[$(517)]($(447))[$(270)](x=>document[$(376)]("click",function(e){let t=$,a=x[t(310)](e[t(503)]);a||(x.classList[t(245)](t(512)),x.querySelector(t(433))[t(420)][t(245)](t(352))),document[t(517)](t(410)).forEach($=>{let x=t;$[x(149)]=!0,$[x(274)][x(542)]=x(564)})})),document[$(517)]($(581))[$(270)](x=>{let e=$;x[e(376)](e(551),function(){let $=e,x=this[$(206)]("id"),t=this[$(206)]("data-img"),a=this.getAttribute($(161)),i=this[$(206)]($(469)),r=this[$(206)]($(297)),_=this[$(479)][$(479)].parentElement[$(479)];_[$(332)]($(216))[$(232)]($(331),t);let c=new URL(_[$(332)]($(336)).href);c[$(436)].set($(580),r),_[$(332)](".gift-original-url")[$(317)]=c[$(315)]();let o=this.parentElement.parentElement[$(479)];o[$(332)]($(554))[$(141)]=i,o[$(332)]($(540))[$(141)]=a;let n=o?.[$(332)](".btn-add-to-cart");n[$(232)]($(348),x),n[$(149)]=!1,n.style="";let s=this.parentElement[$(479)][$(332)]($(518));s[$(420)][$(601)]("active"),s[$(243)]=this[$(330)]})}),document[$(517)]("#fg-gift-items .btn-add-to-cart")[$(270)](x=>x[$(376)]($(551),async function(){let x=$,e=this[x(206)]("data-variant")-0,t=this.getAttribute(x(148));try{await c(e,1,t);let i=document[x(332)](x(431));i&&(FGSECOMAPP[x(453)]=!0,await new Promise($=>setTimeout($,800)),i[x(420)][x(245)](a)),window[x(338)][x(317)][x(538)](x(438))?location[x(341)]():typeof Shopify?.[x(385)]===x(286)&&await Shopify?.[x(385)](0===FGSECOMAPP[x(282)][x(190)]?function(){}:FGSECOMAPP[x(282)][0])}catch(r){console[x(379)](r)}}))},W=($,x)=>{let e=_0x5c4574;if($){let t=new Date,a=t[e(460)](),i=new Date($)[e(460)]();if(!x)return a>=i;{let r=new Date(x)[e(460)]();return a>=i&&a<=r}}return!1},X=async $=>{let x=_0x5c4574;if(FGSECOMAPP.fgSettings?.[x(596)])for(let e of FGSECOMAPP.cartItems)o(e)&&($=$[x(543)]($=>$[x(299)]!==e[x(507)]));if(FGSECOMAPP[x(408)]?.[x(585)])for(let t of FGSECOMAPP[x(571)])$=$.filter($=>$[x(399)]!==t[x(507)]);if(FGSECOMAPP[x(408)]?.[x(133)])for(let a of FGSECOMAPP[x(571)])$=$.filter($=>{let e=x,t=$.variants[0].original_price;return FGSECOMAPP[e(408)]?.compare_gift_price_with_product==="compare_at_price"&&(t=$.variants[0][e(188)]),t<=a[e(560)]/100});$&&$[x(190)]>0&&(FGSECOMAPP[x(453)]?(await new Promise($=>setTimeout($,1500)),FGSECOMAPP.isDelayShowAdded=!1,l(),H($)):(l(),H($))),z(),FGSECOMAPP[x(427)](),FGSECOMAPP[x(214)](FGSECOMAPP.offers),K=[]},Y=async $=>{let x=_0x5c4574;K=[];let e=window[x(338)][x(317)],a=await t(e,{method:x(320)});await a[x(475)]()[x(349)]($=>{let e=x,t=new DOMParser,a=t.parseFromString($,e(387)),i=e(347)+h(e(606)),r=e(567)+h(e(298)),_=document[e(332)](i),c=!1;_&&(c=!0,_[e(243)]=a[e(332)](i)?.[e(243)]??_[e(243)]);let o=document[e(332)](r);o||(o=document.querySelector("#shopify-section-header #cart-icon-bubble, .shopify-section.section-header #cart-icon-bubble")),o&&(c=!0,o.innerHTML=a[e(332)](r)?.[e(243)]??a[e(332)](e(195))?.[e(243)]??o[e(243)]),c||console.log("Can not fetch all body")}),typeof FGSECOMAPP?.reRenderCartCustom===x(286)&&await FGSECOMAPP[x(165)](),setTimeout(function(){X($)},800)},J=async()=>{let $=_0x5c4574;try{await t(SECOMAPP[$(203)],{method:"GET",headers:{"Content-Type":$(593)}})[$(349)](async x=>{let e=$,t=await x.json();FGSECOMAPP[e(571)]=t?.[e(276)]?.map($=>{let x=e;return{...FGSECOMAPP.cartItems?.[x(215)](x=>x.id===$.id),...$[x(558)],collections:$.collections,tags:$[x(339)]}})??[],FGSECOMAPP[e(449)]=t?.[e(271)]??{}})[$(440)](async x=>{let e=$;console[e(379)](e(180)+x[e(363)]);let a=await t("/cart.js",{method:"GET",headers:{Accept:e(281),"Content-Type":e(281)}}),i=await a.json(),r=i[e(464)];FGSECOMAPP[e(449)]=i,FGSECOMAPP[e(571)]=r?.[e(238)]($=>{let x=e;return{...FGSECOMAPP.cartItems?.[x(215)](x=>x.id===$.id),...$}})??[]})}catch(x){console[$(379)]($(334),x[$(363)]);let e=await t($(382),{method:$(320),headers:{Accept:$(281),"Content-Type":$(281)}}),a=(await e[$(415)]())[$(464)];FGSECOMAPP.cartItems=a?.[$(238)](x=>{let e=$;return{...FGSECOMAPP[e(571)]?.[e(215)]($=>$.id===x.id),...x}})??[]}},K=[],V=async $=>{let x=_0x5c4574;try{"/cart.js"===$?K[x(360)](x(508)):K[x(360)]($[0]),await J();let e=await F(FGSECOMAPP[x(571)],FGSECOMAPP[x(183)]);FGSECOMAPP[x(214)](FGSECOMAPP[x(183)]);let a=!1;$[0][x(222)](x(278))&&JSON[x(600)]($[1].headers??[])[x(538)](x(153))?(console[x(250)](x(487),[...K]),await Y(e),a=!0):$[0][x(222)]("/cart/update")&&JSON[x(600)]($[1].headers??[])[x(538)]("sca_process_gifts")&&(K[x(538)](x(278))||1===K[x(190)])?(console[x(250)](x(386),[...K]),await Y(e),a=!0):(console[x(250)](x(576),[...K]),await X(e)),a&&(window[x(338)][x(317)][x(538)](x(438))||"fg-checkout"===document[x(332)](x(211))?.getAttribute(x(268)))&&(K=[],location.reload());let i=await t(x(382),{method:x(320),headers:{Accept:"application/json","Content-Type":"application/json"}});return await i.json()[x(349)]($=>{let e=x;FGSECOMAPP[e(571)]=$[e(464)]?.map($=>{let x=e;return{...FGSECOMAPP.cartItems?.[x(215)](x=>x.id===$.id),...$}})}),FGSECOMAPP[x(571)]}catch(r){console.error(r)}},Z=()=>{let $=_0x5c4574;if(!Shopify?.[$(146)])return;let x=document[$(332)]($(247));if(!x)return;x[$(243)]="";let e=Shopify?.sca_text_notify_success??$(284),t=document[$(272)]("li");t[$(424)]=$(309),t[$(243)]=$(468)+e+$(137),x.appendChild(t),t[$(173)]=setTimeout(()=>Q(t),3e3),document.querySelector($(418))?.[$(376)]($(551),()=>Q(t))},Q=$=>{let x=_0x5c4574;$[x(420)][x(601)](x(478)),$.timeoutId&&clearTimeout($[x(173)]),setTimeout(()=>$[x(245)](),500)},$$=($,{value:x,innerHTML:e})=>{let t=_0x5c4574;try{let a=FGSECOMAPP[t(408)]?.mode_override_checkout,i=a===t(199)?$[t(503)]:$[t(234)]??$[t(503)];if(i?.[t(496)](t(459))||(i=document[t(332)]("#sca-spinner-checkout")?.[t(239)]),i[t(594)]=x,i[t(243)]=e,i.disabled=!1,i[t(497)]("click",$x),i[t(483)](t(459)),a===t(409)){i[t(239)][t(332)](t(184))[t(551)]();return}"trigger_body"===a&&window[t(497)]("click",$0,!0),i[t(551)]()}catch(r){window[t(338)][t(437)]((Shopify?.[t(200)]?.[t(316)]??"/")+t(201)),console[t(379)](r[t(363)])}},$x=async $=>{let x=_0x5c4574;try{$.preventDefault(),$[x(304)](),$[x(155)]();let e=FGSECOMAPP[x(408)]?.[x(556)],a=e===x(199)?$.target:$[x(234)]??$[x(503)],{form:i}=a,r="",_="";if(a&&(a[x(149)]=!0,r=a.innerHTML,_=a[x(594)],typeof FGSECOMAPP?.[x(417)]===x(286)?await FGSECOMAPP[x(417)](x(251)):(a[x(594)]=x(273),a[x(243)]=x(492))),FGSECOMAPP[x(498)])return!1;FGSECOMAPP[x(498)]=!0;try{await t(x(438),{method:x(300),body:new FormData(i)})}catch(c){console.log(x(236))}if(g(FGSECOMAPP[x(183)])&&g(FGSECOMAPP.cartItems?.[x(215)]($=>o($))))return console[x(250)](x(129)),$$($,{value:_,innerHTML:r}),!1;let n=await t(x(382),{method:x(320),headers:{Accept:"application/json","Content-Type":"application/json"}}),s=(await n.json())[x(464)];await J();let l=FGSECOMAPP[x(571)]?.[x(238)]($=>{let e=x;return{...s?.[e(215)](x=>x.id===$.id),collections:$[e(156)],tags:$[e(339)]}})??[],f=!1;for(let d of FGSECOMAPP.offers)if(d.giftsAdded&&d.giftsAdded[x(190)]){let u=I(l,d),b=W(d[x(583)],d.end_time);!b&&u[x(191)][x(190)]>0&&(f=!0),u[x(368)]||(f=!0),u[x(443)]<0&&(f=!0),d[x(515)]&&!P(d,SECOMAPP)&&(f=!0)}if(await F(l,FGSECOMAPP[x(183)]),f)location[x(341)]();else try{FGSECOMAPP.fgSettings.using_draft_order&&!g(FGSECOMAPP[x(571)]?.[x(215)]($=>o($)))?await t(SECOMAPP[x(203)]+x(260)+Shopify?.[x(423)],{method:"GET",headers:{"Content-Type":x(593)}})[x(349)](async $=>{let e=x,a=await $[e(415)]();a.cart=(a[e(276)]??[])[e(238)]($=>{let x=e;return $.product[x(156)]=$[x(156)]?.[x(238)]($=>({id:$.id})),$[x(558)][x(339)]=$[x(339)],{id:$[x(558)].id,variant_id:$[x(558)][x(212)],title:$.product.title,handle:$.product[x(457)],price:$.product[x(560)],quantity:$[x(558)].quantity,product_type:$[x(558)][x(429)],vendor:$[x(558)][x(327)],tags:$[x(558)][x(339)],collections:$[x(558)][x(156)]}}),a[e(582)]={arr_offer_added:FGSECOMAPP[e(513)],secomapp:{customer:SECOMAPP?.[e(421)]??{},fg_codes:SECOMAPP?.[e(306)]??[],fgSettings:FGSECOMAPP.fgSettings},cookie_fg_code:L(e(463)),shopify_currency:Shopify?.[e(471)]},await t(SECOMAPP.freegiftProxy+e(557)+LZString.compressToEncodedURIComponent(a=JSON[e(600)](a)),{method:e(320),headers:{"Content-Type":e(593)}})[e(349)](async $=>{let x=e,t=await $[x(415)]();try{FGSECOMAPP[x(498)]=!1,t[x(590)]&&(window[x(338)][x(317)]=t.sca_link_checkout[x(489)])}catch(a){console[x(379)](a)}})}):(console[x(250)](x(169)),FGSECOMAPP[x(498)]=!1,$$($,{value:_,innerHTML:r}))}catch(p){FGSECOMAPP.checkIsBlockCheckout=!1,$$(p,{value:_,innerHTML:r})}(a=e===x(199)?$[x(503)]:$.currentTarget??$[x(503)])&&(typeof FGSECOMAPP?.[x(417)]===x(286)?await FGSECOMAPP[x(417)](x(189)):(a.value=_,a[x(243)]=r),a.disabled=!1)}catch(h){typeof FGSECOMAPP?.[x(417)]===x(286)&&await FGSECOMAPP.scaCustomLoadingCheckout(x(189)),console.error(h)}},$0=async $=>{let x=_0x5c4574;$[x(503)]?.[x(496)]("sca_handle_checkout")&&await $x($)},$e=()=>{let $=_0x5c4574,x=FGSECOMAPP[$(408)]?.mode_override_checkout,e=".sca_handle_button_checkout, input[name='checkout'], button[name='checkout'], input[name='goto_pp'], button[name='goto_pp'], input[name='goto_gc'], button[name='goto_gc'], a[href$='checkout'], form[action='/checkout'] input[type='submit'], button.new_checkout_button, input[value='Checkout'], input[value='Checkout'], input[value='Check out'], input[value='Check Out'] a.checkout-link "+h("sca_fg_form_checkbox_button_query");document[$(517)](e)[$(270)](e=>{let t=$,a=e[t(496)](t(509)),i=e[t(496)](t(204)),r=e[t(496)](t(459));if(x===t(409)){if(a)return;if(!i&&!r){let _=e[t(246)](!0);_[t(376)]("click",$x),_[t(232)](t(459),""),_[t(232)](t(204),""),e.style[t(448)]=t(242),e[t(274)][t(357)]=t(275),e[t(274)][t(154)]="0",e[t(232)](t(509),""),e[t(239)]?.[t(491)](_)}i&&!r&&(e.addEventListener(t(551),$x),e[t(232)](t(459),""))}else x===t(199)?e[t(232)](t(459),""):r||(e[t(376)](t(551),$x),e[t(232)](t(459),""));FGSECOMAPP[t(289)]=!0}),x===$(199)&&window[$(376)]("click",$0,!0)};FGSECOMAPP.fetchCheckoutEvents=()=>{FGSECOMAPP.scaCountRenderEventCheckout=0;let $=setInterval(()=>{let x=_0x4121;$e(),FGSECOMAPP[x(532)]++,(FGSECOMAPP[x(532)]>10||FGSECOMAPP[x(289)])&&(FGSECOMAPP.scaCountRenderEventCheckout=0,clearInterval($))},400)};let $t=$=>{let x=_0x5c4574;try{let e={},t={},a=FGSECOMAPP.offers;if(g($)){$=[],g(Shopify?.current_product)||$[x(360)]({...Shopify?.[x(393)]});let i={...Shopify?.[x(462)],...Shopify?.current_collection?.[x(608)]};Object.values(FGSECOMAPP.productsInPage)?.filter($=>!g($[x(378)])&&(g($?.[x(536)])||$?.[x(536)]&&!$?.position?.[x(420)]?.[x(310)](x(369))))?.[x(270)]($=>{let e=x;i[$.info.id]={...$[e(378)]}}),$=$[x(535)]([...Object.values(i)])}for(let r in $?.[x(270)]($=>{let e=x,t=FGSECOMAPP.productsInPage[$[e(457)]];FGSECOMAPP[e(196)][$.handle]={...t,info:{...$},product_has_icon:!!g(a)&&void 0}}),a?.forEach(a=>{let i=x,r=a[i(178)];if(1===r[i(190)]&&r[0].unit===i(266)&&typeof r[0][i(219)]===i(227)){let _,c=r[0][i(569)];c?.[i(270)](x=>{let e=i;switch(x[e(342)]){case"variants_ids":_=Object[e(164)](x[e(594)]);break;case e(400):let t=Object.keys(x[e(594)]);t.length>0&&(_=(void 0===_?$:_)?.[e(543)]($=>t[e(538)]($.type))??[]);break;case e(426):let a=Object.keys(x.value);a[e(190)]>0&&(_=(void 0===_?$:_)?.[e(543)]($=>a[e(538)]($.vendor))??[]);break;case e(519):let r=Object[e(324)](x[e(594)]);r[e(190)]>0&&(_=(void 0===_?$:_)?.[e(543)]($=>{let x=e,t=$[x(156)]?.[x(238)]($=>$.id+""),a=t?.filter($=>r[x(538)]($));return!g(a)})??[])}}),_?.forEach($=>{let x=i,r=$[x(457)];if(e[r]){let _=e[r]?.[x(238)]($=>$[x(399)]),c=a[x(553)]?.filter($=>!_?.[x(538)]($.original_product_shopify_id));e[r]=e[r].concat(c)}else e[r]=a.gift_products;let o=$.variant?.[x(238)]($=>$.id)??[];t[r]=o[x(535)](t[r]??[]),t[r]=[...new Set(t[r])]})}}),e){let _=FGSECOMAPP[x(196)][r];FGSECOMAPP[x(196)][r]={..._,gifts_will_receive:[...e[r]],product_has_icon:!0,variants_has_gift:[...t[r]]}}return Object.entries(e)?.[x(190)]?e:{}}catch(c){return console.error(c),null}},$a=$=>{let x=_0x5c4574,e=FGSECOMAPP[x(381)][x(539)]??{},t="";e[x(294)]?.[x(445)]&&(t=x(291)+(e.gift_thumbnail?.[x(308)]??x(470))+x(287)+$?.[x(238)]($=>x(574)+b($[x(399)],$[x(186)])+'" target="_blank">\n
\n \n ').join("")+x(318)+($?.[x(190)]>=4?'\n
\xab\n
\xbb\n ':"")+x(500));let a=x(177)+h("sca_fg_btn_gift_thumbnail_query"),i=document[x(332)](a)??document[x(332)]("[type='submit'][name='add'], [type='button'][name='add'], [data-add-to-cart], [data-action='add-to-cart']");if(!i)return;i[x(239)].style[x(257)]="100%",i.parentNode[x(274)][x(138)]="auto",i[x(239)]?.[x(424)]?.includes(x(451))||i[x(239)]?.classList?.[x(601)](x(451));let r=i.parentNode.querySelector(x(231));if(r)r.innerHTML=t;else{(r=document[x(272)](x(570))).setAttribute("id",x(159));let _=new DOMParser()[x(455)](t,x(387));r[x(243)]=_[x(295)].innerHTML,i[x(239)][x(425)](r,i)}i.parentNode[x(425)](r,i);let c=document[x(332)](x(340));if(c)switch(e.gift_thumbnail?.[x(534)]){case"32":c[x(274)][x(364)]=x(321);break;case"50":c[x(274)].maxWidth=x(202);break;case x(523):c[x(274)][x(364)]=x(524);break;case x(312):c[x(274)][x(364)]=x(485);break;case x(562):c[x(274)][x(364)]=x(521);break;default:c[x(274)].maxWidth="60%"}if($?.[x(190)]>=4)new Glider(document[x(332)](".sca-list-gift-thumbnail"),{slidesToShow:3,slidesToScroll:1,draggable:!0,dots:x(367),arrows:{prev:x(302),next:x(160)}});else{c&&(c[x(274)].maxWidth="100%");let o=document[x(332)](x(506));o&&(o.style[x(448)]=x(520))}},$i=()=>{let $=_0x5c4574,x=FGSECOMAPP[$(381)].product_page??{},e="";x[$(589)]?.[$(445)]&&(e=$(598)+FGSECOMAPP.fgAppearanceGiftIcon[$(407)]+'" alt="free-gift-icon" class="sca-gift-icon-img" />\n ');let t=".fg-secomapp-product-title "+h($(456)),a=document.querySelector(t)??document[$(332)]($(405));if(!a)return;a[$(274)][$(383)]="relative",a.style[$(257)]=$(510),a.className?.includes("sca-fg-form-icon-product-page")||a.classList?.[$(601)]($(499));let i=a[$(332)]($(578));if(i)i[$(243)]=e;else{(i=document.createElement($(570)))[$(232)]("id",$(403));let r=new DOMParser()[$(455)](e,$(387));i[$(243)]=r[$(295)][$(243)],a[$(491)](i)}},$r=()=>{let $=_0x5c4574,x=[],e=".fg-secomapp-collection-img, .product-card, #product-grid .grid__item, .card-list .card-list__column, .cc-product-list .product-block, .collection-list.grid .grid__item, .collection-grid.grid .grid__item "+h($(458));return document.querySelectorAll(e)[$(270)](e=>{let t=$,a=e[t(332)]('a[href*="/products/"]'),i=a?.getAttribute(t(317))?.[t(566)]("/")??[],r=i?.[t(516)]("products"),_=r>=0?i[r+1]??null:null;if(_=_?.[t(566)]("?")?.[t(162)](),o(_)){e[t(245)]();return}let c=e[t(332)](t(258));if(c){e[t(245)]();return}if(g(_))return;let n=decodeURI(_);g(FGSECOMAPP[t(196)][n]?.[t(378)])&&x[t(360)](n),FGSECOMAPP[t(196)][n]={...FGSECOMAPP[t(196)][n],position:e}}),x},$_=$=>{Object.keys($)?.forEach($=>{let x=_0x4121,e=FGSECOMAPP[x(196)][$]?.[x(383)];if(!e)return;let t=FGSECOMAPP[x(381)][x(446)]??{},a="";t[x(445)]&&(a='\n
]+x(530)),e.style[x(383)]=x(568),e[x(424)]?.[x(538)](x(397))||e.classList?.[x(601)]()
{let x=_0x5c4574;await t(SECOMAPP[x(203)]+"&sca_products_handle="+LZString.compressToEncodedURIComponent(JSON[x(600)]($)),{method:x(320),headers:{"Content-Type":"application/liquid"}})[x(349)](async $=>{let e=x,t=await $.json(),a=[];t?.products?.[e(270)]($=>{let x=e;g($?.products?.id)||a.push({...$[x(608)],collections:$[x(156)],variants_quantity:$[x(514)]})});let i=$t(a);$_(i)}).catch($=>{let e=x;console[e(379)]($)})},$o=async $=>{let x=_0x5c4574,e=[];for(let[t,a]of $[x(175)]())g(FGSECOMAPP.productsInPage[a]?.info)&&e[x(360)](a),20===e.length&&(await $c([...e]),e=[]),t===$[x(190)]-1&&e.length>0&&(await $c([...e]),e=[])},$n=()=>{let $=_0x5c4574,x=$r(),e=$t();$_(e),$o(x)[$(349)]()},$s=()=>{let $=_0x5c4574;Shopify?.[$(198)]&&document[$(376)]($(430),function(){let x=$,e=new URL(document[x(185)]),t=parseInt(e[x(436)][x(132)](x(580)));$l(isNaN(t)?void 0:t)})},$l=$=>{let x=_0x5c4574;if(!location[x(317)].includes(x(414)))return;document.querySelector(x(578))?.[x(245)](),document.querySelector("#sca-gift-thumbnail")?.[x(245)]();let e=$t();if(g(e))return;let t=location[x(550)].split("/"),a=t?.[x(516)](x(608)),i=decodeURI(a>=0?t[a+1]??null:null);if(!Object.keys(e)?.[x(538)](i))return;let r=e[i],_=FGSECOMAPP[x(196)][i]?.[x(265)]??[];!(Shopify?.[x(198)]&&(!g($)&&!_[x(538)]($)||g($)&&!g(Shopify?.[x(393)]?.[x(333)])&&!_[x(538)](Shopify?.[x(393)]?.[x(333)]?.id)))&&($a(r),$i(r))};FGSECOMAPP.renderPromotionMessage=$=>{let x=_0x5c4574;try{g($)&&($=[...FGSECOMAPP[x(183)]]);let e=location.href.includes(x(438)),t=[];if($?.forEach($=>{let e=x;if($[e(368)]||g($[e(432)])||!g(FGSECOMAPP[e(511)])&&!$[e(368)]&&$[e(285)]&&$[e(544)]>FGSECOMAPP[e(511)])return;let a=$[e(432)];$.offer_conditions?.[e(270)]($=>{let x=e,t=k(FGSECOMAPP[x(571)],$);t=A(t,$[x(466)]);let i=0,r=null,_=0;$.unit===x(244)?(i=y(t),r=x(504),_=Shopify?.[x(187)]??2):"number_of_products"===$[x(366)]&&(i=w(t),r=x(603),_=0);let c=Math[x(402)]($[x(480)]-i,0)[x(171)](_);a=a[x(264)](r,c)}),t[e(360)](a)}),g(t)){document[x(517)](".sca-promotion-message-layout")[x(270)]($=>$.innerHTML="");return}let a="",i=x(394)+t?.[x(238)]($=>'
'+$+x(135))[x(167)]("")+"\n
";FGSECOMAPP[x(233)][x(253)]&&(a=i);let r=document[x(332)]("#MainContent, #mainContent, #main, .main-content"),_=r?.querySelector(x(545)),c=document[x(517)](x(442)+h(x(142))),o=document[x(517)](x(388));if(g(o)){(o=document[x(272)](x(570))).setAttribute("id","sca-promotion-message-layout"),o[x(420)][x(601)]("sca-promotion-message-layout");let n=new DOMParser()[x(455)](a,x(387));o[x(243)]=n.body[x(243)],g(c)?(n=new DOMParser()[x(455)](a,x(387)),o[x(243)]=n[x(295)][x(243)],r&&_&&e?_.prepend(o):r&&e&&r[x(454)](o)):c?.[x(270)]($=>{let e=x,t=o[e(246)](!0);$[e(454)](t)})}else o.forEach($=>$[x(243)]=a);try{document[x(517)](x(588))[x(270)]($=>{let x=new Glider($);(($,x)=>{let e=_0x4121,t=$.track[e(230)],a=null,i=1;function r(){a=setTimeout(()=>{i>=t&&(i=0),$.scrollItem(i++)},3e3)}$.ele[e(376)](e(599),function(){window.clearInterval(a),r()}),r()})(x,3e3)})}catch(s){console.error(s)}}catch(l){console[x(379)](l)}},U(FGSECOMAPP[_0x5c4574(571)])[_0x5c4574(349)]()}}catch($f){console.log("can not check freegifts version",$f)}function _0x4121($,x){let e=_0x43e6();return(_0x4121=function($,x){return e[$-=128]})($,x)}function _0x43e6(){let $=["fgSettings","clone_checkout",".btn-add-to-cart.sca-fg-out-stock",'","status","collection_page","#fg-gift-items .dropdown","display","SHOPIFY_CART","show_variant_title","sca-fg-form-thumbnail-product-page",'\n \n \n \n
\n
\n ',"isDelayShowAdded","prepend","parseFromString","sca_fg_title_product_gift_icon_query","handle","sca_fg_img_collection_gift_icon_query","sca_handle_checkout","getTime","variantId","other_products","sca_fg_codes","items"," \n ","offer_id","have_not_got_gift_from_this_offer",'
\n
\n \n \n
',"data-original-price","Free Gift","currency","fg_decimal","customer_order_history","data-version","text","hidden_brand_mark","padding","hide","parentElement","min_amount","/cart/update","total_spent_on_last_order","removeAttribute","\n ","80%","appearance","event add gift to cart from popup","orders","invoice_url","cal_gift_for_other_rules","appendChild",'
\n Loading...\n
',"sca-is-visible-fg","sca_process_gifts","settings","hasAttribute","removeEventListener","checkIsBlockCheckout","sca-fg-form-icon-product-page",'\n
\n
\n
\n ',"secomappGetCartRunning",".freegifts-main-container .glider-prev","target","{{sca_min_total}}","Default Title",".sca-list-gift-thumbnail","product_id","/cart/change.js","sca_root_checkout","fit-content","maxOfferPriority","active","arrOfferAdded","variants_quantity","sub_conditions","indexOf","querySelectorAll",".selected-variant","product_collections","flex","100%","freegifts-main-page-container","100","70%","Add to cart","arrGiftsData","headers",'">\n ',"159504IAHXeW",'" alt="free-gift-icon" class="sca-gift-icon-collection-img" />\n ',"sections_cart","scaCountRenderEventCheckout","initializeForXHR","size","concat","product_has_icon","isUpdateCart","includes","product_page",".gift-price","stop_offer","backgroundColor","filter","priority","cart-items, .cart-header, .section-header","locale","some","Select variant","NumberFormat","pathname","click","variant_shopify_id","gift_products",".original-price del",'"\n data-variant="',"mode_override_checkout","&data_checkout=","product","scaHandleConfigValue","price",'.btn-add-to-cart[data-variant="',"240","add_to_cart_btn_color","#82868b","compressToBase64","split",".fg-secomapp-cart-icon ","relative","product_narrow","div","cartItems","freegifts-main-popup-container","/cart/change",'\n \n
.dropdown-menu > li","others","start_time","sca-d-none","not_show_gift_if_already_on_cart","sections","fgAppearance",".sca-promotion-glider","gift_icon","sca_link_checkout","#freegifts-main-popup-container [data-close]","fetch_new_cart","application/liquid","value","78985HDqLwU","select_one_gift_price",'">\n ','\n
\n \n
\n\n
\n
\n \n
\n
\n \n
\n
\n \n ',"formatter","sca_fg_cart_drawer_query","value_customer_tags","products","max_gifts_can_get","not have orders and gifts","sections_url","gift_popup_title","get","compare_gift_price_with_product","order_created_from","","total_price",'\n \n \n \n \n ',"height","tabindex","color","textContent","sca_fg_main_promotion_message_query","variants",".dots","SECOMAPP_FREEGIFT","enable_toast_added","undefined","data-offer","disabled",'\n \n ',"entries","number",".fg-secomapp-handle-add-to-cart ","offer_conditions","offer_name","failed to parse cart section ","fg-checkout","gifts","offers","[sca_root_checkout]","URL","original_product_handle","sca_amount_fixed","original_compare_at_price","end","length","giftsAdded","sca-fg-out-stock","-sca_clone_freegift","open","#shopify-section-header #cart-icon-bubble","productsInPage","flat","enable_check_variants_has_gift","trigger_body","routes","checkout","60%","freegiftProxy","sca_clone_checkout","manual_input_inventory","getAttribute","reduce","show_gift_for_customer",'\n