1/** 2 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. 3 * Original file: /npm/@stimulus-components/[email protected]/dist/stimulus-character-counter.mjs 4 * 5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 */ 7import{Controller as t}from"@hotwired/stimulus";const e=class extends t{initialize(){this.update=this.update.bind(this)}connect(){this.update(),this.inputTarget.addEventListener("input",this.update)}disconnect(){this.inputTarget.removeEventListener("input",this.update)}update(){this.counterTarget.innerHTML=this.count.toLocaleString()}get count(){let t=this.inputTarget.value.length;return this.hasCountdownValue&&(this.maxLength<0&&console.error(`[stimulus-character-counter] You need to add a maxlength attribute on the input to use countdown mode. The current value is: ${this.maxLength}.`),t=Math.max(this.maxLength-t,0)),t}get maxLength(){return this.inputTarget.maxLength}};e.targets=["input","counter"],e.values={countdown:Boolean};let n=e;export{n as default};
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.