UNPKG

finpro

Version:
3 lines (2 loc) 1.38 kB
import{a as f}from"./chunk-NJQW4VOP.js";import{a}from"./chunk-23UFIOHV.js";import{a as g}from"./chunk-JA3VZI2D.js";import{a as h,b as l,g as c,h as p,i as d}from"./chunk-GBPY57YZ.js";import{a as e}from"./chunk-NZ3RGSR6.js";var v="./assets";function x(m){v=m}function E(){return v}var u=import.meta.url;u&&x(u.split("/").slice(0,-1).concat("assets").join("/"));var y=h`:host{display:inline-block}:host div{display:flex;align-items:stretch;width:1em;height:1em;min-width:1em;min-height:1em;overflow:hidden;transform:translateZ(0)}:host svg{width:1em;height:1em}`,w=y;var n=new Map,t=class extends g{static get styles(){return[w]}get name(){return this._iconName}set name(o){o!==this._iconName&&(this._iconName=o,this.load())}async load(){let r=`${E()}/${this.name}.svg`;n.has(r)||n.set(r,fetch(r));try{let i=await n.get(r),s=await(i==null?void 0:i.clone());s!=null&&s.ok?(this.svg=await s.text(),this.onLoad(`${this.name} icon loaded`),this.requestUpdate()):this.onError(`${this.name} icon failed to load`)}catch(i){this.onError(`${this.name} icon failed to load [${i}]`)}}render(){return l`<div aria-hidden="true">${f(this.svg)}</div>`}};e([p()],t.prototype,"name",1),e([a("fp-load")],t.prototype,"onLoad",2),e([a("fp-error")],t.prototype,"onError",2),e([d()],t.prototype,"svg",2),t=e([c("fp-icon")],t);export{x as a,E as b,t as c}; //# sourceMappingURL=chunk-RDVKBYML.js.map