PageSourceSearch

https://www.eraldo.com/cdn/shop/t/9/assets/component-predictive-se…?v=165625901653510405771747139796

js eraldo.com collected 2026-10-09 18:26:12 UTC 13,497 bytes, 1 lines download raw bytes

1!function(){"use strict";var t=()=>{const t=window.themeCore.utils.images,e=window.themeCore.utils.debounce,n=window.themeCore.utils.formatMoney,a=window.themeCore.utils.cssClasses,r={form:".js-predictive-search-form",input:".js-predictive-search-input",resultContainer:".js-predictive-search-result",searchType:"input[name='type']",applyButton:".js-predictive-search-apply-button",resultRow:".js-predictive-search-result-row",tabsButton:".js-predictive-search-tabs-button",preloader:".js-preloader",searchDrawer:"#headerDrawerSearch"},i={disabled:"disabled",id:"id",dataId:"data-id",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden"},s={visuallyHidden:"visually-hidden",...a},c=8;let l={};const d=document.querySelector(r.preloader),o=window.Shopify.routes.root;async function u(t){const e=t.target.closest(r.input),n=document.querySelector(r.searchDrawer),a=document.querySelector(r.resultContainer),u=document.querySelector(r.applyButton);if(!(n&&e&&a&&u))return;const v=e.value.trim();if(!v.length)return u.setAttribute(i.disabled,i.disabled),u.setAttribute(i.ariaHidden,"true"),void g(a);if(function(){if(!d)return;d.classList.add(s.active)}(),l[v])return p(l[v].resources.results,a,u),void h();const m=await async function(t){const e=document.querySelector(r.searchType);if(!e)return;const n=`${encodeURIComponent("resources[type]")}=${e.value}`,a=`${encodeURIComponent("resources[limit]")}=${c}`,i=`${o}search/suggest.json?q=${encodeURIComponent(t)}&${n}&${a}`;return await fetch(i)}(v),w=await m.json();l[v]=w,p(w.resources.results,a,u),h()}function h(){d&&d.classList.remove(s.active)}function p(e,a,r){const c=Object.values(e).filter(t=>t.length);if(g(a),r.removeAttribute(i.disabled),r.removeAttribute(i.ariaHidden),!c.length)return r.setAttribute(i.disabled,i.disabled),r.setAttribute(i.ariaHidden,"true"),void function(t){const e=`\n\t\t\t\t<p class="h4 predictive-search__result-empty">\n\t\t\t\t\t${window.themeCore.translations.get("general.predictive_search.no_results")}\n\t\t\t\t</p>\n\t\t\t`;t.innerHTML+=e}(a);!function(e,a,r,c){let l,d,o;if(a||r){const t=`\n\t\t\t\t\t<ul class="predictive-search__tabs">\n\t\t\t\t\t\t${e?`\n\t\t\t\t\t\t\t\t\t<li class="predictive-search__tabs-item js-predictive-search-tabs-item">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclass="focus-visible-outline predictive-search__tabs-button ${e.length?s.active:""} js-predictive-search-tabs-button"\n\t\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\t\taria-controls="search-products"\n\t\t\t\t\t\t\t\t\t\t\taria-expanded="true"\n\t\t\t\t\t\t\t\t\t\t\taria-label="${window.themeCore.translations.get("general.predictive_search.products_aria_label")}"\n\t\t\t\t\t\t\t\t\t\t\tdata-id="products"\n\t\t\t\t\t\t\t\t\t\t\t${e.length?"":"disabled"}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t${window.themeCore.translations.get("general.predictive_search.products")}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`:""}\n\n\t\t\t\t\t\t${a?`\n\t\t\t\t\t\t\t\t\t<li class="predictive-search__tabs-item js-predictive-search-tabs-item">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclass="focus-visible-outline predictive-search__tabs-button ${e&&e.length||!a.length?"":s.active}\n\t\t\t\t\t\t\t\t\t\t\tjs-predictive-search-tabs-button"\n\t\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\t\taria-controls="search-articles"\n\t\t\t\t\t\t\t\t\t\t\taria-expanded="false"\n\t\t\t\t\t\t\t\t\t\t\taria-label="${window.themeCore.translations.get("general.predictive_search.articles_aria_label")}"\n\t\t\t\t\t\t\t\t\t\t\tdata-id="articles"\n\t\t\t\t\t\t\t\t\t\t\t${a.length?"":"disabled"}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t${window.themeCore.translations.get("general.predictive_search.articles")}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`:""}\n\n\t\t\t\t\t\t${r?`\n\t\t\t\t\t\t\t\t\t<li class="predictive-search__tabs-item js-predictive-search-tabs-item">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclass="focus-visible-outline predictive-search__tabs-button ${e&&e.length||a&&a.length||!r.length?"":s.active}\n\t\t\t\t\t\t\t\t\t\t\tjs-predictive-search-tabs-button"\n\t\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\t\taria-controls="search-pages"\n\t\t\t\t\t\t\t\t\t\t\taria-expanded="false"\n\t\t\t\t\t\t\t\t\t\t\taria-label="${window.themeCore.translations.get("general.predictive_search.pages_aria_label")}"\n\t\t\t\t\t\t\t\t\t\t\tdata-id="pages"\n\t\t\t\t\t\t\t\t\t\t\t${r.length?"":"disabled"}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t${window.themeCore.translations.get("general.predictive_search.pages")}\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`:""}\n\t\t\t\t\t</ul>\n\t\t\t\t`;c.innerHTML+=t}if(e&&e.length){const a=document.createElement("ul");a.className=`predictive-search__result-row ${e.length?s.active:s.visuallyHidden}\n\t\t\tjs-predictive-search-result-row\n\t\t\t`,a.setAttribute(i.dataId,"products"),a.setAttribute(i.id,"search-products"),c.appendChild(a),e.forEach(e
1=>{let r="",i="",s="";e.image?(r=t.generateSrc(e.image,260),i=t.generateSrcset(e.image,260)):window.themeCore.productPlaceholderImage&&(r=t.generateSrc(window.themeCore.productPlaceholderImage,260),i=t.generateSrcset(window.themeCore.productPlaceholderImage,260),window.themeCore.productPlaceholderImageFocal&&(s=`--img-desktop-pos: ${window.themeCore.productPlaceholderImageFocal}`));let c=e.price;const d=c.split(".");d.length>=2&&(c=d[0]+"."+d[1].substring(0,2)),l=`\n\t\t\t\t\t\t<li class="predictive-search__result-col">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclass="focus-visible-outline predictive-search__product-card"\n\t\t\t\t\t\t\t\thref="${e.url}"\n\t\t\t\t\t\t\t\taria-label="${e.title}"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div class="predictive-search__product-card-image-container">\n\t\t\t\t\t\t\t\t\t${r?`<img\n\t\t\t\t\t\t\t\t\t\t\t\tclass="predictive-search__product-card-image"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc="${r}"\n\t\t\t\t\t\t\t\t\t\t\t\tsrcset="${i}"\n\t\t\t\t\t\t\t\t\t\t\t\talt="${e.featured_image.alt||""}"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="130"\n\t\t\t\t\t\t\t\t\t\t\t\theight="130"\n\t\t\t\t\t\t\t\t\t\t\t\t${s?`style="${s}"`:""}\n\t\t\t\t\t\t\t\t\t\t\t/>`:""}\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div class="predictive-search__product-card-info">\n\t\t\t\t\t\t\t\t\t<h3 class="predictive-search__product-card-heading">\n\t\t\t\t\t\t\t\t\t\t${e.title}\n\t\t\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t\t\t<div class="predictive-search__product-card-price">\n\t\t\t\t\t\t\t\t\t\t${n(c.includes(".")?c:c+".00",window.themeCore.objects.shop.money_format)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<span class="predictive-search__product-card-icon">\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\tclass="icon"\n\t\t\t\t\t\t\t\t\t\twidth="14"\n\t\t\t\t\t\t\t\t\t\theight="14"\n\t\t\t\t\t\t\t\t\t\tviewBox="0 0 14 14"\n\t\t\t\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\t\t\t\taria-hidden="true"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t\t\t\t\t\tclip-rule="evenodd"\n\t\t\t\t\t\t\t\t\t\t\td="M9.36899 3.15909L12.8402 6.61591C13.0533 6.82804 13.0533 7.17196 12.8402 7.38409L9.36899 10.8409C9.15598 11.053 8.81061 11.053 8.5976 10.8409C8.38459 10.6288 8.38459 10.2848 8.5976 10.0727L11.1377 7.54318L1.54545 7.54319C1.24421 7.54319 1 7.29999 1 7C1 6.70001 1.24421 6.45681 1.54545 6.45681L11.1377 6.45681L8.5976 3.92728C8.38459 3.71515 8.38459 3.37122 8.5976 3.15909C8.81061 2.94697 9.15598 2.94697 9.36899 3.15909Z">\n\t\t\t\t\t\t\t\t\t\t</path>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t`,a.innerHTML+=l})}if(a&&a.length){const n=document.createElement("ul");n.className=`predictive-search__result-row ${e&&e.length||!a.length?s.visuallyHidden:s.active}\n\t\t\tjs-predictive-search-result-row\n\t\t\t`,n.setAttribute(i.dataId,"articles"),n.setAttribute(i.id,"search-articles"),c.appendChild(n),a.forEach(e=>{let a="",r="",i="";if(e.image){let n=260;e.featured_image&&e.featured_image.aspect_ratio>1&&(n*=e.featured_image.aspect_ratio),a=t.generateSrc(e.image,n),r=t.generateSrcset(e.image,n)}else window.themeCore.articlePlaceholderImage&&(a=t.generateSrc(window.themeCore.articlePlaceholderImage,260),r=t.generateSrcset(window.themeCore.articlePlaceholderImage,260),window.themeCore.articlePlaceholderImageFocal&&(i=`--img-desktop-pos: ${window.themeCore.articlePlaceholderImageFocal}`));d=`\n\t\t\t\t\t\t<li class="predictive-search__result-col">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclass="focus-visible-outline predictive-search__article-card"\n\t\t\t\t\t\t\t\thref="${e.url}"\n\t\t\t\t\t\t\t\taria-label="${e.title}"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div class="predictive-search__article-card-image-container">\n\t\t\t\t\t\t\t\t\t${a?`\n\t\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\t\tclass="predictive-search__article-card-image"\n\t\t\t\t\t\t\t\t\t\t\t\t\tsrc="${a}"\n\t\t\t\t\t\t\t\t\t\t\t\t\tsrcset="${r}"\n\t\t\t\t\t\t\t\t\t\t\t\t\talt="${e.featured_image.alt?e.featured_image.alt:""}"\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth="130"\n\t\t\t\t\t\t\t\t\t\t\t\t\theight="130"\n\t\t\t\t\t\t\t\t\t\t\t\t\t${i?`style="${i}"`:""}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t`:""}\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<h3 class="predictive-search__article-card-heading">\n\t\t\t\t\t\t\t\t\t${e.title}\n\t\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t\t<span class="predictive-search__article-card-icon">\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\tclass="icon"\n\t\t\t\t\t\t\t\t\t\twidth="14"\n\t\t\t\t\t\t\t\t\t\theight="14"\n\t\t\t\t\t\t\t\t\t\tviewBox="0 0 14 14"\n\t\t\t\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\t\t\t\taria-hidden="true"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t\t\t\t\t\tclip-rule="evenodd"\n\t\t\t\t\t\t\t\t\t\t\td="M9.36899 3.15909L12.8402 6.61591C13.0533 6.82804 13.0533 7.17196 12.8402 7.38409L9.36899 10.8409C9.15598 11.
1053 8.81061 11.053 8.5976 10.8409C8.38459 10.6288 8.38459 10.2848 8.5976 10.0727L11.1377 7.54318L1.54545 7.54319C1.24421 7.54319 1 7.29999 1 7C1 6.70001 1.24421 6.45681 1.54545 6.45681L11.1377 6.45681L8.5976 3.92728C8.38459 3.71515 8.38459 3.37122 8.5976 3.15909C8.81061 2.94697 9.15598 2.94697 9.36899 3.15909Z">\n\t\t\t\t\t\t\t\t\t\t</path>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t`,n.innerHTML+=d})}if(r&&r.length){const t=document.createElement("ul");t.className=`predictive-search__result-row ${e&&e.length||a&&a.length||!r.length?s.visuallyHidden:s.active}\n\t\t\tjs-predictive-search-result-row\n\t\t\t`,t.setAttribute(i.dataId,"pages"),t.setAttribute(i.id,"search-pages"),c.appendChild(t),r.forEach(e=>{o=`\n\t\t\t\t\t\t<li class="predictive-search__result-col">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tclass="focus-visible-outline predictive-search__page-card"\n\t\t\t\t\t\t\t\thref="${e.url}"\n\t\t\t\t\t\t\t\taria-label="${e.title}"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<h3 class="predictive-search__page-card-link">\n\t\t\t\t\t\t\t\t\t${e.title}\n\t\t\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t\t\t<span class="predictive-search__page-card-icon">\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\tclass="icon"\n\t\t\t\t\t\t\t\t\t\twidth="14"\n\t\t\t\t\t\t\t\t\t\theight="14"\n\t\t\t\t\t\t\t\t\t\tviewBox="0 0 14 14"\n\t\t\t\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\t\t\t\taria-hidden="true"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t\t\t\t\t\tclip-rule="evenodd"\n\t\t\t\t\t\t\t\t\t\t\td="M9.36899 3.15909L12.8402 6.61591C13.0533 6.82804 13.0533 7.17196 12.8402 7.38409L9.36899 10.8409C9.15598 11.053 8.81061 11.053 8.5976 10.8409C8.38459 10.6288 8.38459 10.2848 8.5976 10.0727L11.1377 7.54318L1.54545 7.54319C1.24421 7.54319 1 7.29999 1 7C1 6.70001 1.24421 6.45681 1.54545 6.45681L11.1377 6.45681L8.5976 3.92728C8.38459 3.71515 8.38459 3.37122 8.5976 3.15909C8.81061 2.94697 9.15598 2.94697 9.36899 3.15909Z">\n\t\t\t\t\t\t\t\t\t\t</path>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t`,t.innerHTML+=o})}document.addEventListener("click",v)}(e.products,e.articles,e.pages,a)}function v(t){const e=[...document.querySelectorAll(r.tabsButton)],n=[...document.querySelectorAll(r.resultRow)],a=t.target.closest(r.tabsButton);a&&e.length&&n.length&&(e.forEach(t=>{t.classList.remove(s.active),t.setAttribute(i.ariaExpanded,!1)}),a.classList.add(s.active),a.setAttribute(i.ariaExpanded,!0),n.forEac
1h(t=>{t.classList.remove(s.active),t.classList.add(s.visuallyHidden)}),n.filter(t=>t.dataset.id===a.dataset.id).forEach(t=>{t.classList.add(s.active),t.classList.remove(s.visuallyHidden)}))}function g(t){t.innerHTML=""}function m(t){const e=t.target.closest(r.form);if(!e)return;t.preventDefault();const n=e.querySelector(r.input).value.trim();n.length&&function(t){const e=document.querySelector(r.searchType);if(!e)return;const n=encodeURI(t),a=`${o}search/?type=${e.value}&options%5Bprefix%5D=last&q=${n}`;window.location.replace(a)}(n)}return Object.freeze({init:function(){document.addEventListener("input",e(u,200,!1)),document.addEventListener("submit",m)}})};const e=()=>{window.themeCore.PredictiveSearch=window.themeCore.PredictiveSearch||t(),window.themeCore.utils.register(window.themeCore.PredictiveSearch,"predictive-search")};window.themeCore&&window.themeCore.loaded?e():document.addEventListener("theme:all:loaded",e)}();

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