1import{g as o}from"./chunk-DG27WG7O.js";import{u as l,ua as g}from"./chunk-UT3T4CPM.js";import{h as m,oa as u,ua as n}from"./chunk-LBMBSTLT.js";var S=(()=>{class i{constructor(){this.sanitizer=n(l),this.communicationService=n(g),this.base64Output="",this.avatarImage=""}formatHtml(e){if(e&&typeof e=="object"&&"changingThisBreaksApplicationSecurity"in e)return e;let t;try{t=this.sanitizer.bypassSecurityTrustHtml(o(e))}catch{try{t=this.sanitizer.bypassSecurityTrustHtml(e)}catch{t=e}}return t}toPlainText(e){let t=r=>{let a=document.createElement("div");return a.innerHTML=r,a.textContent??""};try{return t(o(e))}catch{try{return t(e)}catch{return e??""}}}uploadFile(e){let r=e.currentTarget.files;var a=!1,s="";if(r){switch(r[0].type){case"image/jpeg":case"image/webp":case"image/png":case"image/svg+xml":case"image/avif":a=!0;break;default:a=!1,s="Invalid File Type";break}return r[0].size>4e6&&(a=!1,s="File is greater than 4 MB"),a?(this.convertFile(r[0]).subscribe(c=>{this.base64Output=c,this.avatarImage=this.sanitizer.bypassSecurityTrustUrl("data:"+r[0].type+";base64,"+this.base64Output),this.avatarJson={image_type:r[0].type,image_name:r[0].name,image_base64:c}}),{fileErrorMessage:s,avatarJson:this.avatarJson}):(this.communicationService.setSnackBarMessage({message:s,action:"OK",message_type:"error"}),{fileErrorMessage:s,avatarJson:this.avatarJson})}else return this.communicationService.setSnackBarMessage({message:"No Files",action:"OK",message_type:"error"}),{fileErrorMessage:"No Files",avatarJson:this.avatarJson}}convertFile(e){let t=new m(1),r=new FileReader;return r.readAsBinaryString(e),r.onload=a=>t.next(btoa(a.target.result.toString())),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{S as 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.