/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import{a as c,b as n,c as y}from"./VKY6CRVQ.js";import{b as d}from"./ODCCVHGI.js";import{F as a,G as s,H as m,h as u,i as t,r as p}from"./42WFQ3AX.js";import"./3QPJ2JCA.js";var h=u`/** @license
 * Copyright 2025 Esri
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:host {
  display: block;
  --calcite-label-margin-bottom: 0;
}

.label-display {
  display: block;
  padding-bottom: 1rem;
}`,r=class extends m{constructor(){super(...arguments),this._densityElement=a(),this._typeElement=a(),this._severityElement=a(),this._types=Object.keys(n).filter(e=>!Number.isNaN(Number(n[e]))),this.deductValueComplete=p()}static{this.styles=h}render(){return t`<div class="label-display"><calcite-label class="label-display">\r\n            Density %${this._getDensityInput()}</calcite-label><calcite-label class="label-display">\r\n            Type${this._getTypeInput()}</calcite-label><calcite-label class="label-display">\r\n            Severity${this._getSeverityInput()}</calcite-label></div><div>${this._getCalculateInput()}</div>`}_getDensityInput(){return t`<calcite-input max=100 min=0 type=number ${s(this._densityElement)}></calcite-input>`}_getTypeInput(){return t`<calcite-select label ${s(this._typeElement)}>${this._types.map((e,i)=>t`<calcite-option .value=${n[e].toString()}>${`${e} (${i+1})`}</calcite-option>`)}</calcite-select>`}_getSeverityInput(){return t`<calcite-select label ${s(this._severityElement)}><calcite-option .value=${c.H}>\r\n          High</calcite-option><calcite-option .value=${c.M}>\r\n          Medium</calcite-option><calcite-option .value=${c.L}>\r\n          Low</calcite-option></calcite-select>`}_getCalculateInput(){let e=this._typeElement.value&&Number.parseFloat(this._typeElement.value.value),i=this._severityElement.value&&this._severityElement.value.value,l=this._densityElement.value&&Number.parseFloat(this._densityElement.value.value);return t`<calcite-button @click=${()=>this._calculateDeduct(e,i,l)}>\r\n        Calculate Deduct Value</calcite-button>`}_calculateDeduct(e,i,l){if(e&&i&&!Number.isNaN(l)){let o=y(e.toString(),i.toString(),l.toString(),!0);this.deductValueComplete.emit(o),alert(o)}else alert("Type, severity, and a density number are required")}};d("deduct-calculator",r);export{r as DeductCalculator};
