if(void 0===SPICEVIA)var SPICEVIA={};SPICEVIA.SGvarintsImage=function(){window.location;var e="lago-beachwear",t={"is_active":"1","show_on":0,"theme_id":"724","evi_fimg_skip":0,"evi_product_show":"default","sg_script_run":"1","w_w_liquid":"1","user_batches":"1","isCreateScriptTag":"0","sg_solved":"0"};let i,n,o,a,r,d,s,c,p,l,u,m,h,f="undefined"!=typeof spice_allImages&&0!==spice_allImages.length,g=[],y=[],v={},_=[],w=0,S=!1,I="",E=!1;c={"t_name":"Luca","productblock":"empty","thumbList":"empty","variant_selector":"empty","update_fimg":"empty","otherImgSelector":null,"type":"1","scroller":null,"slideDots":null}.t_name;let O,A=[],L=0;let q={conditions:function(){let i=window.Shopify.shop.replace(".myshopify.com",""),n=window.location.host.replace(".myshopify.com","")===e||i===e,o=-1!==window.location.href.split("/").indexOf("products");n&&"1"===t.is_active&&o?q.setJquery():q.opacity("r")},setJquery:function(){if("undefined"==typeof jQuery||"object"==typeof jQuery){var e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/combine/npm/jquery@3.5.0/dist/jquery.min.js",document.head.appendChild(e),e.onload=f?q.checkLiquid:q.getProductData}else $=jQuery,f?q.checkLiquid():q.getProductData()},checkLiquid:function(){v=spice_mainObject,g=spice_allImages,y=spice_commonImages,a=spice_allTags,r=spice_allVariants,_=spice_allImagesNoVideo,i=spice_evi_productJSON,d=i.media,q.checkTags()},getProductData:async function(){let e=window.location.href.split("/").indexOf("products"),t=window.location.href.split("/")[e+1];t=t.split("?")[0];let s=await q.sendRequest(["/products/"+t+".js","/products/"+t+".json"]);i=s[0],n=s[1],o=n.product.images,a=i.tags,r=n.product.variants,d=i.media,q.setImageData()},setImageData:function(){let e,t=!1;i.media.forEach(((e,t)=>{"image"!=e.media_type&&o.splice(e.position-1,0,{src:e.preview_image.src,variant_ids:[]})})),o.forEach(((i,n)=>{i.variant_ids.length>0?(t=!0,e=i.variant_ids):t||y.push(i.src.replace("https:","").split("?")[0]),void 0!==e&&e.forEach(((e,t)=>{void 0===v[e]?v[e]=[i.src.replace("https:","").split("?")[0]]:v[e].push(i.src.replace("https:","").split("?")[0])})),g.push(i.src.replace("https:","").split("?")[0])})),q.checkTags()},checkTags:function(){let e=t.evi_product_show,i=a.indexOf("evi_showorno")>-1;return"hide"===e&&i||"show"===e&&!i?(q.opacity("r"),!1):("1"===t.evi_fimg_skip&&y.shift(),Object.keys(v).length<2||g.length<2?(q.opacity("r"),!1):void q.setSelectors())},setSelectors:function(){if(void 0===window.Alpine&&L<500)return L+=2,setTimeout((()=>{q.setSelectors()}),50),!1;if(O="none"!==getComputedStyle(document.querySelector("[id*=product-info] .gallery.product-image")).display,O&&"function"!=typeof Splide||!$("[id*=product-info] .product-image").hasClass("is-initialized"))return setTimeout((()=>{q.setSelectors()}),20),!1;u=O?$("[id*=product-info] .product-image .splide__slide:not(.splide__slide--clone)"):$("[id*=product-info] > .flex .hidden > div"),m=$(".product-media__thumbnails")[0];let e=O?$("[id*=product-info] .product-image .splide__slide:not(.splide__slide--clone) img"):$("[id*=product-info] .hidden > div img");A=Array.from(e).map((e=>$(e).attr("src").split("?")[0].replace("_small",""))),A.length>0&&q.isFromStoreDomain(A),l=$(m).length>0||$(u).length>0?"1":"0",q.setEvents()},isFromStoreDomain:function(e){g[0].includes("cdn.shopify.com"),e[0].includes("cdn.shopify.com");const t=e=>e.map((e=>e.split("/").pop()));A=t(e),g=t(g),y=t(y),Object.keys(v).forEach((e=>{v[e]=t(v[e])}))},setEvents:function(){let e;if(e=new URL(document.location).searchParams.get("variant")||$("input[name^=id]:checked, select[name^=id], input[name=id], hidden[name^=id]").val()||99,void 0!==window.Alpine){let t=Alpine.morph;Alpine.morph=async function(...i){let n=await t.apply(Alpine,i);n&&n.getAttribute("id").includes("product-info")&&(e=new URL(document.location).searchParams.get("variant")||$("input[name^=id]:checked, select[name^=id], input[name=id], hidden[name^=id]").val()||99,q.getVariantImages(parseInt(e)))}}else $("body").on("change",".variant-selector input",(function(){setTimeout((function(){e=new URL(document.location).searchParams.get("variant")||$("input[name^=id]:checked, select[name^=id], input[name=id], hidden[name^=id]").val()||$("select[name^=id]").val()||99,q.getVariantImages(parseInt(e))}),50)}));q.getVariantImages(parseInt(e))},getVariantImages:function(e){if(h===e&&$("[id*=product-info] .flex > div").attr("sg-variant-id")==e)return q.opacity("r"),!1;let t;h=e,$("[id*=product-info] .flex > div").attr("sg-variant-id",e),99===e&&(e=parseInt(Object.keys(v)[0])),t=null==e||null==v[e]?g:v[e].concat(y);const i=new CustomEvent("SGEVI:variantChanged",{detail:{variantId:e}});window.dispatchEvent(i),O?q.removeAppendSlider(t):q.removeAppend(t)},removeAppend:function(e){try{$("[id*=product-info] .hidden > div").remove(),e.forEach(((e,t)=>{let i=A.indexOf(e);$("[id*=product-info] .hidden").append($(u[i]))})),q.opacity("r"),"0"!==l&&f||(I="0"!==l||f?f?"Error From Selectors":"Liquid Not Available":"Liquid and Selectors aren't available","0"!==l&&0!==parseInt(p)||q.prepareURLStructure())}catch(e){q.opacity("r"),E=!0,I=e.message,console.warn(e.message),q.prepareURLStructure()}finally{setTimeout((()=>{q.opacity("r"),$("[id*=product-info] .hidden > div").css("opacity",1)}),100)}},removeAppendSlider:function(e){try{$(".sgFeat").remove(),$("[id*=product-info] .product-image:not(.sgFeat)").show(),$("[id*=product-info] .product-image").after($("[id*=product-info] .product-image ").clone().addClass("sgFeat").removeClass("splide--loop splide--ltr splide--draggable is-active is-overflow is-initialized ").removeAttr("id")),$("[id*=product-info] .product-image:not(.sgFeat)").hide(),$("[id*=product-info] .product-image:not(.sgFeat) .splide__list").empty(),$(".sgFeat .splide__list").empty().removeAttr("style"),e.forEach((e=>{let t=A.indexOf(e);$(".sgFeat .splide__list").append($(u[t]).removeAttr("style"))}));let t={perPage:1,pagination:!1,arrows:!!$("[id*=product-info] .product-image .splide__arrows").length,lazyLoad:"nearby",drag:!0,type:"loop",video:{loop:!0,mute:!0,autoplay:!0,hideControls:!0}};new Splide(".sgFeat",t).mount(),$(".sgFeat").find("video").trigger("play"),q.opacity("r"),"0"!==l&&f||(I="0"!==l||f?f?"Error From Selectors":"Liquid Not Available":"Liquid and Selectors aren't available","0"!==l&&0!==parseInt(p)||q.prepareURLStructure())}catch(e){q.opacity("r"),E=!0,I=e.message,console.warn(e.message),q.prepareURLStructure()}finally{setTimeout((()=>{q.opacity("r")}),100)}},opacity:function(e){if(document.querySelectorAll("style#spiceMviOpacity").length>0&&"r"===e)return document.querySelectorAll("style#spiceMviOpacity").forEach((e=>{e.remove()})),!0;if("c"===e){let e=document.createElement("STYLE");return e.id="spiceMviOpacity",e.innerHTML=" {opacity: 0 !important}",document.head.append(e),!0}return!1},sendRequest:async function(e){let t=[];e.forEach((e=>{let i=new Promise((function(t,i){let n=new XMLHttpRequest;n.open("GET",e),n.onload=function(){t(n.response)},n.send()}));t.push(i)}));return(await Promise.all(t).then((e=>e)).catch((e=>{throw e}))).map((e=>JSON.parse(e)))},sendErrorRequest:function(e,t){return $.post(e,{data:t},"json")},prepareURLStructure:function(){if("undefined"==typeof BOOMR&&w<100)return w+=5,setTimeout((()=>{q.prepareURLStructure()}),5),!1;s="undefined"==typeof BOOMR||0===window.BOOMR.themeName.length?Shopify.theme.name:window.BOOMR.themeName;let i="1"===l&!f;i+="";let n="1"===l&!E;if(n=n.toString(),Shopify.theme.role&&"main"!==Shopify.theme.role)return!1;if(0===parseInt(t.sg_script_run)||S)return!1;let o="undefined"!=typeof BOOMR?BOOMR.themeVersion:null,a={themeId:Shopify.theme.id||BOOMR.themeId||"Nahi aayi",themeVersion:o||"Nahi mila"},r={is_liquid:+f,users_theme:s,script_theme:c,shop_name:e,app_status:1,error_msg:I,is_selector_present:l,w_w_liquid:i,evi_run:n,themeInfo:a,productUrl:window.location.href};q.sendErrorRequest("https://evi.spicegems.com/themeliquidissue",r).done((function(){S=!0})).fail((function(e){}))}};f||q.opacity("r"),q.conditions()},function(){if(window.SPICEVIAScript)return!1;window.SPICEVIAScript=!0;let e=document.createElement("STYLE");e.id="spiceMviOpacity",e.innerHTML="[id*=product-info] > .flex .hidden, .product-image{opacity: 0 !important}",document.head.append(e),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?setTimeout((()=>{SPICEVIA.SGvarintsImage()}),200):document.addEventListener("DOMContentLoaded",(()=>{setTimeout((()=>{window.SPICEVIAScript=!0,SPICEVIA.SGvarintsImage()}),500)}))}();
// Luca