PageSourceSearch

https://www.mtbproject.com/js/components/search/main.js?id=b68edf1adcb1a4ac44a76f4d30f3cc51

js mtbproject.com collected 2026-10-01 10:26:18 UTC 3,350 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e=function(e,t,s,r,a,i,n,o){var c,h="function"==typeof e?e.options:e;if(t&&(h.render=t,h.staticRenderFns=s,h._compiled=!0),r&&(h.functional=!0),i&&(h._scopeId="data-v-"+i),n?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},h._ssrRegister=c):a&&(c=o?function(){a.call(this,(h.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(h.functional){h._injectStyles=c;var l=h.render;h.render=function(e,t){return c.call(t),l(e,t)}}else{var d=h.beforeCreate;h.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:h}}({name:"Search",props:{redirectUrl:String,endpoint:String,container:String,placeholder:String,extraParams:Object},data:()=>({query:"",results:"",isLoading:!1,showResults:!1}),computed:{searchUrl(){return`${this.redirectUrl}?q=${encodeURIComponent(this.query)}`},cdnUrl:function(){return window.ap.config.cdnUrl}},methods:{handleKeyUp(e){const t=13===e.keyCode;let s=1===e.key.length;229===e.keyCode&&(s=!0,this.query=e.target.value),t&&this.redirectUrl&&(window.location.href=this.searchUrl),s&&this.query.length>3&&(this.handleSearch(),this.showResults=!0)},fadeBackground(){const e=$("#faded-background"),t=$(`#${this.container}`);e.click(()=>{this.showResults=!1,t.removeClass("above-faded-background"),hideSearchResults(e,t)}),t.click(()=>{this.showResults=!1}),fadeSearchBackground(e,t)},handleSearch(){this.request&&this.request.abort(),this.searchTimer&&(clearTimeout(this.searchTimer),this.searchTimer=null),this.isLoading=!0,this.searchTimer=setTimeout(function(){log("Starting search for "+this.query);const e={q:this.query};for(const t in this.extraParams)e[t]=this.extraParams[t];this.request=$.get(this.endpoint,e).done(e=>{log("Finished search"),this.isLoading=!1,this.results=e.html}).fail(e=>{"abort"!==e.statusText&&(this.isLoading=!1,this.results='<p class="error-message">Whoops, something went wrong.</p>')})}.bind(this),500)}}},function(){var e=this,t=e._self._c;return t("div",{staticClass:"search-container text-xs-xenter mx-auto"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],staticClass:"form-control",attrs:{type:"search",placeholder:e.placeholder,autocomplete:"off",name:"search"},domProps:{value:e.query},on:{focus:e.fadeBackground,keyup:e.handleKeyUp,input:function(t){t.target.composing||(e.query=t.target.value)}}}),e._v(" "),e.redirectUrl?t("a",{staticClass:"btn btn-primary search-submit",attrs:{href:e.searchUrl}},[t("span",{staticClass:"search-text"},[e._v("Search")]),e._v(" "),t("img",{staticClass:"search-icon",attrs:{src:e.cdnUrl+"/img/searchWhite.svg",alt:"search"}})]):e._e(),e._v(" "),t("div",{staticClass:"results-container"},[e.showResults?t("div",{staticClass:"search-results"},[e.isLoading?t("img",{staticClass:"wait-gif",attrs:{src:e.cdnUrl+"/img/waitWhite.gif"}}):t("div",{domProps:{innerHTML:e._s(e.results)}})]):e._e()])])},[],!1,null,null,null);const t=e.exports;Vue.component("Search",t);["apv-hero-search","faq-hero-search","faq-results-search","desktop-header-search","mobile-header-search","trail-search-container"].forEach(e=>{document.getElementById(e)&&new Vue({el:`#${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.