/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as __rest}from"./tslib.es6.js";import{h}from"@stencil/core/internal/client";import{c as clsx}from"./clsx.js";const MIN_HEADING_LEVEL=1,MAX_HEADING_LEVEL=6;function isValidHeadingLevel(e){return e>=MIN_HEADING_LEVEL&&e<=6}function getHeadlineTag(e){return isValidHeadingLevel(e)?`h${e}`:"strong"}const KolHeadlineFc=(e,s)=>{var{class:l,level:a=MIN_HEADING_LEVEL}=e,n=__rest(e,["class","level"]);const c=getHeadlineTag(a);return h(c,Object.assign({class:clsx("kol-headline",`kol-headline--${c}`,l)},n),s)},KolSecondaryHeadlineFc=(e,s)=>{var{class:l}=e,a=__rest(e,["class"]);return h("p",Object.assign({class:clsx("kol-headline kol-headline--group kol-headline--secondary",l)},a),s)},KolHeadingFc=(e,s)=>{var{secondaryHeadline:l,level:a=MIN_HEADING_LEVEL,class:n,HeadingGroupProps:c={},SecondaryHeadlineProps:i={}}=e,o=__rest(e,["secondaryHeadline","level","class","HeadingGroupProps","SecondaryHeadlineProps"]);const r=Object.assign({level:a},o);if(!l)return h(KolHeadlineFc,Object.assign({class:clsx(n,"kol-headline--single")},r),s);const{class:t}=c,d=__rest(c,["class"]),g=Object.assign({class:clsx("kol-heading-group",t)},d);return h("hgroup",Object.assign({},g),h(KolHeadlineFc,Object.assign({class:clsx(n,"kol-headline--group","kol-headline--primary")},r),s),h(KolSecondaryHeadlineFc,Object.assign({},i),l))};export{KolHeadingFc as K};