1import{Controller}from"@hotwired/stimulus";const ATTRIBUTE="data-appearance";export default class extends Controller{static values={url:String};select(t){const e=t.detail.value,a=document.documentElement.getAttribute(ATTRIBUTE);this.#t(e),this.#e(e).catch(()=>this.#t(a))}#t(t){document.documentElement.setAttribute(ATTRIBUTE,t)}async#e(t){if(!this.hasUrlValue)return;const e=document.querySelector('meta[name="csrf-token"]')?.content,a=await fetch(this.urlValue,{method:"PATCH",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-Token":e||""},body:JSON.stringify({appearance:t}),credentials:"same-origin"});if(!a.ok)throw new Error(`appearance failed: ${a.status}`)}}
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.