window.fgData={"offers":[{"id":10528,"shop_id":4309,"offer_name":"Buy 1 get 1 Test","offer_description":null,"promotion_message":null,"start_time":"2023-08-29T14:35:36.000000Z","end_time":null,"condition_relationship":null,"gift_settings":{"discount":{"type":"percentage","value":100},"auto_add_all_gifts":false,"customer_will_receive":"number_of_gift_can_receive","cal_gift_for_other_rules":false,"number_of_gift_can_receive":1},"gift_should_the_same":{"type":"variant","status":false},"sub_conditions":null,"priority":1,"stop_lower_priority":false,"status":true,"loading":"not_running","gift_products":[{"title":"\u00bb Koala Cosy (100% off)","original_product_handle":"koala-cosy","clone_product_handle":"koala-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-01862.jpg?v=1687415594","product_shopify_id":8584437629204,"original_product_shopify_id":8295655309588,"variants":[{"id":65870,"gift_product_id":25203,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8295655309588,"original_variant_shopify_id":45108759888148,"price":0,"product_shopify_id":8584437629204,"variant_shopify_id":46509862027540,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-01862.jpg?v=1687415594","pivot":{"offer_id":10528,"gift_item_id":65870},"gift_product":{"id":25203,"shop_id":4309,"title":"\u00bb Koala Cosy (100% off)","original_product_handle":"koala-cosy","clone_product_handle":"koala-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-01862.jpg?v=1687415594","product_shopify_id":8584437629204,"original_product_shopify_id":8295655309588,"created_at":"2023-08-29T14:36:22.000000Z","updated_at":"2023-08-29T14:36:22.000000Z"}}]},{"title":"\u00bb Grey Cosy (100% off)","original_product_handle":"grey-cosy","clone_product_handle":"grey-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-00952.jpg?v=1687415443","product_shopify_id":8584437891348,"original_product_shopify_id":8295666942228,"variants":[{"id":65871,"gift_product_id":25204,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8295666942228,"original_variant_shopify_id":45108835614996,"price":0,"product_shopify_id":8584437891348,"variant_shopify_id":46509862289684,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-00952.jpg?v=1687415443","pivot":{"offer_id":10528,"gift_item_id":65871},"gift_product":{"id":25204,"shop_id":4309,"title":"\u00bb Grey Cosy (100% off)","original_product_handle":"grey-cosy","clone_product_handle":"grey-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-00952.jpg?v=1687415443","product_shopify_id":8584437891348,"original_product_shopify_id":8295666942228,"created_at":"2023-08-29T14:36:26.000000Z","updated_at":"2023-08-29T14:36:26.000000Z"}}]},{"title":"\u00bb Pink Cosy (100% off)","original_product_handle":"pink-cosy","clone_product_handle":"pink-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-0060_2.jpg?v=1687415833","product_shopify_id":8584438186260,"original_product_shopify_id":8295670939924,"variants":[{"id":65872,"gift_product_id":25205,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8295670939924,"original_variant_shopify_id":45108880703764,"price":0,"product_shopify_id":8584438186260,"variant_shopify_id":46509863371028,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-0060_2.jpg?v=1687415833","pivot":{"offer_id":10528,"gift_item_id":65872},"gift_product":{"id":25205,"shop_id":4309,"title":"\u00bb Pink Cosy (100% off)","original_product_handle":"pink-cosy","clone_product_handle":"pink-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-0060_2.jpg?v=1687415833","product_shopify_id":8584438186260,"original_product_shopify_id":8295670939924,"created_at":"2023-08-29T14:36:29.000000Z","updated_at":"2023-08-29T14:36:29.000000Z"}}]},{"title":"\u00bb Couch Potato Cosy (100% off)","original_product_handle":"couch-potato-cosy","clone_product_handle":"couch-potato-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-02162.jpg?v=1684397843","product_shopify_id":8584620900628,"original_product_shopify_id":8296742682900,"variants":[{"id":65880,"gift_product_id":25212,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8296742682900,"original_variant_shopify_id":45111348658452,"price":0,"product_shopify_id":8584620900628,"variant_shopify_id":46510304067860,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-02162.jpg?v=1684397843","pivot":{"offer_id":10528,"gift_item_id":65880},"gift_product":{"id":25212,"shop_id":4309,"title":"\u00bb Couch Potato Cosy (100% off)","original_product_handle":"couch-potato-cosy","clone_product_handle":"couch-potato-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-02162.jpg?v=1684397843","product_shopify_id":8584620900628,"original_product_shopify_id":8296742682900,"created_at":"2023-08-29T15:21:29.000000Z","updated_at":"2023-08-29T15:21:29.000000Z"}}]}],"offer_conditions":[{"id":10973,"offer_id":10528,"is_multiply":true,"min_amount":"1.00","max_amount":null,"product_narrow":[{"type":"variants_ids","value":{"8295655309588":{"id":8295655309588,"image":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-01862.jpg?v=1683757296","title":"Koala Cosy","handle":"koala-cosy","status":"ACTIVE","vendor":"The Cosy","variant":[{"id":45108759888148,"image":null,"price":"99.00","title":"Default Title"}],"product_tag":[],"product_type":null,"total_variants":1,"variant_last_cursor":"eyJsYXN0X2lkIjo0NTEwODc1OTg4ODE0OCwibGFzdF92YWx1ZSI6IjEifQ=="},"8295666942228":{"id":8295666942228,"image":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-00952.jpg?v=1683757853","title":"Grey Cosy","handle":"grey-cosy","status":"ACTIVE","vendor":"The Cosy","variant":[{"id":45108835614996,"image":null,"price":"99.00","title":"Default Title"}],"product_tag":[],"product_type":null,"total_variants":1,"variant_last_cursor":"eyJsYXN0X2lkIjo0NTEwODgzNTYxNDk5NiwibGFzdF92YWx1ZSI6IjEifQ=="},"8295670939924":{"id":8295670939924,"image":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-0060_2.jpg?v=1683758066","title":"Pink Cosy","handle":"pink-cosy","status":"ACTIVE","vendor":"The Cosy","variant":[{"id":45108880703764,"image":null,"price":"99.00","title":"Default Title"}],"product_tag":[],"product_type":null,"total_variants":1,"variant_last_cursor":"eyJsYXN0X2lkIjo0NTEwODg4MDcwMzc2NCwibGFzdF92YWx1ZSI6IjEifQ=="},"8296742682900":{"id":8296742682900,"image":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-02162.jpg?v=1684397843","title":"Couch Potato Cosy","handle":"couch-potato-cosy","status":"ACTIVE","vendor":"The Cosy","variant":[{"id":45111348658452,"image":null,"price":"99.00","title":"Default Title"}],"product_tag":[],"product_type":null,"total_variants":1,"variant_last_cursor":"eyJsYXN0X2lkIjo0NTExMTM0ODY1ODQ1MiwibGFzdF92YWx1ZSI6IjEifQ=="}}}],"unit":"number_of_products"}],"gift_items":[{"id":65870,"gift_product_id":25203,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8295655309588,"original_variant_shopify_id":45108759888148,"price":0,"product_shopify_id":8584437629204,"variant_shopify_id":46509862027540,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-01862.jpg?v=1687415594","pivot":{"offer_id":10528,"gift_item_id":65870},"gift_product":{"id":25203,"shop_id":4309,"title":"\u00bb Koala Cosy (100% off)","original_product_handle":"koala-cosy","clone_product_handle":"koala-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-01862.jpg?v=1687415594","product_shopify_id":8584437629204,"original_product_shopify_id":8295655309588,"created_at":"2023-08-29T14:36:22.000000Z","updated_at":"2023-08-29T14:36:22.000000Z"}},{"id":65871,"gift_product_id":25204,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8295666942228,"original_variant_shopify_id":45108835614996,"price":0,"product_shopify_id":8584437891348,"variant_shopify_id":46509862289684,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-00952.jpg?v=1687415443","pivot":{"offer_id":10528,"gift_item_id":65871},"gift_product":{"id":25204,"shop_id":4309,"title":"\u00bb Grey Cosy (100% off)","original_product_handle":"grey-cosy","clone_product_handle":"grey-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-00952.jpg?v=1687415443","product_shopify_id":8584437891348,"original_product_shopify_id":8295666942228,"created_at":"2023-08-29T14:36:26.000000Z","updated_at":"2023-08-29T14:36:26.000000Z"}},{"id":65872,"gift_product_id":25205,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8295670939924,"original_variant_shopify_id":45108880703764,"price":0,"product_shopify_id":8584438186260,"variant_shopify_id":46509863371028,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-0060_2.jpg?v=1687415833","pivot":{"offer_id":10528,"gift_item_id":65872},"gift_product":{"id":25205,"shop_id":4309,"title":"\u00bb Pink Cosy (100% off)","original_product_handle":"pink-cosy","clone_product_handle":"pink-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-0060_2.jpg?v=1687415833","product_shopify_id":8584438186260,"original_product_shopify_id":8295670939924,"created_at":"2023-08-29T14:36:29.000000Z","updated_at":"2023-08-29T14:36:29.000000Z"}},{"id":65880,"gift_product_id":25212,"discount_type":"percentage","discount_value":100,"original_price":99,"original_compare_at_price":null,"original_product_shopify_id":8296742682900,"original_variant_shopify_id":45111348658452,"price":0,"product_shopify_id":8584620900628,"variant_shopify_id":46510304067860,"variant_title":"Default Title","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-02162.jpg?v=1684397843","pivot":{"offer_id":10528,"gift_item_id":65880},"gift_product":{"id":25212,"shop_id":4309,"title":"\u00bb Couch Potato Cosy (100% off)","original_product_handle":"couch-potato-cosy","clone_product_handle":"couch-potato-cosy-sca_clone_freegift","thumbnail":"https:\/\/cdn.shopify.com\/s\/files\/1\/0744\/3605\/1220\/files\/TheCosy-02162.jpg?v=1684397843","product_shopify_id":8584620900628,"original_product_shopify_id":8296742682900,"created_at":"2023-08-29T15:21:29.000000Z","updated_at":"2023-08-29T15:21:29.000000Z"}}]}],"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 Cosy!","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,"gift_img_size":"&width=480&height=480"},"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 _0xc049d=_0x4518;function _0x4518($,x){let t=_0x1d8e();return(_0x4518=function($,x){return t[$-=197]})($,x)}function _0x1d8e(){let $=["sca_fg_cart_drawer_query","\n \n ","show_product_title","scrollItem","add_to_cart_btn_color","original_variant_shopify_id","sca_add_gift","reduce","sca_root_checkout","802716TDWyDy","min_amount","info","compressToEncodedURIComponent","product_vendors","status","openSlider","getAttribute","/cart/update","#fg-gift-items","customGiftImgSize","stop_lower_priority","freegifts-main-page-container","freegifts-main-popup-container",".btn-add-to-cart","currency","subscription_products","/?sections=","include","&width=480&height=480","none","variant_title","length","sca-promotion-message-layout","arrGiftsRemove","time","searchParams","by_variants",".gift-original-url",'" data-original-id="',"d-block","fg-gifts:updated","createElement","appearance","variants_quantity","Update cart.attributes ","fg-gifts:show-slider",'" target="_blank">\n ","\n \n ","message","original_compare_at_price","substring","map","totarrCustomerOrderal_spend_on_order_history","max_amount","disabled","querySelectorAll","gift_icon","failed to parse cart section ","auto add gift: ","reRenderCartCustom","\n \n \n ","auto_add_all_gifts","POST","variants_has_gift","focus","backgroundColor","sca_cart_xhr","/cart/add","?sca_process_gifts","renderPromotionMessage",".selected-variant","rebuy:smartcart.show","sca_fg_title_product_gift_icon_query","display","Widgets","sca-gift-icon-collection-page","SHOPIFY_CART",".fg-secomapp-collection-img, .product-card, #product-grid .grid__item, .product-grid .grid__item, .card-list .card-list__column, .cc-product-list .product-block, .collection-list.grid .grid__item, .collection-grid.grid .grid__item ","fgData",'",'\n
✕ \n
\n ',"sync_quantity","visibility","setItem","appendChild","URL","price","#sca-spinner-checkout","Select variant",'">\n ',"show_variant_title","fg-gift-items","Can not fetch all body","current_product","monster_refresh","isSameNode",".dropdown-menu","compare_at_price","customer_tags","#sca-gift-thumbnail",'
\n
\n \n \n \n \n \n
',"240","other_products","compressToBase64","variant_shopify_id","#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg","fg-checkout:start","active","log","upcartOnAddToCart","gift_popup_title","&sca_shop_name=","sca-gift-thumbnail","action","sections","handle","last_total","upcartRegisterAddToCart",'\n \n \n \n \n \n ',"fgCallback","collections","secomappGetCartRunning","formatter","ele",'\n
\n ','\n
\n
\n
\n
\n \n
\n\n
\n
\n ❮ \n
\n
\n ❯ \n
\n
\n
\n ',"color","json","title","icartSideCartOpenEvent","decompressFromBase64","SLIDECART_OPENED","preventDefault","div","data-img","final_price","#fg-gift-items .dropdown","body","auto_add_gift","getTime","href","cookie",".fg-secomapp-product-title ",'\n \n \n
\n
\n ',"cal_gift_for_other_rules","scaCustomLoadingCheckout","#82868b","current_collection","cal_gift_discount","product_narrow",'"\n data-original-price="',"stopPropagation","3.0","trigger_body","not have orders and gifts","keyup",'" alt="free-gift-icon" class="sca-gift-icon-img" />\n ',"cart:change","sca_catch","sca-is-visible-fg","gift_should_the_same","STICKY_CART_OPEN","product_shopify_id",'\n
\n ','.btn-add-to-cart[data-variant="',"specific_link_address","relative","SATCB","cartItems","filter","api","Add to cart",'
','" alt="">\n \n ',"application/liquid","timeoutId","data-original-price","#fg-gift-items .btn-add-to-cart","items","thumbnail","track","FGSECOMAPP",".freegifts-main-container .glider-prev","condition_relationship","4666529tQKedx","-sca_clone_freegift","customerLocation","\n \n
\n \n
","sca_offers_added","product_id","\n ","toggle","icartUpdateCartEvent","#freegifts-main-popup-container [data-close]","type","/cart/add.js","tags",'
\n Loading... \n
',"prepareDataForDisplayWidgetByRule","/cart/change.js","not type checkout btn","value_customer_locations","[data-open]","Escape","GIFT_UPDATED","max","gift_img_size","total_spend_on_order_history","511939AbXZud","fgSettings","fg-gifts:render-cart","end","/cart/change","insertBefore","XMLHttpRequest","parse","#shopify-section-header #cart-icon-bubble","belongs_to_offer","classList","width",".original-price del",'
\n ',"number",".sca-gift-icon-collection-page","unit","sca_locale","format","change","includes","customer","getElementById","CUSTOM_EVENTS","orders","END_VALIDATE_CHECKOUT","variant_id","sections_cart","clone_checkout","charAt","SLIDECART_OPEN","remove","get","data-offer","freegifts","offers","maxWidth","shift","catch","arrGiftsAdd","prepend","quantity","enable_toast_added","openCart","checkIsBlockCheckout","SHOW_GIFT_SLIDER","sca_add_url","\n
","sca-fg-icon-collection-page","promotion_message",'\n
\n ','">\n ','\n
\n \n \n \n \n \n ',"fgAppearancePromotionMessage","stringify","?sca_attr_cart","/cart.js?sca_fetch&",'\n \n \n
\n "+(FGSECOMAPP[t(353)][t(360)]===t(517)&&FGSECOMAPP[t(353)][t(585)]?t(391)+(1===$[t(700)][t(512)]?t(565)+(H(e[t(511)])?t(433):"")+t(584)+e.variant_title+t(477):''+(FGSECOMAPP[t(353)].select_gift_btn??t(583))+t(532))+t(235):"")+t(453)+p(e)+'\n \n '+u(e)+t(533)+(FGSECOMAPP[t(353)].show_gift_for_customer!==t(517)?t(619)+(1===$[t(700)].length?t(565)+(H(e[t(511)])?t(433):"")+'">'+e[t(511)]+t(532):t(217)+(FGSECOMAPP[t(353)][t(320)]??"Select variant")+t(532))+t(329)+f($[t(700)],$.thumbnail)+t(482):"")+t(644)+$.belongs_to_offer+t(411)+(1===$.variants[t(512)]?e[t(599)]:"")+t(312)+(FGSECOMAPP[t(353)].add_to_cart_btn_title??t(216))+t(232)})[x(725)](" \n"),new Glider(document[x(337)](x(499)),{slidesToShow:1,slidesToScroll:1,draggable:!1,dots:FGSECOMAPP[x(353)][x(651)]?x(467):null,arrows:{prev:x(227),next:".freegifts-main-container .glider-next"},responsive:[{breakpoint:1024,settings:{slidesToShow:FGSECOMAPP[x(353)].number_product_slider??4,slidesToScroll:1}},{breakpoint:768,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:576,settings:{slidesToShow:2,slidesToScroll:1}}]}),document[x(372)](new CustomEvent(FGSECOMAPP[x(276)][x(298)],{detail:FGSECOMAPP})))},U=async()=>{let $=_0xc049d;try{let x=window.fgData?.[$(288)]??[];for(let t in await $u(),Shopify?.products)h(Shopify?.[$(384)][t]?.id)&&delete Shopify?.[$(384)][t];let e=[];return x[$(378)](x=>{let t=$,a=JSON.parse(JSON.stringify(x));if(x[t(205)][t(495)]){let i=x.offer_conditions[0][t(738)],r=i[0][t(406)],c=[...a.gift_items],_=[...a.gift_products];if(x[t(205)][t(239)]===t(723))for(let d in r){let n=r[d]?.[t(723)]??[];for(let o of n){a[t(724)][0][t(738)]=[{type:i[0].type,value:{[d]:{...r[d],variant:[{...o}]}}}],a.gift_items=c[t(214)]($=>$[t(729)]+""===d&&o.id===$.original_variant_shopify_id),a[t(573)]=_[t(214)]($=>$.original_product_shopify_id+""===d),a[t(573)][0].variants=[...a.gift_items];let s=a[t(664)].number_of_gift_can_receive,l=a.gift_settings[t(547)];a[t(664)][t(547)]&&(s=a.gift_items[t(512)]),1===a[t(692)][t(512)]&&0===a[t(692)][0].price&&(l=!0),e[t(387)](JSON[t(260)](JSON[t(326)]({...a,gift_settings:{...a.gift_settings,number_of_gift_can_receive:s,auto_add_all_gifts:l},id:a.id+"_"+r[d][t(610)]+"_"+o.id})))}}else if(x[t(205)][t(239)]===t(465))for(let f in r){a.offer_conditions[0][t(738)]=[{type:i[0].type,value:{[f]:r[f]}}],a[t(692)]=c[t(214)]($=>$.original_product_shopify_id+""===f),a[t(573)]=_[t(214)]($=>$[t(729)]+""===f);let u=a[t(664)][t(429)],p=a[t(664)][t(547)];a.gift_settings[t(547)]&&(u=a.gift_items[t(512)]),1===a[t(692)].length&&0===a[t(692)][0][t(581)]&&(p=!0),e.push(JSON.parse(JSON[t(326)]({...a,gift_settings:{...a.gift_settings,number_of_gift_can_receive:u,auto_add_all_gifts:p},id:a.id+"_"+r[f][t(610)]})))}}}),(x=(x=(x=x?.[$(214)](x=>!x?.[$(205)]?.status)?.[$(408)](e))?.[$(537)](x=>{let t=$;return{...x,id:x.id[t(470)]()}}))?.filter(x=>{let t=$;if(!V(x[t(351)],x[t(434)]))return!1;let e=!h(x[t(731)]?.customer_order_history||x[t(731)]?.[t(593)]);if(x[t(731)]&&(!L(x,SECOMAPP)||e&&h(SECOMAPP[t(274)][t(650)])))return!1;let a={...Shopify?.[t(384)]},i=!1;if("stop_offer"===FGSECOMAPP[t(254)].sync_quantity){x[t(692)]=x?.[t(692)][t(214)]($=>{let x=t,e=a[$[x(729)]]?.[x(524)]??{};return e[$.original_variant_shopify_id]>0})??[];let r=x[t(692)]?.map($=>$[t(599)]);x[t(573)]=x?.[t(573)]?.filter($=>{let x=t;return $[x(700)]=$?.variants?.filter($=>{let t=x;return r?.[t(273)]($[t(599)])}),$?.[x(700)]?.[x(512)]>0}),i=!0}else if(FGSECOMAPP.fgSettings.manual_input_inventory){x[t(692)]=x?.gift_items[t(214)]($=>{let x=t,e=a[$.product_shopify_id]?.[x(524)]??{};return e[$[x(599)]]>0});let c=x[t(692)]?.[t(537)]($=>$[t(599)]);x[t(573)]=x?.[t(573)]?.[t(214)]($=>{let x=t;return $[x(700)]=$?.[x(700)]?.[x(214)]($=>{let t=x;return c?.[t(273)]($.variant_shopify_id)}),$?.variants?.length>0}),i=!0}return i&&x[t(664)]?.[t(547)]&&(x[t(664)][t(429)]=x.gift_items?.[t(512)]),!i||x.gift_items&&x[t(692)][t(512)]>0}))?.[$(537)](x=>{let t=$,e=x[t(692)][t(537)]($=>$[t(729)]);return x.gift_products=x.gift_products?.[t(214)]($=>{let x=t;return e[x(273)]($.original_product_shopify_id)}),x[t(724)]?.[t(378)]($=>{let x=t;$[x(269)]===x(456)&&($[x(491)]=v($.min_amount),$[x(539)]=h($[x(539)])?$.max_amount:v($[x(539)]))}),x})}catch(a){return console[$(359)](a),[]}},B=$=>{let x=_0xc049d;for(let t of FGSECOMAPP[x(213)]){let e=t[x(234)];if($[0].original_product_shopify_id===e)return!1}return!0},j=$=>{let x=_0xc049d;for(let t of FGSECOMAPP[x(213)]){let e=$[0].variants[0][x(720)];if(FGSECOMAPP[x(254)][x(704)]===x(592)&&(e=$[0][x(700)][0][x(535)]),e>(t[x(469)]??t.final_price??t[x(581)])/100)return!1}return!0},z=async()=>{let $=_0xc049d;try{let x=[];window[$(564)]?.offers?.[$(378)](t=>{let e=$,a=[];t.gift_products[e(378)]($=>{let x=e;a[x(387)]($[x(476)],$.original_product_handle)}),x=[...x,...a]}),await $s(x=(x=[...new Set(x)])[$(214)](x=>h(FGSECOMAPP[$(395)][x]))),Object[$(624)](FGSECOMAPP[$(395)])?.[$(378)]($=>{let{info:x}=$;h(x)||h(x?.id)||(Shopify.products[x.id]={...x})})}catch(t){console[$(359)](t)}},W=async $=>{let x=_0xc049d;y(),FGSECOMAPP[x(368)](),(FGSECOMAPP?.[x(254)]?.[x(576)]===x(441)||FGSECOMAPP?.[x(254)]?.manual_input_inventory)&&await z(),FGSECOMAPP[x(288)]=await U(),FGSECOMAPP[x(425)](),a();try{h($)?(FGSECOMAPP[x(714)]=[],localStorage[x(578)](x(233),LZString[x(598)](JSON[x(326)](FGSECOMAPP.arrOfferAdded)))):FGSECOMAPP[x(714)]=JSON[x(260)](LZString[x(631)](localStorage[x(690)](x(233))))}catch(t){FGSECOMAPP[x(714)]=[],localStorage[x(578)](x(233),LZString[x(598)](JSON[x(326)](FGSECOMAPP[x(714)])))}let e={};FGSECOMAPP[x(288)]?.[x(378)]($=>{let t=x;e[$.id]=$?.[t(692)]?.map($=>$[t(599)])});let i=Object.keys(e);FGSECOMAPP.arrOfferAdded=FGSECOMAPP[x(714)]?.[x(214)]($=>i?.[x(273)]($[x(262)]?.[x(470)]())&&e[$[x(262)]?.toString()][x(273)]($[x(379)]));let r={};FGSECOMAPP[x(714)]?.[x(378)]($=>{let t=x,e=r[$[t(262)]+"_"+$[t(379)]]??{};r[$[t(262)]+"_"+$.variantId]={...$,belongs_to_offer:$.belongs_to_offer?.[t(470)](),quantity:(e?.quantity??0)+($?.[t(294)]??0)}}),FGSECOMAPP.arrOfferAdded=Object[x(624)](r),localStorage[x(578)]("sca_offers_added",LZString[x(598)](JSON[x(326)](FGSECOMAPP.arrOfferAdded)));let c=await F($,FGSECOMAPP[x(288)]);await X(c),$f(),$8(),$l()},K=function(){let $=_0xc049d,x=document[$(541)]($(247)),e=document.querySelectorAll($(238)),a="sca-is-visible-fg",i=document[$(541)]($(222)),r=i.length;for(let c=0;c{let e=$;x[e(448)]===document[e(337)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg")&&(document[e(337)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg")[e(263)][e(284)](a),t())}),document[$(454)]($(200),x=>{let e=$;x.key===e(248)&&document[e(337)](e(600))&&(document[e(337)](e(600))[e(263)][e(284)](a),t())}),document.querySelectorAll($(637))[$(378)](x=>x.addEventListener($(424),function(){let x=$;this[x(452)](x(323),1),this[x(550)](),this[x(263)][x(236)](x(602)),this.querySelector(".dropdown-menu")[x(263)][x(236)](x(520))})),document.querySelectorAll($(637))[$(378)](x=>document[$(454)]($(424),function(t){let e=$,a=x[e(436)](t[e(448)]);a||(x[e(263)][e(284)](e(602)),x[e(337)](e(591))[e(263)][e(284)]("d-block")),document[e(541)](e(687))[e(378)]($=>{let x=e;$[x(540)]=!0,$[x(430)][x(551)]=x(735)})})),document[$(541)]("#fg-gift-items .dropdown > .dropdown-menu > li")[$(378)](x=>{let t=$;x[t(454)](t(424),function(){let $=t,x=this[$(497)]("id"),e=this.getAttribute($(635)),a=this[$(497)]($(376)),i=this.getAttribute($(221)),r=this[$(497)]("data-original-id"),c=this[$(660)][$(660)].parentElement[$(660)];c[$(337)](".product-item-thumbnail")[$(452)]($(317),e);let _=new URL(c[$(337)]($(518))[$(641)]);_[$(516)][$(677)]("variant",r),c[$(337)]($(518))[$(641)]=_[$(470)]();let d=this[$(660)].parentElement[$(660)];d.querySelector($(265)).textContent=i,d.querySelector(".gift-price")[$(377)]=a;let n=d?.[$(337)]($(504));n[$(452)]($(358),x),n[$(540)]=!1,n.style="";let o=this[$(660)][$(660)][$(337)]($(556));o[$(263)][$(397)]($(602)),o.innerHTML=this[$(334)]})}),document[$(541)]("#fg-gift-items .btn-add-to-cart")[$(378)](x=>x[$(454)]($(424),async function(){let x=$,t=this[x(497)]("data-variant")-0,e=this[x(497)](x(286));try{await _(t,1,e);let i=document[x(337)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg");i&&(FGSECOMAPP[x(339)]=!0,await new Promise($=>setTimeout($,800)),i[x(263)].remove(a)),window[x(621)][x(641)][x(273)](x(572))?location[x(667)]():typeof Shopify?.getCart===x(673)&&await Shopify?.[x(478)](0===FGSECOMAPP[x(614)][x(512)]?function(){}:FGSECOMAPP[x(614)][0])}catch(r){console[x(359)](r)}}))},V=($,x)=>{let t=_0xc049d;if($){let e=new Date,a=e[t(640)](),i=new Date($)[t(640)]();if(!x)return a>=i;{let r=new Date(x)[t(640)]();return a>=i&&a<=r}}return!1},X=async $=>{let x=_0xc049d;if(FGSECOMAPP[x(254)]?.[x(682)])for(let t of FGSECOMAPP[x(213)])d(t)&&($=$[x(214)]($=>$[x(207)]!==t[x(234)]));if(FGSECOMAPP[x(254)]?.not_show_gift_if_already_on_cart)for(let e of FGSECOMAPP[x(213)])$=$[x(214)]($=>$.original_product_shopify_id!==e[x(234)]);if(FGSECOMAPP[x(254)]?.[x(704)])for(let a of FGSECOMAPP.cartItems)$=$[x(214)]($=>{let t=x;return $[t(700)]=$[t(700)][t(214)]($=>{let x=t,e=$.original_price;return FGSECOMAPP[x(254)]?.[x(704)]===x(592)&&(e=$.original_compare_at_price),e<=(a[x(469)]??a[x(636)]??a[x(581)])/100}),!h($[t(700)])});$&&$[x(512)]>0&&(FGSECOMAPP[x(339)]?(await new Promise($=>setTimeout($,1500)),FGSECOMAPP.isDelayShowAdded=!1,l(),N($)):(l(),N($))),K(),FGSECOMAPP.fetchCheckoutEvents(),FGSECOMAPP[x(555)](FGSECOMAPP.offers),J=[]},Y=async $=>{let x=_0xc049d;J=[];let t=new URL(window.location.href);t.searchParams[x(677)](x(530),""),e(t.toString()).then($=>$[x(713)]())[x(654)]($=>{let t=x,e=new DOMParser,a=e.parseFromString($,t(472)),i=t(531)+m(t(481)),r=t(343)+m("sca_fg_cart_icon_query"),c=document[t(337)](i),_=!1;c&&(_=!0,c[t(694)]=a.querySelector(i)?.[t(694)]??c[t(694)]);let d=document.querySelector(r);d||(d=document.querySelector(t(711))),d&&(_=!0,d[t(694)]=a[t(337)](r)?.[t(694)]??a[t(337)](t(261))?.[t(694)]??d[t(694)]),_||console[t(603)](t(587))}),typeof FGSECOMAPP?.[x(545)]===x(673)&&await FGSECOMAPP[x(545)](),document[x(372)](new CustomEvent(FGSECOMAPP[x(276)][x(249)],{detail:FGSECOMAPP})),setTimeout(function(){X($)},800)},Z=async $=>{let x=_0xc049d,t=await e(x(328)+($??""),{method:"GET",headers:{Accept:"application/json","Content-Type":x(427)}})[x(654)]($=>$.json()),a=t[x(223)];return FGSECOMAPP.SHOPIFY_CART=t,FGSECOMAPP.cartItems=a?.[x(537)]($=>{let t=x;return{...FGSECOMAPP[t(213)]?.[t(389)](x=>x.id===$.id),...$}})??[],t},Q=async()=>{let $=_0xc049d,x=FGSECOMAPP[$(562)];try{await e(SECOMAPP[$(567)],{method:"GET",headers:{"Content-Type":$(219)}}).then(async t=>{let e=$,a=await t[e(628)]();FGSECOMAPP.cartItems=a?.[e(420)]?.[e(537)]($=>{let x=e;return{...FGSECOMAPP[x(213)]?.[x(389)](x=>x.id===$.id),...$[x(465)],collections:$.collections,tags:$.tags}})??[],FGSECOMAPP[e(562)]=a?.[e(471)]??{},x=FGSECOMAPP[e(562)]})[$(291)](async t=>{let e=$;console[e(359)](e(543)+t.message),x=await Z()})}catch(t){console[$(359)]($(203),t.message),x=await Z()}return x},J=[],$$=async $=>{let x=_0xc049d;try{$===x(475)?J[x(387)](x(244)):J[x(387)]($[0]),await Q();let t=await F(FGSECOMAPP[x(213)],FGSECOMAPP[x(288)]);FGSECOMAPP[x(555)](FGSECOMAPP[x(288)]);let e=!1;return $[0][x(385)](x(553))&&JSON[x(326)]($[1][x(466)]??[])[x(273)]("sca_add_gift")?(console[x(603)](x(665),[...J]),await Y(t),e=!0):$[0][x(385)]("/cart/update")&&JSON[x(326)]($[1][x(466)]??[]).includes(x(705))?(console.log(x(451),[...J]),await Y(t),e=!0):(console[x(603)](x(304),[...J]),await X(t)),e&&(window[x(621)][x(641)][x(273)](x(572))||"fg-checkout"===document[x(337)](x(370))?.[x(497)](x(479)))&&(J=[],location[x(667)]()),FGSECOMAPP[x(213)]}catch(a){console[x(359)](a)}},$x=()=>{let $=_0xc049d;if(!Shopify?.[$(295)])return;let x=document.querySelector($(679));if(!x)return;x[$(694)]="";let t=Shopify?.sca_text_notify_success??"Add gift to cart successfully!",e=document[$(522)]("li");e[$(348)]="sca-fg-toast sca-fg-success",e[$(694)]=$(595)+t+$(324),x[$(579)](e),e.timeoutId=setTimeout(()=>$0(e),3e3),document[$(337)]($(706))?.[$(454)]("click",()=>$0(e))},$0=$=>{let x=_0xc049d;$[x(263)][x(397)]("hide"),$.timeoutId&&clearTimeout($[x(220)]),setTimeout(()=>$[x(284)](),500)},$t=($,{value:x,innerHTML:t})=>{let e=_0xc049d;try{let a=FGSECOMAPP[e(254)]?.mode_override_checkout,i=a===e(198)?$[e(448)]:$[e(394)]??$[e(448)];if(i?.[e(357)](e(462))||(i=document[e(337)](e(582))?.[e(698)]),i[e(406)]=x,i[e(694)]=t,i[e(540)]=!1,i.removeEventListener(e(424),$e),i[e(721)](e(462)),a===e(281)){i[e(698)][e(337)]("[sca_root_checkout]").click();return}"trigger_body"===a&&window[e(413)](e(424),$a,!0),i[e(424)]()}catch(r){window[e(621)][e(347)]((Shopify?.[e(699)]?.root??"/")+e(569)),console[e(359)](r[e(534)])}},$e=async $=>{let x=_0xc049d;try{$[x(633)](),$[x(740)](),$[x(625)]();let t=FGSECOMAPP[x(254)]?.[x(459)],a=t===x(198)?$[x(448)]:$.currentTarget??$[x(448)],{form:i}=a,r="",c="";if(a&&(a[x(540)]=!0,r=a[x(694)],c=a[x(406)],typeof FGSECOMAPP?.[x(734)]===x(673)?await FGSECOMAPP[x(734)](x(666)):(a[x(406)]=x(672),a[x(694)]=x(242))),document[x(372)](new CustomEvent(FGSECOMAPP[x(276)][x(670)],{detail:FGSECOMAPP})),FGSECOMAPP[x(297)])return!1;FGSECOMAPP.checkIsBlockCheckout=!0;try{let _=new URL(i[x(608)]);_[x(516)].append(x(336),""),await e(_[x(470)](),{method:x(548),body:new FormData(i)})}catch(n){console[x(603)](x(245))}if(h(FGSECOMAPP[x(288)])&&h(FGSECOMAPP.cartItems?.[x(389)]($=>d($))))return console[x(603)](x(199)),$t($,{value:c,innerHTML:r}),!1;await Q();let o=[...FGSECOMAPP[x(213)]],s=!1;for(let l of FGSECOMAPP[x(288)])if(l[x(409)]&&l[x(409)][x(512)]){let f=P(o,l),u=V(l[x(351)],l[x(434)]);!u&&f.giftsAdded.length>0&&(s=!0),f.isReachConditions||(s=!0),f[x(405)]<0&&(s=!0),l[x(731)]&&!L(l,SECOMAPP)&&(s=!0)}if(await F(o,FGSECOMAPP[x(288)]),s)location.reload();else try{FGSECOMAPP.fgSettings[x(404)]&&!h(FGSECOMAPP[x(213)]?.find($=>d($)))?await e(SECOMAPP.freegiftProxy+x(606)+Shopify?.[x(321)],{method:x(460),headers:{"Content-Type":x(219)}})[x(654)](async $=>{let t=x,a=await $[t(628)]();a[t(420)]=(a.cart??[])[t(537)]($=>{let x=t;return $[x(465)][x(615)]=$[x(615)]?.[x(537)]($=>({id:$.id})),$.product[x(241)]=$[x(241)],{id:$[x(465)].id,variant_id:$[x(465)][x(279)],title:$[x(465)][x(629)],handle:$[x(465)].handle,price:$[x(465)].discounted_price??$[x(465)].final_price??$[x(465)][x(581)],quantity:$[x(465)][x(294)],product_type:$[x(465)][x(331)],vendor:$[x(465)][x(310)],tags:$[x(465)][x(241)],collections:$[x(465)].collections,selling_plan_allocation:$.product[x(401)]}}),a[t(662)]={arr_offer_added:FGSECOMAPP[t(714)],secomapp:{customer:SECOMAPP?.[t(274)]??{},fg_codes:SECOMAPP?.[t(663)]??[],fgSettings:FGSECOMAPP[t(254)]},cookie_fg_code:D(t(674)),shopify_currency:Shopify?.currency},await e(SECOMAPP[t(567)]+"&data_checkout="+LZString[t(493)](a=JSON[t(326)](a)),{method:t(460),headers:{"Content-Type":t(219)}})[t(654)](async $=>{let x=t,e=await $[x(628)]();try{FGSECOMAPP[x(297)]=!1,e[x(342)]&&(window.location[x(641)]=e[x(342)][x(371)])}catch(a){console[x(359)](a)}})}):(console[x(603)](x(403)),FGSECOMAPP[x(297)]=!1,$t($,{value:c,innerHTML:r}))}catch(p){FGSECOMAPP[x(297)]=!1,$t(p,{value:c,innerHTML:r})}(a="trigger_body"===t?$[x(448)]:$[x(394)]??$.target)&&(typeof FGSECOMAPP?.scaCustomLoadingCheckout===x(673)?await FGSECOMAPP[x(734)](x(256)):(a[x(406)]=c,a.innerHTML=r),a.disabled=!1),document[x(372)](new CustomEvent(FGSECOMAPP[x(276)][x(278)],{detail:FGSECOMAPP}))}catch(g){typeof FGSECOMAPP?.[x(734)]===x(673)&&await FGSECOMAPP[x(734)]("end"),document.dispatchEvent(new CustomEvent(FGSECOMAPP[x(276)][x(278)],{detail:FGSECOMAPP})),console[x(359)](g)}},$a=async $=>{let x=_0xc049d;$.target?.hasAttribute(x(462))&&await $e($)},$i=()=>{let $=_0xc049d,x=FGSECOMAPP[$(254)]?.[$(459)],t=$(646),e=t+$(349)+m($(332));document.querySelectorAll(e)[$(378)](t=>{let e=$,a=t[e(357)](e(489)),i=t[e(357)](e(388)),r=t.hasAttribute(e(462));if("clone_checkout"===x){if(a)return;if(!i&&!r){let c=t.cloneNode(!0);c[e(454)](e(424),$e),c.setAttribute(e(462),""),c[e(452)](e(388),""),t[e(430)][e(559)]=e(510),t[e(430)][e(577)]=e(703),t[e(430)][e(716)]="0",t[e(452)](e(489),""),t.parentNode?.[e(579)](c)}i&&!r&&(t[e(454)](e(424),$e),t.setAttribute(e(462),""))}else x===e(198)?t[e(452)](e(462),""):r||(t[e(454)](e(424),$e),t[e(452)]("sca_handle_checkout",""));FGSECOMAPP[e(726)]=!0}),x===$(198)&&window[$(454)]($(424),$a,!0)};FGSECOMAPP[_0xc049d(368)]=()=>{let $=_0xc049d;FGSECOMAPP[$(386)]=0;let x=setInterval(()=>{let t=$;$i(),FGSECOMAPP.scaCountRenderEventCheckout++,(FGSECOMAPP[t(386)]>10||FGSECOMAPP[t(726)])&&(FGSECOMAPP.scaCountRenderEventCheckout=0,clearInterval(x))},400)};let $r=$=>{let x=_0xc049d;try{let t={},e={},a=FGSECOMAPP[x(288)];if(h($)){$=[],h(Shopify?.[x(588)])||$.push({...Shopify?.[x(588)]});let i={...Shopify?.[x(597)],...Shopify?.[x(736)]?.[x(384)]};Object.values(FGSECOMAPP[x(395)])?.filter($=>!h($.info)&&(h($?.[x(366)])||$?.[x(366)]&&!$?.[x(380)]?.[x(410)]($=>$?.[x(263)]?.[x(436)](x(561)))))?.[x(378)]($=>{let t=x;i[$[t(492)].id]={...$[t(492)]}}),$=$[x(408)]([...Object[x(624)](i)])}for(let r in $?.[x(378)]($=>{let t=x,e=FGSECOMAPP[t(395)][$[t(610)]];FGSECOMAPP.productsInPage[$[t(610)]]={...e,info:{...$},product_has_icon:!!h(a)&&void 0}}),a?.[x(378)](a=>{let i=x,r=a[i(724)];if(1===r[i(512)]&&r[0][i(269)]===i(396)&&typeof r[0][i(461)]===i(709)){let c,_=r[0][i(738)];_?.[i(378)](x=>{let t=i;switch(x[t(239)]){case t(697):c=Object[t(624)](x[t(406)]);break;case"product_types":let e=Object[t(686)](x[t(406)]);e[t(512)]>0&&(c=(void 0===c?$:c)?.filter($=>e[t(273)]($[t(239)]))??[]);break;case t(494):let a=Object.keys(x[t(406)]);a[t(512)]>0&&(c=(void 0===c?$:c)?.filter($=>a.includes($.vendor))??[]);break;case"product_collections":let r=Object.keys(x[t(406)]);r.length>0&&(c=(void 0===c?$:c)?.[t(214)]($=>{let x=t,e=$[x(615)]?.[x(537)]($=>$.id+""),a=e?.[x(214)]($=>r[x(273)]($));return!h(a)})??[])}}),c?.[i(378)]($=>{let x=i,r=$[x(610)];if(t[r]){let c=t[r]?.[x(537)]($=>$[x(729)]),_=a[x(573)]?.filter($=>!c?.[x(273)]($.original_product_shopify_id));t[r]=t[r][x(408)](_)}else t[r]=a[x(573)];let d=$[x(723)]?.map($=>$.id)??[];e[r]=d[x(408)](e[r]??[]),e[r]=[...new Set(e[r])]})}}),t){let c=FGSECOMAPP.productsInPage[r];FGSECOMAPP[x(395)][r]={...c,gifts_will_receive:[...t[r]],product_has_icon:!0,variants_has_gift:[...e[r]]}}return Object.entries(t)?.[x(512)]?t:{}}catch(_){return console.error(_),null}},$c=$=>{let x=_0xc049d,t=FGSECOMAPP[x(685)][x(400)]??{};if(!t[x(414)]?.[x(495)])return;let e='\n '+(t[x(414)]?.title??x(322))+'
\n \n \n
\n
\n '+$?.[x(537)]($=>x(313)+g($.original_product_shopify_id,$[x(355)])+x(681)+$[x(224)]+x(218)).join("")+x(546)+($?.[x(512)]>=4?'\n
\xab \n
\xbb \n ':"")+x(732),a=".fg-secomapp-handle-add-to-cart "+m(x(458)),i=document[x(337)](a)??document[x(337)](x(727));if(!i)return;i.parentNode[x(430)][x(264)]=x(717),i[x(698)][x(430)][x(680)]=x(474),i[x(698)]?.[x(348)]?.[x(273)](x(455))||i[x(698)]?.[x(263)]?.[x(397)](x(455));let r=i[x(698)][x(337)]("#sca-gift-thumbnail");if(r)r[x(694)]=e;else{(r=document.createElement(x(634)))[x(452)]("id",x(607));let c=new DOMParser().parseFromString(e,x(472));r[x(694)]=c[x(638)].innerHTML,i.parentNode[x(258)](r,i)}i.parentNode[x(258)](r,i);let _=document[x(337)](x(570));if(_)switch(t.gift_thumbnail?.[x(684)]){case"32":_[x(430)][x(289)]="50%";break;case"50":_.style[x(289)]="60%";break;case x(707):_.style[x(289)]="70%";break;case x(719):_[x(430)][x(289)]="80%";break;case x(596):_.style[x(289)]=x(717);break;default:_[x(430)][x(289)]=x(688)}if($?.length>=4)new Glider(document[x(337)](x(309)),{slidesToShow:3,slidesToScroll:1,draggable:!0,dots:".dots-thumbnail",arrows:{prev:x(362),next:x(417)}});else{_&&(_[x(430)][x(289)]=x(717));let d=document[x(337)](".sca-list-gift-thumbnail");d&&(d[x(430)].display="flex")}},$_=()=>{let $=_0xc049d;if(!(FGSECOMAPP[$(685)][$(400)]??{})[$(542)]?.[$(495)])return;let x=$(710)+FGSECOMAPP.fgAppearanceGiftIcon.gift_icon_path+$(201),t=$(643)+m($(558)),e=document.querySelector(t)??document[$(337)](".product_name, .product-title, .product__title, .product-single__title, .tt-title, .ProductMeta__Title");if(!e)return;e[$(430)][$(418)]=$(211),e[$(430)][$(264)]=$(675),e[$(348)]?.includes($(341))||e[$(263)]?.[$(397)]("sca-fg-form-icon-product-page");let a=e.querySelector($(649));if(a)a[$(694)]=x;else{(a=document.createElement($(634)))[$(452)]("id",$(691));let i=new DOMParser()[$(715)](x,"text/html");a[$(694)]=i[$(638)].innerHTML,e[$(579)](a)}},$d=()=>{let $=_0xc049d,x=[],t=$(563)+m("sca_fg_img_collection_gift_icon_query");return document[$(541)](t)[$(378)](t=>{let e=$,a=t[e(337)](e(363)),i=a?.[e(497)](e(641))?.[e(464)]("/")??[],r=i?.[e(622)](e(384)),c=r>=0?i[r+1]??null:null;if(c=c?.[e(464)]("?")?.[e(290)](),d(c)){t[e(284)]();return}let _=t[e(337)](e(364));if(_){t[e(284)]();return}if(h(c))return;let n=decodeURI(c);h(FGSECOMAPP[e(395)][n]?.[e(492)])&&x[e(387)](n);let o=(FGSECOMAPP.productsInPage[n]?.[e(380)]??[])[e(214)]($=>!t[e(590)]($));o[e(387)](t),FGSECOMAPP[e(395)][n]={...FGSECOMAPP[e(395)][n],positions:[...o]}}),x},$n=$=>{let x=_0xc049d;Object[x(686)]($)?.[x(378)]($=>{let t=x,e=FGSECOMAPP[t(395)][$]?.[t(380)]??[];if(h(e)||!Array[t(435)](e))return;if(!(FGSECOMAPP.fgAppearanceGiftIcon[t(718)]??{})[t(495)])return;let a=t(445)+FGSECOMAPP[t(685)][t(442)]+'" alt="free-gift-icon" class="sca-gift-icon-collection-img" />\n ';e[t(378)]($=>{let x=t;$[x(430)].position=x(211),$[x(348)]?.[x(273)](x(301))||$[x(263)]?.add(x(301));let e=$.querySelector(x(268));if(e)e[x(694)]=a;else{(e=document[x(522)](x(634)))[x(452)]("class",x(561));let i=new DOMParser()[x(715)](a,x(472));e.innerHTML=i.body.innerHTML,$.appendChild(e)}})})},$o=async $=>{let x=_0xc049d;await e(SECOMAPP[x(567)]+x(571)+LZString[x(493)](JSON[x(326)]($)),{method:x(460),headers:{"Content-Type":x(219)}})[x(654)](async $=>{let t=x,e=await $.json(),a=[];e?.[t(384)]?.[t(378)]($=>{let x=t;h($?.[x(384)]?.id)||a[x(387)]({...$[x(384)],collections:$.collections,variants_quantity:$[x(524)]})});let i=$r(a);$n(i)})[x(291)]($=>{console.error($)})},$s=async $=>{let x=_0xc049d,t=[];for(let[e,a]of $.entries())h(FGSECOMAPP[x(395)][a]?.[x(492)])&&t[x(387)](a),20===t.length&&(await $o([...t]),t=[]),e===$[x(512)]-1&&t[x(512)]>0&&(await $o([...t]),t=[])},$l=()=>{let $=_0xc049d,x=$d(),t=$r();$n(t),$s(x)[$(654)]()},$f=()=>{let $=_0xc049d;Shopify?.[$(352)]&&document[$(454)]($(272),function(){let x=$,t=new URL(document[x(580)]),e=parseInt(t[x(516)].get("variant"));$8(isNaN(e)?void 0:e)})},$8=$=>{let x=_0xc049d;if(!location[x(641)][x(273)]("/products/"))return;document[x(337)]("#sca-gift-icon")?.[x(284)](),document.querySelector(x(594))?.[x(284)]();let t=$r();if(h(t))return;let e=location.pathname[x(464)]("/"),a=e?.[x(622)](x(384)),i=decodeURI(a>=0?e[a+1]??null:null);if(!Object[x(686)](t)?.[x(273)](i))return;let r=t[i],c=FGSECOMAPP[x(395)][i]?.[x(549)]??[];!(Shopify?.[x(352)]&&(!h($)&&!c[x(273)]($)||h($)&&!h(Shopify?.[x(588)]?.current_variant)&&!c[x(273)](Shopify?.[x(588)]?.[x(421)]?.id)))&&($c(r),$_(r))};FGSECOMAPP[_0xc049d(555)]=$=>{let x=_0xc049d;try{h($)&&($=[...FGSECOMAPP[x(288)]]);let t=location.href.includes(x(572)),e=[];if($?.[x(378)]($=>{let t=x;if($[t(468)]||h($.promotion_message)||!h(FGSECOMAPP[t(708)])&&!$[t(468)]&&$[t(501)]&&$[t(446)]>FGSECOMAPP[t(708)])return;let a=$[t(302)];$[t(724)]?.[t(378)]($=>{let x=t,e=C(FGSECOMAPP[x(213)],$);e=S(e,$[x(382)]);let i=0,r=null,c=0;$[x(269)]===x(456)?(i=w(e),r="{{sca_min_total}}",c=Shopify?.sca_amount_fixed??2):$[x(269)]===x(396)&&(i=k(e),r=x(307),c=0);let _=Math[x(250)]($.min_amount-i,0).toFixed(c);a=a[x(623)](r,_)}),e[t(387)](a)}),h(e)){document[x(541)](x(415)).forEach($=>$[x(694)]="");return}let a="",i=x(266)+e?.map($=>'
'+$+"
")[x(725)]("")+x(300);FGSECOMAPP.fgAppearancePromotionMessage.show_on_cart_page&&(a=i);let r="#MainContent, #mainContent, #main, .main-content",c=document[x(337)](r),_=c?.[x(337)](x(432)),d=x(426),n=document.querySelectorAll(d+", \n .fg-secomapp-cart-item-promotion\n "+m(x(407))),o=document[x(541)](x(415));h(o)||o[x(378)]($=>$.innerHTML=a),(o=document[x(522)](x(634)))[x(452)]("id","sca-promotion-message-layout"),o.classList[x(397)](x(513));let s=new DOMParser()[x(715)](a,x(472));o[x(694)]=s[x(638)][x(694)],h(n)?!c?.[x(337)](".sca-promotion-message-layout")&&(s=new DOMParser()[x(715)](a,x(472)),o[x(694)]=s.body[x(694)],c&&_&&t?_[x(293)](o):c&&t&&c[x(293)](o)):n?.[x(378)]($=>{let t=x;if($[t(337)](t(415)))return;let e=o.cloneNode(!0);$[t(293)](e)});try{document[x(541)](".sca-promotion-glider")[x(378)]($=>{let x=new Glider($);(($,x)=>{let t=_0x4518,e=$[t(225)].childElementCount,a=null,i=1;function r(){a=setTimeout(()=>{let x=_0x4518;i>=e&&(i=0),$[x(484)](i++)},3e3)}$[t(618)][t(454)](t(354),function(){window[t(671)](a),r()}),r()})(x,3e3)})}catch(l){console[x(359)](l)}}catch(f){console.error(f)}};let $u=async()=>{let $=_0xc049d;try{let x=await e($(693)),t=await x[$(628)]();FGSECOMAPP[$(231)]=t?.country_code}catch(a){console.log($(647))}},$p=function(){let $=_0xc049d;try{let x=()=>{let $=_0x4518;typeof FGSECOMAPP[$(545)]!==$(673)&&typeof window[$(243)]===$(673)&&(FGSECOMAPP[$(545)]=async()=>{await window[$(243)]()})};x(),window.addEventListener($(630),function(x){let t=$;FGSECOMAPP[t(555)](),FGSECOMAPP[t(368)]()}),window.addEventListener($(657),function(t){let e=$;x(),$$(e(475))[e(654)](()=>{window.prepareDataForDisplayWidgetByRule()})}),window[$(454)]($(237),function(t){let e=$;x(),$$(e(475)).then(()=>{window[e(243)]()})}),document[$(454)]($(557),x=>{FGSECOMAPP.renderPromotionMessage(),FGSECOMAPP[$(368)]()});let t=()=>{let x=$;typeof FGSECOMAPP.reRenderCartCustom!==x(673)&&typeof window[x(333)]===x(673)&&(FGSECOMAPP[x(545)]=async()=>{let $=x;await Z($(402))[$(654)](x=>{let t=$;window[t(333)](x),window[t(283)]()})})};t(),window[$(722)]=function(x){let e=$;t();let a={...FGSECOMAPP[e(562)]};$$(e(475)).then(()=>{let $=e;Z($(402))[$(654)](x=>{let t=$;window[t(423)](),window.SLIDECART_UPDATE(x),document[t(337)]("#freegifts-main-popup-container.sca-modal-fg.sca-is-visible-fg")||h(a)||window[t(283)]()})})},window[$(632)]=function(){let x=$;FGSECOMAPP[x(555)](),FGSECOMAPP[x(368)]()};let e=()=>{let x=$,t=document[x(337)]("#upCartStickyButton .upcart-sticky-cart-quantity-icon-text");t&&(t[x(694)]=FGSECOMAPP?.[x(562)]?.[x(306)]??0),typeof FGSECOMAPP[x(545)]!==x(673)&&typeof window[x(612)]===x(673)&&(FGSECOMAPP[x(545)]=async()=>{await window[x(612)]()})};e(),window[$(604)]=(x,t)=>{e(),$$($(475)).then()},window[$(566)]=$=>{e(),$$("/cart.js").then()},window.upcartOnCartOpened=()=>{let x=$;FGSECOMAPP[x(555)](),FGSECOMAPP[x(368)]()};let a=()=>{let x=$;"function"!=typeof FGSECOMAPP[x(545)]&&typeof window[x(457)]===x(673)&&(FGSECOMAPP[x(545)]=async()=>{let $=x;await window[$(457)](),window[$(206)]()})};a(),document.addEventListener($(202),x=>{let t=$;a(),$$(t(475))[t(654)]()});let i=()=>{let x=$;typeof FGSECOMAPP[x(545)]!==x(673)&&typeof window?.SATCB?.[x(560)]?.[x(658)]?.[x(496)]===x(673)&&(FGSECOMAPP.reRenderCartCustom=async()=>{let $=x;await window[$(212)][$(560)][$(658)][$(496)]()})};i(),document[$(454)]($(345),x=>{let t=$;i(),$$(t(475))[t(654)](()=>{let $=t;document.querySelector($(600))&&document[$(337)]($(344))?.click()})});let r=()=>{let x=$;"function"!=typeof FGSECOMAPP[x(545)]&&typeof window[x(589)]===x(673)&&(FGSECOMAPP[x(545)]=async()=>{let $=x;await window[$(589)](),window[$(296)]()})};r(),document[$(454)]($(568),x=>{r(),$$("/cart.js")[$(654)]()}),(()=>{let x=$;typeof FGSECOMAPP[x(545)]!==x(673)&&"function"==typeof window.HS_SLIDE_CART_UPDATE&&(FGSECOMAPP[x(545)]=async()=>{let $=x;await window[$(701)](),window[$(528)]()})})(),document[$(454)](FGSECOMAPP.CUSTOM_EVENTS[$(298)],()=>{let x=$;try{typeof window.HS_SLIDE_CART_CLOSE===x(673)&&window[x(375)](),typeof window.closeCart===x(673)&&window[x(645)]()}catch(t){console.error(t)}})}catch(c){console[$(359)](c)}};W(FGSECOMAPP[_0xc049d(213)])[_0xc049d(654)](()=>{$p()})}}catch($g){console[_0xc049d(603)]("can not check freegifts version",$g)}