1import{h as i}from"./@vue-4f455194.js";const s={};function l(t){return Object.keys(t).reduce((n,e)=>(t[e]!==!1&&t[e]!==null&&t[e]!==void 0&&(n[e]=t[e]),n),{})}const u={name:"InlineSvg",inheritAttrs:!1,render(){return this.svgElSource?i("svg",Object.assign({},this.getSvgAttrs(this.svgElSource),l(this.$attrs),{innerHTML:this.getSvgContent(this.svgElSource)})):null},props:{src:{type:String,required:!0},title:{type:String},transformSource:{type:Function,default:t=>t},keepDuringLoading:{type:Boolean,default:!0}},emits:["loaded","unloaded","error"],data(){return{svgElSource:null}},watch:{src(t){this.getSource(t)}},mounted(){this.getSource(this.src)},methods:{getSvgAttrs(t){let n={};const e=t.attributes;if(!e)return n;for(let r=e.length-1;r>=0;r--)n[e[r].name]=e[r].value;return n},getSvgContent(t){return t=t.cloneNode(!0),t=this.transformSource(t),this.title&&g(t,this.title),t.innerHTML},getSource(t){s[t]||(s[t]=this.download(t)),this.svgElSource&&s[t].getIsPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),s[t].then(n=>{this.svgElSource=n,this.$nextTick(()=>{this.$emit("loaded",this.$el)})}).catch(n=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete s[t],this.$emit("error",n)})},download(t){return a(new Promise((n,e)=>{const r=new XMLHttpRequest;r.open("GET",t,!0),r.onload=()=>{if(r.status>=200&&r.status<400)try{let o=new DOMParser().parseFromString(r.responseText,"text/xml").getElementsByTagName("svg")[0];o?n(o):e(new Error('Loaded file is not valid SVG"'))}catch(o){e(o)}else e(new Error("Error loading SVG"))},r.onerror=e,r.send()}))}}};function g(t,n){const e=t.getElementsByTagName("title");if(e.length)e[0].textContent=n;else{const r=document.createElementNS("http://www.w3.org/2000/svg","title");r.textContent=n,t.insertBefore(r,t.firstChild)}}function a(t){if(t.getIsPending)return t;let n=!0,e=t.then(r=>(n=!1,r),r=>{throw n=!1,r});return e.getIsPending=function(){return n},e}export{u as I};
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.