@abtasty/search 0.0.2-9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +2 -3
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";const e=()=>{let e;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S?.USER?.accountIdentifier?.length?e=window.ABTASTY_S.USER.accountIdentifier:"function"==typeof window.ABTasty?.getAccountSettings?e=window.ABTasty.getAccountSettings().identifier:window.ABTasty?.accountSettings&&(e=window.ABTasty.accountSettings.identifier),e):e},t=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),a=e=>(e=>{if("string"!=typeof e||!e.trim().length)return null;const[t,a,s]=e.split("[]").map(e=>e.trim()),i=Boolean(s)?s:e,r=a?document.querySelector(t)?.[a]:document;return r?r.querySelector(i):null})(e),s=(e,t)=>{const s=document.querySelector("body")||document.documentElement,i={childList:!0,subtree:!0,attributes:!0},r=()=>n.disconnect(),n=new MutationObserver(()=>{const s=a(t);return s&&!r()&&e(s)});return{clear:r,observe:(e=s)=>n.observe(e,i)}},i=()=>{},r=(e,n)=>{const o=a(e),c={selector:e,clear:i,observe:i};if(o)return setTimeout(()=>n(o),0),c;if(t())return setTimeout(()=>r(e,n),1e3),c;if(e.includes("[]"))return((e,t)=>{const[i,r]=t.split("[]").map(e=>e.trim()),n=a(i),o=n?.[r],{clear:c,observe:l}=s(e,t),h=()=>{const s=a(t);return s&&!d()&&e(s)},d=()=>{c(),n?.removeEventListener("load",h)},u=()=>{l(o),"iframe"===n?.localName&&n.addEventListener("load",h)};return u(),{selector:t,clear:d,observe:u}})(n,e);const{clear:l,observe:h}=s(n,e);return h(),{selector:e,clear:l,observe:h}},n=e=>{const t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),t},o="https://ms-839f1388554f-19719.fra.meilisearch.io",c=`${o}/indexes/${DATA.meilisearchIndex||e()}/search`,l=`${o}/multi-search`,h=["hasbro","lego","mattel"],d={"Content-Type":"application/json",Authorization:"Bearer 1b3d6acfb9eac2780cd20a30ce8728a565960d213b0729b01d9b5e9fdcd3f77b"};function u(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function g(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?u(Object(a),!0).forEach(function(t){m(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):u(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function m(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const b=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)},p=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.entries(e).reduce((e,t)=>{let[s,i]=t;return e[s]&&(Array.isArray(e[s].values)?e[s]=g(g({},i),{},{values:e[s].values.map(e=>{let[t,s]=e;const r=i.values.find(e=>{let[a]=e;return a===t});return r?[t,r[1]]:[t,a?0:s]})}):e[s]=g(g({},i),{},{min:e[s].values.min,max:e[s].values.max})),e},g({},t))};class f{constructor(e){let{baseContainer:t,baseClassName:a,target:s,onInput:i,closeSearchWidget:r}=e;this.baseContainer=t,this.baseClassName=a,this.target=s,this.onInput=i,this.closeSearchWidget=r,this.inputId=`${this.baseClassName}-search-input`,this.searchBarContainer=this.getSearchBarContainer(),this.searchBarLabel=this.getSearchBarLabel(),this.searchBar=this.getSearchBar(),this.searchInput=this.getSearchInput(),this.renderSearchBar()}getSearchBarContainerHeight(){const e=this.target.closest("header");if(e){const t=e.getBoundingClientRect().height;return Math.max(t,150)+"px"}return"auto"}getCurrentSearchBarContainerHeight(){return this.searchBarContainer.getBoundingClientRect().height}resetSearchBarHeight(){this.searchBarContainer.style.minHeight=this.getSearchBarContainerHeight()}focusInput(){this.searchInput.focus()}getSearchBarContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-container`,e.style.minHeight=this.getSearchBarContainerHeight(),e}getSearchBarLabel(){const{searchLabel:e}=DATA,t=document.createElement("label");return t.className=`${this.baseClassName}-search-input-label`,t.innerHTML=e,t.htmlFor=this.inputId,t}getSearchBarAndCloseButtonContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-close-button-container`,e}getSearchBar(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar`,e}getSearchInput(){const e=document.createElement("input");return e.id=this.inputId,e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,e}getSearchCloseButton(){const e=document.createElement("button");e.className=`${this.baseClassName}-close-icon-container`,e.onclick=this.closeSearchWidget;const t=document.createElement("i");return t.className=`${this.baseClassName}-close-icon`,e.appendChild(t),e}renderSearchBar(){this.searchBar.appendChild(this.searchInput);const e=this.getSearchBarAndCloseButtonContainer();e.append(this.searchBar,this.getSearchCloseButton()),this.searchBarContainer.appendChild(this.searchBarLabel),this.searchBarContainer.appendChild(e),this.baseContainer.appendChild(this.searchBarContainer)}}function y(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function w(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?y(Object(a),!0).forEach(function(t){v(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):y(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function v(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const C={text:"",filters:{},sort:[],page:0,totalPages:0,totalHits:0},x=function(){let e=w({},C);return w({get state(){return e}},{logState(e){},setText(t){e.text=t,this.logState("setText")},setPage(t){e.page=t,this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(t){e.totalHits=t,this.logState("setTotalHits")},setSort(t){e.sort=""===t?[]:[t],this.logState("setSort")},onFilterChange(t,a,s){e.page=0,void 0!==s.checked?this.updateFilterArray(t,a,s.checked):this.updateRangeFilter(t,s.min,s.max),this.logState("onFilterChange")},updateRangeFilter(t,a,s){e.filters[t]=[{operator:">",value:a},{operator:"<",value:s}],this.logState("updateRangeFilter")},updateFilterArray(t,a,s){s?e.filters[t]=[...e.filters[t]||[],a]:(e.filters[t].length&&(e.filters[t]=e.filters[t].filter(e=>e!==a)),0===e.filters[t].length&&delete e.filters[t]),this.logState("updateFilterArray")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},this.logState("resetFilters")},resetPagination(){e.page=0,e.totalPages=0,this.logState("resetPagination")},reset(){e=w({},C),this.logState("reset")}})}();class S{constructor(e){let{baseClassName:t,currentRange:a,min:s,max:i,onRangeChange:r}=e;this.baseClassName=t,this.currentRange=a||{min:s,max:i},this.min=s,this.max=i,this.onRangeChange=r}render(){const e=document.createElement("div");e.className=`${this.baseClassName}-range-slider`;const t=document.createElement("div");t.className="range-progress";const a=document.createElement("div");a.className="range-handle";const s=document.createElement("div");s.className="range-handle";const i=document.createElement("div");if(i.className=`${this.baseClassName}-range-values`,this.min===this.max)return a.style.left="0%",s.style.left="100%",t.style.left="0%",t.style.width="100%",a.style.pointerEvents="none",s.style.pointerEvents="none",i.innerHTML=`\n\t\t\t\t<span>${this.min}</span>\n\t\t\t\t<span>${this.max}</span>\n\t\t\t`,e.append(t,a,s),{rangeContainer:e,valuesContainer:i};const r=(this.currentRange.min-this.min)/(this.max-this.min)*100,n=(this.currentRange.max-this.min)/(this.max-this.min)*100;a.style.left=`${r}%`,s.style.left=`${n}%`,t.style.left=`${r}%`,t.style.width=n-r+"%",i.innerHTML=`\n\t\t\t<span>${this.currentRange.min}</span>\n\t\t\t<span>${this.currentRange.max}</span>\n\t\t`,e.append(t,a,s);let o=!1,c=null,l=0,h=0;const d=()=>{const e=parseFloat(a.style.left),t=parseFloat(s.style.left),r=(this.min+e/100*(this.max-this.min)).toFixed(2),n=(this.min+t/100*(this.max-this.min)).toFixed(2);return i.innerHTML=`\n\t\t\t\t<span>${r}</span>\n\t\t\t\t<span>${n}</span>\n\t\t\t`,{minValue:r,maxValue:n}},u=e=>{e.preventDefault(),o=!0,c=e.target,l=e.clientX,h=parseFloat(c.style.left)},g=i=>{if(!o)return;i.preventDefault();const r=i.clientX-l,n=e.offsetWidth;let u=h+r/n*100;u=c===a?Math.max(0,Math.min(u,parseFloat(s.style.left))):Math.max(parseFloat(a.style.left),Math.min(u,100)),u=.8*Math.round(u/.8),c.style.left=`${u}%`,(()=>{const e=parseFloat(a.style.left),i=parseFloat(s.style.left);t.style.left=`${e}%`,t.style.width=i-e+"%"})(),d()},m=()=>{if(!o)return;o=!1,c=null;const{minValue:e,maxValue:t}=d();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[a,s].forEach(e=>{e.addEventListener("mousedown",u),document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)}),{rangeContainer:e,valuesContainer:i}}}class k{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r}=e;this.id=t,this.facet=a,this.baseClassName=s,this.facetsListContainer=i,this.onFiltersChange=r,this.facetContentContainers=this.createFacetContainers(),this.facetsListContainer.appendChild(this.facetContentContainers.facetContainer)}createFacetContainers(){const e=document.createElement("details");e.className=`${this.baseClassName}-search-facet`,e.open=!0;const t=document.createElement("summary");var a;t.innerHTML=`\n\t\t\t<span>${a=this.facet.title,`${a.charAt(0).toUpperCase()}${a.slice(1)}`}</span>\n\t\t\t<div class="${this.baseClassName}-search-facet-arrow" />\n\t\t`;const s=document.createElement("div");return s.className=`${this.baseClassName}-search-facet-content ${this.facet.type}-facet`,e.append(t,s),{facetContainer:e,facetContent:s}}getFacetContainers(){return this.facetContentContainers}}class F extends k{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r}=e;super({id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r});const{facetContent:n,facetContainer:o}=this.getFacetContainers();this.facetContent=n,this.facetContainer=o,this.onFiltersChange=r,this.filterRange=new S({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:e=>{this.onFiltersChange({facetType:"range",facetKey:this.facet.title,options:e})}})}createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){b(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new S({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:e=>{this.onFiltersChange({facetType:"range",facetKey:this.facet.title,options:e})}}),this.createFacetContent())}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.updateFacetContent()}}class N extends k{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r}=e;super({id:t,facet:a,baseClassName:s,facetsListContainer:i,onFiltersChange:r});const{facetContent:n,facetContainer:o}=this.getFacetContainers();this.facetContent=n,this.facetContainer=o,this.facetList=this.getFacetListElement(),this.onFiltersChange=r,this.showAll=!1,this.facetContent.append(this.facetList)}createFacetContent(){const e=this.showAll?this.facet.values:this.facet.values.sort((e,t)=>{let[a,s]=e,[i,r]=t;return r-s}).slice(0,10),t=[];for(const[a,s]of e){const e=this.getFacetListItemElement({name:a,count:s});t.push(e)}if(this.facetList.append(...t),this.facet.values.length>10){const e=document.createElement("button");e.className=`${this.baseClassName}-search-facet-show-more`,e.innerHTML="Show "+(this.showAll?"less":"more"),e.onclick=()=>{this.showAll=!this.showAll,this.updateFacetContent()},this.facetList.append(e)}}getFacetListElement(){const e=document.createElement("ul");return e.style.padding="0",e}getFacetListItemElement(e){const{name:t,count:a}=e,s=document.createElement("li");s.className=`${this.baseClassName}-search-facet-list-item`,s.id=`${this.baseClassName}-search-facet-list-item-${t.replace(" ","-").toLowerCase()}`;const i=(x.state.filters[this.facet.title]||[]).includes(t),r=document.createElement("label");r.className=`${this.baseClassName}-search-facet-checkbox-container ${i||0!==a?"":"disabled"} ${i?"checked":""}`,r.innerHTML=`${t} (${a})`;const n=document.createElement("span");n.className=`${this.baseClassName}-search-facet-checkbox-checkmark`;const o=document.createElement("input");return o.disabled=!i&&0===a,o.checked=i,o.type="checkbox",o.onclick=()=>{const e=o.checked;this.onFiltersChange({facetType:"list",facetKey:this.facet.title,facetValue:t,options:{checked:e}})},r.appendChild(o),r.appendChild(n),s.appendChild(r),s}updateFacetContent(){b(this.facetList),0!==this.facet.values.length&&this.createFacetContent()}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.showAll=!1,this.updateFacetContent()}}class T{constructor(e){let{baseClassName:t,baseContainer:a,searchBar:s,onFiltersChange:i}=e;this.baseClassName=t,this.baseContainer=a,this.searchBar=s,this.onFiltersChange=i,this.facets=[],this.facetsListContainer=this.getFacetsListContainer()}setMaxHeight(e){this.facetsListContainer.style.maxHeight=e}getFacetsListContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-facets-list`,e}renderFacets(e){b(this.facetsListContainer),this.facets=[];for(const[t,a]of Object.entries(e)){if(0===a.values.length||1===a.values.length)continue;const e={id:t,facet:{title:t,values:a.values,type:a.type},baseClassName:this.baseClassName,facetsListContainer:this.facetsListContainer,onFiltersChange:this.onFiltersChange},s=new("range"===a.type?F:N)(e);this.facets.push(s)}this.facets.forEach(e=>{e.createFacetContent()}),this.baseContainer.appendChild(this.facetsListContainer)}updateRangeFacets(e){this.facets.filter(e=>e instanceof F).forEach(t=>{t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof N).forEach(t=>{t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}}class R{constructor(e){let{result:t,index:a,baseClassName:s}=e;this.result=t,this.index=a,this.baseClassName=s}getSearchResultElement(){const e=document.createElement("a");return e.className=`${this.baseClassName}-search-result-container`,e.href=this.result.link,e.target="_blank",e.rel="noreferrer",e.innerHTML=`\n <div class="${this.baseClassName}-search-result result-${this.index}">\n <img loading="lazy" style="height: 60%; width: 100%" src="${this.result.img_link}" />\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="${this.baseClassName}-search-result-name">${this.result.name}</div>\n\t\t\t\t\t\t<div class="${this.baseClassName}-search-result-price">${this.result.price}€</div>\n\t\t\t\t\t</div>\n </div\n\t\t`,e}}class E{constructor(e){let{baseClassName:t,sortOptions:a,infos:s,onSortChange:i}=e;this.baseClassName=t,this.onSortChange=i,this.sortOptions=a,this.infos=s,this.infosElement=this.getInfosElement(),this.sortLabelElement=this.getSortLabelElement(),this.sortSelectElement=this.getSortSelectElement(),this.sortElement=this.getSortElement(),this.infosAndSortContainer=this.getInfoAndSortContainerElement(),this.infosAndSortContainer.appendChild(this.infosElement),this.infosAndSortContainer.appendChild(this.sortElement),this.setSortOptions()}getInfoAndSortContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-info-and-sort`,e}getInfosElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-infos`,e.innerHTML=`\n\t\t\t<span><strong>${this.infos.totalHits}</strong> items</span>\n\t\t`,e}getSortLabelElement(){const e=document.createElement("label");return e.className=`${this.baseClassName}-search-sort-label`,e.textContent="Sort by:",e.htmlFor=`${this.baseClassName}-search-sort-select`,e}getSortSelectElement(){const e=document.createElement("select");return e.className=`${this.baseClassName}-search-sort-select`,e.id=`${this.baseClassName}-search-sort-select`,e.name=`${this.baseClassName}-search-sort-select`,e.onchange=this.handleSortChange.bind(this),e}getSortElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-sort`,e.appendChild(this.sortLabelElement),e.appendChild(this.sortSelectElement),e}setSortOptions(){this.sortSelectElement.childElementCount&&removeChildren(this.sortSelectElement);for(const e of this.sortOptions){const t=document.createElement("option");t.value=e.value,t.textContent=e.label,this.sortSelectElement.appendChild(t)}}handleSortChange(e){const t=e.target.value;this.onSortChange(t)}updateInfos(e){this.infos=e,this.infosElement.innerHTML=`\n\t\t\t<span><strong>${this.infos.totalHits}</strong> items</span>\n\t\t`}updateSortOptions(e){this.sortOptions=e,this.setSortOptions()}}class L{hasTriggeredSeeMore=!1;constructor(e){let{baseContainer:t,baseClassName:a,searchBar:s,onFiltersChange:i,onSortChange:r,onSeeMore:n}=e;this.baseContainer=t,this.baseClassName=a,this.searchBar=s,this.onFiltersChange=i,this.onSortChange=r,this.onSeeMore=n,this.sortOptions=[{value:"",label:"Relevance"},{value:"price:asc",label:"↑ Price"},{value:"price:desc",label:"↓ Price"}],this.searchResultContainer=this.getSearchResultContainerElement(),this.searchResultListContainer=this.getSearchResultListContainerElement(),this.searchResultList=this.getSearchResultListElement(),this.facetsList=new T({searchBar:this.searchBar,baseContainer:this.searchResultContainer,baseClassName:this.baseClassName,onFiltersChange:this.onFiltersChange}),this.infoAndSort=new E({baseClassName:this.baseClassName,infos:{totalHits:x.state.totalHits},sortOptions:this.sortOptions,onSortChange:this.onSortChange}),new MutationObserver(this.mutationCallback.bind(this)).observe(this.searchResultContainer,{childList:!0})}mutationCallback(e){for(const t of e)if("childList"===t.type)if(!t.target.childNodes.length||"0px"!==this.searchResultContainer.style.maxHeight&&""!==this.searchResultContainer.style.maxHeight)0===t.target.childNodes.length&&(this.searchResultListContainer.style.maxHeight="0px",this.facetsList.setMaxHeight("0px"));else{const e=`calc(100vh - ${this.searchBar.getCurrentSearchBarContainerHeight()||0}px)`;this.searchResultListContainer.style.maxHeight=e,this.facetsList.setMaxHeight(e)}}scrollToTop(){this.searchResultList.scrollTop=0}clearSearchResults(){b(this.searchResultList),b(this.searchResultListContainer),b(this.searchResultContainer),this.searchResultContainer.classList.remove("visible","no-results")}getSearchResultContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-container`,e}getSearchResultListContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-list-container`,e.addEventListener("scroll",e=>{const t=e.target.scrollTop+e.target.clientHeight>=e.target.scrollHeight-500;!this.hasTriggeredSeeMore&&t&&x.state.page<x.state.totalPages&&(this.hasTriggeredSeeMore=!0,this.onSeeMore())}),e}getSearchResultListElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-list`,e}updateFacets(e){this.facetsList.updateFacets(e)}updateListFacets(e){this.facetsList.updateListFacets(e)}updateRangeFacets(e){this.facetsList.updateRangeFacets(e)}updateSearchResults(e){if(b(this.searchResultList),this.searchResultList.classList.remove("no-results"),this.infoAndSort.updateInfos({totalHits:x.state.totalHits}),e.length)for(const[t,a]of e.entries()){const e=new R({result:a,index:t,searchResultContainer:this.searchResultList,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML="No results found",this.searchResultList.classList.add("no-results"),this.searchResultList.appendChild(e)}this.hasTriggeredSeeMore=!1}renderSearchResults(e,t){if(this.baseContainer.classList.add("search-completed"),this.clearSearchResults(),this.infoAndSort.updateInfos({totalHits:x.state.totalHits}),e.length){this.facetsList.renderFacets(t);for(const[t,a]of e.entries()){const e=new R({result:a,index:t,searchResultContainer:this.searchResultList,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}this.searchResultListContainer.appendChild(this.infoAndSort.infosAndSortContainer),this.searchResultListContainer.appendChild(this.searchResultList),this.searchResultContainer.appendChild(this.searchResultListContainer),this.baseContainer.appendChild(this.searchResultContainer)}else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML="No results found",this.searchResultContainer.classList.add("no-results"),this.searchResultContainer.appendChild(e)}this.searchResultContainer.classList.add("visible"),this.baseContainer.appendChild(this.searchResultContainer),this.hasTriggeredSeeMore=!1}}function $(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function P(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?$(Object(a),!0).forEach(function(t){O(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):$(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function O(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const A={results:[],facets:{},selectedFacets:{}},j=(()=>{let e=P({},A);return P({get state(){return e}},{logState(e){},addResults(t){e.results=[...e.results,...t.sort((e,t)=>((e,t)=>{const a=e.toLowerCase(),s=t.toLowerCase();return h.some(e=>a.includes(e))&&!h.some(e=>s.includes(e))?-1:h.some(e=>s.includes(e))&&!h.some(e=>a.includes(e))?1:0})(e.name,t.name))],this.logState("addResults")},setFacets(t){e.facets=t,this.logState("setFacets")},addRangeToSelectedFacets(t,a){e.selectedFacets[t]={type:a.type,values:a.values},this.logState("addRangeToSelectedFacets")},addListToSelectedFacets(t,a){if(a){const s=a.values[0],i=a.values[1],r=e.selectedFacets[t];if(r){const e=r.values.findIndex(e=>{let[t]=e;return t===s});e>-1?r.values[e]=[s,r.values[e][1]+i]:r.values.push([s,i])}else e.selectedFacets[t]={type:a.type,values:[[s,i]]}}this.logState("addListToSelectedFacets")},removeSelectedFacet(t,a){const s=e.selectedFacets[t];s&&(s.values=s.values.filter(e=>{let[t]=e;return t!==a})),0===s.values.length&&delete e.selectedFacets[t],this.logState("removeSelectedFacet")},updateSelectedFacets(t){const a=p(t,e.selectedFacets,!0);e.selectedFacets=a,this.logState("updateSelectedFacets")},updateFacets(t){e.facets=p(t,e.facets,!0),this.logState("updateFacets")},setSelectedFacets(t){e.selectedFacets=t,this.logState("setSelectedFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=P({},A),this.logState("reset")}})})();function B(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function H(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?B(Object(a),!0).forEach(function(t){D(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):B(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function D(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const I=function(e){let t=[];for(const a in e){const s=e[a];if(Array.isArray(s))if("object"==typeof s[0]){const e=s.map(e=>`${a} ${e.operator} ${e.value}`);t.push(`(${e.join(" AND ")})`)}else{const e=s.map(e=>`"${a}" = "${e}"`);t.push(`(${e.join(" OR ")})`)}}return t.join(" AND ")},M=function(e){const{facetDistribution:t,facetStats:a}=e;let s={};for(const e in t)a&&a[e]?s[e]={type:"range",values:{min:a[e].min,max:a[e].max}}:s[e]={type:"list",values:Object.entries(t[e])};return s},z=e=>e.filter(e=>e.img_link&&e.price&&e.link).map(e=>({name:e.title,img_link:e.img_link,link:e.link,price:e.price,category:e.category,brand:e.brand})),W=e=>{let{text:t,filters:a,sort:s,page:i}=e;return JSON.stringify({q:t,filter:I(a),facets:["*"],hitsPerPage:50,page:i+1,sort:s||[]})},_=e=>({hits:z(e.hits),facets:M(e),page:e.page,totalPages:e.totalPages,totalHits:e.totalHits}),q=/.+\/([^.]+)\.(otf|ttf)$/,U=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(q)?t.match(q)[1]:""};`:t||"";class V{constructor(e){let{target:t,rootElement:a}=e;this.baseClassName="abtasty-search-widget",this.target=t,this.rootElement=a,this.searchOpen=!1,this.searchWidgetContainer=this.getSearchWidgetContainerElement(),this.searchBar=new f({baseContainer:this.searchWidgetContainer,baseClassName:this.baseClassName,target:this.target,onInput:this.debouncedOnInput.bind(this),closeSearchWidget:this.closeSearchWidget.bind(this)}),this.searchResultsList=new L({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersChange:this.onFiltersChange.bind(this),onSeeMore:this.onSeeMore.bind(this),onSortChange:this.onSortChange.bind(this)})}insertIn(e,t){e.insertAdjacentElement(t,this.searchWidgetContainer)}remove(){this.rootElement.querySelector("body").removeChild(this.searchWidgetContainer)}openSearchWidget(){if(this.searchOpen)return;const e=this.rootElement.querySelector("body");this.rootElement.querySelector("html").classList.add("search-open"),this.insertIn(e,"afterbegin"),this.searchBar.focusInput(),this.searchOpen=!0}closeSearchWidget(){this.rootElement.querySelector("html").classList.remove("search-open"),this.searchOpen=!1,this.remove()}onFiltersChange=e=>{let{facetType:t,facetKey:a,facetValue:s,options:i}=e;"range"===t?this.onRangeChange(a,i.min,i.max):this.onListCheckboxChange(a,s,i.checked)};onSortChange=async e=>{x.setPage(0),j.clearResults(),x.setSort(e),this.searchResultsList.scrollToTop();const t=await(async()=>{try{const e=await fetch(c,{method:"POST",headers:d,body:W(x.state)}),t=await e.json();return{results:_(t).hits}}catch(e){return window.console.error(e),{results:[]}}})();if(!t)return;const{results:a}=t;j.addResults(a),this.searchResultsList.updateSearchResults(j.state.results)};onRangeChange=async(e,t,a)=>{x.resetPagination(),j.clearResults(),x.updateRangeFilter(e,t,a);const s=await this.onSearchWithFilters();if(!s)return;const{results:i,facets:r,totalPages:n,totalHits:o}=s;j.addResults(i),r[e]&&delete r[e],j.updateFacets(r),j.addRangeToSelectedFacets(e,{type:"range",values:{min:t,max:a}}),x.setTotalPages(n),x.setTotalHits(o),this.searchResultsList.updateSearchResults(j.state.results),this.searchResultsList.updateListFacets(j.state.facets)};onListCheckboxChange=async(e,t,a)=>{x.resetPagination(),j.clearResults(),x.updateFilterArray(e,t,a);const s=await this.onSearchWithFilters();if(!s)return;const{results:i,facets:r,totalPages:n,totalHits:o}=s;if(j.addResults(i),j.updateFacets(r),a){const a=r[e]?.values.find(e=>{let[a]=e;return a===t});j.addListToSelectedFacets(e,{type:"list",values:a||[t,0]})}else j.removeSelectedFacet(e,t);x.setTotalPages(n),x.setTotalHits(o),this.searchResultsList.updateSearchResults(j.state.results),this.searchResultsList.updateFacets(j.state.facets)};onInput=e=>{x.setText(e.target.value),e.target.value.length?((Object.keys(x.state.filters).length||x.state.page>0)&&x.resetFiltersAndPagination(),this.onSearch()):(this.searchWidgetContainer.classList.remove("search-completed"),this.searchResultsList.clearSearchResults())};onSeeMore=async()=>{x.setPage(x.state.page+1);const e=await(async()=>{try{const e=await fetch(c,{method:"POST",headers:d,body:W(x.state)}),t=await e.json(),a=_(t);return{results:a.hits,totalPages:a.totalPages}}catch(e){return window.console.error(e),null}})();if(!e)return;const{results:t,totalPages:a}=e;j.addResults(t),x.setTotalPages(a),this.searchResultsList.updateSearchResults(j.state.results)};async onSearchWithFilters(){const{text:t}=x.state;return this.searchResultsList.scrollToTop(),t?await(async()=>{const t=(e=>{const t=[],{text:a,filters:s,page:i,sort:r}=x.state;return t.push({indexUid:e,q:a,filter:I(s),hitsPerPage:50,page:i+1,sort:r||[]}),Object.entries(j.state.facets).forEach(i=>{let[r]=i;const n=H({},s);delete n[r],t.push({indexUid:e,q:a,filter:I(n),facets:[r],hitsPerPage:0})}),JSON.stringify({queries:t})})(DATA.meilisearchIndex||e());try{const e=await fetch(l,{method:"POST",headers:d,body:t}),a=(e=>{const{results:t}=e,a=t.slice(1).reduce((e,t)=>{const a=M(t);return H(H({},e),a)},{});return{hits:z(t[0].hits),facets:a,page:t[0].page,totalPages:t[0].totalPages,totalHits:t[0].totalHits}})(await e.json());return{results:a.hits,facets:a.facets,totalPages:a.totalPages,page:a.page,totalHits:a.totalHits}}catch(e){return window.console.error(e),null}})():(this.searchWidgetContainer.classList.remove("search-completed"),null)}onSearch=async()=>{const{text:e}=x.state;if(j.clearResults(),this.searchResultsList.scrollToTop(),e)try{const e=await(async()=>{try{const e=await fetch(c,{method:"POST",headers:d,body:W(x.state)}),t=await e.json(),a=_(t);return{results:a.hits,facets:a.facets,totalPages:a.totalPages,page:a.page,totalHits:a.totalHits}}catch(e){return window.console.error(e),{results:[],facets:{},totalPages:0,page:0,totalHits:0}}})(),{results:t,facets:a,totalPages:s,totalHits:i}=e;j.addResults(t),j.setFacets(a),x.setTotalPages(s),x.setTotalHits(i),this.searchResultsList.renderSearchResults(t,a)}catch(e){window.console.error(e)}else this.searchWidgetContainer.classList.remove("search-completed")};debouncedOnInput=(()=>(e=>{let t=null;return function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];window.clearTimeout(t),t=window.setTimeout(()=>{e(...s)},150)}})(this.onInput.bind(this)))();getSearchWidgetContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-container`,e.insertAdjacentElement("afterbegin",n((()=>{const{primaryColor:e,secondaryColor:t,tertiaryColor:a,searchBarTitleAlign:s,searchBarTitleFontName:i,searchBarTitleFontSize:r,searchBarTitleFontStyle:n,searchBarTitleCustomFontColor:o,searchBarInputAlign:c,searchBarInputFontName:l,searchBarInputFontSize:h,searchBarInputFontStyle:d,searchBarTitleTextColor:u,searchBarInputTextColor:g,searchBarInputCustomFontColor:m,facetSectionTitleAlign:b,facetSectionTitleFontName:p,facetSectionTitleFontSize:f,facetSectionTitleFontStyle:y,facetSectionTitleCustomFontColor:w,facetSectionTitleTextColor:v,facetTitleAlign:C,facetTitleFontName:x,facetTitleFontSize:S,facetTitleFontStyle:k,facetTitleTextColor:F,facetTitleCustomFontColor:N,searchResultNameAlign:T,searchResultNameFontName:R,searchResultNameFontSize:E,searchResultNameFontStyle:L,searchResultNameCustomFontColor:$,searchResultNameTextColor:P,searchResultPriceAlign:O,searchResultPriceFontName:A,searchResultPriceFontSize:j,searchResultPriceFontStyle:B,searchResultPriceCustomFontColor:H,searchResultPriceTextColor:D}=DATA,I=U(i,n),M=U(l,d);return["div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container {",`background-color: ${e};`,"}","div.abtasty-search-widget-container i.abtasty-search-widget-close-icon {",`background-color: ${e};`,"}","div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary {",`text-align: ${b};`,U(p,y),`font-size: ${f}px;`,`color: ${w?v:e};`,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container {",`text-align: ${C};`,U(x,k),`font-size: ${S}px;`,`color: ${N?F:e};`,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-input-label {",`text-align: ${s};`,I,`font-size: ${r}px;`,`color: ${o?u:t};`,"}","div.abtasty-search-widget-container input.abtasty-search-widget-search-input {",`text-align: ${c};`,M,`font-size: ${h}px;`,`color: ${m?g:t};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name {",`text-align: ${T};`,U(R,L),`font-size: ${E}px;`,`color: ${$?P:e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price {",`text-align: ${O};`,U(A,B),`font-size: ${j}px;`,`color: ${H?D:a};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more {",`color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider {",`background-color: ${t};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress {",`background-color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle {",`background-color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-values {",`color: ${a};`,"}"].join("")})())),e.insertAdjacentElement("afterbegin",n("html.search-open{height:100vh;overflow:hidden;padding:0}div.abtasty-search-widget-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:hsla(0,0%,100%,.5);bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:inherit;height:100vh;left:0;position:fixed;right:0;top:0;width:100vw;z-index:9999}div.abtasty-search-widget-container i{display:inline-block;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}div.abtasty-search-widget-container.search-completed{background-color:#fff}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#0c4884;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:22.5px 100px;position:sticky;top:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar{background-color:#fff;border-radius:12px;margin-top:12px;padding:12px;width:100%}div.abtasty-search-widget-container label.abtasty-search-widget-search-input-label{color:#fff;font-size:16px;font-weight:700;line-height:17px;margin-left:auto;margin-right:auto;margin-top:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;line-height:unset}div.abtasty-search-widget-container input.abtasty-search-widget-search-input{border:unset;font-size:1.6em;font-weight:700;outline:0;padding:unset;width:100%}div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container{background-color:#fff!important;border:none;border-radius:100%;cursor:pointer!important;margin-top:12px;padding:8px;-webkit-transform:translateX(150%);transform:translateX(150%);vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-close-icon{background-color:#0c4884;height:28px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' fill='rgba(0, 0, 0, 0.999)'%3E%3Cpath d='M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25-6.2 6.25-14.4 9.35-22.6 9.35s-16.38-3.125-22.62-9.375L160 301.3 54.63 406.6C48.38 412.9 40.19 416 32 416s-16.37-3.1-22.625-9.4c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' fill='rgba(0, 0, 0, 0.999)'%3E%3Cpath d='M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25-6.2 6.25-14.4 9.35-22.6 9.35s-16.38-3.125-22.62-9.375L160 301.3 54.63 406.6C48.38 412.9 40.19 416 32 416s-16.37-3.1-22.625-9.4c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z'/%3E%3C/svg%3E\");vertical-align:middle;width:28px}div.abtasty-search-widget-container i.abtasty-search-widget-search-icon{background-color:#fff;height:12.5px;margin-right:6px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='rgba(74, 76, 83, 0.999)'%3E%3Cpath d='M500.3 443.7 380.6 324c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723 99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9 53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0 15.606-15.64 15.606-41.04.006-56.64zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128-57.42 128-128 128-128-57.4-128-128z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='rgba(74, 76, 83, 0.999)'%3E%3Cpath d='M500.3 443.7 380.6 324c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723 99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9 53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0 15.606-15.64 15.606-41.04.006-56.64zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128-57.42 128-128 128-128-57.4-128-128z'/%3E%3C/svg%3E\");width:12.5px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container{display:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{display:grid;grid-template-columns:240px 1fr}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible.no-results{grid-template-columns:1fr}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow-y:auto;overscroll-behavior:none;padding:16px 16px 50px}div.abtasty-search-widget-container div.abtasty-search-widget-search-info-and-sort{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort label.abtasty-search-widget-search-sort-label{margin-right:12px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #caced1;border-radius:.25rem;color:#000;cursor:pointer;font-size:16px;font-size:1rem;outline:none;padding:.675em 2em .675em 1em;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:after,div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:before{content:\"\";pointer-events:none;position:absolute;right:16px;right:1rem}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:before{border-bottom:.3rem solid #000;border-left:.3rem solid transparent;border-right:.3rem solid transparent;top:35%}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:after{border-left:.3rem solid transparent;border-right:.3rem solid transparent;border-top:.3rem solid #000;top:55%}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;display:grid;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:24px;justify-content:center;margin-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list.no-results{display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(5,minmax(0,1fr))}div.abtasty-search-widget-container div.abtasty-search-widget-search-no-result{font-size:38px;font-weight:700;margin-left:auto;margin-right:auto;margin-top:82px}div.abtasty-search-widget-container a.abtasty-search-widget-search-result-container{color:unset!important;text-decoration:none!important}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;border-radius:12px;-webkit-box-shadow:0 2px 8px 0 rgba(0,0,0,.11);box-shadow:0 2px 8px 0 rgba(0,0,0,.11);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:400px;justify-content:space-between;padding:18px;width:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result img{aspect-ratio:400/450;height:60%;margin-bottom:12px;margin-left:auto;margin-right:auto;-o-object-fit:contain;object-fit:contain;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name{-webkit-line-clamp:3;-webkit-box-orient:vertical;color:#0d4884;display:-webkit-box;font-size:1em;font-weight:700;height:auto;line-height:1.5em;margin-bottom:8px;max-height:4.5em;min-height:1.5em;overflow:hidden;text-decoration:none!important}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{color:#404040;font-size:1.833em;font-weight:bolder;line-height:normal;margin-top:auto;text-decoration:none!important}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{overflow-y:auto;overscroll-behavior:none;padding-bottom:50px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content{padding-left:18px;padding-right:18px}div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more{background-color:transparent;border:none;color:#0c4884;font-size:14px;font-weight:700;margin-bottom:12px;padding:0;text-decoration:underline}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content.range-facet{margin-bottom:12px;padding-right:18px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-list-item-container{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:space-between}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-list-item-container div.checkbox{margin:unset}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container{cursor:pointer;display:block;font-size:14px;font-weight:400;line-height:14px;margin-bottom:12px;padding-left:30px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.checked,div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container:hover:not(.disabled){font-weight:700}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.disabled{cursor:not-allowed}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input{cursor:pointer;height:0;opacity:0;position:absolute;width:0}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.disabled input{cursor:not-allowed}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input[type=checkbox]:before{content:none!important}div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark{background-color:transparent;border:1px solid #000;border-radius:4px;height:15px;left:0;position:absolute;top:0;width:15px}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark{background-color:#0c4884;font-weight:700}div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark:after{content:\"\";display:none;position:absolute}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark:after{display:block}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container span.abtasty-search-widget-search-facet-checkbox-checkmark:after{border:solid #fff;border-width:0 2px 2px 0;height:8px;left:4.5px;top:1.5px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:4px}div.abtasty-search-widget-container li.abtasty-search-widget-search-facet-list-item{margin-bottom:12px;margin-top:12px}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:rgba(0,0,0,.067);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:16px;font-weight:700;justify-content:space-between;padding:13.5px 18px}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary:before{content:none}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary div.abtasty-search-widget-search-facet-arrow:before{content:\"\\276F\"}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary div.abtasty-search-widget-search-facet-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg);-webkit-transform-origin:center;transform-origin:center}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet[open] summary div.abtasty-search-widget-search-facet-arrow{-webkit-transform:rotate(270deg);transform:rotate(270deg)}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content ul{list-style:none}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider{background-color:#e0e0e0;border-radius:5px;height:5px;margin:20px 0;position:relative;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress{background-color:#0c4884;border-radius:5px;height:100%;position:absolute;z-index:1}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle{background-color:#0c4884;border:2px solid #fff;border-radius:50%;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2);box-shadow:0 2px 4px rgba(0,0,0,.2);cursor:pointer;height:20px;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:20px;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-range-values{-webkit-box-pack:justify;-ms-flex-pack:justify;color:#404040;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;justify-content:space-between;margin-top:10px}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span{font-weight:600}@media (max-width:1199.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (max-width:991.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (max-width:767.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(2,minmax(0,1fr))}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{height:300px}}@media (max-width:575.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{padding:22.5px}div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container{-webkit-transform:translateX(15%);transform:translateX(15%)}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(1,minmax(0,1fr))}}")),e}}(()=>{const{elementReferrer:e}=DATA;return(e=>{const a=(()=>{if(t()||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),s=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(a||s){const t=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${t} - ${a?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${e}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}})("Widget launch"),(()=>{const e=[{name:DATA.facetTitleFontName,style:DATA.facetTitleFontStyle},{name:DATA.searchBarTitleFontName,style:DATA.searchBarTitleFontStyle},{name:DATA.searchBarInputFontName,style:DATA.searchBarInputFontStyle},{name:DATA.facetSectionTitleFontName,style:DATA.facetSectionTitleFontStyle},{name:DATA.searchResultNameFontName,style:DATA.searchResultNameFontStyle},{name:DATA.searchResultPriceFontName,style:DATA.searchResultPriceFontStyle}];for(const{name:t,style:a}of e){if(!t||"inherit"===t||!/otf|ttf/g.test(a))continue;const e=document.createElement("style"),s=a.match(q)?a.match(q)[1]:"";e.innerHTML=`@font-face { font-family: '${t}_${s}'; src: url('${a}'); font-display: swap; }`,document.head.appendChild(e)}})(),new Promise(s=>{r(e,()=>{const i=a(e),r=i.getRootNode();i.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.right="0",n.style.bottom="0",n.style.backgroundColor="transparent",n.style.cursor="pointer",n.onclick=e=>{e?.preventDefault?.(),e?.stopPropagation?.(),new V({target:i,rootElement:r}).openSearchWidget()},i.appendChild(n),t()&&n.onclick(),s()})})})().then(()=>{})}();
|
|
1
|
+
!function(){"use strict";const e=()=>{let e;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S?.USER?.accountIdentifier?.length?e=window.ABTASTY_S.USER.accountIdentifier:"function"==typeof window.ABTasty?.getAccountSettings?e=window.ABTasty.getAccountSettings().identifier:window.ABTasty?.accountSettings&&(e=window.ABTasty.accountSettings.identifier),e):e},t=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),a=e=>(e=>{if("string"!=typeof e||!e.trim().length)return null;const[t,a,s]=e.split("[]").map(e=>e.trim()),i=Boolean(s)?s:e,r=a?document.querySelector(t)?.[a]:document;return r?r.querySelector(i):null})(e),s=(e,t)=>{const s={childList:!0,subtree:!0,attributes:!0},i=()=>r.disconnect(),r=new MutationObserver(()=>{const s=a(t);return s&&!i()&&e(s)});return{clear:i,observe:e=>{const t=document.querySelector("body")||document.documentElement,a=e??t;r.observe(a,s)}}},i=()=>{},r=(e,n)=>{const o=a(e),c={selector:e,clear:i,observe:i};if(o)return setTimeout(()=>n(o),0),c;if(t())return setTimeout(()=>r(e,n),1e3),c;if(e.includes("[]"))return((e,t)=>{const[i,r]=t.split("[]").map(e=>e.trim()),n=a(i),o=n?.[r],{clear:c,observe:l}=s(e,t),d=()=>{const s=a(t);return s&&!h()&&e(s)},h=()=>{c(),n?.removeEventListener("load",d)},b=()=>{l(o),"iframe"===n?.localName&&n.addEventListener("load",d)};return b(),{selector:t,clear:h,observe:b}})(n,e);const{clear:l,observe:d}=s(n,e);return d(),{selector:e,clear:l,observe:d}},n="https://ms-839f1388554f-19719.fra.meilisearch.io",o=`${n}/indexes/${DATA.meilisearchIndex||e()}/search`,c=`${n}/multi-search`,l={"Content-Type":"application/json",Authorization:"Bearer 1b3d6acfb9eac2780cd20a30ce8728a565960d213b0729b01d9b5e9fdcd3f77b"},d=e=>{for(;e.firstChild;)e.removeChild(e.lastChild)};class h{constructor(){this.observers=[]}subscribe(e){this.observers.push(e)}unsubscribe(e){this.observers=this.observers.filter(t=>t!==e)}notify(e){this.observers.forEach(t=>t(e))}}const b=e=>{const{translationKeys:t}=DATA;if(!t)return e;try{const a=JSON.parse(t),s=a?.[e];return s&&""!==s?s:e}catch(t){return e}};function g(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?g(Object(a),!0).forEach(function(t){m(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):g(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function m(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const p=()=>[{value:"relevance",label:b("Relevance")},{value:"price:asc",label:`↑ ${b("Price")}`},{value:"price:desc",label:`↓ ${b("Price")}`}],f="RESET",w="SET_TEXT",y="SET_TOTAL_HITS",v="SET_SORT",x="SET_LIST_FILTERS",C="SET_RANGE_FILTERS",k="REMOVE_RANGE_FILTERS",E="RESET_FILTERS",S="GET_NEXT_PAGE",N="SET_RESULTS",A="UPDATE_RESULTS",T="ADD_RESULTS";function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function R(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(Object(a),!0).forEach(function(t){F(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function F(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const I={results:[],facets:{}},O=(()=>{let e=R({},I);const t=new h;return R({get state(){return e},get observable(){return t}},{logState(t){JSON.parse(JSON.stringify(e))},setResults(a,s){e.results=a,e.facets=s,t.notify({type:N})},updateResults(a){e.results=a,t.notify({type:A}),this.logState("updateResults")},setFacets(a){e.facets=a,t.notify({type:"SET_FACETS"}),this.logState("setFacets")},addResults(a){e.results=[...e.results,...a],t.notify({type:T,payload:a}),this.logState("addResults")},updateFacets(t){const a=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Object.entries(e).reduce((e,t)=>{let[s,i]=t;return e[s]&&(Array.isArray(e[s].values)?e[s]=u(u({},i),{},{values:e[s].values.map(e=>{let[t,s]=e;const r=i.values.find(e=>{let[a]=e;return a===t});return r?[t,r[1]]:[t,a?0:s]})}):e[s]=u(u({},i),{},{min:e[s].values.min,max:e[s].values.max})),e},u({},t))}(t,e.facets,!0);this.setFacets(a),this.logState("updateFacets")},clearResults(){e.results=[],this.logState("clearResults")},reset(){e=R({},I),this.logState("reset")}})})();function j(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function B(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?j(Object(a),!0).forEach(function(t){M(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function M(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const P={text:"",filters:{},sort:["relevance"],page:1,totalPages:0,totalHits:0},D=function(){let e=B({},P);const t=new h;return B({get state(){return e},get observable(){return t},isNoFiltersAndNoSort:()=>0===Object.keys(e.filters).length&&"relevance"===e.sort[0]},{logState(t){JSON.parse(JSON.stringify(e))},setText(a){e.text=a,t.notify({type:w}),this.logState("setText")},setPage(a){e.page=a,e.page<e.totalPages&&t.notify({type:S}),this.logState("setPage")},setTotalPages(t){e.totalPages=t,this.logState("setTotalPages")},setTotalHits(a){e.totalHits=a,t.notify({type:y}),this.logState("setTotalHits")},setSort(a){e.sort=""===a?[]:[a],t.notify({type:v}),this.logState("setSort")},updateRangeFilter(a,s,i){e.filters[a]=[{operator:">=",value:s},{operator:"<=",value:i}],t.notify({type:C}),this.logState("updateRangeFilter")},removeRangeFilter(a){const s=B({},e.filters);delete s[a],e.filters=s,t.notify({type:k}),this.logState("removeRangeFilter")},updateFilterArray(a,s,i){const r=B({},e.filters);i?r[a]=[...r[a]||[],s]:(r[a].length&&(r[a]=r[a].filter(e=>e!==s)),0===r[a].length&&delete r[a]),e.filters=r,t.notify({type:x}),this.logState("updateFilterArray")},resetFiltersAndPagination(){this.resetFilters(),this.resetPagination(),this.logState("resetFiltersAndPagination")},resetFilters(){e.filters={},t.notify({type:E}),this.logState("resetFilters")},resetPagination(){e.page=1,e.totalPages=0,this.logState("resetPagination")},reset(){e=B({},P),t.notify({type:f}),this.logState("reset")}})}();class z{constructor(e){let{baseClassName:t,target:a,onInput:s,closeSearchWidget:i}=e;this.baseClassName=t,this.target=a,this.onInput=s,this.closeSearchWidget=i,this.inputId=`${this.baseClassName}-search-input`,this.searchBarContainer=this.getSearchBarContainer(),this.searchBar=this.getSearchBar(),this.searchInput=this.getSearchInput(),this.buildSearchBar()}getSearchBarContainerHeight(){const e=this.target.closest("header");if(e){const t=e.getBoundingClientRect().height;return Math.max(t,150)+"px"}return"auto"}getCurrentSearchBarContainerHeight(){return this.searchBarContainer.getBoundingClientRect().height}resetSearchBarHeight(){this.searchBarContainer.style.minHeight=this.getSearchBarContainerHeight()}setInputValue(e){this.searchInput.value=e}focusInput(){this.searchInput.focus()}resetInput(){this.searchInput.value=""}setResetIconVisibility(e){this.resetSearchBarButton.style.visibility=e?"visible":"hidden"}getSearchBarContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-container`,e}getSearchBarAndCloseButtonContainer(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-bar-close-button-container`,e}getSearchBar(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-bar`;const t=document.createElement("i");return t.className=`${this.baseClassName}-search-icon`,e.appendChild(t),e}getSearchInput(){const e=document.createElement("input");return e.id=this.inputId,e.placeholder=b("Search..."),e.className=`${this.baseClassName}-search-input`,e.oninput=this.onInput,e}getSearchCloseButton(){const e=document.createElement("button");e.className=`${this.baseClassName}-close-icon-container`,e.onclick=this.closeSearchWidget;const t=document.createElement("i");return t.className=`${this.baseClassName}-close-icon`,e.appendChild(t),e}buildSearchBar(){const e=document.createElement("button");e.className=`${this.baseClassName}-reset-search-bar`,e.onclick=()=>{O.reset(),D.reset()};const t=document.createElement("i");t.className=`${this.baseClassName}-close-icon`,e.appendChild(t),this.resetSearchBarButton=e,this.searchBar.appendChild(this.searchInput),this.searchBar.appendChild(this.resetSearchBarButton);const a=this.getSearchBarAndCloseButtonContainer();a.append(this.searchBar,this.getSearchCloseButton()),this.searchBarContainer.appendChild(a)}}class H{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i}=e;this.id=t,this.facet=a,this.baseClassName=s,this.facetsListContainer=i,this.facetContentContainers=this.createFacetContainers(),this.facetsListContainer.insertBefore(this.facetContentContainers.facetContainer,this.facetsListContainer.lastChild)}createFacetContainers(){const e=`${(t=this.facet.title).charAt(0).toUpperCase()}${t.slice(1)}`;var t;const a=b(e),s=document.createElement("details");s.className=`${this.baseClassName}-search-facet`,s.open=!0;const i=document.createElement("summary");i.innerHTML=`\n\t\t\t<span>${a}</span>\n\t\t\t<div class="${this.baseClassName}-search-facet-arrow">\n <svg width="14" height="8" viewBox="0 0 14 8" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.04951 7.55342C0.837905 7.44427 0.664506 7.23215 0.599514 7.00293C0.581178 6.93825 0.572874 6.8248 0.579306 6.72657C0.601746 6.38349 0.419705 6.58327 3.63323 3.37487C6.89349 0.119802 6.61624 0.367433 7.00022 0.367433C7.38419 0.367433 7.10695 0.119802 10.3672 3.37487C13.6501 6.65253 13.4202 6.39573 13.4202 6.78523C13.4202 6.96849 13.4118 7.00722 13.3413 7.15046C13.1287 7.58246 12.6239 7.75732 12.1892 7.54958C12.1021 7.50794 11.4956 6.91619 9.53822 4.96288L7.00022 2.43019L4.46222 4.96288C2.50749 6.91353 1.8983 7.50796 1.81149 7.54946C1.57821 7.66094 1.26117 7.66257 1.04951 7.55342Z" fill="%232A2A3C"/>\n </svg>\n </div>\n\t\t`;const r=document.createElement("div");return r.className=`${this.baseClassName}-search-facet-content ${this.facet.type}-facet`,s.append(i,r),{facetContainer:s,facetContent:r}}getFacetContainers(){return this.facetContentContainers}}class _ extends H{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i}=e;super({id:t,facet:a,baseClassName:s,facetsListContainer:i});const{facetContent:r,facetContainer:n}=this.getFacetContainers();this.facetContent=r,this.facetContainer=n,this.facetList=this.getFacetListElement(),this.showAll=!1,this.facetContent.append(this.facetList)}createFacetContent(){const e=this.facet.values.sort((e,t)=>{let[a,s]=e,[i,r]=t;const n=(D.state.filters[this.facet.title]||[]).includes(a),o=(D.state.filters[this.facet.title]||[]).includes(i);return n===o?r-s:o-n}),t=this.showAll?e:e.slice(0,10),a=[];for(const[e,s]of t){const t=this.getFacetListItemElement({name:e,count:s});a.push(t)}if(this.facetList.append(...a),this.facet.values.length>10){const e=document.createElement("button");e.className=`${this.baseClassName}-search-facet-show-more`,e.innerHTML=this.showAll?b("See less"):b("See more"),e.onclick=()=>{this.showAll=!this.showAll,this.updateFacetContent()},this.facetList.append(e)}}getFacetListElement(){return document.createElement("ul")}getFacetListItemElement(e){const{name:t,count:a}=e,s=document.createElement("li");s.className=`${this.baseClassName}-search-facet-list-item`,s.id=`${this.baseClassName}-search-facet-list-item-${t.replace(" ","-").toLowerCase()}`;const i=(D.state.filters[this.facet.title]||[]).includes(t),r=document.createElement("label");r.className=`${this.baseClassName}-search-facet-checkbox-container ${i||0!==a?"":"disabled"} ${i?"checked":""}`,r.innerHTML=`${t} (${a})`;const n=document.createElement("span");n.className=`${this.baseClassName}-search-facet-checkbox-checkmark`;const o=document.createElement("input");return o.disabled=!i&&0===a,o.checked=i,o.type="checkbox",o.onclick=()=>{const e=o.checked;D.resetPagination(),O.clearResults(),D.updateFilterArray(this.facet.title,t,e)},r.appendChild(o),r.appendChild(n),s.appendChild(r),s}updateFacetContent(){d(this.facetList),0!==this.facet.values.length&&this.createFacetContent()}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.showAll=!1,this.updateFacetContent()}}class W{constructor(e){let{baseClassName:t,currentRange:a,min:s,max:i,onRangeChange:r}=e;this.baseClassName=t,this.currentRange=a||{min:s,max:i},this.min=s,this.max=i,this.onRangeChange=r}render(){const e=document.createElement("div");e.className=`${this.baseClassName}-range-slider`;const t=document.createElement("div");t.className="range-progress";const a=document.createElement("div");a.className="steps-container";for(let e=0;e<20;e++){const e=document.createElement("div");e.className="step-bar",a.appendChild(e)}const s=document.createElement("div");s.className="range-handle";const i=document.createElement("div");i.className="range-handle-value",s.appendChild(i);const r=document.createElement("div");r.className="range-handle";const n=document.createElement("div");n.className="range-handle-value",r.appendChild(n);const o=document.createElement("div");if(o.className=`${this.baseClassName}-range-values`,this.min===this.max)return s.style.left="0%",r.style.left="100%",t.style.left="0%",t.style.width="100%",s.style.pointerEvents="none",r.style.pointerEvents="none",i.textContent=Math.floor(this.min),n.textContent=Math.ceil(this.max),o.innerHTML=`\n\t\t\t\t<span>${Math.floor(this.min)}</span>\n\t\t\t\t<span>${Math.ceil(this.max)}</span>\n\t\t\t`,e.append(a,t,s,r),{rangeContainer:e,valuesContainer:o};const c=(this.currentRange.min-this.min)/(this.max-this.min)*100,l=(this.currentRange.max-this.min)/(this.max-this.min)*100;s.style.left=`${c}%`,r.style.left=`${l}%`,t.style.left=`${c}%`,t.style.width=l-c+"%",i.textContent=Math.floor(this.currentRange.min),n.textContent=Math.ceil(this.currentRange.max),o.innerHTML=`\n\t\t\t<span>${Math.floor(this.currentRange.min)}</span>\n\t\t\t<span>${Math.ceil(this.currentRange.max)}</span>\n\t\t`,e.append(a,t,s,r);let d=!1,h=null,b=0,g=0;const u=()=>{const e=parseFloat(s.style.left),t=parseFloat(r.style.left),a=Math.floor(this.min+e/100*(this.max-this.min)),o=Math.ceil(this.min+t/100*(this.max-this.min));return i.textContent=a,n.textContent=o,{minValue:a,maxValue:o}},m=e=>{e.preventDefault(),d=!0,h=e.target.closest(".range-handle"),b=e.clientX||e.touches&&e.touches[0].clientX,g=parseFloat(h.style.left)},p=a=>{if(!d)return;a.preventDefault();const i=(a.clientX||a.touches&&a.touches[0].clientX)-b,n=e.offsetWidth;let o=g+i/n*100;o=h===s?Math.max(0,Math.min(o,parseFloat(r.style.left))):Math.max(parseFloat(s.style.left),Math.min(o,100));const c=100/19;o=Math.round(o/c)*c,h.style.left=`${o}%`,(()=>{const e=parseFloat(s.style.left),a=parseFloat(r.style.left);t.style.left=`${e}%`,t.style.width=a-e+"%"})(),u()},f=()=>{if(!d)return;d=!1,h=null;const{minValue:e,maxValue:t}=u();this.currentRange={min:e,max:t},this.onRangeChange(this.currentRange)};return[s,r].forEach(e=>{e.addEventListener("mousedown",m),e.addEventListener("touchstart",m,{passive:!1})}),document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",f),document.addEventListener("touchcancel",f),{rangeContainer:e,valuesContainer:o}}}class q extends H{constructor(e){let{id:t,facet:a,baseClassName:s,facetsListContainer:i}=e;super({id:t,facet:a,baseClassName:s,facetsListContainer:i});const{facetContent:r,facetContainer:n}=this.getFacetContainers();this.facetContent=r,this.facetContainer=n,this.filterRange=new W({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:this.onRangeChange.bind(this)})}onRangeChange=e=>{const{min:t,max:a}=e,{min:s,max:i}=O.state.facets[this.facet.title]?.values,r=!(void 0===s||void 0===i||Math.floor(s)!==Number(t)||Math.ceil(i)!==Number(a));D.resetPagination(),O.clearResults(),r?D.removeRangeFilter(this.facet.title):D.updateRangeFilter(this.facet.title,t,a)};createFacetContent(){const{rangeContainer:e,valuesContainer:t}=this.filterRange.render();this.facetContent.append(e,t)}updateFacetContent(){d(this.facetContent),void 0!==this.facet.values.min&&void 0!==this.facet.values.max&&(this.filterRange=new W({baseClassName:this.baseClassName,currentRange:{min:this.facet.values.min,max:this.facet.values.max},min:this.facet.values.min,max:this.facet.values.max,onRangeChange:this.onRangeChange.bind(this)}),this.createFacetContent())}updateFacet(e){this.facet={title:this.facet.title,type:this.facet.type,values:e.values},this.updateFacetContent()}}class Z{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getSortFacetElement(),D.observable.subscribe(e=>{let{type:t}=e;switch(t){case f:case v:this.updateSortValue()}})}updateSortValue(){this.element.querySelectorAll(".active").forEach(e=>{e.classList.remove("active"),e.disabled=!1});const e=this.element.querySelector(`[data-value="${D.state.sort[0]||"relevance"}"]`);e&&(e.classList.add("active"),e.disabled=!0)}getSortOptionsElements(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-options`;const t=p();for(const a of t){const t=document.createElement("button");t.classList.add(`${this.baseClassName}-search-sort-option`),(""===a.value&&0===D.state.sort.length||D.state.sort.includes(a.value))&&(t.classList.add("active"),t.disabled=!0),t.innerHTML=a.label,t.dataset.value=a.value,t.onclick=()=>{D.setPage(1),O.clearResults(),D.setSort(a.value)},e.appendChild(t)}return e}getSortFacetElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-facet`;const t=document.createElement("label");return t.className=`${this.baseClassName}-search-sort-label`,t.textContent=`${b("Sort By")}:`,e.appendChild(t),e.appendChild(this.getSortOptionsElements()),e}}class G{constructor(e){let{baseClassName:t}=e;this.baseClassName=t,this.element=this.getInfosElement(),D.observable.subscribe(e=>{let{type:t}=e;t===y&&(this.element.innerHTML=this.getContent())})}getInfosElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-infos`,e.style.whiteSpace="nowrap",e.innerHTML=this.getContent(),e}getContent(){const e=`${b("result")}${D.state.totalHits>1?"s":""}`;return`<span><b>${D.state.totalHits}</b> ${e}</span>`}}class V{constructor(e){let{baseClassName:t,baseContainer:a,searchBar:s,onFiltersReset:i}=e;this.baseClassName=t,this.baseContainer=a,this.searchBar=s,this.onFiltersReset=i,this.facets=[],this.facetsListContainer=this.getFacetsListContainer(),D.observable.subscribe(e=>{let{type:t}=e;switch(t){case x:case C:case k:case E:this.setResetButtonAvailability()}})}setResetButtonAvailability(){const e=this.facetsListContainer.querySelector(`.${this.baseClassName}-search-facets-list-reset-button`);e&&(e.disabled=!Object.keys(D.state.filters).length)}getFacetsListContainer(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-facets-list`;const t=document.createElement("button");t.className=`${this.baseClassName}-search-facets-list-close-button`,t.onclick=this.closeFilters.bind(this);const a=document.createElement("i");a.className=`${this.baseClassName}-close-icon`,t.appendChild(a),this.sortFacet=new Z({baseClassName:this.baseClassName});const s=document.createElement("div");s.className=`${this.baseClassName}-search-facets-list-bottom-buttons-container`;const i=document.createElement("button");i.className=`plain inverted ${this.baseClassName}-search-facets-list-reset-button`,i.disabled=!0,i.innerHTML=b("Clear results"),i.onclick=this.onFiltersReset;const r=document.createElement("div");r.className=`${this.baseClassName}-search-facets-list-header`,this.searchInfos=new G({baseClassName:this.baseClassName});const n=document.createElement("button");return n.className=`plain ${this.baseClassName}-search-facets-list-bottom-close-button`,n.innerHTML=b("Show results"),n.onclick=this.closeFilters.bind(this),r.append(this.searchInfos.element,t),s.append(i,n),e.append(r,this.sortFacet.element,s),e}renderFacets(e){[...this.facetsListContainer.children].forEach(e=>{e.tagName.toLowerCase()==="details".toLowerCase()&&e.parentNode.removeChild(e)}),this.facets=[];for(const[t,a]of Object.entries(e)){if(0===a.values.length||1===a.values.length)continue;const e={id:t,facet:{title:t,values:a.values,type:a.type},baseClassName:this.baseClassName,facetsListContainer:this.facetsListContainer},s=new("range"===a.type?q:_)(e);this.facets.push(s)}this.facets.forEach(e=>{e.createFacetContent()}),this.baseContainer.appendChild(this.facetsListContainer)}setMaxHeight(e){e?(this.facetsListContainer.style.maxHeight=`calc(100vh - ${e}px)`,this.facetsListContainer.style.top=`${e}px`):(this.facetsListContainer.style.maxHeight="0px",this.facetsListContainer.style.top="0px")}openFilters(){const e=this.baseContainer.parentElement,t=document.createElement("div");t.className=`${this.baseClassName}-search-facets-list-overlay`,t.onclick=this.closeFilters.bind(this),e.insertAdjacentElement("afterbegin",t),e.style.overflowY="hidden",this.facetsListContainer.classList.add("open")}closeFilters(){this.facetsListContainer.classList.remove("open");const e=this.baseContainer.parentElement,t=e.firstChild;e.removeChild(t),e.style.overflowY="auto",setTimeout(()=>{this.facetsListContainer.scrollTop=0},500)}updateRangeFacets(e){this.facets.filter(e=>e instanceof q).forEach(t=>{t.updateFacet(e[t.id])})}updateListFacets(e){this.facets.filter(e=>e instanceof _).forEach(t=>{t.updateFacet(e[t.id])})}updateFacets(e){this.updateRangeFacets(e),this.updateListFacets(e)}}class J{constructor(e){let{result:t,index:a,baseClassName:s}=e;this.result=t,this.index=a,this.baseClassName=s}getRatingElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-result-rating`;const t=document.createElement("div");t.className="reviews-count",t.textContent=`197 ${b("reviews")}`;const a=document.createElement("div");return a.className="star-rating",a.style.setProperty("--rating-width","83.6%"),e.appendChild(a),e.appendChild(t),e}getSearchResultElement(){const e=document.createElement("a");e.className=`${this.baseClassName}-search-result-container`,e.href=this.result.link;const t=this.index<6&&this.index<window.innerHeight/200*2;return e.innerHTML=[`<div class="${this.baseClassName}-search-result result-${this.index}">`,`<div class="${this.baseClassName}-search-result-image-container">`,`<img ${t?`src="${this.result.img_link}"`:`data-src="${this.result.img_link}" class="lazy"`} />`,"</div>",`<div class="${this.baseClassName}-search-result-content">`,`<div class="${this.baseClassName}-search-result-name">${this.result.name}</div>`,this.result.brand?`<div class="${this.baseClassName}-search-result-brand">${this.result.brand}</div>`:"",`<div class="${this.baseClassName}-search-result-price">${this.result.price}€</div>`,"</div>","</div>"].join("\n"),e}}class U{constructor(e){let{baseClassName:t,infos:a,openFilters:s}=e;this.baseClassName=t,this.infos=a,this.openFilters=s,this.searchInfos=new G({baseClassName:t}),this.sortLabelElement=this.getSortLabelElement(),this.sortSelectElement=this.getSortSelectElement(),this.sortAndFiltersButtonElement=this.getSortAndFiltersButtonElement(),this.infosAndSortContainer=this.getInfoAndSortContainerElement(),this.infosAndSortContainer.appendChild(this.searchInfos.element),this.infosAndSortContainer.appendChild(this.sortAndFiltersButtonElement),this.setSortOptions(),D.observable.subscribe(e=>{let{type:t}=e;switch(t){case x:case C:case k:case E:this.updateFiltersInfo();break;case v:this.updateSortValue();break;case f:this.updateFiltersInfo(),this.updateSortValue()}})}updateFiltersInfo(){let e=0;for(const t of Object.values(D.state.filters))"object"==typeof t[0]?e++:e+=t.length;e?(this.filtersButtonElement.classList.add("active"),this.filtersButtonTextElement.textContent=`${e} ${b("Filter")}${e>1?"s":""}`):(this.filtersButtonElement.classList.remove("active"),this.filtersButtonTextElement.textContent=b("Filter"))}updateSortValue(){this.sortSelectElement.value=D.state.sort[0]||"relevance"}getInfoAndSortContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-info-and-sort`,e}getSortLabelElement(){const e=document.createElement("label");return e.className=`${this.baseClassName}-search-sort-label`,e.textContent=`${b("Sort By")}:`,e.htmlFor=`${this.baseClassName}-search-sort-select`,e}getSortSelectElement(){const e=document.createElement("select");return e.className=`${this.baseClassName}-search-sort-select`,e.id=`${this.baseClassName}-search-sort-select`,e.name=`${this.baseClassName}-search-sort-select`,e.onchange=this.handleSortChange.bind(this),e}getSortElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-sort`,e.appendChild(this.sortLabelElement),e.appendChild(this.sortSelectElement),e}getFiltersButtonElement(){const e=document.createElement("button");e.className=`${this.baseClassName}-search-filters-button`;const t=document.createElement("i");t.className=`${this.baseClassName}-search-filters-button-icon`;const a=document.createElement("span");return a.className=`${this.baseClassName}-search-filters-button-text`,a.textContent=b("Filter"),e.append(t,a),e.onclick=this.openFilters,this.filtersButtonTextElement=a,e}getSortAndFiltersButtonElement(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-sort-and-filters-button-container`;const t=this.getSortElement();return this.filtersButtonElement=this.getFiltersButtonElement(),e.appendChild(t),e.appendChild(this.filtersButtonElement),e}setSortOptions(){this.sortSelectElement.childElementCount&&removeChildren(this.sortSelectElement);const e=p();for(const t of e){const e=document.createElement("option");e.value=t.value,e.textContent=t.label,this.sortSelectElement.appendChild(e)}}handleSortChange(e){const t=e.target.value;D.setPage(1),O.clearResults(),D.setSort(t)}}const X=575.99;class Y{constructor(e){let{baseContainer:t,baseClassName:a,searchBar:s,onFiltersReset:i}=e;this.baseContainer=t,this.baseClassName=a,this.searchBar=s,this.onFiltersReset=i,this.searchResultContainer=this.getSearchResultContainerElement(),this.searchResultListContainer=this.getSearchResultListContainerElement(),this.searchResultList=this.getSearchResultListElement(),this.facetsList=new V({searchBar:this.searchBar,baseContainer:this.searchResultContainer,baseClassName:this.baseClassName,onFiltersReset:this.onFiltersReset}),this.infoAndSort=new U({baseClassName:this.baseClassName,infos:{totalHits:D.state.totalHits},openFilters:this.facetsList.openFilters.bind(this.facetsList)}),new MutationObserver(this.mutationCallback.bind(this)).observe(this.searchResultContainer,{childList:!0}),this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),this.resizeObserver.observe(document.body),this.isMobileLayout=window.innerWidth<=X,O.observable.subscribe(e=>{let{type:t,payload:a}=e;switch(t){case N:this.onSetResults(O.state.results,O.state.facets);break;case A:this.onUpdateResults(O.state.results);break;case T:this.onAddResults(a)}})}onSetResults(e,t){if(this.baseContainer.classList.add("search-completed"),this.clearSearchResults(),e.length)this.facetsList.renderFacets(t),this.searchResultListContainer.appendChild(this.infoAndSort.infosAndSortContainer),DATA.groupBy&&DATA.groupByName?this.renderGroupedResultList(e):this.renderResultList(e),this.searchResultContainer.appendChild(this.searchResultListContainer),this.baseContainer.appendChild(this.searchResultContainer),this.lazyLoadImages();else{const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=b("No result found"),this.searchResultContainer.classList.add("no-results"),this.searchResultContainer.appendChild(e)}this.searchResultContainer.classList.add("visible"),this.baseContainer.appendChild(this.searchResultContainer),this.resultsChanged=!0}onAddResults(e){e.length&&(this.renderListItems(e),this.lazyLoadImages(),this.resultsChanged=!0)}onUpdateResults(e){if(this.searchResultContainer.classList.remove("no-results"),DATA.groupBy&&DATA.groupByName)return this.updateGroupedSearchResults(e);d(this.searchResultList),e.length?(this.renderListItems(e),this.lazyLoadImages()):this.renderNoResults(),this.resultsChanged=!0}handleResize(e){const t=(e[0].contentRect.width||window.innerWidth)<=X;if(t!==this.isMobileLayout&&(this.isMobileLayout=t,this.searchResultContainer.childNodes.length)){const e=this.searchBar.getCurrentSearchBarContainerHeight();this.facetsList.setMaxHeight(this.isMobileLayout?0:e),!this.isMobileLayout&&this.facetsList.facetsListContainer.classList.contains("open")&&this.facetsList.closeFilters()}}mutationCallback(e){for(const t of e)if("childList"===t.type&&this.resultsChanged)if(t.target.childNodes.length){const e=this.searchBar.getCurrentSearchBarContainerHeight();this.facetsList.setMaxHeight(e)}else 0===t.target.childNodes.length&&this.facetsList.setMaxHeight(0);this.resultsChanged=!1}lazyLoadImages(){let e=this.searchResultListContainer.querySelectorAll(".lazy");if("IntersectionObserver"in window){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const a=e.target;a.src=a.dataset.src,a.addEventListener("load",()=>{a.classList.remove("lazy"),t.unobserve(a)})}})},{root:this.baseContainer,rootMargin:"0px 0px 500px 0px"});e.forEach(e=>{t.observe(e)})}else{let t;const a=()=>{t&&clearTimeout(t),t=setTimeout(()=>{const t=window.scrollY;e.forEach(a=>{if(a.offsetTop<window.innerHeight+t+500){const t=a.dataset.src;a.src=t,a.classList.remove("lazy"),e=this.searchResultList.querySelectorAll(".lazy")}}),0==e.length&&(document.removeEventListener("scroll",a),window.removeEventListener("resize",a))},20)};document.addEventListener("scroll",a),window.addEventListener("resize",a)}}getSearchResultContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-container`,e}getSearchResultListContainerElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-list-container`,e}getSearchResultListElement(){const e=document.createElement("div");return e.className=`${this.baseClassName}-search-result-list`,e}updateGroupedSearchResults(e){const t=this.searchResultListContainer.querySelectorAll(`.${this.baseClassName}-group-container`);for(const e of t)d(e);e.length?(this.renderGroupedResultList(e),this.lazyLoadImages()):this.renderNoResults(),this.resultsChanged=!0}renderGroupedResultList(e){const t=Object.groupBy(e,e=>e[DATA.groupByName]);let a=0;for(const[e,s]of Object.entries(t)){const t=document.createElement("div");t.className=`${this.baseClassName}-group-container`;const i=document.createElement("div");i.className=`${this.baseClassName}-group-name`,i.innerHTML=e,t.appendChild(i);const r=this.getSearchResultListElement();for(const e of s){const t=new J({result:e,index:a,baseClassName:this.baseClassName});r.appendChild(t.getSearchResultElement()),a++}t.appendChild(r),this.searchResultListContainer.appendChild(t)}}renderResultList(e){this.renderListItems(e),this.searchResultListContainer.appendChild(this.searchResultList)}renderListItems(e){for(const[t,a]of e.entries()){const e=new J({result:a,index:t,baseClassName:this.baseClassName});this.searchResultList.appendChild(e.getSearchResultElement())}}renderNoResults(){const e=document.createElement("div");e.className=`${this.baseClassName}-search-no-result`,e.innerHTML=b("No result found"),this.searchResultContainer.classList.add("no-results"),this.searchResultList.appendChild(e)}clearSearchResults(){d(this.searchResultList),d(this.searchResultListContainer),d(this.searchResultContainer),this.searchResultContainer.classList.remove("visible","no-results"),this.searchResultContainer.remove()}updateListFacets(e){this.facetsList.updateListFacets(e)}updateFacets(e){this.facetsList.updateFacets(e)}}function Q(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,s)}return a}function K(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(a),!0).forEach(function(t){ee(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Q(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function ee(e,t,a){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const te=DATA.groupBy?1e3:50,ae=function(e){let t=[];for(const a in e){const s=e[a];if(Array.isArray(s))if("object"==typeof s[0]){const e=s.map(e=>`${a} ${e.operator} ${e.value}`);t.push(`(${e.join(" AND ")})`)}else{const e=s.map(e=>`"${a}" = "${e}"`);t.push(`(${e.join(" OR ")})`)}}return t.join(" AND ")},se=function(e){const{facetDistribution:t,facetStats:a}=e;let s={};for(const e in t)a&&a[e]?s[e]={type:"range",values:{min:a[e].min,max:a[e].max}}:s[e]={type:"list",values:Object.entries(t[e])};return s},ie=e=>{const t=DATA.language,a=[];for(const s of e){let e=s.title,i=s.link;if(t&&(s.localized_title&&(e=JSON.parse(s.localized_title)[t]??s.title),s.localized_link&&(i=JSON.parse(s.localized_link)[t]??s.link)),i&&s.img_link&&s.price){const t={name:e,link:i,img_link:s.img_link,price:s.price,category:s.category||s.categories,brand:s.brand};DATA.groupBy&&DATA.groupByName&&(t[DATA.groupByName]=s[DATA.groupByName]),a.push(t)}}return a},re=e=>{let{text:t,filters:a,sort:s,page:i}=e;return JSON.stringify(K({q:t,filter:ae(a),facets:["*"],hitsPerPage:te,page:i,sort:"relevance"===s[0]?[]:s,limit:DATA.groupBy?1e3:void 0},DATA.useSemanticSearch&&{hybrid:{semanticRatio:DATA.semanticRatio,embedder:"default"}}))},ne=e=>({hits:ie(e.hits),facets:se(e),page:e.page,totalPages:e.totalPages,totalHits:e.totalHits}),oe=async()=>{try{const e=await fetch(o,{method:"POST",headers:l,body:re(D.state)}),t=await e.json(),a=ne(t);return{results:a.hits,facets:a.facets,totalPages:a.totalPages,page:a.page,totalHits:a.totalHits}}catch(e){return window.console.error(e),{results:[],facets:{},totalPages:0,page:0,totalHits:0}}},ce=/.+\/([^.]+)\.(otf|ttf)$/,le=(e,t)=>e&&"inherit"!==e?`font-family:${e}_${t.match(ce)?t.match(ce)[1]:""};`:t||"",de=()=>{const{primaryColor:e,textColor:t,searchBarBackgroundColor:a,searchBarInputBackgroundColor:s,searchBarInputAlign:i,searchBarInputFontName:r,searchBarInputFontSize:n,searchBarInputFontStyle:o,searchBarInputCustomFontColor:c,searchBarInputTextColor:l,searchBarInputBorderRadius:d}=DATA;return["@media (min-width: 576px) {","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container {",`background-color: ${a};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-bar {",`background-color: ${s};`,`border-color: ${e};`,d?`border-radius: ${d}px;`:"","}","div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon {",`background-color: ${t};`,"opacity: 0.3;","}","div.abtasty-search-widget-container input.abtasty-search-widget-search-input {",`text-align: ${i};`,le(r,o),`font-size: ${n}px;`,`color: ${c?l:t};`,"}","}"].join("")},he=()=>{const{primaryColor:e,textColor:t,secondaryTextColor:a,facetSectionTitleAlign:s,facetSectionTitleFontName:i,facetSectionTitleFontSize:r,facetSectionTitleFontStyle:n,facetSectionTitleCustomFontColor:o,facetSectionTitleTextColor:c,facetTitleAlign:l,facetTitleFontName:d,facetTitleFontSize:h,facetTitleFontStyle:b,facetTitleCustomFontColor:g,facetTitleTextColor:u}=DATA;return["div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary {",`text-align: ${s};`,le(i,n),`font-size: ${r}px;`,`color: ${o?c:t};`,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container {",`text-align: ${l};`,le(d,b),`font-size: ${h}px;`,`color: ${g?u:a};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active,","div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more {",`color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider {",`background-color: ${e};`,"}","div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value,","div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress {",`background-color: ${e};`,"}","div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon,","div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button {",`background-color: ${e};`,`border-color: ${e};`,`color: ${a};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-range-values {",`color: ${a};`,"}"].join("")},be=()=>{const{primaryColor:e,textColor:t,searchResultNameAlign:a,searchResultNameFontName:s,searchResultNameFontSize:i,searchResultNameFontStyle:r,searchResultNameCustomFontColor:n,searchResultNameTextColor:o,searchResultPriceAlign:c,searchResultPriceFontName:l,searchResultPriceFontSize:d,searchResultPriceFontStyle:h,searchResultPriceCustomFontColor:b,searchResultPriceTextColor:g}=DATA;return["div.abtasty-search-widget-container div.abtasty-search-widget-search-result:hover {",`border-color: ${e};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name {",`text-align: ${a};`,le(s,r),`font-size: ${i}px;`,`color: ${n?o:t};`,"}","div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price {",`text-align: ${c};`,le(l,h),`font-size: ${d}px;`,`color: ${b?g:t};`,"}"].join("")},ge=()=>{const{primaryColor:e,backgroundColor:t,secondaryTextColor:a}=DATA;return["div.abtasty-search-widget-container {",`background-color: ${t};`,"}","div.abtasty-search-widget-container button.plain {",`background-color: ${e};`,`color: ${t};`,"}","div.abtasty-search-widget-container button.plain.inverted {",`background-color: ${t};`,`color: ${e};`,"}","div.abtasty-search-widget-container button.plain.inverted:disabled {",`background-color: ${t};`,`color: ${a};`,"}"].join("")};class ue{hasTriggeredSeeMore=!1;constructor(e){let{target:t,rootElement:a}=e;this.baseClassName="abtasty-search-widget",this.target=t,this.rootElement=a,this.searchOpen=!1,this.searchWidgetContainer=this.getSearchWidgetContainerElement(),this.searchBar=new z({baseContainer:this.searchWidgetContainer,baseClassName:this.baseClassName,target:this.target,onInput:this.debouncedOnInput.bind(this),closeSearchWidget:this.closeSearchWidget.bind(this)}),this.searchResultsList=new Y({baseClassName:this.baseClassName,baseContainer:this.searchWidgetContainer,searchBar:this.searchBar,onFiltersReset:this.onFiltersReset.bind(this)}),this.searchWidgetContainer.appendChild(this.searchBar.searchBarContainer),this.getRecommendationsElement(),D.observable.subscribe(e=>{let{type:t}=e;switch(t){case w:this.onTextChange();break;case x:this.onFilterChange(!1);break;case k:case C:this.onFilterChange(!0);break;case v:this.onSortChange();break;case S:this.onSeeMore();break;case f:this.onSearchReset()}})}onTextChange(){if(!D.state.text)return O.reset(),void D.reset();this.searchBar.setResetIconVisibility(!0),this.recommendationsContainer?.remove(),(Object.keys(D.state.filters).length||D.state.page>0)&&D.resetFiltersAndPagination(),this.onSearch()}async onFilterChange(t){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const a=await(async()=>{const t=(e=>{const t=[],{text:a,filters:s,page:i,sort:r}=D.state;return t.push({indexUid:e,q:a,filter:ae(s),hitsPerPage:te,page:i,sort:"relevance"===r[0]?[]:r}),Object.entries(O.state.facets).forEach(i=>{let[r]=i;const n=K({},s);delete n[r],t.push({indexUid:e,q:a,filter:ae(n),facets:[r],hitsPerPage:0})}),JSON.stringify({queries:t})})(DATA.meilisearchIndex||e());try{const e=await fetch(c,{method:"POST",headers:l,body:t}),a=(e=>{const{results:t}=e,a=t.slice(1).reduce((e,t)=>{const a=se(t);return K(K({},e),a)},{});return{hits:ie(t[0].hits),facets:a,page:t[0].page,totalPages:t[0].totalPages,totalHits:t[0].totalHits}})(await e.json());return{results:a.hits,facets:a.facets,totalPages:a.totalPages,page:a.page,totalHits:a.totalHits}}catch(e){return window.console.error(e),null}})();if(!a)return;const{results:s,facets:i,totalPages:r,totalHits:n}=a;if(t)for(const[e,t]of Object.entries(i))"range"===t.type&&delete i[e];O.updateResults(s),O.updateFacets(i),D.setTotalPages(r),D.setTotalHits(n),t?this.searchResultsList.updateListFacets(O.state.facets):this.searchResultsList.updateFacets(O.state.facets)}async onSortChange(){this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1;const e=await(async()=>{try{return{results:(await oe()).results}}catch(e){return window.console.error(e),{results:[]}}})();if(!e)return;const{results:t}=e;O.updateResults(t)}async onSeeMore(){const e=await(async()=>{try{const e=await oe();return{results:e.results,totalPages:e.totalPages}}catch(e){return window.console.error(e),null}})();if(!e)return;this.hasTriggeredSeeMore=!1;const{results:t}=e;O.addResults(t)}onSearchReset=()=>{this.searchResultsList.clearSearchResults(),this.searchWidgetContainer.classList.remove("search-completed"),this.recommendationsContainer&&this.searchWidgetContainer.appendChild(this.recommendationsContainer),this.searchBar.setResetIconVisibility(!1),this.searchBar.resetInput(),this.searchBar.focusInput()};insertIn(e,t){e.insertAdjacentElement(t,this.searchWidgetContainer)}remove(){this.rootElement.querySelector("body").removeChild(this.searchWidgetContainer)}handleScroll(e){const t=e.target.scrollTop+e.target.clientHeight>=e.target.scrollHeight-500;!this.hasTriggeredSeeMore&&t&&D.state.page<D.state.totalPages&&(this.hasTriggeredSeeMore=!0,D.setPage(D.state.page+1))}openSearchWidget(){if(this.searchOpen)return;const e=this.rootElement.querySelector("body");this.rootElement.querySelector("html").classList.add("search-open"),this.insertIn(e,"afterbegin"),this.searchBar.focusInput(),this.searchOpen=!0}closeSearchWidget(){this.rootElement.querySelector("html").classList.remove("search-open"),this.searchOpen=!1,this.remove()}onFiltersReset(){D.isNoFiltersAndNoSort()||(D.resetFiltersAndPagination(),this.onSearch())}onInput=e=>{D.setText(e.target.value)};debouncedOnInput=(()=>(e=>{let t=null;return function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];window.clearTimeout(t),t=window.setTimeout(()=>{e(...s)},150)}})(this.onInput.bind(this)))();async onSearch(){const{text:e}=D.state;this.searchWidgetContainer.scrollTop=0,this.hasTriggeredSeeMore=!1,window.abtasty.send("event",{ec:"Action Tracking",ea:"search",el:e});const t=await oe(),{results:a,facets:s,totalPages:i,totalHits:r}=t;D.setTotalPages(i),D.setTotalHits(r),O.setResults(a,s)}getSearchWidgetContainerElement(){const e=document.createElement("div"),t=document.createElement("style");t.setAttribute("abtasty-script-added","true");const a=document.createElement("style");a.setAttribute("abtasty-script-added","true"),e.className=`${this.baseClassName}-container`,!DATA.groupBy&&e.addEventListener("scroll",this.handleScroll.bind(this));const[s,i,r,n]=[de(),be(),he(),ge()],o=document.createTextNode("html.search-open{height:100vh;overflow:hidden}div.abtasty-search-widget-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:inherit;inset:0;overflow-y:auto;position:fixed;z-index:9999}div.abtasty-search-widget-container button:not(:disabled):hover{opacity:.5}div.abtasty-search-widget-container i{display:inline-block;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}div.abtasty-search-widget-container button.plain{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#3100bf;border:none;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:8px;width:100%}div.abtasty-search-widget-container button.plain:not(:disabled){cursor:pointer}div.abtasty-search-widget-container button.plain.inverted{background-color:#fff;color:#3100bf}div.abtasty-search-widget-container button.plain.inverted:disabled{background-color:#fff;color:#d8d8e2}div.abtasty-search-widget-container.search-completed{background-color:#fff}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#fff;border-bottom:1px solid #d8d8e2;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:24px 0;position:sticky;top:0;z-index:10}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin-inline:auto;max-width:1104px;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:#fff;border:1px solid #a18cde;border-radius:4px;display:-webkit-box;display:-ms-flexbox;display:flex;margin-right:24px;padding:12px;width:100%}div.abtasty-search-widget-container input.abtasty-search-widget-search-input{border:none;font-size:13px;font-weight:400;outline:0;padding:0;width:100%}div.abtasty-search-widget-container button.abtasty-search-widget-reset-search-bar{background-color:#fff;border:none;cursor:pointer;min-height:24px;min-width:24px;padding:0;visibility:hidden}div.abtasty-search-widget-container button.abtasty-search-widget-reset-search-bar i.abtasty-search-widget-close-icon{background-color:#2a2a3c;min-height:12.19px;min-width:12.19px}div.abtasty-search-widget-container button.abtasty-search-widget-reset-search-bar svg{fill:#000;min-height:12.19px;min-width:12.19px}div.abtasty-search-widget-container button.abtasty-search-widget-close-icon-container{background-color:transparent!important;border:none;border-radius:100%;cursor:pointer!important;min-height:32px;min-width:32px;vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-close-icon{background-color:#d8d8e2;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.21 1.209a1.133 1.133 0 0 1 1.602 0l6.19 6.188L15.19 1.21a1.133 1.133 0 0 1 1.603 1.602l-6.189 6.19 6.189 6.188a1.133 1.133 0 0 1-1.603 1.603L9 10.602l-6.189 6.19a1.133 1.133 0 1 1-1.602-1.603L7.398 9 1.21 2.811a1.133 1.133 0 0 1 0-1.602Z' fill='%23787888'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.21 1.209a1.133 1.133 0 0 1 1.602 0l6.19 6.188L15.19 1.21a1.133 1.133 0 0 1 1.603 1.602l-6.189 6.19 6.189 6.188a1.133 1.133 0 0 1-1.603 1.603L9 10.602l-6.189 6.19a1.133 1.133 0 1 1-1.602-1.603L7.398 9 1.21 2.811a1.133 1.133 0 0 1 0-1.602Z' fill='%23787888'/%3E%3C/svg%3E\");min-height:16.25px;min-width:16.25px;vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-search-icon{background-color:#2a2a3c;margin-right:6px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.48.545a6.397 6.397 0 0 0-2.315.615A6.463 6.463 0 0 0 1.16 4.165a6.41 6.41 0 0 0 4.28 9.005 6.668 6.668 0 0 0 2.392.116 6.434 6.434 0 0 0 3.096-1.332l.12-.095 1.768 1.764c1.932 1.927 1.815 1.82 2.028 1.843a.575.575 0 0 0 .622-.631c-.024-.206.074-.098-1.843-2.019l-1.765-1.768.072-.088a6.73 6.73 0 0 0 .791-1.255 6.23 6.23 0 0 0 .618-2.929 6.213 6.213 0 0 0-.749-2.86A6.407 6.407 0 0 0 6.48.546Zm.016 1.146A5.266 5.266 0 0 0 1.72 6.236a7.775 7.775 0 0 0-.024 1.174 5.267 5.267 0 0 0 8.2 3.885 5.296 5.296 0 0 0 2.154-3.087c.106-.426.148-.789.148-1.272 0-.5-.043-.854-.158-1.302a5.259 5.259 0 0 0-1.227-2.258 5.254 5.254 0 0 0-3.318-1.672c-.2-.021-.79-.029-.998-.013Z' fill='%232A2A3C'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.48.545a6.397 6.397 0 0 0-2.315.615A6.463 6.463 0 0 0 1.16 4.165a6.41 6.41 0 0 0 4.28 9.005 6.668 6.668 0 0 0 2.392.116 6.434 6.434 0 0 0 3.096-1.332l.12-.095 1.768 1.764c1.932 1.927 1.815 1.82 2.028 1.843a.575.575 0 0 0 .622-.631c-.024-.206.074-.098-1.843-2.019l-1.765-1.768.072-.088a6.73 6.73 0 0 0 .791-1.255 6.23 6.23 0 0 0 .618-2.929 6.213 6.213 0 0 0-.749-2.86A6.407 6.407 0 0 0 6.48.546Zm.016 1.146A5.266 5.266 0 0 0 1.72 6.236a7.775 7.775 0 0 0-.024 1.174 5.267 5.267 0 0 0 8.2 3.885 5.296 5.296 0 0 0 2.154-3.087c.106-.426.148-.789.148-1.272 0-.5-.043-.854-.158-1.302a5.259 5.259 0 0 0-1.227-2.258 5.254 5.254 0 0 0-3.318-1.672c-.2-.021-.79-.029-.998-.013Z' fill='%232A2A3C'/%3E%3C/svg%3E\");min-height:15px;min-width:15px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-width:300px;min-width:300px;padding:16px 16px 50px 0}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-categories-title,div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-products-title{color:#2a2a3c;font-size:16px;font-weight:700}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-categories-title{margin:16px 0 24px}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-products-title{margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category{color:#2a2a3c;cursor:pointer;font-size:14px;font-weight:400;line-height:20px;text-transform:capitalize}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:not(:first-child),div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:not(:last-child){margin-bottom:16px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-category:hover{color:#3100bf}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container{-webkit-box-sizing:border-box;box-sizing:border-box;display:none}div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;-ms-flex-pack:justify;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:space-between;margin-inline:auto;max-width:1104px;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1;padding:32px 0 50px 32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container div.abtasty-search-widget-group-name{border-bottom:1px solid #d8d8e2;color:#2a2a3c;font-size:24px;font-weight:700;margin:16px 0;padding-bottom:4px;text-transform:uppercase}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container div.abtasty-search-widget-group-container div.abtasty-search-widget-search-result-list{margin-bottom:32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .star-rating{display:inline-block;font-size:12px;height:12px;margin-right:16px;position:relative;width:74px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .star-rating:before{color:#5e5e6e;content:\"★ ★ ★ ★ ★\";inset:0;position:absolute}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .star-rating:after{color:#fac438;content:\"★ ★ ★ ★ ★\";inset:0;overflow:hidden;position:absolute;white-space:nowrap;width:var(--rating-width)}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-rating .reviews-count{color:#5e5e6e;font-size:12px;text-decoration:underline;text-underline-offset:4px}div.abtasty-search-widget-container div.abtasty-search-widget-search-infos{font-size:14px}div.abtasty-search-widget-container div.abtasty-search-widget-search-info-and-sort{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort{-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:13px;position:relative}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort label.abtasty-search-widget-search-sort-label{color:#2a2a3c;font-size:13px;font-weight:400;margin-bottom:0;margin-right:8px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:unset;border:none;color:#2a2a3c;cursor:pointer;outline:none;padding:0 24px 0 0;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort:after{background-color:#2a2a3c;bottom:5%;content:\"\";height:10px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' fill='%232A2A3C' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.967.631a.617.617 0 0 1 .3.367.627.627 0 0 1 .014.184c-.015.229.106.096-2.036 2.235C5.07 5.587 5.256 5.422 5 5.422s-.071.165-2.244-2.005C.566 1.232.72 1.403.72 1.143A.41.41 0 0 1 .773.9.573.573 0 0 1 1.54.634c.058.027.462.422 1.767 1.724L5 4.047l1.692-1.689C7.995 1.058 8.402.661 8.46.634A.612.612 0 0 1 8.967.63Z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' fill='%232A2A3C' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.967.631a.617.617 0 0 1 .3.367.627.627 0 0 1 .014.184c-.015.229.106.096-2.036 2.235C5.07 5.587 5.256 5.422 5 5.422s-.071.165-2.244-2.005C.566 1.232.72 1.403.72 1.143A.41.41 0 0 1 .773.9.573.573 0 0 1 1.54.634c.058.027.462.422 1.767 1.724L5 4.047l1.692-1.689C7.995 1.058 8.402.661 8.46.634A.612.612 0 0 1 8.967.63Z'/%3E%3C/svg%3E\");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute;right:10px;width:10px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-and-filters-button-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:end;-ms-flex-pack:end;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;justify-content:end;width:100%}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button{background-color:#fff;border:1px solid #d8d8e2;border-radius:4px;color:#2a2a3c;cursor:pointer;display:none;font-size:14px;font-weight:700;margin-left:12px;outline:none;padding:8px}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active{color:#3100bf}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button i.abtasty-search-widget-search-filters-button-icon{background-color:#2a2a3c;margin-right:8px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.19.688a.715.715 0 0 0-.473.96c.022.05 1.512 2.15 3.31 4.67l3.273 4.58.005 3.956.005 3.956.051.11a.86.86 0 0 0 .316.338.76.76 0 0 0 .59.032c.124-.052 4.2-2.78 4.26-2.85.03-.036.08-.112.109-.168l.054-.102.005-2.636.005-2.637 3.272-4.58c1.8-2.519 3.29-4.622 3.314-4.673a.6.6 0 0 0 .043-.264.5.5 0 0 0-.061-.3.7.7 0 0 0-.449-.388c-.096-.029-.923-.032-8.818-.03C3.188.663 1.268.669 1.19.688m1.603 1.437c.008.014 1.319 1.85 2.912 4.08s2.921 4.103 2.95 4.16l.055.105.005 3.407c.003 1.974.013 3.403.023 3.4s.585-.385 1.279-.847l1.261-.84.006-2.56.006-2.56.054-.105a407 407 0 0 1 2.95-4.16l2.913-4.08c.012-.02-1.434-.025-7.207-.025s-7.22.005-7.207.025' fill='%232A2A3C'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.19.688a.715.715 0 0 0-.473.96c.022.05 1.512 2.15 3.31 4.67l3.273 4.58.005 3.956.005 3.956.051.11a.86.86 0 0 0 .316.338.76.76 0 0 0 .59.032c.124-.052 4.2-2.78 4.26-2.85.03-.036.08-.112.109-.168l.054-.102.005-2.636.005-2.637 3.272-4.58c1.8-2.519 3.29-4.622 3.314-4.673a.6.6 0 0 0 .043-.264.5.5 0 0 0-.061-.3.7.7 0 0 0-.449-.388c-.096-.029-.923-.032-8.818-.03C3.188.663 1.268.669 1.19.688m1.603 1.437c.008.014 1.319 1.85 2.912 4.08s2.921 4.103 2.95 4.16l.055.105.005 3.407c.003 1.974.013 3.403.023 3.4s.585-.385 1.279-.847l1.261-.84.006-2.56.006-2.56.054-.105a407 407 0 0 1 2.95-4.16l2.913-4.08c.012-.02-1.434-.025-7.207-.025s-7.22.005-7.207.025' fill='%232A2A3C'/%3E%3C/svg%3E\");min-height:19px;min-width:19px}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button.active i.abtasty-search-widget-search-filters-button-icon{background-color:#3100bf}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list{display:grid;gap:24px;grid-auto-rows:1fr;margin-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible:not(.no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(1,minmax(0,1fr))}div.abtasty-search-widget-container div.abtasty-search-widget-search-no-result{font-size:38px;font-weight:700;margin:82px auto 0;text-align:center}div.abtasty-search-widget-container a.abtasty-search-widget-search-result-container{color:inherit;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-webkit-box-orient:vertical;-webkit-box-direction:normal;border:1px solid #d8d8e2;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;padding:18px;width:auto}div.abtasty-search-widget-container div.abtasty-search-widget-search-result:hover{border-color:#a18cde}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{margin-inline:auto;margin-bottom:16px;max-height:200px;max-width:200px;min-height:200px;min-width:200px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result img{aspect-ratio:200/200;max-height:100%;max-width:100%;min-height:100%;min-width:100%;-o-object-fit:contain;object-fit:contain}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-flex:1;-ms-flex-positive:1;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name{-webkit-line-clamp:3;-webkit-box-orient:vertical;color:#2a2a3c;display:-webkit-box;font-size:16px;font-weight:400;line-height:20px;margin-bottom:auto;max-height:60px;overflow:hidden;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name:has(+:not(.abtasty-search-widget-search-result-price)){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-brand{color:#2a2a3c;font-size:12px;font-weight:400;margin-bottom:auto;text-transform:uppercase}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-brand:has(+div.abtasty-search-widget-search-result-rating){margin-bottom:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-price{color:#2a2a3c;font-size:18px;font-weight:700;line-height:normal;margin-top:16px;text-decoration:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:300px;min-width:300px;overflow-y:auto;overscroll-behavior:auto;padding:16px 16px 50px 0;position:sticky;top:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-overlay{background-color:rgba(0,0,0,.5);display:none;inset:0;position:absolute;z-index:11}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet{-webkit-box-orient:vertical;-webkit-box-direction:normal;background-color:#f3f3f7;display:none;-ms-flex-direction:column;flex-direction:column}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet label.abtasty-search-widget-search-sort-label{font-size:16px;font-weight:700;margin:16px 0 0 16px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet div.abtasty-search-widget-search-sort-options{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px;padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option{border:1px solid #d8d8e2;border-radius:50rem;font-size:13px;font-weight:700;padding:6px 12px;white-space:nowrap}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet button.abtasty-search-widget-search-sort-option.active{background-color:#3100bf;color:#fff}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-header{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;border-bottom:1px solid #d8d8e2;display:none;justify-content:space-between;padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;border:none;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;margin-left:auto;width:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{background-color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;gap:8px;padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button{background-color:#3100bf;color:#fff;display:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-close-button i.abtasty-search-widget-close-icon{background-color:#2a2a3c;min-height:14px;min-width:14px}div.abtasty-search-widget-container button.abtasty-search-widget-search-facet-show-more{background-color:transparent;border:none;color:#3100bf;cursor:pointer;font-size:14px;margin-bottom:16px;padding:0;text-decoration:underline}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content.range-facet{margin-bottom:16px;padding:20px 20px 0}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-list-item-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-list-item-container div.checkbox{margin:0}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container{color:#2a2a3c;cursor:pointer;display:block;font-size:13px;padding-left:24px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.checked,div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container:hover:not(.disabled){font-weight:700}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.disabled{cursor:not-allowed}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input{cursor:pointer;height:0;opacity:0;position:absolute;width:0}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container.disabled input{cursor:not-allowed}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input[type=checkbox]:before{content:none}div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark{background-color:transparent;border:1px solid #000;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;height:16px;inset:0;position:absolute;width:16px}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark{background-color:#3100bf;font-weight:700}div.abtasty-search-widget-container span.abtasty-search-widget-search-facet-checkbox-checkmark:after{color:#fff;content:\"\\2713\";display:none;font-size:10px;inset:.25px 2.5px;position:absolute}div.abtasty-search-widget-container label.abtasty-search-widget-search-facet-checkbox-container input:checked~span.abtasty-search-widget-search-facet-checkbox-checkmark:after{display:block}div.abtasty-search-widget-container ul li.abtasty-search-widget-search-facet-list-item{margin:16px 0}div.abtasty-search-widget-container ul li.abtasty-search-widget-search-facet-list-item:first-of-type{margin-top:8px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list details.abtasty-search-widget-search-facet:not(:last-of-type){border-bottom:1px solid #d8d8e2}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary{-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:16px;font-weight:700;justify-content:space-between;margin:0;padding:16px 2px 16px 0}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary:before{content:none}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary div.abtasty-search-widget-search-facet-arrow svg{fill:#2a2a3c}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet summary div.abtasty-search-widget-search-facet-arrow{-webkit-transform-origin:center;transform-origin:center}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet[open] summary div.abtasty-search-widget-search-facet-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}div.abtasty-search-widget-container div.abtasty-search-widget-search-facet-content ul{list-style:none;margin:0;padding:0}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider{background-color:#d8d8e2;border-radius:5px;height:5px;margin:20px 0;position:relative;width:100%}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-progress{background-color:#3100bf;border-radius:5px;height:100%;position:absolute;z-index:1}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle{background-color:#fff;border:1px solid #d8d8e2;border-radius:50%;cursor:pointer;height:24px;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:24px;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.range-handle-value{background-color:#3100bf;border-radius:4px;color:#fff;font-size:12px;font-weight:700;left:50%;padding:4px;position:absolute;text-align:center;top:-34px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container{-webkit-box-pack:justify;-ms-flex-pack:justify;bottom:-14px;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;left:0;padding:0;position:absolute;right:0}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar{background-color:#d8d8e2;width:2px}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar:first-child,div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar:last-child{height:8px}div.abtasty-search-widget-container div.abtasty-search-widget-range-slider div.steps-container div.step-bar:not(:first-child):not(:last-child){height:6px}div.abtasty-search-widget-container div.abtasty-search-widget-range-values{-webkit-box-pack:justify;-ms-flex-pack:justify;color:#2a2a3c;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;justify-content:space-between;margin-top:10px}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span{font-size:12px;font-weight:400}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span:first-child{margin-right:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}div.abtasty-search-widget-container div.abtasty-search-widget-range-values span:last-child{margin-left:-50%;-webkit-transform:translateX(50%);transform:translateX(50%)}div.abtasty-search-widget-container button.abtasty-search-widget-filters-button{background-color:#fff!important;border:none;border-radius:100%;cursor:pointer!important;display:none;margin-top:12px;padding:11px;-webkit-transform:translateX(-15%);transform:translateX(-15%);vertical-align:middle}div.abtasty-search-widget-container i.abtasty-search-widget-filters-icon{background-color:#2a2a3c;-webkit-mask-image:url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDE4IDE4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiM0OTRjNGUiIGQ9Ik0xNyA1SDFhMSAxIDAgMCAxIDAtMmgxNmExIDEgMCAwIDEgMCAyem0wIDVIMWExIDEgMCAwIDEgMC0yaDE2YTEgMSAwIDAgMSAwIDJ6bTAgNUgxYTEgMSAwIDAgMSAwLTJoMTZhMSAxIDAgMCAxIDAgMnoiLz48L3N2Zz4=\");mask-image:url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDE4IDE4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiM0OTRjNGUiIGQ9Ik0xNyA1SDFhMSAxIDAgMCAxIDAtMmgxNmExIDEgMCAwIDEgMCAyem0wIDVIMWExIDEgMCAwIDEgMC0yaDE2YTEgMSAwIDAgMSAwIDJ6bTAgNUgxYTEgMSAwIDAgMSAwLTJoMTZhMSAxIDAgMCAxIDAgMnoiLz48L3N2Zz4=\");min-height:22px;min-width:22px;vertical-align:middle}@media (min-width:576px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:540px}}@media (min-width:768px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:720px}}@media (min-width:992px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:960px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible:not(.no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1200px){div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible{max-width:1104px}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible:not(.no-results) div.abtasty-search-widget-search-result-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (max-width:991.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{max-height:147px;max-width:147px;min-height:147px;min-width:147px}}@media (max-width:767.98px){div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{max-width:240px;min-width:240px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{max-height:200px;max-width:200px;min-height:200px;min-width:200px}}@media (max-width:575.98px){div.abtasty-search-widget-container{overflow-x:hidden}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-container{padding:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container{padding:0 16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}div.abtasty-search-widget-container i.abtasty-search-widget-search-icon{display:none}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container button.abtasty-search-widget-close-icon-container{min-height:24px;min-width:24px;padding:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar-close-button-container button.abtasty-search-widget-close-icon-container i.abtasty-search-widget-close-icon{background-color:#2a2a3c;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.833 7.254c.017.054.058.14.091.192.034.052 1.36 1.39 2.949 2.976 3.247 3.241 2.972 2.995 3.356 2.996.171 0 .226-.01.34-.063.45-.209.636-.72.426-1.168-.04-.085-.54-.599-2.155-2.217L3.738 7.864h9.313c6.6 0 9.355-.008 9.456-.026a.86.86 0 0 0 .63-.498c.053-.113.063-.17.063-.34s-.01-.227-.063-.34a.86.86 0 0 0-.63-.498c-.101-.019-2.856-.026-9.456-.026H3.738L5.84 4.03c1.615-1.618 2.114-2.132 2.155-2.217A.865.865 0 0 0 7.569.644C7.455.591 7.4.581 7.23.581 6.845.583 7.12.337 3.873 3.578 2.285 5.163.958 6.502.925 6.552a.897.897 0 0 0-.092.702Z' fill='%232A2A3C'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.833 7.254c.017.054.058.14.091.192.034.052 1.36 1.39 2.949 2.976 3.247 3.241 2.972 2.995 3.356 2.996.171 0 .226-.01.34-.063.45-.209.636-.72.426-1.168-.04-.085-.54-.599-2.155-2.217L3.738 7.864h9.313c6.6 0 9.355-.008 9.456-.026a.86.86 0 0 0 .63-.498c.053-.113.063-.17.063-.34s-.01-.227-.063-.34a.86.86 0 0 0-.63-.498c-.101-.019-2.856-.026-9.456-.026H3.738L5.84 4.03c1.615-1.618 2.114-2.132 2.155-2.217A.865.865 0 0 0 7.569.644C7.455.591 7.4.581 7.23.581 6.845.583 7.12.337 3.873 3.578 2.285 5.163.958 6.502.925 6.552a.897.897 0 0 0-.092.702Z' fill='%232A2A3C'/%3E%3C/svg%3E\");min-height:24px;min-width:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-bar{border:none;margin-right:0;padding:0}div.abtasty-search-widget-container input.abtasty-search-widget-search-input{font-size:14px;margin-left:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-list-container{padding-left:0;padding-top:16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-container.visible div.abtasty-search-widget-search-result-list-container{width:100vw}div.abtasty-search-widget-container div.abtasty-search-widget-recommendations-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}div.abtasty-search-widget-container div.abtasty-search-widget-recommended-categories-container,div.abtasty-search-widget-container div.abtasty-search-widget-recommended-products-container{margin-bottom:32px;padding:0 16px}div.abtasty-search-widget-container h3.abtasty-search-widget-recommended-categories-title{margin-top:24px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-image-container{margin:auto 12px auto 0;max-height:92px;max-width:92px;min-height:92px;min-width:92px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:start;-ms-flex-pack:start;-ms-flex-direction:row;flex-direction:row;justify-content:flex-start;padding:12px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name{font-size:13px;line-height:16px;max-height:32px}div.abtasty-search-widget-container div.abtasty-search-widget-search-result-name:has(+.abtasty-search-widget-search-result-price){margin-bottom:0}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort-facet{display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-sort{display:none}div.abtasty-search-widget-container button.abtasty-search-widget-filters-button{display:block}div.abtasty-search-widget-container button.abtasty-search-widget-search-filters-button{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{border-top:1px solid #d8d8e2;bottom:0;position:fixed;z-index:2}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-bottom-buttons-container{-webkit-box-sizing:border-box;box-sizing:border-box;max-height:unset!important;max-width:unset;min-width:unset;overflow-x:hidden;right:-325px;-webkit-transition:.5s;transition:.5s;width:325px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list{background-color:#fff;bottom:0;overflow-x:hidden;padding:0 0 100px;position:absolute;right:-325px;top:0!important;z-index:1}div.abtasty-search-widget-container details.abtasty-search-widget-search-facet{margin:0 16px}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list button.abtasty-search-widget-search-facets-list-bottom-close-button,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list div.abtasty-search-widget-search-facets-list-header{display:-webkit-box;display:-ms-flexbox;display:flex}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list-overlay{display:block}div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container{right:0;z-index:100}}@media (max-width:374.98px){div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open,div.abtasty-search-widget-container div.abtasty-search-widget-search-facets-list.open div.abtasty-search-widget-search-facets-list-bottom-buttons-container{width:100%}}");t.appendChild(o),a.textContent=[s,r,i,n].join("");const c=this.rootElement?.head||this.rootElement?.querySelector("style")?.parentElement;return c.appendChild(t),c.appendChild(a),e}async getRecommendationsElement(){const e=await(async()=>{const e=e=>["catégorie","catégories","category","categories"].includes(e);try{const t=await fetch(o,{method:"POST",headers:l,body:JSON.stringify({q:"",facets:["*"],hitsPerPage:0})}),a=await t.json(),s=ne(a);for(const[t,a]of Object.entries(s.facets))if(e(t))return a.values.sort((e,t)=>t[1]-e[1]).slice(0,4).map(e=>e[0]);return[]}catch(e){return window.console.error(e),null}})();if(!e||!e.length)return;const t=document.createElement("div");t.className=`${this.baseClassName}-recommendations-container`;const a=document.createElement("div");a.className=`${this.baseClassName}-recommended-categories-container`;const s=document.createElement("h3");s.className=`${this.baseClassName}-recommended-categories-title`,s.innerHTML=b("Categories"),a.appendChild(s);for(const t of e){const e=document.createElement("div");e.className=`${this.baseClassName}-recommended-category`,e.innerHTML=t,e.onclick=()=>{this.searchBar.setInputValue(t),D.setText(t)},a.appendChild(e)}t.appendChild(a);const i=await(async()=>{if(!DATA.useRecoAndMerch)return null;const e=DATA.siteId,t=DATA.recommendationsRecoId,a=DATA.recoAndMerchApiKey;if(!e||!t||!a)return null;const[s,i]=((e,t,a)=>[`https://uc-info.eu.abtasty.com/v1/reco/${t}/recos/${e}?fields=%5B%22id%22,%22absolute_link%22,%22name%22,%22img_link%22,%22price%22%5D`,{Authorization:"Bearer "+a}])(t,e,a);try{const e=await fetch(s,{method:"GET",headers:i});return(await e.json()).items.slice(0,3).map(e=>({name:e.name,price:e.price,img_link:e.img_link,link:e.absolute_link}))}catch(e){return window.console.error(e),null}})();if(i&&i.length){const e=document.createElement("div");e.className=`${this.baseClassName}-recommended-products-container`;const a=document.createElement("h3");a.className=`${this.baseClassName}-recommended-products-title`,a.innerHTML=b("Recommended Products");const s=document.createElement("div");s.className=`${this.baseClassName}-recommended-products-list`;for(const[e,t]of i.entries()){const a=new J({result:t,index:e,baseClassName:this.baseClassName});s.appendChild(a.getSearchResultElement())}e.appendChild(a),e.appendChild(s),t.appendChild(e)}this.recommendationsContainer=t,this.searchWidgetContainer.appendChild(this.recommendationsContainer)}}(()=>{const{elementReferrer:e}=DATA;return(e=>{const a=(()=>{if(t()||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),s=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(a||s){const t=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${t} - ${a?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${e}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}})("Widget launch"),(()=>{const e=[{name:DATA.facetTitleFontName,style:DATA.facetTitleFontStyle},{name:DATA.searchBarTitleFontName,style:DATA.searchBarTitleFontStyle},{name:DATA.searchBarInputFontName,style:DATA.searchBarInputFontStyle},{name:DATA.facetSectionTitleFontName,style:DATA.facetSectionTitleFontStyle},{name:DATA.searchResultNameFontName,style:DATA.searchResultNameFontStyle},{name:DATA.searchResultPriceFontName,style:DATA.searchResultPriceFontStyle}];for(const{name:t,style:a}of e){if(!t||"inherit"===t||!/otf|ttf/g.test(a))continue;const e=document.createElement("style"),s=a.match(ce)?a.match(ce)[1]:"";e.innerHTML=`@font-face { font-family: '${t}_${s}'; src: url('${a}'); font-display: swap; }`,document.head.appendChild(e)}})(),new Promise(s=>{r(e,()=>{const i=a(e),r=i.getRootNode();i.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.right="0",n.style.bottom="0",n.style.backgroundColor="transparent",n.style.cursor="pointer",n.style.zIndex="10",n.onclick=e=>{e?.preventDefault?.(),e?.stopPropagation?.(),new ue({target:i,rootElement:r}).openSearchWidget()},i.appendChild(n);const o=!!document.querySelector(".abtasty-search-widget-container");t()&&!o&&n.onclick(),s()})})})().then(()=>{})}();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtasty/search",
|
|
3
3
|
"description": "Search Widget MVP",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"form": "dist/form.js",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"type": "module",
|
|
@@ -43,6 +43,5 @@
|
|
|
43
43
|
"postcss-cssnext": "^3.1.1",
|
|
44
44
|
"rollup": "^4.12.0",
|
|
45
45
|
"rollup-plugin-postcss": "^4.0.2"
|
|
46
|
-
}
|
|
47
|
-
"stableVersion": "0.0.2-8"
|
|
46
|
+
}
|
|
48
47
|
}
|