/*!
 * KoliBri - The accessible HTML-Standard
 */
import{r as a,h as t}from"./index-91489a9f.js";import{t as r}from"./i18n-5fe08f1c.js";import{v as s}from"./image-source-320efd4f.js";import{v as e}from"./label-d0315384.js";import"./i18n-7ea9f137.js";import"./reuse-32931294.js";import"./prop.validators-9feb1d92.js";import"./index-da3e0c00.js";import"./dev.utils-fab45cbc.js";const i=a=>0===a.length?"":a[0].toUpperCase(),o=a=>{const t=a.split(/\s+/),s=t.at(0),e=t.at(-1);return t.length>=2&&s&&e?`${i(s)}${i(e)}`:i(a)},l=class{constructor(t){a(this,t),this._src=void 0,this._label=void 0,this.state={_src:"",_label:""}}render(){return t("div",{key:"3343b9da0025b1db79bc3353197ed57e1ea15624","aria-label":r("kol-avatar-alt",{placeholders:{name:this.state._label}}),class:"kol-avatar",role:"img"},this.state._src?t("img",{alt:"","aria-hidden":"true",class:"kol-avatar__image",src:this.state._src}):t("span",{"aria-hidden":"true",class:"kol-avatar__initials"},o(this.state._label.trim())))}validateSrc(a){s(this,a)}validateLabel(a){e(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};