/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-b4950b0c.js"),validation=require("./validation-cd978d87.js"),Alert=require("./Alert-074fe554.js"),prop_validators=require("./prop.validators-888c8338.js"),hasCloser=require("./has-closer-d1310212.js"),label=require("./label-477be19d.js");require("./tslib.es6-16e4524f.js"),require("./clsx-dd4d6dd1.js"),require("./i18n-1d085d07.js"),require("./i18n-737701e2.js"),require("./reuse-8cfefa9b.js"),require("./component-names-2c750b1b.js"),require("./dev.utils-58fde089.js"),require("./index-38f5f0b2.js");const alertTypeOptions=["default","info","success","warning","error"],alertVariantOptions=["card","msg"],KolAlertWc=class{constructor(e){index.registerInstance(this,e),this.close=()=>{var e,t;null===(t=null===(e=this._on)||void 0===e?void 0:e.onClose)||void 0===t||t.call(e,new Event("Close"))},this.handleAlertTimeout=()=>{this.validateAlert(!1)},this.validateOnValue=e=>"object"==typeof e&&null!==e&&"function"==typeof e.onClose,this._alert=!1,this._hasCloser=!1,this._label=void 0,this._level=1,this._on=void 0,this._type="default",this._variant="msg",this.state={_level:1}}render(){const{_alert:e,_hasCloser:t,_label:a,_level:l,_type:i,_variant:s}=this.state,r={alert:e,hasCloser:t,label:a,level:l,type:i,variant:s,onCloserClick:this.close,onAlertTimeout:this.handleAlertTimeout};return index.h(index.Host,{key:"93a18daf255ec95713c85ec926081163cb70df4a"},index.h(Alert.KolAlertFc,Object.assign({key:"dcfb772612cbe77e683b839474ce1e6e56e22dc4"},r),index.h("slot",{key:"daaca45ea2680f9f458dd24c41947214f391d8b2"})))}validateAlert(e){prop_validators.watchBoolean(this,"_alert",e)}validateHasCloser(e){hasCloser.validateHasCloser(this,e)}validateLabel(e){label.validateLabel(this,e)}validateLevel(e){validation.watchHeadingLevel(this,e)}validateOn(e){this.validateOnValue(e)&&prop_validators.setState(this,"_on",{onClose:e.onClose})}validateType(e){prop_validators.watchValidator(this,"_type",(e=>"string"==typeof e&&alertTypeOptions.includes(e)),new Set(`String {${alertTypeOptions.join(", ")}`),e)}validateVariant(e){prop_validators.watchValidator(this,"_variant",(e=>"string"==typeof e&&alertVariantOptions.includes(e)),new Set(`AlertVariant {${alertVariantOptions.join(", ")}`),e)}componentWillLoad(){this.validateAlert(this._alert),this.validateHasCloser(this._hasCloser),this.validateLabel(this._label),this.validateLevel(this._level),this.validateOn(this._on),this.validateType(this._type),this.validateVariant(this._variant)}static get watchers(){return{_alert:["validateAlert"],_hasCloser:["validateHasCloser"],_label:["validateLabel"],_level:["validateLevel"],_on:["validateOn"],_type:["validateType"],_variant:["validateVariant"]}}};exports.kol_alert_wc=KolAlertWc;