import{aD as t,aF as e,b1 as i,a$ as s,b0 as n,bq as a,bw as l,bE as o,b2 as r,b3 as h}from"./p-BTBbFFOR.js";import{s as f}from"./p-C2rs7Hxy.js";import{I as d,V as c}from"./p-ULeawcYN.js";import{c as p}from"./p-CWM11sBo.js";import{c as b}from"./p-BH2dQqyF.js";var m=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(l=(a<3?n(l):a>3?n(e,i,l):n(e,i))||l);return a>3&&l&&Object.defineProperty(e,i,l),l};class x extends e{constructor(){super(),this.handleSuffixButtonClick=t=>{t.stopPropagation(),this.suffixButtonClickEventEmitter.emit()}}render(){if(this.suffixButtonConfig||this.suffixButtonProps){const{icon:t,text:e,size:s,minWidth:n,maxWidth:a,placement:l="right",alignment:o="start",trigger:r="hover"}=this.suffixButtonConfig||this.suffixButtonProps&&{icon:this.suffixButtonProps.icon,text:this.suffixButtonProps.tooltipText,trigger:this.suffixButtonProps.trigger};return i("div",{class:"label-suffix-button",role:"button",tabIndex:0,onClick:this.handleSuffixButtonClick,onKeyDown:b()},e?i("vega-tooltip",{trigger:r,text:e,size:s,minWidth:n,maxWidth:a,alignment:o,placement:l},this.renderSuffixButton(t)):this.renderSuffixButton(t))}}renderSuffixButton(t){return i("vega-button-circle",{size:"extra-small",variant:"icon-only",iconColor:"text-link",showTooltip:!1,icon:t})}}m([t()],x.prototype,"suffixButtonProps",void 0),m([t()],x.prototype,"suffixButtonConfig",void 0),m([t()],x.prototype,"suffixButtonClickEventEmitter",void 0);var g=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(l=(a<3?n(l):a>3?n(e,i,l):n(e,i))||l);return a>3&&l&&Object.defineProperty(e,i,l),l};const u=class{constructor(t){n(this,t),this.vegaClick=a(this,"vegaClick",7),this.vegaLabelButtonClick=a(this,"vegaLabelButtonClick",1),this.labelButtonClick=a(this,"labelButtonClick",1),this.globalSlimmers={},this.clickEventEmitter=p(u,l),this.suffixButtonClickEventEmitter=p(u,o),this.vegaComponentUsageRuntimeMetricsSlimmer=new c,this.suffixElementRenderer=new x,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.host.textContent&&(this.label=this.host.textContent),this.host.textContent=""}render(){return f(i(r,{class:{hidden:""===this.label,disabled:this.disabled},onClick:this.handleClick},i("label",null,i("span",{class:"vega-field-label"},this.label),i("span",{class:{"vega-field-label-required":!0,hidden:!this.isFieldRequired}},"*")),this.suffixElementRenderer.render()),this.host)}get host(){return h(this)}};g([d()],u.prototype,"globalSlimmers",void 0),g([s()],u.prototype,"clickEventEmitter",void 0),g([s()],u.prototype,"suffixButtonClickEventEmitter",void 0),g([s()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),g([s()],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}