1var a,b;a=this,b=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function n(e){return"string"==typeof e?document.querySelector(e):e()}function i(e){return"<span class=".concat(l,">").concat(e,"</span>")}function o(e){return e.innerHTML=""}function r(e,t,n,i,r,a){i({event:e,query:t instanceof HTMLInputElement?t.value:t.innerHTML,matches:r.matches,results:r.list.map((function(e){return e.value})),selection:r.list.find((function(t){return e.keyCode===c?t.index===Number(a.getAttribute(s)):"mousedown"===e.type?t.index===Number(e.currentTarget.getAttribute(s)):void 0}))}),o(n)}function a(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}var s="data-id",l="autoComplete_highlighted",u="autoComplete_selected",c=13,d=38,h=40;a.prototype=window.Event.prototype;var f={CustomEventWrapper:"function"==typeof window.CustomEvent&&window.CustomEvent||a,initElementClosestPolyfill:function(){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null})}};return function(){function a(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a);var t,i,o=e.selector,r=void 0===o?"#autoComplete":o,s=e.data,l=s.key,u=s.src,c=s.cache,d=void 0===c||c,h=e.query,f=e.trigger,v=(f=void 0===f?{}:f).event,m=void 0===v?["input"]:v,p=f.condition,y=void 0!==p&&p,g=e.searchEngine,b=void 0===g?"strict":g,E=e.threshold,w=void 0===E?0:E,C=e.debounce,S=void 0===C?0:C,L=e.resultsList,k=(L=void 0===L?{}:L).render,x=void 0!==k&&k,A=L.container,T=void 0!==A&&A,M=L.destination,R=L.position,q=void 0===R?"afterend":R,H=L.element,I=void 0===H?"ul":H,j=L.navigation,P=void 0!==j&&j,N=e.sort,_=void 0!==N&&N,O=e.placeHolder,V=e.maxResults,W=void 0===V?5:V,D=e.resultItem,F=(D=void 0===D?{}:D).content,U=void 0!==F&&F,$=D.element,z=void 0===$?"li":$,B=e.noResults,G=e.highlight,J=void 0!==G&&G,K=e.onSelection,Q=x?(t={container:T,destination:M||n(r),position:q,element:I},(i=document.createElement(t.element)).setAttribute("id","autoComplete_list"),t.container&&t.container(i),t.destination.insertAdjacentElement(t.position,i),i):null;this.selector=r,this.data={src:function(){return"function"==typeof u?u():u},key:l,cache:d},this.query=h,this.trigger={event:m,condition:y},this.searchEngine="loose"===b?"loose":"function"==typeof b?b:"strict",this.threshold=w,this.debounce=S,this.resultsList={render:x,view:Q,navigation:P},this.sort=_,this.placeHolder=O,this.maxResults=W,this.resultItem={content:U,element:z},this.noResults=B,this.highlight=J,this.onSelection=K,this.init()}var l,v;return l=a,(v=[{key:"search",value:function(e,t){var n=t.toLowerCase();if("loose"===this.searchEngine){e=e.replace(/ /g,"");for(var o=[],r=0,a=0;a<n.length;a++){var s=t[a];r<e.length&&n[a]===e[r]&&(s=this.highlight?i(s):s,r++),o.push(s)}return r===e.length&&o.join("")}if(n.includes(e))return e=new RegExp("".concat(e),"i").exec(t),this.highlight?t.replace(e,i(e)):t}},{key:"listMatchedResults",value:function(e){var n=this;return new Promise((function(i){var o=[];e.filter((function(e,i){function r(t){var r=t?e[t]:e;if(r){var a="function"==typeof n.searchEngine?n.searchEngine(n.queryValue,r):n.search(n.queryValue,r);a&&t?o.push({key:t,index:i,match:a,value:e}):a&&!t&&o.push({index:i,match:a,value:e})}}if(n.data.key){var a,s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,n){if(e){if("string"==typeof e)return t(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}(e))){var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
1}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r,a=!0,s=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==o.return||o.return()}finally{if(s)throw r}}}}(n.data.key);try{for(s.s();!(a=s.n()).done;)r(a.value)}catch(r){s.e(r)}finally{s.f()}}else r()}));var r=n.sort?o.sort(n.sort).slice(0,n.maxResults):o.slice(0,n.maxResults);return i({matches:o.length,list:r})}))}},{key:"ignite",value:function(){var e=this,t=n(this.selector);function i(n){function i(e,n){t.dispatchEvent(new f.CustomEventWrapper("autoComplete",{bubbles:!0,detail:{event:e,input:a,query:l,matches:n?n.matches:null,results:n?n.list:null},cancelable:!0}))}var a=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value.toLowerCase():t.innerHTML.toLowerCase(),l=e.queryValue=e.query&&e.query.manipulate?e.query.manipulate(a):a,v=e.resultsList.render,m=e.trigger.condition?e.trigger.condition(l):l.length>=e.threshold&&l.replace(/ /g,"").length;if(v){var p=e.resultsList.view;o(p),m?e.listMatchedResults(e.dataStream,n).then((function(o){var a,l,f,v;i(n,o),e.resultsList.render&&(0===o.list.length&&e.noResults?e.noResults():(a=p,l=o.list,f=e.resultItem,v=document.createDocumentFragment(),l.forEach((function(e,t){var n=document.createElement(f.element),i=l[t].index;n.setAttribute(s,i),n.setAttribute("class","autoComplete_result"),f.content?f.content(e,n):n.innerHTML=e.match||e,v.appendChild(n)})),a.appendChild(v),e.onSelection&&(e.resultsList.navigation?e.resultsList.navigation(n,t,p,e.onSelection,o):function(e,t,n,i){function o(e){v.classList.remove(u),s=1===e?v.nextSibling:v.previousSibling}function a(e){(v=e).classList.add(u)}var s,l=t.childNodes,f=l.length-1,v=void 0;e.onkeydown=function(u){if(0<l.length)switch(u.keyCode){case d:v?(o(0),a(s||l[f])):a(l[f]);break;case h:v?(o(1),a(s||l[0])):a(l[0]);break;case c:v&&r(u,e,t,n,i,v)}},l.forEach((function(o){o.onmousedown=function(o){return r(o,e,t,n,i)}}))}(t,p,e.onSelection,o))))})):i(n)}else!v&&m&&e.listMatchedResults(e.dataStream,n).then((function(e){i(n,e)}))}this.placeHolder&&t.setAttribute("placeholder",this.placeHolder),this.trigger.event.forEach((function(n){var o,r,a;t.addEventListener(n,(o=function(t){return n=t,void Promise.resolve(e.data.cache?e.dataStream:e.data.src()).then((function(t){e.dataStream=t,i(n)}));var n},r=e.debounce,function(){var e=this,t=arguments;clearTimeout(a),a=setTimeout((function(){return o.apply(e,t)}),r)}))}))}},{key:"init",value:function(){var e=this;this.data.cache?Promise.resolve(this.data.src()).then((function(t){e.dataStream=t,e.ignite()})):this.ignite(),f.initElementClosestPolyfill()}}])&&e(l.prototype,v),a}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.autoComplete=b();
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.