import{h as t,r as e,c as i,H as s,g as n}from"./p-6b2342e0.js";import{s as a}from"./p-519a7d55.js";import{c as o,V as r,I as l}from"./p-6e1ab235.js";import{V as f,I as p}from"./p-4415ad28.js";import{c as h}from"./p-6b5cb920.js";import{a as d,x as c}from"./p-9af0e2e7.js";import{c as m}from"./p-6ac8e655.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-f28a6074.js";import"./p-331a62d5.js";import"./p-6e70d3cc.js";import"./p-f1c672e4.js";import"./p-b75ee3ba.js";var x=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class b extends r{constructor(){super(...arguments),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:e,text:i,size:s,minWidth:n,maxWidth:a,placement:o="right",alignment:r="start",trigger:l="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return t("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:m()},i?t("vega-tooltip",{trigger:l,text:i,size:s,minWidth:n,maxWidth:a,alignment:r,placement:o},this.renderSuffixButton(e)):this.renderSuffixButton(e))}}renderSuffixButton(e){return t("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:e})}}x([o()],b.prototype,"suffixButtonProps",void 0),x([o()],b.prototype,"suffixButtonConfig",void 0),x([o()],b.prototype,"suffixButtonClickEventEmitter",void 0);var g=function(t,e,i,s){var n,a=arguments.length,o=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};const u=class{constructor(t){e(this,t),this.vegaClick=i(this,"vegaClick",7),this.vegaLabelButtonClick=i(this,"vegaLabelButtonClick",1),this.labelButtonClick=i(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=h(u,d),this.suffixButtonClickEventEmitter=h(u,c),this.vegaComponentUsageRuntimeMetricsSlimmer=new f,this.suffixElementRenderer=new b,this.suffixButtonProps=null,this.suffixButtonConfig=null,this.label="",this.isFieldRequired=!1,this.disabled=!1,this.handleClick=t=>{this.clickEventEmitter.emit(void 0,t)}}componentWillLoad(){""===this.label&&(this.label=this.host.textContent,this.host.textContent="")}render(){return a(t(s,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},t("label",null,t("span",{class:"vega-field-label"},this.label),t("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return n(this)}};g([p()],u.prototype,"globalSlimmers",void 0),g([l()],u.prototype,"clickEventEmitter",void 0),g([l()],u.prototype,"suffixButtonClickEventEmitter",void 0),g([l()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),g([l()],u.prototype,"suffixElementRenderer",void 0),u.style=':host{display:inline-block}:host(.disabled){pointer-events:none}:host(.hidden){display:none}label:first-of-type{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;word-break:break-word}@media screen and (min-width: 768px) and (max-width: 1023px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){label:first-of-type{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host(.disabled)>label>span.vega-field-label{color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}.vega-field-label-required{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}.vega-field-label-required.hidden{display:none}.label-suffix-button{display:inline-block;margin-left:4px;vertical-align:top}';export{u as vega_field_label}