next-flow-design 1.1.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
1
  import { createComponent as O } from "@lit/react";
2
2
  import V from "react";
3
- import { css as E, LitElement as W, html as p } from "lit";
4
- const N = (t) => (e, s) => {
5
- s !== void 0 ? s.addInitializer(() => {
3
+ import { css as A, LitElement as q, html as p } from "lit";
4
+ const N = (t) => (e, o) => {
5
+ o !== void 0 ? o.addInitializer(() => {
6
6
  customElements.define(t, e);
7
7
  }) : customElements.define(t, e);
8
8
  };
9
- const Z = globalThis, oe = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, xe = /* @__PURE__ */ Symbol(), pe = /* @__PURE__ */ new WeakMap();
9
+ const G = globalThis, ie = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, xe = /* @__PURE__ */ Symbol(), ue = /* @__PURE__ */ new WeakMap();
10
10
  let Pe = class {
11
- constructor(e, s, r) {
12
- if (this._$cssResult$ = !0, r !== xe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
13
- this.cssText = e, this.t = s;
11
+ constructor(e, o, s) {
12
+ if (this._$cssResult$ = !0, s !== xe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
13
+ this.cssText = e, this.t = o;
14
14
  }
15
15
  get styleSheet() {
16
16
  let e = this.o;
17
- const s = this.t;
18
- if (oe && e === void 0) {
19
- const r = s !== void 0 && s.length === 1;
20
- r && (e = pe.get(s)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && pe.set(s, e));
17
+ const o = this.t;
18
+ if (ie && e === void 0) {
19
+ const s = o !== void 0 && o.length === 1;
20
+ s && (e = ue.get(o)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && ue.set(o, e));
21
21
  }
22
22
  return e;
23
23
  }
@@ -26,17 +26,17 @@ let Pe = class {
26
26
  }
27
27
  };
28
28
  const De = (t) => new Pe(typeof t == "string" ? t : t + "", void 0, xe), Me = (t, e) => {
29
- if (oe) t.adoptedStyleSheets = e.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
30
- else for (const s of e) {
31
- const r = document.createElement("style"), i = Z.litNonce;
32
- i !== void 0 && r.setAttribute("nonce", i), r.textContent = s.cssText, t.appendChild(r);
33
- }
34
- }, ue = oe ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
35
- let s = "";
36
- for (const r of e.cssRules) s += r.cssText;
37
- return De(s);
29
+ if (ie) t.adoptedStyleSheets = e.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
30
+ else for (const o of e) {
31
+ const s = document.createElement("style"), r = G.litNonce;
32
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = o.cssText, t.appendChild(s);
33
+ }
34
+ }, pe = ie ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
35
+ let o = "";
36
+ for (const s of e.cssRules) o += s.cssText;
37
+ return De(o);
38
38
  })(t) : t;
39
- const { is: Oe, defineProperty: Ve, getOwnPropertyDescriptor: Ne, getOwnPropertyNames: Te, getOwnPropertySymbols: Ie, getPrototypeOf: He } = Object, ee = globalThis, fe = ee.trustedTypes, Ue = fe ? fe.emptyScript : "", Be = ee.reactiveElementPolyfillSupport, z = (t, e) => t, G = { toAttribute(t, e) {
39
+ const { is: Oe, defineProperty: Ve, getOwnPropertyDescriptor: Ne, getOwnPropertyNames: Be, getOwnPropertySymbols: Te, getPrototypeOf: He } = Object, te = globalThis, fe = te.trustedTypes, Ue = fe ? fe.emptyScript : "", Ie = te.reactiveElementPolyfillSupport, z = (t, e) => t, J = { toAttribute(t, e) {
40
40
  switch (e) {
41
41
  case Boolean:
42
42
  t = t ? Ue : null;
@@ -47,25 +47,25 @@ const { is: Oe, defineProperty: Ve, getOwnPropertyDescriptor: Ne, getOwnProperty
47
47
  }
48
48
  return t;
49
49
  }, fromAttribute(t, e) {
50
- let s = t;
50
+ let o = t;
51
51
  switch (e) {
52
52
  case Boolean:
53
- s = t !== null;
53
+ o = t !== null;
54
54
  break;
55
55
  case Number:
56
- s = t === null ? null : Number(t);
56
+ o = t === null ? null : Number(t);
57
57
  break;
58
58
  case Object:
59
59
  case Array:
60
60
  try {
61
- s = JSON.parse(t);
61
+ o = JSON.parse(t);
62
62
  } catch {
63
- s = null;
63
+ o = null;
64
64
  }
65
65
  }
66
- return s;
67
- } }, ne = (t, e) => !Oe(t, e), me = { attribute: !0, type: String, converter: G, reflect: !1, useDefault: !1, hasChanged: ne };
68
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), ee.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
66
+ return o;
67
+ } }, ne = (t, e) => !Oe(t, e), be = { attribute: !0, type: String, converter: J, reflect: !1, useDefault: !1, hasChanged: ne };
68
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), te.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
69
69
  let T = class extends HTMLElement {
70
70
  static addInitializer(e) {
71
71
  this._$Ei(), (this.l ??= []).push(e);
@@ -73,25 +73,25 @@ let T = class extends HTMLElement {
73
73
  static get observedAttributes() {
74
74
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
75
75
  }
76
- static createProperty(e, s = me) {
77
- if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(e, s), !s.noAccessor) {
78
- const r = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(e, r, s);
79
- i !== void 0 && Ve(this.prototype, e, i);
76
+ static createProperty(e, o = be) {
77
+ if (o.state && (o.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((o = Object.create(o)).wrapped = !0), this.elementProperties.set(e, o), !o.noAccessor) {
78
+ const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, s, o);
79
+ r !== void 0 && Ve(this.prototype, e, r);
80
80
  }
81
81
  }
82
- static getPropertyDescriptor(e, s, r) {
83
- const { get: i, set: o } = Ne(this.prototype, e) ?? { get() {
84
- return this[s];
82
+ static getPropertyDescriptor(e, o, s) {
83
+ const { get: r, set: i } = Ne(this.prototype, e) ?? { get() {
84
+ return this[o];
85
85
  }, set(n) {
86
- this[s] = n;
86
+ this[o] = n;
87
87
  } };
88
- return { get: i, set(n) {
89
- const l = i?.call(this);
90
- o?.call(this, n), this.requestUpdate(e, l, r);
88
+ return { get: r, set(n) {
89
+ const l = r?.call(this);
90
+ i?.call(this, n), this.requestUpdate(e, l, s);
91
91
  }, configurable: !0, enumerable: !0 };
92
92
  }
93
93
  static getPropertyOptions(e) {
94
- return this.elementProperties.get(e) ?? me;
94
+ return this.elementProperties.get(e) ?? be;
95
95
  }
96
96
  static _$Ei() {
97
97
  if (this.hasOwnProperty(z("elementProperties"))) return;
@@ -101,32 +101,32 @@ let T = class extends HTMLElement {
101
101
  static finalize() {
102
102
  if (this.hasOwnProperty(z("finalized"))) return;
103
103
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(z("properties"))) {
104
- const s = this.properties, r = [...Te(s), ...Ie(s)];
105
- for (const i of r) this.createProperty(i, s[i]);
104
+ const o = this.properties, s = [...Be(o), ...Te(o)];
105
+ for (const r of s) this.createProperty(r, o[r]);
106
106
  }
107
107
  const e = this[Symbol.metadata];
108
108
  if (e !== null) {
109
- const s = litPropertyMetadata.get(e);
110
- if (s !== void 0) for (const [r, i] of s) this.elementProperties.set(r, i);
109
+ const o = litPropertyMetadata.get(e);
110
+ if (o !== void 0) for (const [s, r] of o) this.elementProperties.set(s, r);
111
111
  }
112
112
  this._$Eh = /* @__PURE__ */ new Map();
113
- for (const [s, r] of this.elementProperties) {
114
- const i = this._$Eu(s, r);
115
- i !== void 0 && this._$Eh.set(i, s);
113
+ for (const [o, s] of this.elementProperties) {
114
+ const r = this._$Eu(o, s);
115
+ r !== void 0 && this._$Eh.set(r, o);
116
116
  }
117
117
  this.elementStyles = this.finalizeStyles(this.styles);
118
118
  }
119
119
  static finalizeStyles(e) {
120
- const s = [];
120
+ const o = [];
121
121
  if (Array.isArray(e)) {
122
- const r = new Set(e.flat(1 / 0).reverse());
123
- for (const i of r) s.unshift(ue(i));
124
- } else e !== void 0 && s.push(ue(e));
125
- return s;
122
+ const s = new Set(e.flat(1 / 0).reverse());
123
+ for (const r of s) o.unshift(pe(r));
124
+ } else e !== void 0 && o.push(pe(e));
125
+ return o;
126
126
  }
127
- static _$Eu(e, s) {
128
- const r = s.attribute;
129
- return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
127
+ static _$Eu(e, o) {
128
+ const s = o.attribute;
129
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
130
130
  }
131
131
  constructor() {
132
132
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
@@ -141,8 +141,8 @@ let T = class extends HTMLElement {
141
141
  this._$EO?.delete(e);
142
142
  }
143
143
  _$E_() {
144
- const e = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
145
- for (const r of s.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
144
+ const e = /* @__PURE__ */ new Map(), o = this.constructor.elementProperties;
145
+ for (const s of o.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
146
146
  e.size > 0 && (this._$Ep = e);
147
147
  }
148
148
  createRenderRoot() {
@@ -157,42 +157,42 @@ let T = class extends HTMLElement {
157
157
  disconnectedCallback() {
158
158
  this._$EO?.forEach((e) => e.hostDisconnected?.());
159
159
  }
160
- attributeChangedCallback(e, s, r) {
161
- this._$AK(e, r);
160
+ attributeChangedCallback(e, o, s) {
161
+ this._$AK(e, s);
162
162
  }
163
- _$ET(e, s) {
164
- const r = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, r);
165
- if (i !== void 0 && r.reflect === !0) {
166
- const o = (r.converter?.toAttribute !== void 0 ? r.converter : G).toAttribute(s, r.type);
167
- this._$Em = e, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
163
+ _$ET(e, o) {
164
+ const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
165
+ if (r !== void 0 && s.reflect === !0) {
166
+ const i = (s.converter?.toAttribute !== void 0 ? s.converter : J).toAttribute(o, s.type);
167
+ this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
168
168
  }
169
169
  }
170
- _$AK(e, s) {
171
- const r = this.constructor, i = r._$Eh.get(e);
172
- if (i !== void 0 && this._$Em !== i) {
173
- const o = r.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : G;
174
- this._$Em = i;
175
- const l = n.fromAttribute(s, o.type);
176
- this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
170
+ _$AK(e, o) {
171
+ const s = this.constructor, r = s._$Eh.get(e);
172
+ if (r !== void 0 && this._$Em !== r) {
173
+ const i = s.getPropertyOptions(r), n = typeof i.converter == "function" ? { fromAttribute: i.converter } : i.converter?.fromAttribute !== void 0 ? i.converter : J;
174
+ this._$Em = r;
175
+ const l = n.fromAttribute(o, i.type);
176
+ this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
177
177
  }
178
178
  }
179
- requestUpdate(e, s, r, i = !1, o) {
179
+ requestUpdate(e, o, s, r = !1, i) {
180
180
  if (e !== void 0) {
181
181
  const n = this.constructor;
182
- if (i === !1 && (o = this[e]), r ??= n.getPropertyOptions(e), !((r.hasChanged ?? ne)(o, s) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, r)))) return;
183
- this.C(e, s, r);
182
+ if (r === !1 && (i = this[e]), s ??= n.getPropertyOptions(e), !((s.hasChanged ?? ne)(i, o) || s.useDefault && s.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(n._$Eu(e, s)))) return;
183
+ this.C(e, o, s);
184
184
  }
185
185
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
186
186
  }
187
- C(e, s, { useDefault: r, reflect: i, wrapped: o }, n) {
188
- r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? s ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (s = void 0), this._$AL.set(e, s)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
187
+ C(e, o, { useDefault: s, reflect: r, wrapped: i }, n) {
188
+ s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? o ?? this[e]), i !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (o = void 0), this._$AL.set(e, o)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
189
189
  }
190
190
  async _$EP() {
191
191
  this.isUpdatePending = !0;
192
192
  try {
193
193
  await this._$ES;
194
- } catch (s) {
195
- Promise.reject(s);
194
+ } catch (o) {
195
+ Promise.reject(o);
196
196
  }
197
197
  const e = this.scheduleUpdate();
198
198
  return e != null && await e, !this.isUpdatePending;
@@ -204,28 +204,28 @@ let T = class extends HTMLElement {
204
204
  if (!this.isUpdatePending) return;
205
205
  if (!this.hasUpdated) {
206
206
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
207
- for (const [i, o] of this._$Ep) this[i] = o;
207
+ for (const [r, i] of this._$Ep) this[r] = i;
208
208
  this._$Ep = void 0;
209
209
  }
210
- const r = this.constructor.elementProperties;
211
- if (r.size > 0) for (const [i, o] of r) {
212
- const { wrapped: n } = o, l = this[i];
213
- n !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, o, l);
210
+ const s = this.constructor.elementProperties;
211
+ if (s.size > 0) for (const [r, i] of s) {
212
+ const { wrapped: n } = i, l = this[r];
213
+ n !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, i, l);
214
214
  }
215
215
  }
216
216
  let e = !1;
217
- const s = this._$AL;
217
+ const o = this._$AL;
218
218
  try {
219
- e = this.shouldUpdate(s), e ? (this.willUpdate(s), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(s)) : this._$EM();
220
- } catch (r) {
221
- throw e = !1, this._$EM(), r;
219
+ e = this.shouldUpdate(o), e ? (this.willUpdate(o), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(o)) : this._$EM();
220
+ } catch (s) {
221
+ throw e = !1, this._$EM(), s;
222
222
  }
223
- e && this._$AE(s);
223
+ e && this._$AE(o);
224
224
  }
225
225
  willUpdate(e) {
226
226
  }
227
227
  _$AE(e) {
228
- this._$EO?.forEach((s) => s.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
228
+ this._$EO?.forEach((o) => o.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
229
229
  }
230
230
  _$EM() {
231
231
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
@@ -240,19 +240,19 @@ let T = class extends HTMLElement {
240
240
  return !0;
241
241
  }
242
242
  update(e) {
243
- this._$Eq &&= this._$Eq.forEach((s) => this._$ET(s, this[s])), this._$EM();
243
+ this._$Eq &&= this._$Eq.forEach((o) => this._$ET(o, this[o])), this._$EM();
244
244
  }
245
245
  updated(e) {
246
246
  }
247
247
  firstUpdated(e) {
248
248
  }
249
249
  };
250
- T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[z("elementProperties")] = /* @__PURE__ */ new Map(), T[z("finalized")] = /* @__PURE__ */ new Map(), Be?.({ ReactiveElement: T }), (ee.reactiveElementVersions ??= []).push("2.1.2");
251
- const Fe = { attribute: !0, type: String, converter: G, reflect: !1, hasChanged: ne }, Le = (t = Fe, e, s) => {
252
- const { kind: r, metadata: i } = s;
253
- let o = globalThis.litPropertyMetadata.get(i);
254
- if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(s.name, t), r === "accessor") {
255
- const { name: n } = s;
250
+ T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[z("elementProperties")] = /* @__PURE__ */ new Map(), T[z("finalized")] = /* @__PURE__ */ new Map(), Ie?.({ ReactiveElement: T }), (te.reactiveElementVersions ??= []).push("2.1.2");
251
+ const Le = { attribute: !0, type: String, converter: J, reflect: !1, hasChanged: ne }, Fe = (t = Le, e, o) => {
252
+ const { kind: s, metadata: r } = o;
253
+ let i = globalThis.litPropertyMetadata.get(r);
254
+ if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), s === "setter" && ((t = Object.create(t)).wrapped = !0), i.set(o.name, t), s === "accessor") {
255
+ const { name: n } = o;
256
256
  return { set(l) {
257
257
  const a = e.get.call(this);
258
258
  e.set.call(this, l), this.requestUpdate(n, a, t, !0, l);
@@ -260,33 +260,33 @@ const Fe = { attribute: !0, type: String, converter: G, reflect: !1, hasChanged:
260
260
  return l !== void 0 && this.C(n, void 0, t, l), l;
261
261
  } };
262
262
  }
263
- if (r === "setter") {
264
- const { name: n } = s;
263
+ if (s === "setter") {
264
+ const { name: n } = o;
265
265
  return function(l) {
266
266
  const a = this[n];
267
267
  e.call(this, l), this.requestUpdate(n, a, t, !0, l);
268
268
  };
269
269
  }
270
- throw Error("Unsupported decorator location: " + r);
270
+ throw Error("Unsupported decorator location: " + s);
271
271
  };
272
272
  function h(t) {
273
- return (e, s) => typeof s == "object" ? Le(t, e, s) : ((r, i, o) => {
274
- const n = i.hasOwnProperty(o);
275
- return i.constructor.createProperty(o, r), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
276
- })(t, e, s);
273
+ return (e, o) => typeof o == "object" ? Fe(t, e, o) : ((s, r, i) => {
274
+ const n = r.hasOwnProperty(i);
275
+ return r.constructor.createProperty(i, s), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
276
+ })(t, e, o);
277
277
  }
278
- function y(t) {
278
+ function $(t) {
279
279
  return h({ ...t, state: !0, attribute: !1 });
280
280
  }
281
- const K = E`:host{display:inline-flex;align-items:center;position:relative;width:var(--nf-width);height:var(--nf-height);padding:var(--nf-padding);margin:var(--nf-margin);font-size:var(--nf-text-font-size);font-weight:var(--nf-font-weight);color:var(--nf-color);background:var(--nf-background-color);border-radius:var(--nf-border-radius);border:1px solid var(--nf-border-color);outline:0;background-clip:padding-box;box-shadow:0 0 0 .15rem var(--nf-box-shadow-color);transition:color var(--nf-transition) ease-in-out,background-color var(--nf-transition) ease-in-out,border-color var(--nf-transition) ease-in-out,box-shadow var(--nf-transition) ease-in-out}:host(:focus){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus);background:var(--nf-background-color-hover)}:host(:hover){border-color:var(--nf-border-color-hover);background:var(--nf-background-color-hover)}`, ze = E`:host{min-width:10rem;position:relative;display:inline-block}::slotted(*){position:absolute;top:50%;left:.75rem;transform:translateY(-50%)}.input{position:absolute;inset:0;padding:var(--nf-input-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input:has(.toggle-password){padding-right:2.5rem}.input .toggle-password{position:absolute;top:50%;right:.5rem;transform:translateY(-50%);background:0 0;border:none;cursor:pointer;padding:.25rem;display:flex;align-items:center;justify-content:center;color:var(--nf-select-icon-color);transition:color var(--nf-transition-fast) ease;outline:0}.input .toggle-password:hover{color:var(--nf-icon-color-hover)}.input .toggle-password:active{color:var(--nf-icon-color-active)}.input .toggle-password svg{display:block}`;
282
- var je = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, F = (t, e, s, r) => {
283
- for (var i = r > 1 ? void 0 : r ? Re(e, s) : e, o = t.length - 1, n; o >= 0; o--)
284
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
285
- return r && i && je(e, s, i), i;
281
+ const K = A`:host{display:inline-flex;align-items:center;position:relative;width:var(--nf-width);height:var(--nf-height);padding:var(--nf-padding);margin:var(--nf-margin);font-size:var(--nf-text-font-size);font-weight:var(--nf-font-weight);color:var(--nf-color);background:var(--nf-background-color);border-radius:var(--nf-border-radius);border:1px solid var(--nf-border-color);outline:0;background-clip:padding-box;box-shadow:0 0 0 .15rem var(--nf-box-shadow-color);transition:color var(--nf-transition) ease-in-out,background-color var(--nf-transition) ease-in-out,border-color var(--nf-transition) ease-in-out,box-shadow var(--nf-transition) ease-in-out}:host(:focus){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus);background:var(--nf-background-color-hover)}:host(:hover:not([disabled])){border-color:var(--nf-border-color-hover);background:var(--nf-background-color-hover)}:host([disabled]){cursor:not-allowed;opacity:.6;pointer-events:auto}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}`, ze = A`:host{min-width:10rem;position:relative;display:inline-block}:host([disabled]) .input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .toggle-password{cursor:not-allowed;pointer-events:none;opacity:.5}::slotted(*){position:absolute;top:50%;left:.75rem;transform:translateY(-50%);color:var(--nf-color)}:host([disabled]) ::slotted(*){color:var(--nf-color-disabled)}.input{position:absolute;inset:0;padding:var(--nf-input-padding);outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input:has(.toggle-password){padding-right:2.5rem}.input .toggle-password{position:absolute;top:50%;right:.5rem;transform:translateY(-50%);background:0 0;border:none;cursor:pointer;padding:.25rem;display:flex;align-items:center;justify-content:center;color:var(--nf-select-icon-color);transition:color var(--nf-transition-fast) ease;outline:0}.input .toggle-password:hover{color:var(--nf-icon-color-hover)}.input .toggle-password:active{color:var(--nf-icon-color-active)}.input .toggle-password svg{display:block}`;
282
+ var je = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, B = (t, e, o, s) => {
283
+ for (var r = s > 1 ? void 0 : s ? Re(e, o) : e, i = t.length - 1, n; i >= 0; i--)
284
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
285
+ return s && r && je(e, o, r), r;
286
286
  };
287
- let x = class extends W {
287
+ let y = class extends q {
288
288
  constructor() {
289
- super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.showPassword = !1, this.onInput = (t) => {
289
+ super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.disabled = !1, this.showPassword = !1, this.onInput = (t) => {
290
290
  t.stopPropagation();
291
291
  const e = t.target?.value;
292
292
  this.dispatchEvent(
@@ -325,12 +325,12 @@ let x = class extends W {
325
325
  );
326
326
  }
327
327
  }, this.togglePasswordVisibility = (t) => {
328
- t.preventDefault(), t.stopPropagation(), this.showPassword = !this.showPassword;
328
+ this.disabled || (t.preventDefault(), t.stopPropagation(), this.showPassword = !this.showPassword);
329
329
  };
330
330
  }
331
331
  render() {
332
332
  const t = this.type === "password" && !this.showPassword ? "password" : "text", e = this.type === "password";
333
- return p`<slot></slot><input .value=${t} @change=${this.value} @input=${this.placeholder} @keydown=${this.maxLength ?? ""} class=input maxlength=${this.onInput} placeholder=${this.onChange} type=${this.onKeyDown}> ${e ? p`<button @click=${this.togglePasswordVisibility} aria-label=${this.showPassword ? "Hide password" : "Show password"} class=toggle-password tabindex=-1 type=button>${this.showPassword ? this.renderEyeOffIcon() : this.renderEyeIcon()}</button>` : ""}`;
333
+ return p`<slot></slot><input .value=${t} ?disabled=${this.value} @change=${this.placeholder} @input=${this.maxLength ?? ""} @keydown=${this.disabled} class=input maxlength=${this.onInput} placeholder=${this.onChange} type=${this.onKeyDown}> ${e ? p`<button @click=${this.togglePasswordVisibility} aria-label=${this.showPassword ? "Hide password" : "Show password"} class=toggle-password tabindex=-1 type=button>${this.showPassword ? this.renderEyeOffIcon() : this.renderEyeIcon()}</button>` : ""}`;
334
334
  }
335
335
  renderEyeIcon() {
336
336
  return p`<svg height=16 stroke=currentColor stroke-width=2 viewBox="0 0 24 24"width=16><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx=12 cy=12 r=3 /></svg>`;
@@ -344,28 +344,31 @@ let x = class extends W {
344
344
  });
345
345
  }
346
346
  };
347
- x.styles = [K, ze];
348
- F([
347
+ y.styles = [K, ze];
348
+ B([
349
349
  h({ type: String })
350
- ], x.prototype, "value", 2);
351
- F([
350
+ ], y.prototype, "value", 2);
351
+ B([
352
352
  h({ type: String })
353
- ], x.prototype, "placeholder", 2);
354
- F([
353
+ ], y.prototype, "placeholder", 2);
354
+ B([
355
355
  h({ type: String })
356
- ], x.prototype, "type", 2);
357
- F([
356
+ ], y.prototype, "type", 2);
357
+ B([
358
358
  h({ type: Number })
359
- ], x.prototype, "maxLength", 2);
360
- F([
361
- y()
362
- ], x.prototype, "showPassword", 2);
363
- x = F([
359
+ ], y.prototype, "maxLength", 2);
360
+ B([
361
+ h({ type: Boolean, reflect: !0 })
362
+ ], y.prototype, "disabled", 2);
363
+ B([
364
+ $()
365
+ ], y.prototype, "showPassword", 2);
366
+ y = B([
364
367
  N("nf-input")
365
- ], x);
368
+ ], y);
366
369
  const Mt = O({
367
370
  tagName: "nf-input",
368
- elementClass: x,
371
+ elementClass: y,
369
372
  react: V,
370
373
  events: {
371
374
  onInput: "input",
@@ -373,42 +376,44 @@ const Mt = O({
373
376
  onPressEnter: "pressEnter"
374
377
  }
375
378
  });
376
- async function qe(t) {
379
+ async function We(t) {
377
380
  return new Promise((e) => setTimeout(e, t));
378
381
  }
379
- const We = E`:host{min-width:5rem;-webkit-user-select:none;user-select:none;cursor:pointer}:host .text{flex-grow:1;display:inline-block;outline:0;white-space:nowrap}:host .icon{width:1.5rem;height:1.5rem;display:inline-block;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round;margin:0 -.3rem 0 .5rem}:host .dropdown{position:absolute;top:2rem;right:0;left:0;padding:.3rem;background:var(--nf-dropdown-background);-webkit-backdrop-filter:blur(32px);backdrop-filter:blur(32px);border-radius:.5rem;opacity:0;pointer-events:none;color:var(--nf-color);box-shadow:0 0 1rem 0 var(--nf-dropdown-shadow);z-index:1;transition:opacity var(--nf-transition) ease-out,transform var(--nf-transition) ease-out}:host .dropdown .item{white-space:nowrap;padding:.4rem .7rem;overflow:hidden;text-overflow:ellipsis;border-radius:.3rem;cursor:pointer}:host .dropdown .item-unselected:hover{background:var(--nf-item-background-hover);transition:background-color var(--nf-transition) ease-in-out}:host .dropdown .item-unselected:active{background:var(--nf-item-background-active)}:host .dropdown .item-selected{background-color:color-mix(in srgb,var(--nf-primary-color) 30%,transparent)}:host(:focus){color:var(--nf-focus-text-color)}:host(:focus) .dropdown{transform:translateY(.5rem);opacity:1;pointer-events:auto}:host(:focus) .cover{pointer-events:auto}`;
380
- var Ke = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, te = (t, e, s, r) => {
381
- for (var i = r > 1 ? void 0 : r ? Ye(e, s) : e, o = t.length - 1, n; o >= 0; o--)
382
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
383
- return r && i && Ke(e, s, i), i;
382
+ const qe = A`:host{min-width:5rem;-webkit-user-select:none;user-select:none;cursor:pointer}:host .text{flex-grow:1;display:inline-block;outline:0;white-space:nowrap}:host .icon{width:1.5rem;height:1.5rem;display:inline-block;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round;margin:0 -.3rem 0 .5rem}:host .dropdown{position:absolute;top:2rem;right:0;left:0;padding:.3rem;background:var(--nf-dropdown-background);-webkit-backdrop-filter:blur(32px);backdrop-filter:blur(32px);border-radius:.5rem;opacity:0;pointer-events:none;color:var(--nf-color);box-shadow:0 0 1rem 0 var(--nf-dropdown-shadow);z-index:1000;transition:opacity var(--nf-transition) ease-out,transform var(--nf-transition) ease-out}:host .dropdown .item{white-space:nowrap;padding:.4rem .7rem;overflow:hidden;text-overflow:ellipsis;border-radius:.3rem;cursor:pointer}:host .dropdown .item-unselected:hover{background:var(--nf-item-background-hover);transition:background-color var(--nf-transition) ease-in-out}:host .dropdown .item-unselected:active{background:var(--nf-item-background-active)}:host .dropdown .item-selected{background-color:color-mix(in srgb,var(--nf-primary-color) 30%,transparent)}:host([disabled]){cursor:not-allowed}:host([disabled]) .text{color:var(--nf-color-disabled)}:host([disabled]) .icon{stroke:var(--nf-color-disabled)}:host([disabled]) .dropdown{display:none}:host(:focus:not([disabled])){color:var(--nf-focus-text-color)}:host(:focus:not([disabled])) .dropdown{transform:translateY(.5rem);opacity:1;pointer-events:auto}:host(:focus:not([disabled])) .cover{pointer-events:auto}`;
383
+ var Ke = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Y = (t, e, o, s) => {
384
+ for (var r = s > 1 ? void 0 : s ? Ye(e, o) : e, i = t.length - 1, n; i >= 0; i--)
385
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
386
+ return s && r && Ke(e, o, r), r;
384
387
  };
385
- let P = class extends W {
388
+ let C = class extends q {
386
389
  constructor() {
387
- super(...arguments), this.value = "", this.options = [], this.showDropdown = !1, this.jumpCloseFlag = !1, this.timeoutId = null, this.onFocus = () => {
388
- this.timeoutId && clearTimeout(this.timeoutId), this.showDropdown = !0, this.jumpCloseFlag = !0;
390
+ super(...arguments), this.value = "", this.options = [], this.disabled = !1, this.showDropdown = !1, this.jumpCloseFlag = !1, this.timeoutId = null, this.onFocus = () => {
391
+ this.disabled || (this.timeoutId && clearTimeout(this.timeoutId), this.showDropdown = !0, this.jumpCloseFlag = !0);
389
392
  }, this.onBlur = () => {
390
393
  this.jumpCloseFlag = !1, this.timeoutId = setTimeout(() => {
391
394
  this.showDropdown = !1, this.timeoutId = null;
392
395
  }, 500);
393
396
  }, this.onClick = () => {
394
- if (this.jumpCloseFlag) {
395
- this.jumpCloseFlag = !1;
396
- return;
397
+ if (!this.disabled) {
398
+ if (this.jumpCloseFlag) {
399
+ this.jumpCloseFlag = !1;
400
+ return;
401
+ }
402
+ this.blur();
397
403
  }
398
- this.blur();
399
404
  };
400
405
  }
401
406
  async set(t) {
402
- this.dispatchEvent(new CustomEvent("input", { detail: t, bubbles: !0, composed: !0 })), this.value !== t && this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), await qe(34), this.blur();
407
+ this.dispatchEvent(new CustomEvent("input", { detail: t, bubbles: !0, composed: !0 })), this.value !== t && this.dispatchEvent(new CustomEvent("change", { detail: t, bubbles: !0, composed: !0 })), await We(34), this.blur();
403
408
  }
404
409
  render() {
405
- const t = this.options.findIndex((s) => s.value == this.value), e = t > -1 ? this.options[t]?.label : this.value;
410
+ const t = this.options.findIndex((o) => o.value == this.value), e = t > -1 ? this.options[t]?.label : this.value;
406
411
  return p`<div class=dropdown>${(this.showDropdown ? this.options : []).map(
407
- (s) => p`<div @click=${() => this.set(s.value)} class="${this.value == s.value ? "item-selected" : "item-unselected"} item">${s.label}</div>`
408
- )}</div><slot></slot><div class=text>${e}</div><svg class=icon height=24 viewBox="0 0 24 24"width=24><path d="M17 9.5l-5 7-5-7"/></svg>`;
412
+ (o) => p`<div @click=${() => this.set(o.value)} class="${this.value == o.value ? "item-selected" : "item-unselected"} item">${o.label}</div>`
413
+ )}</div><slot></slot><div class=text>${e}</div><svg class=icon height=24 viewBox="0 0 24 24"width=24><path d="M17 10l-5 5.5-5-5.5"/></svg>`;
409
414
  }
410
415
  connectedCallback() {
411
- this.style.transition = "none", super.connectedCallback(), this.tabIndex = 0, this.addEventListener("focus", this.onFocus), this.addEventListener("blur", this.onBlur), this.addEventListener("click", this.onClick), requestAnimationFrame(() => {
416
+ this.style.transition = "none", super.connectedCallback(), this.disabled || (this.tabIndex = 0), this.addEventListener("focus", this.onFocus), this.addEventListener("blur", this.onBlur), this.addEventListener("click", this.onClick), requestAnimationFrame(() => {
412
417
  this.style.transition = "";
413
418
  });
414
419
  }
@@ -416,11 +421,11 @@ let P = class extends W {
416
421
  super.disconnectedCallback(), this.removeEventListener("focus", this.onFocus), this.removeEventListener("blur", this.onBlur), this.removeEventListener("click", this.onClick);
417
422
  }
418
423
  };
419
- P.styles = [K, We];
420
- te([
424
+ C.styles = [K, qe];
425
+ Y([
421
426
  h({ type: String })
422
- ], P.prototype, "value", 2);
423
- te([
427
+ ], C.prototype, "value", 2);
428
+ Y([
424
429
  h({
425
430
  type: Array,
426
431
  converter: (t) => {
@@ -435,87 +440,90 @@ te([
435
440
  return [];
436
441
  }
437
442
  })
438
- ], P.prototype, "options", 2);
439
- te([
440
- y()
441
- ], P.prototype, "showDropdown", 2);
442
- P = te([
443
+ ], C.prototype, "options", 2);
444
+ Y([
445
+ h({ type: Boolean, reflect: !0 })
446
+ ], C.prototype, "disabled", 2);
447
+ Y([
448
+ $()
449
+ ], C.prototype, "showDropdown", 2);
450
+ C = Y([
443
451
  N("nf-select")
444
- ], P);
452
+ ], C);
445
453
  const Ot = O({
446
454
  tagName: "nf-select",
447
- elementClass: P,
455
+ elementClass: C,
448
456
  react: V,
449
457
  events: {
450
458
  onInput: "input",
451
459
  onChange: "change"
452
460
  }
453
461
  });
454
- const ae = globalThis, be = (t) => t, J = ae.trustedTypes, ge = J ? J.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, ke = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, Ce = "?" + C, Xe = `<${Ce}>`, D = document, j = () => D.createComment(""), R = (t) => t === null || typeof t != "object" && typeof t != "function", le = Array.isArray, Ze = (t) => le(t) || typeof t?.[Symbol.iterator] == "function", re = `[
455
- \f\r]`, L = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ve = /-->/g, _e = />/g, A = RegExp(`>|${re}(?:([^\\s"'>=/]+)(${re}*=${re}*(?:[^
456
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ye = /'/g, $e = /"/g, Ee = /^(?:script|style|textarea|title)$/i, Ge = (t) => (e, ...s) => ({ _$litType$: t, strings: e, values: s }), ie = Ge(1), M = /* @__PURE__ */ Symbol.for("lit-noChange"), u = /* @__PURE__ */ Symbol.for("lit-nothing"), we = /* @__PURE__ */ new WeakMap(), S = D.createTreeWalker(D, 129);
462
+ const ae = globalThis, me = (t) => t, Q = ae.trustedTypes, ge = Q ? Q.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, ke = "$lit$", E = `lit$${Math.random().toFixed(9).slice(2)}$`, Ee = "?" + E, Xe = `<${Ee}>`, D = document, j = () => D.createComment(""), R = (t) => t === null || typeof t != "object" && typeof t != "function", le = Array.isArray, Ze = (t) => le(t) || typeof t?.[Symbol.iterator] == "function", se = `[
463
+ \f\r]`, F = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ve = /-->/g, _e = />/g, S = RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^
464
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), we = /'/g, ye = /"/g, Ce = /^(?:script|style|textarea|title)$/i, Ge = (t) => (e, ...o) => ({ _$litType$: t, strings: e, values: o }), re = Ge(1), M = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), $e = /* @__PURE__ */ new WeakMap(), P = D.createTreeWalker(D, 129);
457
465
  function Ae(t, e) {
458
466
  if (!le(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
459
467
  return ge !== void 0 ? ge.createHTML(e) : e;
460
468
  }
461
469
  const Je = (t, e) => {
462
- const s = t.length - 1, r = [];
463
- let i, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = L;
464
- for (let l = 0; l < s; l++) {
470
+ const o = t.length - 1, s = [];
471
+ let r, i = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = F;
472
+ for (let l = 0; l < o; l++) {
465
473
  const a = t[l];
466
- let c, f, d = -1, w = 0;
467
- for (; w < a.length && (n.lastIndex = w, f = n.exec(a), f !== null); ) w = n.lastIndex, n === L ? f[1] === "!--" ? n = ve : f[1] !== void 0 ? n = _e : f[2] !== void 0 ? (Ee.test(f[2]) && (i = RegExp("</" + f[2], "g")), n = A) : f[3] !== void 0 && (n = A) : n === A ? f[0] === ">" ? (n = i ?? L, d = -1) : f[1] === void 0 ? d = -2 : (d = n.lastIndex - f[2].length, c = f[1], n = f[3] === void 0 ? A : f[3] === '"' ? $e : ye) : n === $e || n === ye ? n = A : n === ve || n === _e ? n = L : (n = A, i = void 0);
468
- const k = n === A && t[l + 1].startsWith("/>") ? " " : "";
469
- o += n === L ? a + Xe : d >= 0 ? (r.push(c), a.slice(0, d) + ke + a.slice(d) + C + k) : a + C + (d === -2 ? l : k);
474
+ let c, u, d = -1, x = 0;
475
+ for (; x < a.length && (n.lastIndex = x, u = n.exec(a), u !== null); ) x = n.lastIndex, n === F ? u[1] === "!--" ? n = ve : u[1] !== void 0 ? n = _e : u[2] !== void 0 ? (Ce.test(u[2]) && (r = RegExp("</" + u[2], "g")), n = S) : u[3] !== void 0 && (n = S) : n === S ? u[0] === ">" ? (n = r ?? F, d = -1) : u[1] === void 0 ? d = -2 : (d = n.lastIndex - u[2].length, c = u[1], n = u[3] === void 0 ? S : u[3] === '"' ? ye : we) : n === ye || n === we ? n = S : n === ve || n === _e ? n = F : (n = S, r = void 0);
476
+ const k = n === S && t[l + 1].startsWith("/>") ? " " : "";
477
+ i += n === F ? a + Xe : d >= 0 ? (s.push(c), a.slice(0, d) + ke + a.slice(d) + E + k) : a + E + (d === -2 ? l : k);
470
478
  }
471
- return [Ae(t, o + (t[s] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
479
+ return [Ae(t, i + (t[o] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
472
480
  };
473
- class q {
474
- constructor({ strings: e, _$litType$: s }, r) {
475
- let i;
481
+ class W {
482
+ constructor({ strings: e, _$litType$: o }, s) {
483
+ let r;
476
484
  this.parts = [];
477
- let o = 0, n = 0;
478
- const l = e.length - 1, a = this.parts, [c, f] = Je(e, s);
479
- if (this.el = q.createElement(c, r), S.currentNode = this.el.content, s === 2 || s === 3) {
485
+ let i = 0, n = 0;
486
+ const l = e.length - 1, a = this.parts, [c, u] = Je(e, o);
487
+ if (this.el = W.createElement(c, s), P.currentNode = this.el.content, o === 2 || o === 3) {
480
488
  const d = this.el.content.firstChild;
481
489
  d.replaceWith(...d.childNodes);
482
490
  }
483
- for (; (i = S.nextNode()) !== null && a.length < l; ) {
484
- if (i.nodeType === 1) {
485
- if (i.hasAttributes()) for (const d of i.getAttributeNames()) if (d.endsWith(ke)) {
486
- const w = f[n++], k = i.getAttribute(d).split(C), X = /([.?@])?(.*)/.exec(w);
487
- a.push({ type: 1, index: o, name: X[2], strings: k, ctor: X[1] === "." ? et : X[1] === "?" ? tt : X[1] === "@" ? st : se }), i.removeAttribute(d);
488
- } else d.startsWith(C) && (a.push({ type: 6, index: o }), i.removeAttribute(d));
489
- if (Ee.test(i.tagName)) {
490
- const d = i.textContent.split(C), w = d.length - 1;
491
- if (w > 0) {
492
- i.textContent = J ? J.emptyScript : "";
493
- for (let k = 0; k < w; k++) i.append(d[k], j()), S.nextNode(), a.push({ type: 2, index: ++o });
494
- i.append(d[w], j());
491
+ for (; (r = P.nextNode()) !== null && a.length < l; ) {
492
+ if (r.nodeType === 1) {
493
+ if (r.hasAttributes()) for (const d of r.getAttributeNames()) if (d.endsWith(ke)) {
494
+ const x = u[n++], k = r.getAttribute(d).split(E), Z = /([.?@])?(.*)/.exec(x);
495
+ a.push({ type: 1, index: i, name: Z[2], strings: k, ctor: Z[1] === "." ? et : Z[1] === "?" ? tt : Z[1] === "@" ? ot : oe }), r.removeAttribute(d);
496
+ } else d.startsWith(E) && (a.push({ type: 6, index: i }), r.removeAttribute(d));
497
+ if (Ce.test(r.tagName)) {
498
+ const d = r.textContent.split(E), x = d.length - 1;
499
+ if (x > 0) {
500
+ r.textContent = Q ? Q.emptyScript : "";
501
+ for (let k = 0; k < x; k++) r.append(d[k], j()), P.nextNode(), a.push({ type: 2, index: ++i });
502
+ r.append(d[x], j());
495
503
  }
496
504
  }
497
- } else if (i.nodeType === 8) if (i.data === Ce) a.push({ type: 2, index: o });
505
+ } else if (r.nodeType === 8) if (r.data === Ee) a.push({ type: 2, index: i });
498
506
  else {
499
507
  let d = -1;
500
- for (; (d = i.data.indexOf(C, d + 1)) !== -1; ) a.push({ type: 7, index: o }), d += C.length - 1;
508
+ for (; (d = r.data.indexOf(E, d + 1)) !== -1; ) a.push({ type: 7, index: i }), d += E.length - 1;
501
509
  }
502
- o++;
510
+ i++;
503
511
  }
504
512
  }
505
- static createElement(e, s) {
506
- const r = D.createElement("template");
507
- return r.innerHTML = e, r;
513
+ static createElement(e, o) {
514
+ const s = D.createElement("template");
515
+ return s.innerHTML = e, s;
508
516
  }
509
517
  }
510
- function H(t, e, s = t, r) {
518
+ function U(t, e, o = t, s) {
511
519
  if (e === M) return e;
512
- let i = r !== void 0 ? s._$Co?.[r] : s._$Cl;
513
- const o = R(e) ? void 0 : e._$litDirective$;
514
- return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(t), i._$AT(t, s, r)), r !== void 0 ? (s._$Co ??= [])[r] = i : s._$Cl = i), i !== void 0 && (e = H(t, i._$AS(t, e.values), i, r)), e;
520
+ let r = s !== void 0 ? o._$Co?.[s] : o._$Cl;
521
+ const i = R(e) ? void 0 : e._$litDirective$;
522
+ return r?.constructor !== i && (r?._$AO?.(!1), i === void 0 ? r = void 0 : (r = new i(t), r._$AT(t, o, s)), s !== void 0 ? (o._$Co ??= [])[s] = r : o._$Cl = r), r !== void 0 && (e = U(t, r._$AS(t, e.values), r, s)), e;
515
523
  }
516
524
  class Qe {
517
- constructor(e, s) {
518
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = s;
525
+ constructor(e, o) {
526
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = o;
519
527
  }
520
528
  get parentNode() {
521
529
  return this._$AM.parentNode;
@@ -524,34 +532,34 @@ class Qe {
524
532
  return this._$AM._$AU;
525
533
  }
526
534
  u(e) {
527
- const { el: { content: s }, parts: r } = this._$AD, i = (e?.creationScope ?? D).importNode(s, !0);
528
- S.currentNode = i;
529
- let o = S.nextNode(), n = 0, l = 0, a = r[0];
535
+ const { el: { content: o }, parts: s } = this._$AD, r = (e?.creationScope ?? D).importNode(o, !0);
536
+ P.currentNode = r;
537
+ let i = P.nextNode(), n = 0, l = 0, a = s[0];
530
538
  for (; a !== void 0; ) {
531
539
  if (n === a.index) {
532
540
  let c;
533
- a.type === 2 ? c = new Y(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new rt(o, this, e)), this._$AV.push(c), a = r[++l];
541
+ a.type === 2 ? c = new X(i, i.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, e) : a.type === 6 && (c = new st(i, this, e)), this._$AV.push(c), a = s[++l];
534
542
  }
535
- n !== a?.index && (o = S.nextNode(), n++);
543
+ n !== a?.index && (i = P.nextNode(), n++);
536
544
  }
537
- return S.currentNode = D, i;
545
+ return P.currentNode = D, r;
538
546
  }
539
547
  p(e) {
540
- let s = 0;
541
- for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, s), s += r.strings.length - 2) : r._$AI(e[s])), s++;
548
+ let o = 0;
549
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, o), o += s.strings.length - 2) : s._$AI(e[o])), o++;
542
550
  }
543
551
  }
544
- class Y {
552
+ class X {
545
553
  get _$AU() {
546
554
  return this._$AM?._$AU ?? this._$Cv;
547
555
  }
548
- constructor(e, s, r, i) {
549
- this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = e, this._$AB = s, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
556
+ constructor(e, o, s, r) {
557
+ this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = e, this._$AB = o, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
550
558
  }
551
559
  get parentNode() {
552
560
  let e = this._$AA.parentNode;
553
- const s = this._$AM;
554
- return s !== void 0 && e?.nodeType === 11 && (e = s.parentNode), e;
561
+ const o = this._$AM;
562
+ return o !== void 0 && e?.nodeType === 11 && (e = o.parentNode), e;
555
563
  }
556
564
  get startNode() {
557
565
  return this._$AA;
@@ -559,8 +567,8 @@ class Y {
559
567
  get endNode() {
560
568
  return this._$AB;
561
569
  }
562
- _$AI(e, s = this) {
563
- e = H(this, e, s), R(e) ? e === u || e == null || e === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ze(e) ? this.k(e) : this._(e);
570
+ _$AI(e, o = this) {
571
+ e = U(this, e, o), R(e) ? e === f || e == null || e === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : e !== this._$AH && e !== M && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ze(e) ? this.k(e) : this._(e);
564
572
  }
565
573
  O(e) {
566
574
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -569,115 +577,115 @@ class Y {
569
577
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
570
578
  }
571
579
  _(e) {
572
- this._$AH !== u && R(this._$AH) ? this._$AA.nextSibling.data = e : this.T(D.createTextNode(e)), this._$AH = e;
580
+ this._$AH !== f && R(this._$AH) ? this._$AA.nextSibling.data = e : this.T(D.createTextNode(e)), this._$AH = e;
573
581
  }
574
582
  $(e) {
575
- const { values: s, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = q.createElement(Ae(r.h, r.h[0]), this.options)), r);
576
- if (this._$AH?._$AD === i) this._$AH.p(s);
583
+ const { values: o, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = W.createElement(Ae(s.h, s.h[0]), this.options)), s);
584
+ if (this._$AH?._$AD === r) this._$AH.p(o);
577
585
  else {
578
- const o = new Qe(i, this), n = o.u(this.options);
579
- o.p(s), this.T(n), this._$AH = o;
586
+ const i = new Qe(r, this), n = i.u(this.options);
587
+ i.p(o), this.T(n), this._$AH = i;
580
588
  }
581
589
  }
582
590
  _$AC(e) {
583
- let s = we.get(e.strings);
584
- return s === void 0 && we.set(e.strings, s = new q(e)), s;
591
+ let o = $e.get(e.strings);
592
+ return o === void 0 && $e.set(e.strings, o = new W(e)), o;
585
593
  }
586
594
  k(e) {
587
595
  le(this._$AH) || (this._$AH = [], this._$AR());
588
- const s = this._$AH;
589
- let r, i = 0;
590
- for (const o of e) i === s.length ? s.push(r = new Y(this.O(j()), this.O(j()), this, this.options)) : r = s[i], r._$AI(o), i++;
591
- i < s.length && (this._$AR(r && r._$AB.nextSibling, i), s.length = i);
592
- }
593
- _$AR(e = this._$AA.nextSibling, s) {
594
- for (this._$AP?.(!1, !0, s); e !== this._$AB; ) {
595
- const r = be(e).nextSibling;
596
- be(e).remove(), e = r;
596
+ const o = this._$AH;
597
+ let s, r = 0;
598
+ for (const i of e) r === o.length ? o.push(s = new X(this.O(j()), this.O(j()), this, this.options)) : s = o[r], s._$AI(i), r++;
599
+ r < o.length && (this._$AR(s && s._$AB.nextSibling, r), o.length = r);
600
+ }
601
+ _$AR(e = this._$AA.nextSibling, o) {
602
+ for (this._$AP?.(!1, !0, o); e !== this._$AB; ) {
603
+ const s = me(e).nextSibling;
604
+ me(e).remove(), e = s;
597
605
  }
598
606
  }
599
607
  setConnected(e) {
600
608
  this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
601
609
  }
602
610
  }
603
- class se {
611
+ class oe {
604
612
  get tagName() {
605
613
  return this.element.tagName;
606
614
  }
607
615
  get _$AU() {
608
616
  return this._$AM._$AU;
609
617
  }
610
- constructor(e, s, r, i, o) {
611
- this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = s, this._$AM = i, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = u;
618
+ constructor(e, o, s, r, i) {
619
+ this.type = 1, this._$AH = f, this._$AN = void 0, this.element = e, this.name = o, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
612
620
  }
613
- _$AI(e, s = this, r, i) {
614
- const o = this.strings;
621
+ _$AI(e, o = this, s, r) {
622
+ const i = this.strings;
615
623
  let n = !1;
616
- if (o === void 0) e = H(this, e, s, 0), n = !R(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
624
+ if (i === void 0) e = U(this, e, o, 0), n = !R(e) || e !== this._$AH && e !== M, n && (this._$AH = e);
617
625
  else {
618
626
  const l = e;
619
627
  let a, c;
620
- for (e = o[0], a = 0; a < o.length - 1; a++) c = H(this, l[r + a], s, a), c === M && (c = this._$AH[a]), n ||= !R(c) || c !== this._$AH[a], c === u ? e = u : e !== u && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
628
+ for (e = i[0], a = 0; a < i.length - 1; a++) c = U(this, l[s + a], o, a), c === M && (c = this._$AH[a]), n ||= !R(c) || c !== this._$AH[a], c === f ? e = f : e !== f && (e += (c ?? "") + i[a + 1]), this._$AH[a] = c;
621
629
  }
622
- n && !i && this.j(e);
630
+ n && !r && this.j(e);
623
631
  }
624
632
  j(e) {
625
- e === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
633
+ e === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
626
634
  }
627
635
  }
628
- class et extends se {
636
+ class et extends oe {
629
637
  constructor() {
630
638
  super(...arguments), this.type = 3;
631
639
  }
632
640
  j(e) {
633
- this.element[this.name] = e === u ? void 0 : e;
641
+ this.element[this.name] = e === f ? void 0 : e;
634
642
  }
635
643
  }
636
- class tt extends se {
644
+ class tt extends oe {
637
645
  constructor() {
638
646
  super(...arguments), this.type = 4;
639
647
  }
640
648
  j(e) {
641
- this.element.toggleAttribute(this.name, !!e && e !== u);
649
+ this.element.toggleAttribute(this.name, !!e && e !== f);
642
650
  }
643
651
  }
644
- class st extends se {
645
- constructor(e, s, r, i, o) {
646
- super(e, s, r, i, o), this.type = 5;
652
+ class ot extends oe {
653
+ constructor(e, o, s, r, i) {
654
+ super(e, o, s, r, i), this.type = 5;
647
655
  }
648
- _$AI(e, s = this) {
649
- if ((e = H(this, e, s, 0) ?? u) === M) return;
650
- const r = this._$AH, i = e === u && r !== u || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== u && (r === u || i);
651
- i && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
656
+ _$AI(e, o = this) {
657
+ if ((e = U(this, e, o, 0) ?? f) === M) return;
658
+ const s = this._$AH, r = e === f && s !== f || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, i = e !== f && (s === f || r);
659
+ r && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
652
660
  }
653
661
  handleEvent(e) {
654
662
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
655
663
  }
656
664
  }
657
- class rt {
658
- constructor(e, s, r) {
659
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = r;
665
+ class st {
666
+ constructor(e, o, s) {
667
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = s;
660
668
  }
661
669
  get _$AU() {
662
670
  return this._$AM._$AU;
663
671
  }
664
672
  _$AI(e) {
665
- H(this, e);
673
+ U(this, e);
666
674
  }
667
675
  }
668
- const it = ae.litHtmlPolyfillSupport;
669
- it?.(q, Y), (ae.litHtmlVersions ??= []).push("3.3.2");
670
- const ot = (t, e, s) => {
671
- const r = s?.renderBefore ?? e;
672
- let i = r._$litPart$;
673
- if (i === void 0) {
674
- const o = s?.renderBefore ?? null;
675
- r._$litPart$ = i = new Y(e.insertBefore(j(), o), o, void 0, s ?? {});
676
- }
677
- return i._$AI(t), i;
676
+ const rt = ae.litHtmlPolyfillSupport;
677
+ rt?.(W, X), (ae.litHtmlVersions ??= []).push("3.3.2");
678
+ const it = (t, e, o) => {
679
+ const s = o?.renderBefore ?? e;
680
+ let r = s._$litPart$;
681
+ if (r === void 0) {
682
+ const i = o?.renderBefore ?? null;
683
+ s._$litPart$ = r = new X(e.insertBefore(j(), i), i, void 0, o ?? {});
684
+ }
685
+ return r._$AI(t), r;
678
686
  };
679
687
  const he = globalThis;
680
- let I = class extends T {
688
+ let H = class extends T {
681
689
  constructor() {
682
690
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
683
691
  }
@@ -686,8 +694,8 @@ let I = class extends T {
686
694
  return this.renderOptions.renderBefore ??= e.firstChild, e;
687
695
  }
688
696
  update(e) {
689
- const s = this.render();
690
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ot(s, this.renderRoot, this.renderOptions);
697
+ const o = this.render();
698
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = it(o, this.renderRoot, this.renderOptions);
691
699
  }
692
700
  connectedCallback() {
693
701
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -699,17 +707,17 @@ let I = class extends T {
699
707
  return M;
700
708
  }
701
709
  };
702
- I._$litElement$ = !0, I.finalized = !0, he.litElementHydrateSupport?.({ LitElement: I });
710
+ H._$litElement$ = !0, H.finalized = !0, he.litElementHydrateSupport?.({ LitElement: H });
703
711
  const nt = he.litElementPolyfillSupport;
704
- nt?.({ LitElement: I });
712
+ nt?.({ LitElement: H });
705
713
  (he.litElementVersions ??= []).push("4.2.2");
706
- const at = E`:host{display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;outline:0}:host[disabled]{cursor:not-allowed;opacity:.5}.switch-wrapper{position:relative;display:inline-block}.switch-container{position:relative;z-index:1;width:3.1rem;height:1.5rem;background-color:var(--nf-background-color);border-radius:.75rem;transition:background-color .2s ease;overflow:hidden}.switch-container:hover{background:var(--nf-background-color-hover)}:host([checked]) .switch-container{background-color:var(--nf-primary-color,var(--primary-color))}:host([disabled]) .switch-container{opacity:.5}.ripple{position:absolute;border-radius:.75rem;background-color:#3333334d;top:0;left:0;width:100%;height:100%;transform:scale(1);transform-origin:center center;animation:ripple-animation .6s ease-out forwards;pointer-events:none;opacity:1}@keyframes ripple-animation{to{transform:scale(1.3);opacity:0}}.switch-thumb{position:absolute;top:.125rem;left:0;width:1.25rem;height:1.25rem;transition:transform .2s ease-in-out}.switch-thumb:before{content:\"\";position:absolute;top:0;left:0;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:.625rem;box-shadow:0 .125rem .25rem #0003;transition:width .2s ease-in-out,transform .2s ease-in-out}:host(:not([checked])) .switch-thumb{transform:translate(.125rem)}:host(:not([checked])) .switch-thumb:active:before{width:1.625rem;border-radius:.625rem}:host([checked]) .switch-thumb{transform:translate(1.725rem)}:host([checked]) .switch-thumb:active:before{width:1.625rem;border-radius:.625rem;transform:translate(-.375rem)}:host(:focus) .switch-container{outline:.125rem solid var(--nf-primary-color,var(--primary-color));outline-offset:.125rem}`;
707
- var lt = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, ce = (t, e, s, r) => {
708
- for (var i = r > 1 ? void 0 : r ? ht(e, s) : e, o = t.length - 1, n; o >= 0; o--)
709
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
710
- return r && i && lt(e, s, i), i;
714
+ const at = A`:host{display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;outline:0}:host[disabled]{cursor:not-allowed;opacity:.6}.switch-wrapper{position:relative;display:inline-block}.switch-container{position:relative;z-index:1;width:3.1rem;height:1.5rem;background-color:var(--nf-background-color);border-radius:.75rem;transition:background-color .2s ease;overflow:hidden}:host(:not([disabled]):not([checked])) .switch-container:hover{background:var(--nf-background-color-hover)}:host([checked]) .switch-container{background-color:var(--nf-primary-color,var(--primary-color))}:host([disabled]) .switch-container{opacity:.5}.ripple{position:absolute;border-radius:.875rem;inset:-.2rem;background-color:#6464641a;animation:ripple-animation 1s ease-out forwards;pointer-events:none;opacity:1}@keyframes ripple-animation{0%{opacity:0}20%{opacity:1}to{opacity:0}}.switch-thumb{position:absolute;top:.125rem;left:0;width:1.25rem;height:1.25rem;transition:transform .2s ease-in-out}.switch-thumb:before{content:\"\";position:absolute;top:0;left:0;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:.625rem;box-shadow:0 .125rem .25rem #0003;transition:width .2s ease-in-out,transform .2s ease-in-out}:host(:not([checked])) .switch-thumb{transform:translate(.125rem)}:host(:not([checked])) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem}:host([checked]) .switch-thumb{transform:translate(1.725rem)}:host([checked]) .switch-container:active .switch-thumb:before{width:1.625rem;border-radius:.625rem;transform:translate(-.375rem)}:host(:focus) .switch-container{outline:.125rem solid var(--nf-primary-color,var(--primary-color));outline-offset:.125rem}`;
715
+ var lt = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, ce = (t, e, o, s) => {
716
+ for (var r = s > 1 ? void 0 : s ? ht(e, o) : e, i = t.length - 1, n; i >= 0; i--)
717
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
718
+ return s && r && lt(e, o, r), r;
711
719
  };
712
- let U = class extends I {
720
+ let I = class extends H {
713
721
  constructor() {
714
722
  super(...arguments), this.checked = !1, this.disabled = !1, this.rippleElement = null;
715
723
  }
@@ -726,61 +734,61 @@ let U = class extends I {
726
734
  createRipple(t) {
727
735
  const e = this.shadowRoot?.querySelector(".switch-wrapper");
728
736
  if (!e) return;
729
- const s = e.querySelector(".ripple");
730
- s && e.removeChild(s);
731
- const r = document.createElement("div");
732
- r.classList.add("ripple"), e.appendChild(r), r.addEventListener("animationend", () => {
733
- e.contains(r) && e.removeChild(r);
737
+ const o = e.querySelector(".ripple");
738
+ o && e.removeChild(o);
739
+ const s = document.createElement("div");
740
+ s.classList.add("ripple"), e.appendChild(s), s.addEventListener("animationend", () => {
741
+ e.contains(s) && e.removeChild(s);
734
742
  });
735
743
  }
736
744
  // 渲染开关组件
737
745
  render() {
738
- return ie`<div class=switch-wrapper><div class=switch-container @click=${this.toggleSwitch} aria-checked=${this.checked} aria-disabled=${this.disabled} role=switch><div class=switch-thumb></div></div></div>`;
746
+ return re`<div class=switch-wrapper><div class=switch-container @click=${this.toggleSwitch} aria-checked=${this.checked} aria-disabled=${this.disabled} role=switch><div class=switch-thumb></div></div></div>`;
739
747
  }
740
748
  };
741
- U.styles = [at];
749
+ I.styles = [at];
742
750
  ce([
743
751
  h({ type: Boolean, reflect: !0 })
744
- ], U.prototype, "checked", 2);
752
+ ], I.prototype, "checked", 2);
745
753
  ce([
746
754
  h({ type: Boolean, reflect: !0 })
747
- ], U.prototype, "disabled", 2);
748
- U = ce([
755
+ ], I.prototype, "disabled", 2);
756
+ I = ce([
749
757
  N("nf-switch")
750
- ], U);
758
+ ], I);
751
759
  const Nt = O({
752
760
  tagName: "nf-switch",
753
- elementClass: U,
761
+ elementClass: I,
754
762
  react: V,
755
763
  events: {
756
764
  onChange: "change"
757
765
  }
758
- }), ct = E`:host{min-width:10rem;position:relative;display:inline-block;box-sizing:border-box;padding:0}.input-number-container{position:relative;width:100%;height:100%;display:flex;align-items:center;padding-left:.625rem;box-sizing:border-box}.input-number{position:relative;flex:1;height:100%;outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-weight:var(--nf-font-weight);text-align:left}.input-number .input-number-input-wrapper{height:100%}.input-number .input-number-input-wrapper .input-number-input{background:0 0;width:100%;height:100%;text-align:start;border:0;outline:0;color:var(--nf-color);font-weight:var(--nf-font-weight)}.input-number::-webkit-inner-spin-button,.input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-number[type=number]{appearance:textfield}.input-number:hover .controls{width:1.5rem}.input-prefix{display:flex;align-items:center;color:var(--nf-color-secondary);font-size:var(--nf-font-size);pointer-events:none;margin-inline-end:.25rem}.input-suffix{display:flex;align-items:center;color:var(--nf-color-secondary);font-size:var(--nf-font-size);pointer-events:none;margin-inline-end:.625rem;margin-inline-start:.25rem}.controls{position:absolute;top:0;right:0;height:100%;width:0;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;box-sizing:border-box;transition:width var(--nf-transition-fast) ease}.control-btn{flex:1;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;color:#999;transition:background-color var(--nf-transition-fast) ease,color var(--nf-transition-fast) ease;outline:0;-webkit-user-select:none;user-select:none}.control-btn:hover{background-color:#0000000d;color:#fff}.control-btn:active{background-color:#0000001a}.control-btn:focus-visible{background-color:#0000000d}.control-btn svg{display:block;pointer-events:none}`;
759
- var dt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, _ = (t, e, s, r) => {
760
- for (var i = r > 1 ? void 0 : r ? pt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
761
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
762
- return r && i && dt(e, s, i), i;
766
+ }), ct = A`:host{min-width:10rem;position:relative;display:inline-block;box-sizing:border-box;padding:0;overflow:hidden}.input-number-container{position:relative;width:100%;height:100%;display:flex;align-items:center;box-sizing:border-box}.input-number{position:relative;flex:1;height:100%;outline:0;border:none;background:0 0;box-sizing:border-box;color:var(--nf-color);font-weight:var(--nf-font-weight);text-align:left}.input-number .input-number-input-wrapper{height:100%}.input-number .input-number-input-wrapper .input-number-input{background:0 0;width:100%;height:100%;text-align:start;border:0;outline:0;padding:0;box-sizing:border-box;color:var(--nf-color);font-size:var(--nf-font-size);font-weight:var(--nf-font-weight);font-family:var(--nf-font-family),sans-serif}.input-number::-webkit-inner-spin-button,.input-number::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-number[type=number]{appearance:textfield}.input-number:hover .controls{width:1.5rem}.input-prefix{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline-start:.6125rem;color:var(--nf-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-prefix:not(:empty){padding-inline-end:.25rem}.input-suffix{display:flex;align-items:center;justify-content:center;color:var(--nf-color);font-size:var(--nf-font-size);pointer-events:none;-webkit-user-select:none;user-select:none}.input-suffix:not(:empty){padding-inline-end:.6125rem;padding-inline-start:.5rem}.controls{position:absolute;top:0;right:0;height:100%;width:0;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;transition:width var(--nf-transition-fast) ease}.controls:before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}:host([suffix]) .controls:after{content:\"\";position:absolute;right:0;top:0;bottom:0;width:.67px;background-color:var(--nf-control-divider-color)}.control-btn{flex:1;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;transition:background-color var(--nf-transition-fast) ease;outline:0;-webkit-user-select:none;user-select:none}.control-btn:hover{background-color:var(--nf-control-btn-background-hover)}.control-btn:active{background-color:var(--nf-control-btn-background-active)}.control-btn:focus-visible{background-color:var(--nf-control-btn-background-hover)}.control-btn svg{display:block;pointer-events:none;fill:none;stroke:var(--nf-select-icon-color);stroke-width:1;stroke-linecap:round}.control-btn-up{border-bottom:.67px solid var(--nf-control-divider-color)}:host(:not([suffix])) .control-btn-up{border-top-right-radius:var(--nf-border-radius)}:host(:not([suffix])) .control-btn-down{border-bottom-right-radius:var(--nf-border-radius)}:host([disabled]) .input-number-input{cursor:not-allowed;color:var(--nf-color-disabled)}:host([disabled]) .input-prefix,:host([disabled]) .input-suffix{color:var(--nf-color-disabled)}:host([disabled]) .controls{display:none}:host([disabled]) .control-btn{cursor:not-allowed;pointer-events:none;opacity:.5}`;
767
+ var dt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, _ = (t, e, o, s) => {
768
+ for (var r = s > 1 ? void 0 : s ? ut(e, o) : e, i = t.length - 1, n; i >= 0; i--)
769
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
770
+ return s && r && dt(e, o, r), r;
763
771
  };
764
- let b = class extends W {
772
+ let m = class extends q {
765
773
  constructor() {
766
- super(...arguments), this.value = 0, this.controls = !0, this.changeOnWheel = !0, this.step = 1, this.decimalSeparator = ".", this.prefix = "", this.suffix = "", this.isInputFocused = !1, this.handleInput = (t) => {
774
+ super(...arguments), this.value = 0, this.controls = !0, this.changeOnWheel = !0, this.step = 1, this.decimalSeparator = ".", this.prefix = "", this.suffix = "", this.disabled = !1, this.isInputFocused = !1, this.handleInput = (t) => {
767
775
  t.stopPropagation();
768
- const s = t.target.value;
776
+ const o = t.target.value;
769
777
  this.dispatchEvent(
770
778
  new CustomEvent("input", {
771
- detail: s,
779
+ detail: o,
772
780
  bubbles: !0,
773
781
  composed: !0
774
782
  })
775
783
  );
776
784
  }, this.handleChange = (t) => {
777
785
  t.stopPropagation();
778
- const e = t.target, s = this.parseInputValue(e.value);
779
- if (s !== null) {
780
- const r = this.clampValue(s);
781
- r !== this.value && (this.value = r, this.dispatchEvent(
786
+ const e = t.target, o = this.parseInputValue(e.value);
787
+ if (o !== null) {
788
+ const s = this.clampValue(o);
789
+ s !== this.value && (this.value = s, this.dispatchEvent(
782
790
  new CustomEvent("change", {
783
- detail: r,
791
+ detail: s,
784
792
  bubbles: !0,
785
793
  composed: !0
786
794
  })
@@ -795,7 +803,7 @@ let b = class extends W {
795
803
  })
796
804
  )) : t.key === "ArrowUp" ? (t.preventDefault(), this.handleStepChange(1)) : t.key === "ArrowDown" && (t.preventDefault(), this.handleStepChange(-1));
797
805
  }, this.handleWheel = (t) => {
798
- if (!this.changeOnWheel || !this.isInputFocused) return;
806
+ if (this.disabled || !this.changeOnWheel || !this.isInputFocused) return;
799
807
  t.preventDefault();
800
808
  const e = t.deltaY < 0 ? 1 : -1;
801
809
  this.handleStepChange(e);
@@ -806,78 +814,82 @@ let b = class extends W {
806
814
  };
807
815
  }
808
816
  render() {
809
- return p`<div class=input-number-container>${this.prefix ? p`<div class=input-prefix>${this.prefix}</div>` : ""}<div class=input-number><div class=input-number-input-wrapper><input .value=${this.formatDisplayValue(this.value)} @blur=${this.handleInput} @change=${this.handleChange} @focus=${this.handleKeyDown} @input=${this.handleFocus} @keydown=${this.handleBlur} @wheel=${this.handleWheel} class=input-number-input></div>${this.controls ? p`<div class=controls><button @click=${() => {
817
+ return p`<div class=input-number-container><div class=input-prefix>${this.prefix}</div><div class=input-number><div class=input-number-input-wrapper><input .value=${this.formatDisplayValue(this.value)} ?disabled=${this.disabled} @blur=${this.handleInput} @change=${this.handleChange} @focus=${this.handleKeyDown} @input=${this.handleFocus} @keydown=${this.handleBlur} @wheel=${this.handleWheel} class=input-number-input></div>${this.controls ? p`<div class=controls><button ?disabled=${this.disabled} @click=${() => {
810
818
  this.handleStepChange(1);
811
- }} aria-label="Increase value"class="control-btn control-btn-up"type=button><svg aria-hidden=true data-icon=up focusable=false height=0.5rem viewBox="64 64 896 896"width=0.5rem><path d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"></path></svg></button><button @click=${() => {
819
+ }} aria-label="Increase value"class="control-btn control-btn-up"type=button><svg height=12 viewBox="0 0 24 24"width=12><path d="M6 14.6l6-6.6 6 6.6"/></svg></button><button ?disabled=${this.disabled} @click=${() => {
812
820
  this.handleStepChange(-1);
813
- }} aria-label="Decrease value"class="control-btn control-btn-down"type=button><svg aria-hidden=true data-icon=down focusable=false height=0.5rem viewBox="64 64 896 896"width=0.5rem><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg></button></div>` : ""}</div>${this.suffix ? p`<div class=input-suffix>${this.suffix}</div>` : ""}</div>`;
821
+ }} aria-label="Decrease value"class="control-btn control-btn-down"type=button><svg height=12 viewBox="0 0 24 24"width=12><path d="M18 9.4l-6 6.6-6-6.6"/></svg></button></div>` : ""}</div>${this.suffix ? p`<div class=input-suffix>${this.suffix}</div>` : ""}</div>`;
814
822
  }
815
823
  formatDisplayValue(t) {
816
- return isNaN(t) ? "" : t.toString().replace(".", this.decimalSeparator);
824
+ return t === null || isNaN(t) ? "" : t.toString().replace(".", this.decimalSeparator);
817
825
  }
818
826
  parseInputValue(t) {
819
827
  if (!t) return null;
820
- const e = t.replace(this.decimalSeparator, "."), s = parseFloat(e);
821
- return isNaN(s) ? null : s;
828
+ const e = t.replace(this.decimalSeparator, "."), o = parseFloat(e);
829
+ return isNaN(o) ? null : o;
822
830
  }
823
831
  clampValue(t) {
824
832
  let e = t;
825
833
  return this.min !== void 0 && (e = Math.max(e, this.min)), this.max !== void 0 && (e = Math.min(e, this.max)), e;
826
834
  }
827
835
  handleStepChange(t) {
828
- const e = this.clampValue(this.value + t * this.step);
829
- e !== this.value && (this.value = e, this.dispatchEvent(
836
+ if (this.disabled) return;
837
+ const e = this.value ?? 0, o = this.clampValue(e + t * this.step);
838
+ o !== this.value && (this.value = o, this.dispatchEvent(
830
839
  new CustomEvent("step", {
831
- detail: e,
840
+ detail: o,
832
841
  bubbles: !0,
833
842
  composed: !0
834
843
  })
835
844
  ), this.dispatchEvent(
836
845
  new CustomEvent("change", {
837
- detail: e,
846
+ detail: o,
838
847
  bubbles: !0,
839
848
  composed: !0
840
849
  })
841
850
  ));
842
851
  }
843
852
  };
844
- b.styles = [K, ct];
853
+ m.styles = [K, ct];
845
854
  _([
846
855
  h({ type: Number })
847
- ], b.prototype, "value", 2);
856
+ ], m.prototype, "value", 2);
848
857
  _([
849
858
  h({ type: Boolean })
850
- ], b.prototype, "controls", 2);
859
+ ], m.prototype, "controls", 2);
851
860
  _([
852
861
  h({ type: Boolean })
853
- ], b.prototype, "changeOnWheel", 2);
862
+ ], m.prototype, "changeOnWheel", 2);
854
863
  _([
855
864
  h({ type: Number })
856
- ], b.prototype, "min", 2);
865
+ ], m.prototype, "min", 2);
857
866
  _([
858
867
  h({ type: Number })
859
- ], b.prototype, "max", 2);
868
+ ], m.prototype, "max", 2);
860
869
  _([
861
870
  h({ type: Number })
862
- ], b.prototype, "step", 2);
871
+ ], m.prototype, "step", 2);
863
872
  _([
864
873
  h({ type: String })
865
- ], b.prototype, "decimalSeparator", 2);
874
+ ], m.prototype, "decimalSeparator", 2);
866
875
  _([
867
876
  h({ type: String })
868
- ], b.prototype, "prefix", 2);
877
+ ], m.prototype, "prefix", 2);
869
878
  _([
870
879
  h({ type: String })
871
- ], b.prototype, "suffix", 2);
880
+ ], m.prototype, "suffix", 2);
872
881
  _([
873
- y()
874
- ], b.prototype, "isInputFocused", 2);
875
- b = _([
882
+ h({ type: Boolean, reflect: !0 })
883
+ ], m.prototype, "disabled", 2);
884
+ _([
885
+ $()
886
+ ], m.prototype, "isInputFocused", 2);
887
+ m = _([
876
888
  N("nf-input-number")
877
- ], b);
878
- const Tt = O({
889
+ ], m);
890
+ const Bt = O({
879
891
  tagName: "nf-input-number",
880
- elementClass: b,
892
+ elementClass: m,
881
893
  react: V,
882
894
  events: {
883
895
  onInput: "input",
@@ -885,13 +897,13 @@ const Tt = O({
885
897
  onPressEnter: "pressEnter",
886
898
  onStep: "step"
887
899
  }
888
- }), ut = E`:host{cursor:pointer;-webkit-user-select:none;user-select:none}:host:disabled{cursor:not-allowed;opacity:.5}.checkbox-container{position:relative;width:1rem;height:1rem;transition:opacity .2s ease}.checkbox-box{width:100%;height:100%;border-radius:.25rem;background-color:var(--nf-background-color);border:1px solid var(--nf-border-color);display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease}:host(:hover:not([checked]):not([disabled])) .checkbox-box{border-color:var(--nf-primary-color,var(--primary-color))}:host([checked]) .checkbox-box{background-color:var(--nf-primary-color,var(--primary-color));border-color:var(--nf-primary-color,var(--primary-color))}:host([disabled]) .checkbox-box{border-color:#ccc;background:#ccc;cursor:not-allowed;pointer-events:none}:host([disabled][checked]) .checkbox-box{background-color:#ccc;border-color:#ccc}.checkbox-icon{color:#fff;font-size:.75rem;line-height:1;font-weight:700;transition:transform .2s ease;display:flex;align-items:center}:host([checked]) .checkbox-icon{transform:scale(1)}:host(:focus) .checkbox-container{outline:.125rem solid var(--nf-primary-color,var(--primary-color));outline-offset:.125rem}`;
889
- var ft = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, de = (t, e, s, r) => {
890
- for (var i = r > 1 ? void 0 : r ? mt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
891
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
892
- return r && i && ft(e, s, i), i;
900
+ }), pt = A`:host{cursor:pointer;-webkit-user-select:none;user-select:none;width:calc(1rem + 2px);height:calc(1rem + 2px)}:host([disabled]){cursor:not-allowed;opacity:.6}.checkbox-container{position:relative;transition:opacity .2s ease}.checkbox-box{width:1rem;height:1rem;border-radius:.25rem;background-color:var(--nf-background-color);border:1px solid var(--nf-border-color);display:flex;align-items:center;justify-content:center;transition:background-color .2s ease,border-color .2s ease}:host(:hover:not([checked]):not([disabled])) .checkbox-box{border-color:var(--nf-primary-color,var(--primary-color))}:host([checked]) .checkbox-box{background-color:var(--nf-primary-color,var(--primary-color));border-color:var(--nf-primary-color,var(--primary-color))}:host([disabled]) .checkbox-box{border-color:#ccc;background:#ccc;cursor:not-allowed;pointer-events:none}:host([disabled][checked]) .checkbox-box{background-color:#ccc;border-color:#ccc}.checkbox-icon{color:#fff;font-size:.75rem;line-height:1;font-weight:700;transition:transform .2s ease;display:flex;align-items:center}:host([checked]) .checkbox-icon{transform:scale(1)}:host(:focus) .checkbox-container{outline:.125rem solid var(--nf-primary-color,var(--primary-color));outline-offset:.125rem}`;
901
+ var ft = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, de = (t, e, o, s) => {
902
+ for (var r = s > 1 ? void 0 : s ? bt(e, o) : e, i = t.length - 1, n; i >= 0; i--)
903
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
904
+ return s && r && ft(e, o, r), r;
893
905
  };
894
- let B = class extends I {
906
+ let L = class extends H {
895
907
  constructor() {
896
908
  super(...arguments), this.checked = !1, this.disabled = !1;
897
909
  }
@@ -907,87 +919,95 @@ let B = class extends I {
907
919
  }
908
920
  // 渲染复选框组件
909
921
  render() {
910
- return ie`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? ie`<div class=checkbox-icon><svg aria-hidden=true data-icon=check fill=currentColor focusable=false height=0.625rem viewBox="64 64 896 896"width=0.625rem><path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"></path></svg></div>` : ""}</div></div>`;
922
+ return re`<div class=checkbox-container @click=${this.toggleCheckbox} aria-checked=${this.checked} aria-disabled=${this.disabled} role=checkbox><div class=checkbox-box>${this.checked ? re`<div class=checkbox-icon><svg aria-hidden=true data-icon=check fill=currentColor focusable=false height=0.625rem viewBox="64 64 896 896"width=0.625rem><path d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"></path></svg></div>` : ""}</div></div>`;
911
923
  }
912
924
  };
913
- B.styles = [ut];
925
+ L.styles = [pt];
914
926
  de([
915
927
  h({ type: Boolean, reflect: !0 })
916
- ], B.prototype, "checked", 2);
928
+ ], L.prototype, "checked", 2);
917
929
  de([
918
930
  h({ type: Boolean, reflect: !0 })
919
- ], B.prototype, "disabled", 2);
920
- B = de([
931
+ ], L.prototype, "disabled", 2);
932
+ L = de([
921
933
  N("nf-checkbox")
922
- ], B);
923
- const It = O({
934
+ ], L);
935
+ const Tt = O({
924
936
  tagName: "nf-checkbox",
925
- elementClass: B,
937
+ elementClass: L,
926
938
  react: V,
927
939
  events: {
928
940
  onChange: "change"
929
941
  }
930
942
  });
931
- const bt = { ATTRIBUTE: 1 }, gt = (t) => (...e) => ({ _$litDirective$: t, values: e });
943
+ const mt = { ATTRIBUTE: 1 }, gt = (t) => (...e) => ({ _$litDirective$: t, values: e });
932
944
  let vt = class {
933
945
  constructor(e) {
934
946
  }
935
947
  get _$AU() {
936
948
  return this._$AM._$AU;
937
949
  }
938
- _$AT(e, s, r) {
939
- this._$Ct = e, this._$AM = s, this._$Ci = r;
950
+ _$AT(e, o, s) {
951
+ this._$Ct = e, this._$AM = o, this._$Ci = s;
940
952
  }
941
- _$AS(e, s) {
942
- return this.update(e, s);
953
+ _$AS(e, o) {
954
+ return this.update(e, o);
943
955
  }
944
- update(e, s) {
945
- return this.render(...s);
956
+ update(e, o) {
957
+ return this.render(...o);
946
958
  }
947
959
  };
948
- const Se = "important", _t = " !" + Se, Q = gt(class extends vt {
960
+ const Se = "important", _t = " !" + Se, ee = gt(class extends vt {
949
961
  constructor(t) {
950
- if (super(t), t.type !== bt.ATTRIBUTE || t.name !== "style" || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
962
+ if (super(t), t.type !== mt.ATTRIBUTE || t.name !== "style" || t.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
951
963
  }
952
964
  render(t) {
953
- return Object.keys(t).reduce((e, s) => {
954
- const r = t[s];
955
- return r == null ? e : e + `${s = s.includes("-") ? s : s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${r};`;
965
+ return Object.keys(t).reduce((e, o) => {
966
+ const s = t[o];
967
+ return s == null ? e : e + `${o = o.includes("-") ? o : o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
956
968
  }, "");
957
969
  }
958
970
  update(t, [e]) {
959
- const { style: s } = t.element;
971
+ const { style: o } = t.element;
960
972
  if (this.ft === void 0) return this.ft = new Set(Object.keys(e)), this.render(e);
961
- for (const r of this.ft) e[r] == null && (this.ft.delete(r), r.includes("-") ? s.removeProperty(r) : s[r] = null);
962
- for (const r in e) {
963
- const i = e[r];
964
- if (i != null) {
965
- this.ft.add(r);
966
- const o = typeof i == "string" && i.endsWith(_t);
967
- r.includes("-") || o ? s.setProperty(r, o ? i.slice(0, -11) : i, o ? Se : "") : s[r] = i;
973
+ for (const s of this.ft) e[s] == null && (this.ft.delete(s), s.includes("-") ? o.removeProperty(s) : o[s] = null);
974
+ for (const s in e) {
975
+ const r = e[s];
976
+ if (r != null) {
977
+ this.ft.add(s);
978
+ const i = typeof r == "string" && r.endsWith(_t);
979
+ s.includes("-") || i ? o.setProperty(s, i ? r.slice(0, -11) : r, i ? Se : "") : o[s] = r;
968
980
  }
969
981
  }
970
982
  return M;
971
983
  }
972
- }), yt = E`:host{display:inline-block;position:relative}.trigger{height:100%;display:flex;align-items:center;cursor:pointer;transition:all .2s;font-size:.875rem;position:relative}.trigger:hover{border-color:var(--nf-color-primary)}.trigger[disabled]{cursor:not-allowed;opacity:.6}.color-block{width:1.25rem;height:1.25rem;border-radius:.125rem;margin-right:.5rem}.color-text{flex:1}.panel{position:absolute;z-index:1000;background:#fff;border-radius:var(--nf-border-radius);box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d}.panel-content{padding:.75rem;width:15rem}.color-selector{height:9.375rem;position:relative;margin-bottom:.75rem;border-radius:var(--nf-border-radius);overflow:hidden}.color-sb{width:100%;height:100%;position:relative;cursor:pointer}.sb-white{position:absolute;inset:0;background:linear-gradient(to right,#fff,#fff0)}.sb-black{position:absolute;inset:0;background:linear-gradient(to top,#000,#0000)}.selector{position:absolute;width:.625rem;height:.625rem;border:.125rem solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 .125rem #00000080;pointer-events:none}.slider-container{margin-bottom:.75rem}.slider{position:relative;height:.75rem;border-radius:.375rem}.hue-slider{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.alpha-slider{position:relative}.alpha-slider-input{position:relative;z-index:2}.alpha-background{position:absolute;inset:0;border-radius:.375rem;background-size:.625rem .625rem;background:linear-gradient(45deg,#ddd 25%,transparent 25%) linear-gradient(-45deg,#ddd 25%,transparent 25%) linear-gradient(45deg,transparent 75%,#ddd 75%) linear-gradient(-45deg,transparent 75%,#ddd 75%) 0 0,0 .3125rem,.3125rem -.3125rem,-.3125rem 0}input[type=range]{-webkit-appearance:none;width:100%;height:100%;background:0 0;outline:0;position:absolute;top:0;left:0;margin:0;padding:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080;position:relative;z-index:1}input[type=range]::-moz-range-thumb{width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080}.current-color-container{display:flex;justify-content:center;margin-top:.5rem}.current-color{width:1.875rem;height:1.875rem;border-radius:var(--nf-border-radius);border:.0625rem solid var(--nf-color-border)}`;
973
- var $t = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, $ = (t, e, s, r) => {
974
- for (var i = r > 1 ? void 0 : r ? wt(e, s) : e, o = t.length - 1, n; o >= 0; o--)
975
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
976
- return r && i && $t(e, s, i), i;
984
+ }), wt = A`:host{display:inline-block;position:relative}:host([disabled]){cursor:not-allowed;opacity:.6}:host([disabled]:hover){border-color:var(--nf-border-color);background:var(--nf-background-color)}:host([open]){border-color:var(--nf-border-color-hover);box-shadow:0 0 0 .15rem var(--nf-box-shadow-color-focus)}.trigger{width:calc(100% + 1.5rem);height:calc(100% + 2px);margin:-1px -.75rem;padding:1px .75rem;box-sizing:border-box;display:flex;align-items:center;cursor:pointer;transition:all .2s;font-size:.875rem;position:relative}:host(:not([disabled])) .trigger:hover{border-color:var(--nf-color-primary)}.trigger[disabled]{cursor:not-allowed;opacity:.6}:host([disabled]) .trigger{cursor:not-allowed;color:var(--nf-color-disabled)}.color-block{width:1.25rem;height:1.25rem;border-radius:.125rem;margin-left:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem);margin-right:.4rem}:host([show-text=false]) .color-block{margin-right:calc((var(--nf-height) - 1.25rem)/ 2 - .75rem)}.color-text{flex:1}.panel{position:absolute;z-index:1000;background:var(--nf-color-picker-card-background,var(--nf-dropdown-background));border-radius:var(--nf-border-radius);box-shadow:0 6px 16px 0 var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 3px 6px -4px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow)),0 9px 28px 8px var(--nf-color-picker-card-shadow,var(--nf-dropdown-shadow));-webkit-user-select:none;user-select:none}.panel-content{padding:.75rem;width:15rem}.color-selector{height:9.375rem;position:relative;margin-bottom:.75rem;border-radius:var(--nf-border-radius);overflow:hidden}.color-sb{width:100%;height:100%;position:relative;cursor:pointer}.sb-white{position:absolute;inset:0;background:linear-gradient(to right,#fff,#fff0)}.sb-black{position:absolute;inset:0;background:linear-gradient(to top,#000,#0000)}.selector{position:absolute;width:.625rem;height:.625rem;border:.125rem solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 .125rem #00000080;pointer-events:none}.slider-container{margin-bottom:.5rem}.slider-container:last-child{margin-bottom:0}.sliders-row{display:flex;align-items:center;gap:.75rem}.sliders{flex:1}.slider{position:relative;height:.75rem;border-radius:.375rem}.hue-slider{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.alpha-slider{position:relative;background-image:linear-gradient(45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(-45deg,var(--nf-color-picker-card-checker,#ccc) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%),linear-gradient(-45deg,transparent 75%,var(--nf-color-picker-card-checker,#ccc) 75%);background-size:.375rem .375rem;background-position:0 0,0 .1875rem,.1875rem -.1875rem,-.1875rem 0;background-color:var(--nf-color-picker-card-checker-bg,#fff);border-radius:.375rem}.alpha-slider-input{position:relative;z-index:2}.alpha-gradient{position:absolute;inset:0;border-radius:.375rem}input[type=range]{-webkit-appearance:none;width:100%;height:100%;background:0 0;outline:0;position:absolute;top:0;left:0;margin:0;padding:0}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080;position:relative;z-index:1}input[type=range]::-moz-range-thumb{width:1rem;height:1rem;border-radius:50%;background:#fff;border:.125rem solid var(--nf-color-border);cursor:pointer;box-shadow:0 0 .125rem #00000080}.current-color-container{display:flex}.current-color{width:2rem;height:2rem;border-radius:var(--nf-border-radius);border:.0625rem solid var(--nf-color-border)}:host(:not([disabled-alpha])) .current-color{width:2.5rem;height:2.5rem}`;
985
+ var yt = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, v = (t, e, o, s) => {
986
+ for (var r = s > 1 ? void 0 : s ? $t(e, o) : e, i = t.length - 1, n; i >= 0; i--)
987
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
988
+ return s && r && yt(e, o, r), r;
977
989
  };
978
- let g = class extends W {
990
+ let b = class extends q {
979
991
  constructor() {
980
- super(...arguments), this.value = "#FF0000", this.disabled = !1, this.disabledAlpha = !1, this.open = !1, this.showText = !0, this._panelVisible = !1, this._internalValue = "#FF0000FF", this._hsb = { h: 0, s: 100, b: 100 }, this._panelPosition = { top: 0, left: 0 }, this._handleGlobalClick = (t) => {
992
+ super(...arguments), this.value = "#FF0000", this.disabled = !1, this.disabledAlpha = !1, this.open = !1, this.showText = !0, this.placement = "bottom", this.align = "left", this.autoAdjust = !0, this._panelVisible = !1, this._internalValue = "#FF0000FF", this._hsb = { h: 0, s: 100, b: 100 }, this._panelPosition = { top: 0, left: 0 }, this._handleGlobalClick = (t) => {
981
993
  this._panelVisible && !this.contains(t.target) && this._closePanel();
982
994
  }, this._handleKeyDown = (t) => {
983
995
  this._panelVisible && t.key === "Escape" && this._closePanel();
996
+ }, this._handleSBMouseDown = (t) => {
997
+ t.preventDefault(), this._handleSBChange(t), document.addEventListener("mousemove", this._handleSBMouseMove), document.addEventListener("mouseup", this._handleSBMouseUp);
998
+ }, this._handleSBMouseMove = (t) => {
999
+ t.preventDefault(), this._handleSBChange(t);
1000
+ }, this._handleSBMouseUp = () => {
1001
+ document.removeEventListener("mousemove", this._handleSBMouseMove), document.removeEventListener("mouseup", this._handleSBMouseUp);
1002
+ }, this._handleSBTouchMove = (t) => {
1003
+ t.preventDefault(), this._handleSBChange(t);
984
1004
  };
985
1005
  }
986
1006
  connectedCallback() {
987
1007
  super.connectedCallback(), document.addEventListener("click", this._handleGlobalClick), document.addEventListener("keydown", this._handleKeyDown);
988
1008
  }
989
1009
  disconnectedCallback() {
990
- super.disconnectedCallback(), document.removeEventListener("click", this._handleGlobalClick), document.removeEventListener("keydown", this._handleKeyDown);
1010
+ super.disconnectedCallback(), document.removeEventListener("click", this._handleGlobalClick), document.removeEventListener("keydown", this._handleKeyDown), document.removeEventListener("mousemove", this._handleSBMouseMove), document.removeEventListener("mouseup", this._handleSBMouseUp);
991
1011
  }
992
1012
  firstUpdated() {
993
1013
  this._updateInternalValue(this.value), this._updateHSBFromHex(this._internalValue);
@@ -1005,35 +1025,41 @@ let g = class extends W {
1005
1025
  }
1006
1026
  // 从HEX颜色值更新HSB值
1007
1027
  _updateHSBFromHex(t) {
1008
- const e = parseInt(t.slice(1, 3), 16) / 255, s = parseInt(t.slice(3, 5), 16) / 255, r = parseInt(t.slice(5, 7), 16) / 255, i = Math.max(e, s, r), o = Math.min(e, s, r), n = i - o;
1028
+ const e = parseInt(t.slice(1, 3), 16) / 255, o = parseInt(t.slice(3, 5), 16) / 255, s = parseInt(t.slice(5, 7), 16) / 255, r = Math.max(e, o, s), i = Math.min(e, o, s), n = r - i;
1009
1029
  let l = 0, a = 0;
1010
- const c = i;
1011
- n !== 0 && (a = n / i, i === e ? l = (s - r) / n % 6 : i === s ? l = (r - e) / n + 2 : l = (e - s) / n + 4, l *= 60, l < 0 && (l += 360)), this._hsb = {
1030
+ const c = r;
1031
+ n !== 0 && (a = n / r, r === e ? l = (o - s) / n % 6 : r === o ? l = (s - e) / n + 2 : l = (e - o) / n + 4, l *= 60, l < 0 && (l += 360)), this._hsb = {
1012
1032
  h: Math.round(l),
1013
1033
  s: Math.round(a * 100),
1014
1034
  b: Math.round(c * 100)
1015
1035
  };
1016
1036
  }
1017
1037
  // 从HSB值生成HEX颜色值
1018
- _generateHexFromHSB(t, e, s, r = "FF") {
1019
- e /= 100, s /= 100;
1020
- const i = s * e, o = i * (1 - Math.abs(t / 60 % 2 - 1)), n = s - i;
1038
+ _generateHexFromHSB(t, e, o, s = "FF") {
1039
+ e /= 100, o /= 100;
1040
+ const r = o * e, i = r * (1 - Math.abs(t / 60 % 2 - 1)), n = o - r;
1021
1041
  let l = 0, a = 0, c = 0;
1022
- return 0 <= t && t < 60 ? (l = i, a = o, c = 0) : 60 <= t && t < 120 ? (l = o, a = i, c = 0) : 120 <= t && t < 180 ? (l = 0, a = i, c = o) : 180 <= t && t < 240 ? (l = 0, a = o, c = i) : 240 <= t && t < 300 ? (l = o, a = 0, c = i) : 300 <= t && t < 360 && (l = i, a = 0, c = o), l = Math.round((l + n) * 255), a = Math.round((a + n) * 255), c = Math.round((c + n) * 255), "#" + l.toString(16).padStart(2, "0") + a.toString(16).padStart(2, "0") + c.toString(16).padStart(2, "0") + r;
1042
+ return 0 <= t && t < 60 ? (l = r, a = i, c = 0) : 60 <= t && t < 120 ? (l = i, a = r, c = 0) : 120 <= t && t < 180 ? (l = 0, a = r, c = i) : 180 <= t && t < 240 ? (l = 0, a = i, c = r) : 240 <= t && t < 300 ? (l = i, a = 0, c = r) : 300 <= t && t < 360 && (l = r, a = 0, c = i), l = Math.round((l + n) * 255), a = Math.round((a + n) * 255), c = Math.round((c + n) * 255), "#" + l.toString(16).padStart(2, "0") + a.toString(16).padStart(2, "0") + c.toString(16).padStart(2, "0") + s;
1023
1043
  }
1024
1044
  // 计算面板位置
1025
1045
  _updatePanelPosition() {
1026
1046
  requestAnimationFrame(() => {
1027
- const t = this.getBoundingClientRect();
1028
- this._panelPosition = {
1029
- top: t.height + 8,
1030
- left: 0
1031
- };
1047
+ const t = this.getBoundingClientRect(), e = this.shadowRoot?.querySelector(".panel");
1048
+ if (!e) return;
1049
+ const o = 0.15 * 16, s = 8, r = e.offsetWidth || 240, i = e.offsetHeight || 300;
1050
+ let n = this.placement, l = this.align;
1051
+ this.autoAdjust && (n === "bottom" ? window.innerHeight - t.bottom - s < i && t.top - s >= i && (n = "top") : t.top - s < i && window.innerHeight - t.bottom - s >= i && (n = "bottom"), l === "right" ? t.right - o < r && t.left + t.width + o + r <= window.innerWidth && (l = "left") : t.left - o + r > window.innerWidth && t.right - o >= r && (l = "right"));
1052
+ let a;
1053
+ n === "bottom" ? a = t.height + s : a = -i - s;
1054
+ let c;
1055
+ l === "right" ? c = t.width - r + o : c = -o, this._panelPosition = { top: a, left: c };
1032
1056
  });
1033
1057
  }
1034
1058
  // 打开面板
1035
1059
  _openPanel() {
1036
- this.disabled || (this._panelVisible = !0, this._updatePanelPosition(), this.dispatchEvent(new CustomEvent("openChange", {
1060
+ this.disabled || (this._panelVisible = !0, this.open = !0, this.updateComplete.then(() => {
1061
+ this._updatePanelPosition();
1062
+ }), this.dispatchEvent(new CustomEvent("openChange", {
1037
1063
  detail: !0,
1038
1064
  bubbles: !0,
1039
1065
  composed: !0
@@ -1041,7 +1067,7 @@ let g = class extends W {
1041
1067
  }
1042
1068
  // 关闭面板
1043
1069
  _closePanel() {
1044
- this._panelVisible = !1, this.dispatchEvent(new CustomEvent("openChange", {
1070
+ this._panelVisible = !1, this.open = !1, this.dispatchEvent(new CustomEvent("openChange", {
1045
1071
  detail: !1,
1046
1072
  bubbles: !0,
1047
1073
  composed: !0
@@ -1052,15 +1078,15 @@ let g = class extends W {
1052
1078
  this._panelVisible ? this._closePanel() : this._openPanel();
1053
1079
  }
1054
1080
  // 处理HSB颜色变化
1055
- _handleHSBChange(t, e, s) {
1056
- this._hsb = { h: t, s: e, b: s };
1057
- const r = this._internalValue.slice(7), i = this._generateHexFromHSB(t, e, s, r);
1058
- this._handleColorChange(i);
1081
+ _handleHSBChange(t, e, o) {
1082
+ this._hsb = { h: t, s: e, b: o };
1083
+ const s = this._internalValue.slice(7), r = this._generateHexFromHSB(t, e, o, s);
1084
+ this._handleColorChange(r);
1059
1085
  }
1060
1086
  // 处理Alpha值变化
1061
1087
  _handleAlphaChange(t) {
1062
- const e = Math.round(t * 255 / 100).toString(16).padStart(2, "0").toUpperCase(), s = "#" + this._internalValue.slice(1, 7) + e;
1063
- this._handleColorChange(s);
1088
+ const e = Math.round(t * 255 / 100).toString(16).padStart(2, "0").toUpperCase(), o = "#" + this._internalValue.slice(1, 7) + e;
1089
+ this._handleColorChange(o);
1064
1090
  }
1065
1091
  // 处理颜色变化
1066
1092
  _handleColorChange(t) {
@@ -1074,18 +1100,20 @@ let g = class extends W {
1074
1100
  }
1075
1101
  // 处理色相选择
1076
1102
  _handleHueChange(t) {
1077
- const e = t.target, s = parseInt(e.value);
1078
- this._handleHSBChange(s, this._hsb.s, this._hsb.b);
1103
+ const e = t.target, o = parseInt(e.value);
1104
+ this._handleHSBChange(o, this._hsb.s, this._hsb.b);
1079
1105
  }
1080
1106
  // 处理饱和度和亮度选择
1081
1107
  _handleSBChange(t) {
1082
- const e = t.target.getBoundingClientRect(), s = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, r = t instanceof MouseEvent ? t.clientY : t.touches[0].clientY, i = Math.max(0, Math.min(100, Math.round((s - e.left) / e.width * 100))), o = Math.max(0, Math.min(100, Math.round((1 - (r - e.top) / e.height) * 100)));
1083
- this._handleHSBChange(this._hsb.h, i, o);
1108
+ const e = this.shadowRoot?.querySelector(".color-sb");
1109
+ if (!e) return;
1110
+ const o = e.getBoundingClientRect(), s = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, r = t instanceof MouseEvent ? t.clientY : t.touches[0].clientY, i = Math.max(0, Math.min(100, Math.round((s - o.left) / o.width * 100))), n = Math.max(0, Math.min(100, Math.round((1 - (r - o.top) / o.height) * 100)));
1111
+ this._handleHSBChange(this._hsb.h, i, n);
1084
1112
  }
1085
1113
  // 处理透明度选择
1086
1114
  _handleAlphaChangeInput(t) {
1087
- const e = t.target, s = parseInt(e.value);
1088
- this._handleAlphaChange(s);
1115
+ const e = t.target, o = parseInt(e.value);
1116
+ this._handleAlphaChange(o);
1089
1117
  }
1090
1118
  // 渲染触发器
1091
1119
  _renderTrigger() {
@@ -1106,25 +1134,25 @@ let g = class extends W {
1106
1134
  }
1107
1135
  // 渲染颜色选择区域
1108
1136
  _renderColorSelector() {
1109
- const t = this._generateHexFromHSB(this._hsb.h, 100, 100, "FF"), e = this._hsb.s / 100 * 100, s = (1 - this._hsb.b / 100) * 100;
1137
+ const t = this._generateHexFromHSB(this._hsb.h, 100, 100, "FF"), e = this._hsb.s / 100 * 100, o = (1 - this._hsb.b / 100) * 100;
1110
1138
  return p`
1111
1139
  <div class="color-selector">
1112
- <div
1140
+ <div
1113
1141
  class="color-sb"
1114
- style=${Q({
1142
+ style=${ee({
1115
1143
  "background-color": t
1116
1144
  })}
1117
- @click="${this._handleSBChange}"
1118
- @touchstart="${this._handleSBChange}"
1119
- @touchmove="${this._handleSBChange}"
1145
+ @mousedown="${this._handleSBMouseDown}"
1146
+ @touchstart="${this._handleSBTouchMove}"
1147
+ @touchmove="${this._handleSBTouchMove}"
1120
1148
  >
1121
1149
  <div class="sb-white"></div>
1122
1150
  <div class="sb-black"></div>
1123
- <div
1151
+ <div
1124
1152
  class="selector"
1125
- style=${Q({
1153
+ style=${ee({
1126
1154
  left: `${e}%`,
1127
- top: `${s}%`
1155
+ top: `${o}%`
1128
1156
  })}
1129
1157
  ></div>
1130
1158
  </div>
@@ -1151,11 +1179,14 @@ let g = class extends W {
1151
1179
  // 渲染透明度选择条
1152
1180
  _renderAlphaSlider() {
1153
1181
  if (this.disabledAlpha) return null;
1154
- const t = parseInt(this._internalValue.slice(7), 16) / 255 * 100;
1182
+ const t = parseInt(this._internalValue.slice(7), 16) / 255 * 100, e = "#" + this._internalValue.slice(1, 7);
1155
1183
  return p`
1156
1184
  <div class="slider-container">
1157
1185
  <div class="slider alpha-slider">
1158
- <div class="alpha-background"></div>
1186
+ <div
1187
+ class="alpha-gradient"
1188
+ style="background: linear-gradient(to right, transparent, ${e})"
1189
+ ></div>
1159
1190
  <input
1160
1191
  type="range"
1161
1192
  min="0"
@@ -1182,15 +1213,19 @@ let g = class extends W {
1182
1213
  // 渲染颜色面板
1183
1214
  _renderPanel() {
1184
1215
  return this._panelVisible ? p`
1185
- <div
1216
+ <div
1186
1217
  class="panel"
1187
1218
  style="top: ${this._panelPosition.top}px; left: ${this._panelPosition.left}px;"
1188
1219
  >
1189
1220
  <div class="panel-content">
1190
1221
  ${this._renderColorSelector()}
1191
- ${this._renderHueSlider()}
1192
- ${this.disabledAlpha ? null : this._renderAlphaSlider()}
1193
- ${this._renderCurrentColor()}
1222
+ <div class="sliders-row">
1223
+ ${this._renderCurrentColor()}
1224
+ <div class="sliders">
1225
+ ${this._renderHueSlider()}
1226
+ ${this.disabledAlpha ? null : this._renderAlphaSlider()}
1227
+ </div>
1228
+ </div>
1194
1229
  </div>
1195
1230
  </div>
1196
1231
  ` : null;
@@ -1202,54 +1237,79 @@ let g = class extends W {
1202
1237
  `;
1203
1238
  }
1204
1239
  };
1205
- g.styles = [K, yt];
1206
- $([
1240
+ b.styles = [K, wt];
1241
+ v([
1207
1242
  h({ type: String })
1208
- ], g.prototype, "value", 2);
1209
- $([
1210
- h({ type: Boolean })
1211
- ], g.prototype, "disabled", 2);
1212
- $([
1213
- h({ type: Boolean })
1214
- ], g.prototype, "disabledAlpha", 2);
1215
- $([
1216
- h({ type: Boolean })
1217
- ], g.prototype, "open", 2);
1218
- $([
1219
- h({ type: Boolean })
1220
- ], g.prototype, "showText", 2);
1221
- $([
1222
- y()
1223
- ], g.prototype, "_panelVisible", 2);
1224
- $([
1225
- y()
1226
- ], g.prototype, "_internalValue", 2);
1227
- $([
1228
- y()
1229
- ], g.prototype, "_hsb", 2);
1230
- $([
1231
- y()
1232
- ], g.prototype, "_panelPosition", 2);
1233
- g = $([
1243
+ ], b.prototype, "value", 2);
1244
+ v([
1245
+ h({ type: Boolean, reflect: !0 })
1246
+ ], b.prototype, "disabled", 2);
1247
+ v([
1248
+ h({ type: Boolean, reflect: !0, attribute: "disabled-alpha" })
1249
+ ], b.prototype, "disabledAlpha", 2);
1250
+ v([
1251
+ h({ type: Boolean, reflect: !0 })
1252
+ ], b.prototype, "open", 2);
1253
+ v([
1254
+ h({
1255
+ attribute: "show-text",
1256
+ converter: {
1257
+ fromAttribute: (t) => t !== "false",
1258
+ toAttribute: (t) => t ? null : "false"
1259
+ }
1260
+ })
1261
+ ], b.prototype, "showText", 2);
1262
+ v([
1263
+ h({ type: String })
1264
+ ], b.prototype, "placement", 2);
1265
+ v([
1266
+ h({ type: String })
1267
+ ], b.prototype, "align", 2);
1268
+ v([
1269
+ h({
1270
+ attribute: "auto-adjust",
1271
+ converter: {
1272
+ fromAttribute: (t) => t !== "false",
1273
+ toAttribute: (t) => t ? null : "false"
1274
+ }
1275
+ })
1276
+ ], b.prototype, "autoAdjust", 2);
1277
+ v([
1278
+ $()
1279
+ ], b.prototype, "_panelVisible", 2);
1280
+ v([
1281
+ $()
1282
+ ], b.prototype, "_internalValue", 2);
1283
+ v([
1284
+ $()
1285
+ ], b.prototype, "_hsb", 2);
1286
+ v([
1287
+ $()
1288
+ ], b.prototype, "_panelPosition", 2);
1289
+ b = v([
1234
1290
  N("nf-color-picker")
1235
- ], g);
1291
+ ], b);
1236
1292
  const Ut = O({
1237
1293
  tagName: "nf-color-picker",
1238
- elementClass: g,
1294
+ elementClass: b,
1239
1295
  react: V,
1240
1296
  events: {
1241
1297
  onChange: "change",
1242
1298
  onOpenChange: "openChange"
1243
1299
  }
1244
- }), xt = E`:host{background:0 0;border:none;box-shadow:none}:host:hover{background:0 0;border:none}:host:focus{box-shadow:none}.slider-container{position:relative;min-width:10rem;width:100%;height:1.5rem;display:flex;align-items:center;box-sizing:border-box}.slider-track{position:relative;width:100%;height:.25rem;background-color:#e0e0e0;border-radius:.125rem;cursor:pointer}:host([disabled]) .slider-track{cursor:not-allowed;opacity:.5}.slider-track-fill{position:absolute;height:100%;background-color:var(--nf-primary-color,#5e72f9);border-radius:.125rem}.slider-handle{position:absolute;width:1rem;height:1rem;background-color:#fff;border:2px solid var(--nf-primary-color,#5e72f9);border-radius:50%;top:50%;transform:translate(-50%,-50%);cursor:grab;outline:0;box-shadow:0 2px 4px #0003;transition:transform .1s ease,box-shadow .1s ease}:host([disabled]) .slider-handle{cursor:not-allowed}.slider-handle:hover{transform:translate(-50%,-50%) scale(1.1)}.slider-handle:active{cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 4px 8px #0000004d}.slider-handle:focus{box-shadow:0 0 0 3px #5e72f94d}.slider-tooltip{position:absolute;top:-2rem;left:50%;transform:translate(-50%);background-color:#000c;color:#fff;padding:.25rem .5rem;border-radius:.25rem;font-size:.75rem;white-space:nowrap;opacity:0;transition:opacity .2s ease;pointer-events:none}.slider-tooltip.visible{opacity:1}`;
1245
- var kt = Object.defineProperty, Ct = Object.getOwnPropertyDescriptor, v = (t, e, s, r) => {
1246
- for (var i = r > 1 ? void 0 : r ? Ct(e, s) : e, o = t.length - 1, n; o >= 0; o--)
1247
- (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
1248
- return r && i && kt(e, s, i), i;
1300
+ }), xt = A`:host{display:inline-flex;align-items:center;position:relative;min-width:10rem;width:var(--nf-width,100%);height:1.25rem;background-color:var(--nf-border-color,#e0e0e0);border-radius:.625rem;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;box-shadow:none;padding:0}:host:hover{background-color:var(--nf-border-color,#e0e0e0);border:none}:host:focus{box-shadow:none;outline:0}:host([disabled]){cursor:not-allowed;opacity:.6}.slider-fill{position:absolute;left:0;top:0;height:100%;background-color:var(--nf-primary-color,#5e72f9);border-radius:.625rem 0 0 .625rem;pointer-events:none}.slider-handle{position:absolute;width:1.25rem;height:1.25rem;background-color:#fff;border-radius:50%;top:50%;transform:translate(-50%,-50%);cursor:grab;outline:0;box-shadow:0 1px 3px #0000004d;transition:transform .15s ease,box-shadow .15s ease;z-index:1}:host([disabled]) .slider-handle{cursor:not-allowed}:host(:not([disabled])) .slider-handle:hover{transform:translate(-50%,-50%) scale(1.05)}:host(:not([disabled])) .slider-handle:active{cursor:grabbing;transform:translate(-50%,-50%) scale(1.15);box-shadow:0 3px 8px #0006}.slider-handle:focus{box-shadow:0 0 0 3px #5e72f94d}.slider-tooltip{position:absolute;bottom:calc(100% + .5rem);left:50%;transform:translate(-50%);background-color:var(--nf-slider-tooltip-background);color:var(--nf-color);padding:.25rem .5rem;border-radius:.25rem;font-size:.75rem;white-space:nowrap;opacity:0;transition:opacity .2s ease;pointer-events:none;box-shadow:0 0 .4rem .1rem #0000001a}.slider-tooltip.visible{opacity:1}`;
1301
+ var kt = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, w = (t, e, o, s) => {
1302
+ for (var r = s > 1 ? void 0 : s ? Et(e, o) : e, i = t.length - 1, n; i >= 0; i--)
1303
+ (n = t[i]) && (r = (s ? n(e, o, r) : n(r)) || r);
1304
+ return s && r && kt(e, o, r), r;
1249
1305
  };
1250
- let m = class extends W {
1306
+ let g = class extends q {
1251
1307
  constructor() {
1252
- super(...arguments), this.value = 0, this.defaultValue = 0, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.range = !1, this.tooltip = !1, this._currentValue = 0, this._isDragging = !1, this._showTooltip = !1, this._handleDrag = (t) => {
1308
+ super(...arguments), this.value = 0, this.defaultValue = 0, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.range = !1, this.tooltip = !1, this._currentValue = 0, this._isDragging = !1, this._showTooltip = !1, this._handleHostMouseDown = (t) => {
1309
+ this.disabled || (t.preventDefault(), this._startDrag(t));
1310
+ }, this._handleHostTouchStart = (t) => {
1311
+ this.disabled || (t.preventDefault(), this._startDrag(t));
1312
+ }, this._handleDrag = (t) => {
1253
1313
  this._isDragging && (t.preventDefault(), this._updateValue(t));
1254
1314
  }, this._stopDrag = () => {
1255
1315
  this._isDragging && (this._isDragging = !1, this._showTooltip = !1, document.removeEventListener("mousemove", this._handleDrag), document.removeEventListener("touchmove", this._handleDrag), document.removeEventListener("mouseup", this._stopDrag), document.removeEventListener("touchend", this._stopDrag), this.dispatchEvent(
@@ -1262,16 +1322,19 @@ let m = class extends W {
1262
1322
  };
1263
1323
  }
1264
1324
  connectedCallback() {
1265
- super.connectedCallback(), this._currentValue = this.value || this.defaultValue;
1325
+ super.connectedCallback(), this._currentValue = this.value || this.defaultValue, this.addEventListener("mousedown", this._handleHostMouseDown), this.addEventListener("touchstart", this._handleHostTouchStart);
1326
+ }
1327
+ disconnectedCallback() {
1328
+ super.disconnectedCallback(), this.removeEventListener("mousedown", this._handleHostMouseDown), this.removeEventListener("touchstart", this._handleHostTouchStart), document.removeEventListener("mousemove", this._handleDrag), document.removeEventListener("touchmove", this._handleDrag), document.removeEventListener("mouseup", this._stopDrag), document.removeEventListener("touchend", this._stopDrag);
1266
1329
  }
1267
1330
  updated(t) {
1268
1331
  t.has("value") && (this._currentValue = this.value);
1269
1332
  }
1270
1333
  _handleMouseDown(t) {
1271
- this.disabled || (t.preventDefault(), this._startDrag(t));
1334
+ this.disabled || (t.stopPropagation(), t.preventDefault(), this._startDrag(t));
1272
1335
  }
1273
1336
  _handleTouchStart(t) {
1274
- this.disabled || (t.preventDefault(), this._startDrag(t));
1337
+ this.disabled || (t.stopPropagation(), t.preventDefault(), this._startDrag(t));
1275
1338
  }
1276
1339
  _handleKeyDown(t) {
1277
1340
  if (this.disabled) return;
@@ -1309,71 +1372,69 @@ let m = class extends W {
1309
1372
  this._isDragging = !0, this._showTooltip = !0, this._updateValue(t), document.addEventListener("mousemove", this._handleDrag), document.addEventListener("touchmove", this._handleDrag, { passive: !1 }), document.addEventListener("mouseup", this._stopDrag), document.addEventListener("touchend", this._stopDrag);
1310
1373
  }
1311
1374
  _updateValue(t) {
1312
- const e = this.shadowRoot?.querySelector(".slider-track");
1313
- if (!e) return;
1314
- const s = e.getBoundingClientRect(), r = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, i = Math.max(0, Math.min(1, (r - s.left) / s.width)), o = this.max - this.min, n = this.min + i * o, l = Math.round((n - this.min) / this.step), a = this.min + l * this.step;
1315
- this._currentValue = Math.min(this.max, Math.max(this.min, a)), this.requestUpdate();
1375
+ const e = this.getBoundingClientRect(), o = t instanceof MouseEvent ? t.clientX : t.touches[0].clientX, s = Math.max(0, Math.min(1, (o - e.left) / e.width)), r = this.max - this.min, i = this.min + s * r, n = Math.round((i - this.min) / this.step), l = this.min + n * this.step;
1376
+ this._currentValue = Math.min(this.max, Math.max(this.min, l)), this.requestUpdate();
1316
1377
  }
1317
1378
  _getValuePercentage() {
1318
1379
  const t = this.max - this.min;
1319
1380
  return t === 0 ? 0 : (this._currentValue - this.min) / t * 100;
1320
1381
  }
1321
1382
  render() {
1322
- const t = `${this._getValuePercentage()}%`, e = `${this._getValuePercentage()}%`, s = `slider-tooltip ${this._showTooltip || this.tooltip ? "visible" : ""}`;
1323
- return p`<div class=slider-container><div class=slider-track @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart}><div class=slider-track-fill style=${Q({ width: e })}></div><div class=slider-handle style=${Q({ left: t })} @keydown=${this.disabled ? -1 : 0} tabindex=${this._handleKeyDown}><div class=${s}>${this._currentValue}</div></div></div></div>`;
1383
+ const t = this._getValuePercentage(), e = `${t}%`, o = `${t}%`, s = `slider-tooltip ${this._showTooltip || this.tooltip ? "visible" : ""}`;
1384
+ return p`<div class=slider-fill style=${ee({ width: o })}></div><div class=slider-handle style=${ee({ left: e })} @keydown=${this.disabled ? -1 : 0} @mousedown=${this._handleMouseDown} @touchstart=${this._handleTouchStart} tabindex=${this._handleKeyDown}><div class=${s}>${this._currentValue}</div></div>`;
1324
1385
  }
1325
1386
  };
1326
- m.styles = [K, xt];
1327
- v([
1387
+ g.styles = [K, xt];
1388
+ w([
1328
1389
  h({ type: Number })
1329
- ], m.prototype, "value", 2);
1330
- v([
1390
+ ], g.prototype, "value", 2);
1391
+ w([
1331
1392
  h({ type: Number })
1332
- ], m.prototype, "defaultValue", 2);
1333
- v([
1393
+ ], g.prototype, "defaultValue", 2);
1394
+ w([
1334
1395
  h({ type: Number })
1335
- ], m.prototype, "min", 2);
1336
- v([
1396
+ ], g.prototype, "min", 2);
1397
+ w([
1337
1398
  h({ type: Number })
1338
- ], m.prototype, "max", 2);
1339
- v([
1399
+ ], g.prototype, "max", 2);
1400
+ w([
1340
1401
  h({ type: Number })
1341
- ], m.prototype, "step", 2);
1342
- v([
1343
- h({ type: Boolean })
1344
- ], m.prototype, "disabled", 2);
1345
- v([
1402
+ ], g.prototype, "step", 2);
1403
+ w([
1404
+ h({ type: Boolean, reflect: !0 })
1405
+ ], g.prototype, "disabled", 2);
1406
+ w([
1346
1407
  h({ type: Boolean })
1347
- ], m.prototype, "range", 2);
1348
- v([
1408
+ ], g.prototype, "range", 2);
1409
+ w([
1349
1410
  h({ type: Boolean })
1350
- ], m.prototype, "tooltip", 2);
1351
- v([
1352
- y()
1353
- ], m.prototype, "_currentValue", 2);
1354
- v([
1355
- y()
1356
- ], m.prototype, "_isDragging", 2);
1357
- v([
1358
- y()
1359
- ], m.prototype, "_showTooltip", 2);
1360
- m = v([
1411
+ ], g.prototype, "tooltip", 2);
1412
+ w([
1413
+ $()
1414
+ ], g.prototype, "_currentValue", 2);
1415
+ w([
1416
+ $()
1417
+ ], g.prototype, "_isDragging", 2);
1418
+ w([
1419
+ $()
1420
+ ], g.prototype, "_showTooltip", 2);
1421
+ g = w([
1361
1422
  N("nf-slider")
1362
- ], m);
1363
- const Bt = O({
1423
+ ], g);
1424
+ const It = O({
1364
1425
  tagName: "nf-slider",
1365
- elementClass: m,
1426
+ elementClass: g,
1366
1427
  react: V,
1367
1428
  events: {
1368
1429
  onChange: "change"
1369
1430
  }
1370
1431
  });
1371
1432
  export {
1372
- It as NfCheckbox,
1433
+ Tt as NfCheckbox,
1373
1434
  Ut as NfColorPicker,
1374
1435
  Mt as NfInput,
1375
- Tt as NfInputNumber,
1436
+ Bt as NfInputNumber,
1376
1437
  Ot as NfSelect,
1377
- Bt as NfSlider,
1438
+ It as NfSlider,
1378
1439
  Nt as NfSwitch
1379
1440
  };