import{r as s,d as o,K as n,h as l,j as d,s as r,g as h,m as c,w as b}from"./index-Di6F0tPl.js";import{v as _}from"./label-vxVEH2gH-D6YJvZ98.js";import{c as v}from"./clsx-COFh-Vc8-D7cYsJM5.js";import{h as f}from"./tooltip-open-tracking-D3tCiiGP-DFCvib6Z.js";const g=(a,t,i)=>{c(a,"_width",t,Object.assign({defaultValue:"100%"},i))},e=["blank","card"],k=(a,t)=>{b(a,"_variant",i=>typeof i=="string"&&e.includes(i),new Set(e),t)},u=class{constructor(a){s(this,a),this.on={onClose:async()=>{await this.closeModal()}},this._width="100%",this._variant="blank",this.state={_label:"",_width:"100%"}}disconnectedCallback(){this.closeModal()}handleNativeCloseEvent(){var a,t;(t=(a=this.state._on)===null||a===void 0?void 0:a.onClose)===null||t===void 0||t.call(a),this.host&&o(this.host,n.close)}async openModal(){var a;(a=this.refDialog)===null||a===void 0||a.showModal()}async closeModal(){var a,t;(t=(a=this.refDialog)===null||a===void 0?void 0:a.close)===null||t===void 0||t.call(a)}render(){return l("dialog",{key:"2fbbca8fb299ff20a891a1b9745f1898e41e8842","aria-label":this.state._label,class:v("kol-dialog","kol-modal",{"kol-dialog__blank":this.state._variant==="blank","kol-dialog__card":this.state._variant==="card","kol-modal__blank":this.state._variant==="blank","kol-modal__card":this.state._variant==="card"}),onCancel:f,onClose:this.handleNativeCloseEvent.bind(this),ref:a=>{this.refDialog=a},style:{width:this.state._width}},this.state._variant==="blank"&&l("slot",{key:"33d72b4014bb7cfbf77befee0333819065abd02b"}),this.state._variant==="card"&&l(d,{key:"1db808d95fb269977d6de4989190174db2bc111d",_label:this.state._label,_hasCloser:!0,_on:this.on},l("slot",{key:"bd4a40e55c4d8f0af5b6468f43f7acb38f31502c"})))}validateLabel(a){_(this,a,{required:!0})}validateOn(a){if(typeof a=="object"&&a!==null){const t={};(typeof a.onClose=="function"||a.onClose===!0)&&(t.onClose=a.onClose),r(this,"_on",t)}}validateWidth(a){g(this,a)}validateVariant(a){k(this,a)}componentWillLoad(){this.validateLabel(this._label),this.validateOn(this._on),this.validateWidth(this._width),this.validateVariant(this._variant)}get host(){return h(this)}static get watchers(){return{_label:["validateLabel"],_on:["validateOn"],_width:["validateWidth"],_variant:["validateVariant"]}}};export{u as kol_dialog_wc};
//# sourceMappingURL=kol-dialog-wc.entry-CON8aL7b.js.map
