/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as a,h as t,H as s}from"./index-9ca46203.js";import{D as e,v as i}from"./index-0489af72.js";import{t as r}from"./i18n-3bac791b.js";import"./i18n-fddf0324.js";const n=a=>0===a.length?"":a[0].toUpperCase(),c=a=>{const t=a.split(/\s+/),s=t.at(0),e=t.at(-1);return t.length>=2&&s&&e?`${n(s)}${n(e)}`:n(a)},l=class{constructor(t){a(this,t),this._src=void 0,this._label=void 0,this.state={_src:"",_label:""}}render(){return t(s,{key:"f0faaa1a4b75a9e31a241db182d9995b847c7c2b",class:"kol-avatar-wc"},t("div",{key:"2a06a185324e0bc06e2843f909b236fa4dfed4f9","aria-label":r("kol-avatar-alt",{placeholders:{name:this.state._label}}),class:"container",role:"img"},this.state._src?t("img",{alt:"","aria-hidden":"true",class:"image",src:this.state._src}):t("span",{"aria-hidden":"true",class:"initials"},c(this.state._label.trim()))))}validateSrc(a){e(this,a)}validateLabel(a){i(this,a,{required:!0})}componentWillLoad(){this.validateSrc(this._src),this.validateLabel(this._label)}static get watchers(){return{_src:["validateSrc"],_label:["validateLabel"]}}};export{l as kol_avatar_wc};