PageSourceSearch

https://lovebeautyandplanet.in/cdn/shop/t/976/assets/wizzyCustom.js?v=153398863983493043531785147769

js lovebeautyandplanet.in collected 2026-10-07 07:19:25 UTC 11,810 bytes, 12 lines download raw bytes

1window.onWizzyScriptLoaded=function(){if(handleInputEvent("#mob-search"),handleInputEvent("#mob-search-mob"),typeof wizzyInterval>"u")var wizzyInterval=setInterval(function(){window.wizzyConfig.common.lazyDOMConfig.contentDOMIdentifiers.push("#page-content"),window.wizzyConfig&&(window.wizzyConfig.common.lazyDOMConfig.searchInputIdentifiers[0]={dom:window.matchMedia("(max-width: 768px)").matches?"header input#mob-search-mob":"header input",type:"search"},clearInterval(wizzyInterval))},10);function checkForQuery(q){return q.toLowerCase()==="argan"||q.toLowerCase()==="the argan"}window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_INIT,function(payload){return payload.common.lazyDOMConfig.searchInputIdentifiers=[],payload.common.lazyDOMConfig.searchInputIdentifiers.push({dom:"#mob-search",type:"text"}),payload.common.lazyDOMConfig.contentDOMIdentifiers=[],payload.common.lazyDOMConfig.contentDOMIdentifiers.push("#page-content"),payload.search.configs.general.behaviour="search_as_you_type",payload.search.configs.general.minQueryLength=1,payload}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_SEARCH_EXECUTED,function(data){return data.swatches=JSON.stringify([{key:"Title"}]),typeof data.q<"u"&&checkForQuery(data.q)&&data.sort.unshift({field:"product_WizzyScore_tags:float",order:"desc"}),data}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_AUTOCOMPLETE_EXECUTED,function(data){return data}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.AFTER_WIZZY_API_RESPONDED,function(data){return data}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_AUTOCOMPLETE_PRODUCTS_RENDER,function(data){return data}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_AUTOCOMPLETE_PRODUCTS_RENDER,function(data){return data}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_AUTOCOMPLETE_SUGGESTIONS_RENDER,function(dataregister){var data=dataregister.suggestions;function groupItemsByGroup(data2){return data2.reduce((acc,item)=>{const group=item.group;return acc[group]||(acc[group]=[]),acc[group].push(item),acc},{})}const groupedItems=groupItemsByGroup(data);function generateHTML(groupedItems2){let html2="";groupedItems2.others&&(html2+='<div class="others intial-search-display">',html2+='<h2>Trending Searches</h2> <div class="search-custom-results-wizzy">',groupedItems2.others.forEach(item=>{html2+=`<li class="autocomplete-item">
2            <a data-selectable="true" data-searchterm="${item.label}" href="#" class="autocomplete-link" data-index="${item.index}"> 
3            <span class="wizzy-autocomplete-label"> ${item.label} </span> 
4            <span class="autocomplete-text-wrapper"></span>
5            </a> 
6            </li>`}),html2+="</div></div>",delete groupedItems2.others);var search_input_val=$("#mob-search").val(),search_input_val_mob=$("#mob-search-mob").val();if(!(search_input_val.length>=2)&&!(search_input_val_mob.length>=2))for(const group in groupedItems2)html2+=`<div class="${group} intial-search-display">`,html2+='<h2> Top Categories </h2><div class="search-custom-results-wizzy">',groupedItems2[group].forEach(item=>{html2+=`<li class="autocomplete-item">
7              <a data-selectable="true" data-searchterm="${item.label}" href="#" class="autocomplete-link" data-index="${item.index}">
8              <span class="wizzy-autocomplete-label"> ${item.label} </span> 
9              <span class="autocomplete-text-wrapper"></span>
10              </a> 
11              </li>`}),html2+="</div></div>";return html2}const html=generateHTML(groupedItems);return dataregister}),$("body").on("click",".mobile_search__icon",function(){$(".wizzy-search-input").click(),$(".wizzy-search-input").focus()});let cartItems=[];function getCartItems(){return $.getJSON("/cart.js",function(cart){cartItems=cart.items})}function updateSearchCartUI(){$(".quantity-wrapper").each(function(){const qtyWrapper=$(this),variantId=qtyWrapper.attr("data-qty-variant-id"),cartItem=cartItems.find(item=>String(item.variant_id)===String(variantId)),productCard=qtyWrapper.closest(".wizzy-result-product");cartItem?(qtyWrapper.find(".quantity").addClass("active"),qtyWrapper.find(".quantity-input").val(cartItem.quantity)):qtyWrapper.find(".quantity").removeClass("active")})}window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.PRODUCTS_RESULTS_RENDERED,async function(payload){$("body").hasClass("open__search_top")&&$(".cross___icon_cstm").click(),screen.width>800&&$(".hidden-desktop").css("display","none");var notifyBlock=$(".popup-pincode.notify.align-left")[0];return $(".button.product-atc-btn.cstm-notify").click(function(){$(notifyBlock).css("display","block")}),await getCartItems(),updateSearchCartUI(),payload}),$(document).ready(function(){replaceTemplate("wizzy-search-results-product")}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_INIT,function(payload){return window.wizzyConfig.search.view.noProductsFoundDOM=".wizzy-main-content",payload.search.configs.noProductsFound={showProducts:!0,defaultPool:{method:"filters",expiry:"session",data:{productsCount:6,categories:["best-sellers"]}}},payload.pageStore.groupedFilteredProducts||(payload.pageStore.groupedFilteredProducts={}),payload}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.AFTER_PRODUCTS_TRANSFORMED,function(payload){return payload.forEac
11h(item=>{item.swatches.length>0&&item.swatches[0].values.length>0&&item.swatches[0].values[0].value==="Default Title"&&(item.swatches=null),item.product_Size=!1,item.hoverImage=item.mainImage,item.randomNumber=parseInt(Math.random()*30),item.attributes.forEach(attr=>{if(attr.id==="product_tags"){let tags=attr.values[0].value[0];tags=tags.split(","),tags.filter(item2=>{let current_size=item.sizes[0]?.value;return!!item2.includes("buy_@_1399")}).length>0?item.ishavingbuy3tag=!0:item.ishavingbuy3tag=!1}if(attr.id==="product_demand_custom"&&(item.productType=attr.values[0].value[0]),attr.id==="product_overlay_tags"&&(item.overlayTag=attr.values[0].value[0]),attr.id==="product_vendor"&&(item.vendor=attr.values[0].value[0]),attr.id==="product_value_tags_front_end_tags"&&(item.buyTag=attr.values[0].value[0]),attr.id=="product_reviews_spr"){item.reviews=attr.values[0].value[0];var reviewsData=item.reviews;if($(reviewsData)?.get(4)?.innerHTML){item.hasReviews="yes";var customData=JSON.parse($(reviewsData)[4].innerHTML),reviewCount=customData.reviewCount,ratingValue=customData.ratingValue;item.reviewCount=reviewCount,item.ratingValue=parseFloat(ratingValue).toFixed(1)}}attr.id==="product_product_size_custom"&&(item.product_Size_value=attr.values[0].value[0].toUpperCase(),item.product_Size=!0)}),item.price&&(item.price=parseInt(item.price.replace(/,/g,""))),item.sellingPrice=parseInt(item.sellingPrice.replace(/,/g,""))}),payload}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.AFTER_PRODUCTS_TRANSFORMED,function(payload){return payload.map((product,index)=>{let productctVarient=product.attributes.filter(v=>v.id==="product_variant_ids");productctVarient.length?product.varientId=productctVarient[0].values[0].value[0]:product.varientId=product.id}),payload}),$("body").on("click",".wizzy-view-more",function(){$(".wizzy-search-form").submit()}),$("body").on("click",".autocomplete-link",e=>{switch(e.stopImmediatePropagation(),$(e.currentTarget).children(".wizzy-autocomplete-label").text().trim()){case"Serum":window.location.href="https://lovebeautyandplanet.in/collections/bestsellers";break;case"Hair care":window.location.href="https://lovebeautyandplanet.in/collections/hair-care";break;case"Body Care":window.location.href="https://lovebeautyandplanet.in/collections/body-wash-and-body-lotion";break;case"Buy3 @1399":window.location.href="https://lovebeautyandplanet.in/collections/bundle-offers";break;case"Combos":window.location.href="https://lovebeautyandplanet.in/collections/combos";break;case"New Launches":window.location.href="https://lovebeautyandplanet.in/collections/new-launches";break;case"Argan":window.location.href="https://lovebeautyandplanet.in/collections/argan-oil-lavender";break;case"Onion":window.location.href="https://lovebeautyandplanet.in/collections/onion-blackseed-patchouli";break;default:}}),window.wizzyConfig.events.registerEvent(window.wizzyConfig.events.allowedEvents.BEFORE_AUTOCOMPLETE_WRAPPER_RENDER,function(payload){var response=payload.suggestions;const parser=new DOMParser;var $html=$(response),trendingSearches=$html.find('.autocomplete-item-head[data-index="2"]').nextUntil(".autocomplete-item-head"),trendingSearchesContainer=$('<div class="others intial-search-display"><h2>Trending Searches</h2><div class="search-custom-results-wizzy"></div></div>');trendingSearchesContainer.find(".search-custom-results-wizzy").append(trendingSearches);var topCategories=$html.find('.autocomplete-item-head[data-index="0"]').nextUntil(".autocomplete-item-head"),topCategoriesContainer=$('<div class="categories intial-search-display"><h2>Top Categories</h2><div class="search-custom-results-wizzy"></div></div>');topCategoriesContainer.find(".search-custom-results-wizzy").append(topCategories),$html.find(".autocomplete-suggestions-list").html(""),$html.find(".autocomplete-suggestions-list").append(trendingSearchesContainer);var search_input_val=$("#mob-search").val(),search_input_val_mob=$("#mob-search-mob").val();!(search_input_val.length>=2)&&!(search_input_val_mob.length>=2)&&$html.find(".autocomplete-suggestions-list").append(topCategoriesContainer),search_input_val.length==1&&$html.find(".others.intial-search-display").empty(),search_input_val_mob.length==1&&$html.find(".others.intial-search-display").empty();var manipulatedHtmlString=$html.prop("outerHTML");const doc=parser.parseFromString(manipulatedHtmlString,"text/html"),liElement=doc.getElementsByClassName("autocomplete-item-head")[0];return payload.suggestions=doc.documentElement.outerHTML,payload})};function handleInputEvent(inputId){$(inputId).length&&$(inputId).on("input",function(){$(this).val()===""&&$("body").removeClass("wizzy-search-results-rendered")})}const replaceTemplate=div=>
11{let newDiv=document.getElementById(div+"-new").text,oldDiv=document.getElementById(div);oldDiv.text=newDiv};(function($2){$2.fn.moveTo=function(selector){return this.each(function(){var cl=$2(this).clone();$2(cl).appendTo(selector),$2(this).remove()})}})(jQuery),$("body").on("click",".autocomplete-link",e=>{let searchedTerm=$(e.target).closest("[data-searchterm]").attr("data-searchterm");searchedTerm=="buy 3@1399"&&(e.stopImmediatePropagation(),window.location.href="/collections/bundle-offers"),searchedTerm=="hair care"&&(e.stopImmediatePropagation(),window.location.href="/collections/hair-care"),searchedTerm=="body care"&&(e.stopImmediatePropagation(),window.location.href="/collections/body-wash-and-body-lotion"),searchedTerm=="hair fall"&&(e.stopImmediatePropagation(),window.location.href="/collections/onion-blackseed-patchouli"),searchedTerm=="bestsellers"&&(e.stopImmediatePropagation(),window.location.href="/collections/best-sellers"),searchedTerm=="Argan"&&(e.stopImmediatePropagation(),window.location.href="/collections/argan-oil-lavender"),searchedTerm=="Onion"&&(e.stopImmediatePropagation(),window.location.href="/collections/onion-blackseed-patchouli")});function inputHasValue(){if(screen.width>=800)var inputValue=$($(".wizzy-search-input")[1]).val();else var inputValue=$("#st-search-input-mobile").val();return inputValue.length>=1}
12//# sourceMappingURL=/cdn/shop/t/976/assets/wizzyCustom.js.map?v=153398863983493043531785147769

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.