PageSourceSearch

https://www.flatio.com/cdn/dist/js/Front/Help/main.js?v=cdf9b9f876

js flatio.com collected 2026-10-03 21:36:11 UTC 3,336 bytes, 1 lines download raw bytes

1import{Vt as e}from"../../shared/Telemetry-D1z2h3S_.js";import{w as t}from"../../shared/main-CuBJxxrZ.js";import{n}from"../../shared/stimulus-BHfpfkwG.js";import{C as r,w as i}from"../../shared/ModalController-C04E96cV.js";import{t as a}from"../../shared/stimulus-textarea-autogrow-BJgiNLHQ.js";import"../../shared/main-CKbheqxq.js";const o=`helpSearchSuggestion-`;var s=class extends n{static targets=[`input`,`suggestions`];static values={autocompleteUrl:String,searchUrl:String};static debounces=[{name:`suggest`,wait:150}];suggestions=[];activeIndex=-1;latestRequest=0;initialize(){i(this)}connect(){r(this)}clickOutside(){this.close()}async suggest(){let e=this.inputTarget.value.trim();if(e.length<3){this.close();return}let t=new URL(this.autocompleteUrlValue,window.location.origin);t.searchParams.set(`query`,e);let n=++this.latestRequest,r;try{let e=await fetch(t.toString(),{headers:{Accept:`application/json`}});if(!e.ok){this.closeIfCurrent(n);return}r=await e.json()}catch{this.closeIfCurrent(n);return}n===this.latestRequest&&(this.suggestions=c(r),this.activeIndex=-1,this.render())}navigate(e){if(e.key===`Escape`){this.close();return}if(e.key===`Enter`){e.preventDefault(),this.activeIndex>=0?window.location.assign(this.suggestions[this.activeIndex].link):this.submit();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`||this.suggestions.length===0)return;e.preventDefault();let t=e.key===`ArrowDown`?1:-1;this.activeIndex=(this.activeIndex+t+this.suggestions.length)%this.suggestions.length,this.highlight()}choose(e){let t=e.target.closest(`.autocomplete-suggestion`);if(!t)return;let n=Number(t.dataset.index),r=Number.isInteger(n)?this.suggestions[n]:void 0;r&&window.location.assign(r.link)}submit(){let e=this.inputTarget.value.trim();if(e===``)return;let t=new URL(this.searchUrlValue,window.location.origin);t.searchParams.set(`query`,e),window.location.assign(t.toString())}render(){this.suggestionsTarget.replaceChildren(...this.suggestions.map((e,t)=>{let n=document.createElement(`div`);n.className=`autocomplete-suggestion`,n.setAttribute(`role`,`option`),n.dataset.index=String(t),n.textContent=e.name;let r=document.createElement(`span`);return r.textContent=` – ${e.category}`,n.append(r),n})),this.setExpanded(this.suggestions.length>0),this.highlight()}highlight(){this.suggestionsTarget.querySelectorAll(`.autocomplete-suggestion`).forEach((e,t)=>{let n=t===this.activeIndex;e.id=`${o}${t}`,e.classList.toggle(`autocomplete-suggestion--active`,n),e.setAttribute(`aria-selected`,String(n))}),this.activeIndex>=0?this.inputTarget.setAttribute(`aria-activedescendant`,`${o}${this.activeIndex}`):this.inputTarget.removeAttribute(`aria-activedescendant`)}closeIfCurrent(e){e===this.latestRequest&&this.close()}close(){this.latestRequest+=1,this.suggestions=[],this.activeIndex=-1,this.inputTarget.removeAttribute(`aria-activedescendant`),this.suggestionsTarget.replaceChildren(),this.setExpanded(!1)}setExpanded(e){this.suggestionsTarget.hidden=!e,this.inputTarget.setAttribute(`aria-expanded`,String(e))}};const c=e=>{if(typeof e!=`object`||!e)return[];let{suggestions:t}=e;return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&typeof e.name==`string`&&typeof e.category==`string`&&typeof e.link==`string`):[]};e(()=>{t.App().register(`help-search`,s),t.App().register(`textarea-autogrow`,a)});

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.