var boostPFSInstantSearchConfig={search:{suggestionMobileStyle:"style2"}};(function(){BoostPFS.inject(this),SearchInput.prototype.customizeInstantSearch=function(){var suggestionElement=this.$uiMenuElement,searchElement=this.$element,searchBoxId=this.id},InstantSearchResultItemProduct.prototype.compileSuggestionProductPrice=function(){this.prepareSuggestionProductPriceData();var onSale=this.data.compare_at_price_min>this.data.price_min,price=Utils.formatMoney(this.data.price_max),compareAtPrice="";this.data&&this.data.compare_at_price_min&&(compareAtPrice=Utils.formatMoney(this.data.compare_at_price_min),Settings.getSettingValue("search.removePriceDecimal")&&(price=Utils.removeDecimal(price),compareAtPrice=Utils.removeDecimal(compareAtPrice)));var result="";return Settings.getSettingValue("search.showSuggestionProductPrice")&&(onSale&&Settings.getSettingValue("search.showSuggestionProductSalePrice")?result=this.getTemplate(InstantSearchResultItemProduct.tempType.PRICE_SALE):result=this.getTemplate(InstantSearchResultItemProduct.tempType.PRICE)),result.replace(/{{regularPrice}}/g,price).replace(/{{compareAtPrice}}/g,compareAtPrice)},Utils.buildProductItemUrl=function(data,hasCollection){var params=Utils.getWindowLocation().search.substring(1),pathname=window.location.pathname,elements=pathname.split("/"),localeURLPart="",hasShopifyRoutes=Shopify&&Shopify.routes&&typeof Shopify.routes.root!="undefined";Settings.getSettingValue("general.useShopifyRouteForMultiLanguageURL")&&hasShopifyRoutes?localeURLPart=Shopify.routes.root.replace(/\/$/,""):elements.indexOf(boostPFSAppConfig.general.current_locale)>-1&&(localeURLPart="/"+boostPFSAppConfig.general.current_locale);var handle=typeof data=="object"&&data.hasOwnProperty("handle")?data.handle:data,hasCollection=typeof hasCollection!="undefined"?hasCollection:Settings.getSettingValue("general.addCollectionToProductUrl");if(hasCollection)if(pathname=="/"||Utils.isSearchPage()||Utils.isVendorPage()||Utils.isTypePage()){var preHandle=localeURLPart+"/collections/all/products/";return preHandle+handle}else if(Utils.isTagPage()){var preHandle=localeURLPart+"/collections/",collectionHandleIndex=elements.indexOf("collections")+1;return elements.length>=4?preHandle+elements[collectionHandleIndex]+"/products/"+handle:"/collections/all/products/"+handle}else{if(params.indexOf("cache:")>-1){var collectionHandle="all",temp=params.split("&")[0].split("?")[0].split("collections/");return temp.length>1&&(temp[1].indexOf("/")>-1?collectionHandle=temp[1].split("/")[0]:collectionHandle=temp[1]),collectionHandle=collectionHandle.replace(/[`~!@#$%^&*()_|+\=?;:'",.<>\{\}\[\]\\\/]/g,""),"/collections/"+collectionHandle+"/products/"+handle}var collectionHandleIndex=elements.indexOf("collections")+1,preHandle=(typeof elements[2]!="undefined"&&elements[2]==="collections",localeURLPart+"/collections/");return typeof elements[2]!="undefined"?localeURLPart==""&&elements[1]==="collections"||localeURLPart!=""?preHandle+elements[collectionHandleIndex]+"/products/"+handle:preHandle+"all"+elements[collectionHandleIndex]+"/products/"+handle:typeof elements[2]=="undefined"&&localeURLPart==""?"/products/"+handle:window.location.pathname+"/products/"+handle}return localeURLPart+"/products/"+handle},InstantSearchApi.beforeCall=function(searchTerm){Globals.instantSearchQueryParams.q=Utils.encodeURIParamValue(unescape(searchTerm||"").replace(/'/g,"'").replace(/&/g,"").replace(/*/gi,"").replace(/-/g," ")),Globals.instantSearchQueryParams.q||(Globals.instantSearchQueryParams.q=searchTerm)};var searchSubmit=SearchInput.prototype._onSubmit;SearchInput.prototype._onSubmit=function(event,redirect){searchSubmit.call(this,event,redirect);var term=unescape(Globals.currentTerm||"").replace(/'/g,"'").replace(/&/g,"").replace(/*/gi,"").replace(/-/g," "),isApiReturnedResult=Globals.suggestionCache.hasOwnProperty(term),redirectUrl=InstantSearchResultRedirect.getSearchRedirectUrl();isApiReturnedResult&&(redirectUrl&&!Utils.isBadUrl(redirectUrl)?Utils.setWindowLocation(redirectUrl):(this.isChangePage=!0,this.$searchForm[0].submit()))}})(); //# sourceMappingURL=/cdn/shop/t/90/assets/boost-pfs-instant-search.js.map?v=183626250015770797791744288700