var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var l=Array(e),a=0,t=0;t<i;t++)for(var n=arguments[t],c=0,r=n.length;c<r;c++,a++)l[a]=n[c];return l};System.register(["./p-1d25d5b7.system.js","./p-b6e00050.system.js"],(function(e){"use strict";var t,i,l,a,n,c,r;return{setters:[function(e){t=e.r;i=e.c;l=e.h;a=e.H;n=e.g},function(e){c=e.f;r=e.g}],execute:function(){var s=":host([hidden]){display:none}:host-context([theme=dark]){--calcite-ui-blue-1:#00A0FF;--calcite-ui-blue-2:#0087D7;--calcite-ui-blue-3:#47BBFF;--calcite-ui-green-1:#36DA43;--calcite-ui-green-2:#11AD1D;--calcite-ui-green-3:#44ED51;--calcite-ui-yellow-1:#FFC900;--calcite-ui-yellow-2:#F4B000;--calcite-ui-yellow-3:#FFE24D;--calcite-ui-red-1:#FE583E;--calcite-ui-red-2:#F3381B;--calcite-ui-red-3:#FF7465;--calcite-ui-background:#202020;--calcite-ui-foreground-1:#2b2b2b;--calcite-ui-foreground-2:#353535;--calcite-ui-foreground-3:#404040;--calcite-ui-text-1:#ffffff;--calcite-ui-text-2:#bfbfbf;--calcite-ui-text-3:#9f9f9f;--calcite-ui-border-1:#4a4a4a;--calcite-ui-border-2:#404040;--calcite-ui-border-3:#353535;--calcite-ui-border-4:#757575;--calcite-ui-border-5:#9f9f9f}:host([scale=s]) label{font-size:var(--calcite-label-font-size, 12px);--calcite-label-spacing-value:8px}:host([scale=m]) label{font-size:var(--calcite-label-font-size, 16px);--calcite-label-spacing-value:12px}:host([scale=l]) label{font-size:var(--calcite-label-font-size, 20px);--calcite-label-spacing-value:16px}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative;text-align:left}:host([dir=rtl]){text-align:right}:host label{width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;cursor:pointer;margin:0 0 var(--calcite-label-margin-bottom, 1.5rem) 0}:host([layout=inline]) label{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}:host([layout=inline-space-between]) label{-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host([layout=default]) label .calcite-label-text{margin-bottom:8px}:host([layout=inline]) .calcite-label-text:first-child,:host([layout=inline-space-between]) .calcite-label-text:first-child{margin-right:0.75rem}:host([layout=inline]) .calcite-label-text:last-child,:host([layout=inline-space-between]) .calcite-label-text:last-child{margin-left:0.75rem}:host([status=invalid]) label{color:var(--calcite-ui-red-1)}:host([status=valid]) label{color:var(--calcite-ui-text-2)}:host([status=idle]) label{color:var(--calcite-ui-text-2)}";var o=e("calcite_label",function(){function e(e){var l=this;t(this,e);this.calciteLabelFocus=i(this,"calciteLabelFocus",7);this.status="idle";this.scale="m";this.layout="default";this.handleClick=function(e){l.emitSelectedItem(e.target);if(l.requestedFor){c(document.getElementById(l.requestedFor))}else if(l.el.querySelector("textarea")){l.el.querySelector("textarea").focus()}else if(l.el.querySelector("input")){l.el.querySelector("input").focus()}}}e.prototype.connectedCallback=function(){var e=["invalid","valid","idle"];if(!e.includes(this.status))this.status="idle";var t=["inline","inline-space-between","default"];if(!t.includes(this.layout))this.layout="default";var i=["s","m","l"];if(!i.includes(this.scale))this.scale="m"};e.prototype.componentDidLoad=function(){var e=this;this.requestedFor=this.el.getAttribute("for");if(this.layout==="inline"||this.layout==="inline-space-between"){this.displayedSlottedContent=this.handleSlottedContent();this.slottedContent.innerHTML="";this.displayedSlottedContent.map((function(t){e.slottedContent.append(t)}))}};e.prototype.render=function(){var e=this;var t=this.getAttributes();var i=r(this.el);return l(a,{dir:i,onClick:this.handleClick},l("label",Object.assign({},t,{ref:function(t){return e.slottedContent=t}}),l("slot",null)))};e.prototype.handleSlottedContent=function(){var e=[];var t=this.el.childNodes;if(t){t.forEach((function(t){if(t.nodeName==="#text"&&t.textContent.trim().length>0){var i=document.createElement("span");i.classList.add("calcite-label-text");i.innerHTML=t.textContent.trim();e.push(i)}else if(t.nodeName!=="#text"){e.push(t)}}))}return __spreadArrays(Array.from(new Set(e)))};e.prototype.emitSelectedItem=function(e){this.calciteLabelFocus.emit({labelEl:this.el,interactedEl:e,requestedInput:this.requestedFor})};e.prototype.getAttributes=function(){var e=["layout","theme","scale","status"];return Array.from(this.el.attributes).filter((function(t){return t&&!e.includes(t.name)})).reduce((function(e,t){var i;var l=t.name,a=t.value;return Object.assign(Object.assign({},e),(i={},i[l]=a,i))}),{})};Object.defineProperty(e.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());o.style=s}}}));