/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h,F as Fragment}from"./index-C_yiBYg2.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import{K as KolIconFc}from"./Icon-FTWc_xI9.js";import"./common-Dd0zJQbD.js";import{s as showExpertSlot}from"./reuse-CX4AQDkS.js";import{m as md}from"./markdown-BSkXjaSn.js";import{i as isString,K as KolInternalUnderlinedBadgeTextFc}from"./InternalUnderlinedBadgeText-BeTCgMOl.js";import{i as isObject}from"./isObject-DvSELytj.js";const IconHelper=e=>{const{class:l,style:s,label:a,icon:n}=e;return h(KolIconFc,{class:clsx("icon",l),style:s,label:a||"",icons:n})},LabelHelper=({label:e,hideLabel:l,allowMarkdown:s,badgeText:a})=>{if(l||!isString(e))return null;const n="kol-span__label";return s?h("span",{class:clsx(n,"md"),innerHTML:md(e)}):h("span",{class:clsx(n)},a?h(KolInternalUnderlinedBadgeTextFc,{label:e,badgeText:a}):e)},KolSpanCoreHelperFc=({hideLabel:e,label:l,badgeText:s,allowMarkdown:a},n)=>{const o=!showExpertSlot(l);return h(Fragment,null,o&&h(LabelHelper,{label:l,hideLabel:e,badgeText:s,allowMarkdown:a}),h("span",{"aria-hidden":o?"true":void 0,class:"kol-span__label",hidden:o},n),isString(s)&&s.length>0&&h("kbd",{class:"badge-text-hint","aria-hidden":"true"},s))},KolSpanFc=(e,l)=>{const{class:s,label:a,hideLabel:n=!1,badgeText:o,allowMarkdown:t,icons:r}=e,c=__rest(e,["class","label","hideLabel","badgeText","allowMarkdown","icons"]);let i=null,b=null,d=null,p=null;return isObject(r)?(i=r.top,b=r.left,d=r.right,p=r.bottom):isString(r)&&(b={icon:r}),h("span",Object.assign({class:clsx("kol-span",{"kol-span--hide-label":n},s)},c),isObject(i)&&h(IconHelper,Object.assign({class:"top"},i)),h("span",{class:"kol-span__container"},isObject(b)&&h(IconHelper,Object.assign({class:"left"},b)),h(KolSpanCoreHelperFc,{label:a,hideLabel:n,allowMarkdown:t,badgeText:o},l),isObject(d)&&h(IconHelper,Object.assign({class:"right"},d))),isObject(p)&&h(IconHelper,Object.assign({class:"bottom"},p)))};export{KolSpanFc as K};