https://medvestnik.ru/apps/mv/assets/cache/version/1/mjs/medinternet-ai-form/28706a18.mjs?1771937846
1import{Timer,wretch,Err,Message}from 'core';Alpine.component('medinternet.ai.form',(opts={})=>({url:opts.url||null,lang:opts.lang||{},silent:opts.silent||!1,message:'',requesting:!1,suggestion:{full:null,chars:[],value:null,delay:5000,speed:[15,70],},timer:null,init(){this.suggest()},mounted(){this.timer=new Timer({from:-1,period:this.suggestion.speed,ontick:t=>{this.suggestion.value+=this.suggestion.chars[t.value];if(this.suggestion.value==this.suggestion.full){t.complete()}},callback:t=>{setTimeout(()=>{this.suggest();t.start()},this.suggestion.delay)}});this.timer.start()},suggest(){const data=this.lang[Math.floor(Math.random()*this.lang.length)];const endings=data.end||[];const end=endings[Math.floor(Math.random()*endings.length)];this.suggestion.full=[data.start||"",end].filter(Boolean).join(" ");this.suggestion.chars=this.suggestion.full.split("");this.suggestion.value=""},request(){this.message||(this.message=this.suggestion.full);if(this.message&&this.url){this.requesting=!0;wretch(this.url).post({prompt:this.message,}).json(json=>{const data=json.data||{};this.$dispatch('medinternet:prompt',data);if(!this.silent){const loc=data.location;loc&&(document.location=loc)}}).catch(err=>{this.error(Err.from(err).message)}).then(()=>{this.requesting=!1})}},error(msg){msg&&new Message({text:msg,type:'error'})},destruct(){this.timer.destroy()}}))
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.