import { c as a } from "../../chunks/runtime.js";
import { html as r } from "lit";
import { watch as n } from "@arcgis/core/core/reactiveUtils.js";
import { LitElement as s } from "@arcgis/lumina";
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
class p extends s {
  constructor() {
    super(...arguments), this._dpi = 1;
  }
  static {
    this.properties = { _dpi: 16, viewModel: 0, messages: 0 };
  }
  loaded() {
    this.manager.onLifecycle(() => [
      n(() => this.viewModel.templateOptions.dpi, (t) => this._dpi = t <= 0 ? 1 : t, { initial: !0 })
    ]);
  }
  _handleDPIChange(t) {
    const i = this.viewModel.templateOptions, e = Number(t.target.value);
    if (Number.isNaN(e) || e <= 0 || !Number.isFinite(e)) {
      t.target.value = `${this._dpi}`;
      return;
    }
    i.dpi = e;
  }
  render() {
    return r`<div><calcite-label>${this.messages.dpi}<calcite-input-number data-input-name=dpi min=1 .value=${`${this._dpi}`} .max=${Number.MAX_SAFE_INTEGER} @calciteInputNumberInput=${this._handleDPIChange}></calcite-input-number></calcite-label></div>`;
  }
}
a("arcgis-print-dpi-input", p);
export {
  p as PrintDPIInput
};
