import { bY as et, c as W, _ as V, bn as A, D as tt, w as Ae, d as v, K as ie, bo as F, bq as Q, bp as we, g as nt, bZ as rt, T as at, r as Ve, b_ as We, b$ as je, c0 as lt, c1 as it, c2 as ot, c3 as st, c4 as He, c5 as ut, V as dt, W as ct, X as ft, u as pt, Y as mt, Z as gt, a6 as Se, o as vt, c6 as ht, U as bt, bT as Oe, c7 as Te, F as St, P as $e } from "./index2.js"; import { defineComponent as Ee, ref as Ge, onBeforeUnmount as qe, createVNode as b, shallowRef as M, computed as j, watch as ee } from "vue"; function xe() { return typeof BigInt == "function"; } function te(e) { let t = e.trim(), n = t.startsWith("-"); n && (t = t.slice(1)), t = t.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, ""), t.startsWith(".") && (t = `0${t}`); const a = t || "0", o = a.split("."), l = o[0] || "0", d = o[1] || "0"; l === "0" && d === "0" && (n = !1); const c = n ? "-" : ""; return { negative: n, negativeStr: c, trimStr: a, integerStr: l, decimalStr: d, fullStr: `${c}${a}` }; } function Ce(e) { const t = String(e); return !Number.isNaN(Number(t)) && t.includes("e"); } function ne(e) { const t = String(e); if (Ce(e)) { let n = Number(t.slice(t.indexOf("e-") + 2)); const a = t.match(/\.(\d+)/); return a != null && a[1] && (n += a[1].length), n; } return t.includes(".") && De(t) ? t.length - t.indexOf(".") - 1 : 0; } function _e(e) { let t = String(e); if (Ce(e)) { if (e > Number.MAX_SAFE_INTEGER) return String(xe() ? BigInt(e).toString() : Number.MAX_SAFE_INTEGER); if (e < Number.MIN_SAFE_INTEGER) return String(xe() ? BigInt(e).toString() : Number.MIN_SAFE_INTEGER); t = e.toFixed(ne(t)); } return te(t).fullStr; } function De(e) { return typeof e == "number" ? !Number.isNaN(e) : e ? ( // Normal type: 11.28 /^\s*-?\d+(\.\d+)?\s*$/.test(e) || // Pre-number: 1. /^\s*-?\d+\.\s*$/.test(e) || // Post-number: .1 /^\s*-?\.\d+\s*$/.test(e) ) : !1; } function Le(e) { return !e && e !== 0 && !Number.isNaN(e) || !String(e).trim(); } class z { constructor(t) { if (this.origin = "", Le(t)) { this.empty = !0; return; } this.origin = String(t), this.number = Number(t); } negate() { return new z(-this.toNumber()); } add(t) { if (this.isInvalidate()) return new z(t); const n = Number(t); if (Number.isNaN(n)) return this; const a = this.number + n; if (a > Number.MAX_SAFE_INTEGER) return new z(Number.MAX_SAFE_INTEGER); if (a < Number.MIN_SAFE_INTEGER) return new z(Number.MIN_SAFE_INTEGER); const o = Math.max(ne(this.number), ne(n)); return new z(a.toFixed(o)); } isEmpty() { return this.empty; } isNaN() { return Number.isNaN(this.number); } isInvalidate() { return this.isEmpty() || this.isNaN(); } equals(t) { return this.toNumber() === (t == null ? void 0 : t.toNumber()); } lessEquals(t) { return this.add(t.negate().toString()).toNumber() <= 0; } toNumber() { return this.number; } toString() { return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0) ? this.isInvalidate() ? "" : _e(this.number) : this.origin; } } class U { constructor(t) { if (this.origin = "", Le(t)) { this.empty = !0; return; } if (this.origin = String(t), t === "-" || Number.isNaN(t)) { this.nan = !0; return; } let n = t; if (Ce(n) && (n = Number(n)), n = typeof n == "string" ? n : _e(n), De(n)) { const a = te(n); this.negative = a.negative; const o = a.trimStr.split("."); this.integer = BigInt(o[0]); const l = o[1] || "0"; this.decimal = BigInt(l), this.decimalLen = l.length; } else this.nan = !0; } getMark() { return this.negative ? "-" : ""; } getIntegerStr() { return this.integer.toString(); } getDecimalStr() { return this.decimal.toString().padStart(this.decimalLen, "0"); } /** * Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000 * This is used for add function only. */ alignDecimal(t) { const n = `${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(t, "0")}`; return BigInt(n); } negate() { const t = new U(this.toString()); return t.negative = !t.negative, t; } add(t) { if (this.isInvalidate()) return new U(t); const n = new U(t); if (n.isInvalidate()) return this; const a = Math.max(this.getDecimalStr().length, n.getDecimalStr().length), o = this.alignDecimal(a), l = n.alignDecimal(a), d = (o + l).toString(), { negativeStr: c, trimStr: f } = te(d), p = `${c}${f.padStart(a + 1, "0")}`; return new U(`${p.slice(0, -a)}.${p.slice(-a)}`); } isEmpty() { return this.empty; } isNaN() { return this.nan; } isInvalidate() { return this.isEmpty() || this.isNaN(); } equals(t) { return this.toString() === (t == null ? void 0 : t.toString()); } lessEquals(t) { return this.add(t.negate().toString()).toNumber() <= 0; } toNumber() { return this.isNaN() ? NaN : Number(this.toString()); } toString() { return (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0) ? this.isInvalidate() ? "" : te(`${this.getMark()}${this.getIntegerStr()}.${this.getDecimalStr()}`).fullStr : this.origin; } } function D(e) { return xe() ? new U(e) : new z(e); } function Ie(e, t, n) { let a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1; if (e === "") return ""; const { negativeStr: o, integerStr: l, decimalStr: d } = te(e), c = `${t}${d}`, f = `${o}${l}`; if (n >= 0) { const p = Number(d[n]); if (p >= 5 && !a) { const s = D(e).add(`${o}0.${"0".repeat(n)}${10 - p}`); return Ie(s.toString(), t, n, a); } return n === 0 ? f : `${f}${t}${d.padEnd(n, "0").slice(0, n)}`; } return c === ".0" ? f : `${f}${c}`; } const $t = 200, Nt = 600, yt = Ee({ compatConfig: { MODE: 3 }, name: "StepHandler", inheritAttrs: !1, props: { prefixCls: String, upDisabled: Boolean, downDisabled: Boolean, onStep: A() }, slots: Object, setup(e, t) { let { slots: n, emit: a } = t; const o = Ge(), l = (c, f) => { c.preventDefault(), a("step", f); function p() { a("step", f), o.value = setTimeout(p, $t); } o.value = setTimeout(p, Nt); }, d = () => { clearTimeout(o.value); }; return qe(() => { d(); }), () => { if (et()) return null; const { prefixCls: c, upDisabled: f, downDisabled: p } = e, s = `${c}-handler`, w = W(s, `${s}-up`, { [`${s}-up-disabled`]: f }), S = W(s, `${s}-down`, { [`${s}-down-disabled`]: p }), I = { unselectable: "on", role: "button", onMouseup: d, onMouseleave: d }, { upNode: $, downNode: E } = n; return b("div", { class: `${s}-wrap` }, [b("span", V(V({}, I), {}, { onMousedown: (P) => { l(P, !0); }, "aria-label": "Increase Value", "aria-disabled": f, class: w }), [($ == null ? void 0 : $()) || b("span", { unselectable: "on", class: `${c}-handler-up-inner` }, null)]), b("span", V(V({}, I), {}, { onMousedown: (P) => { l(P, !1); }, "aria-label": "Decrease Value", "aria-disabled": p, class: S }), [(E == null ? void 0 : E()) || b("span", { unselectable: "on", class: `${c}-handler-down-inner` }, null)])]); }; } }); function wt(e, t) { const n = Ge(null); function a() { try { const { selectionStart: l, selectionEnd: d, value: c } = e.value, f = c.substring(0, l), p = c.substring(d); n.value = { start: l, end: d, value: c, beforeTxt: f, afterTxt: p }; } catch (l) { } } function o() { if (e.value && n.value && t.value) try { const { value: l } = e.value, { beforeTxt: d, afterTxt: c, start: f } = n.value; let p = l.length; if (l.endsWith(c)) p = l.length - n.value.afterTxt.length; else if (l.startsWith(d)) p = d.length; else { const s = d[f - 1], w = l.indexOf(s, f - 1); w !== -1 && (p = w + 1); } e.value.setSelectionRange(p, p); } catch (l) { tt(!1, `Something warning of cursor restore. Please fire issue about this: ${l.message}`); } } return [a, o]; } const xt = () => { const e = M(0), t = () => { Ae.cancel(e.value); }; return qe(() => { t(); }), (n) => { t(), e.value = Ae(() => { n(); }); }; }; var It = function(e, t) { var n = {}; for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, a = Object.getOwnPropertySymbols(e); o < a.length; o++) t.indexOf(a[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[o]) && (n[a[o]] = e[a[o]]); return n; }; const Be = (e, t) => e || t.isEmpty() ? t.toString() : t.toNumber(), Fe = (e) => { const t = D(e); return t.isInvalidate() ? null : t; }, Ue = () => ({ /** value will show as string */ stringMode: F(), defaultValue: Q([String, Number]), value: Q([String, Number]), prefixCls: we(), min: Q([String, Number]), max: Q([String, Number]), step: Q([String, Number], 1), tabindex: Number, controls: F(!0), readonly: F(), disabled: F(), autofocus: F(), keyboard: F(!0), /** Parse display value to validate number */ parser: A(), /** Transform `value` to display value show in input */ formatter: A(), /** Syntactic sugar of `formatter`. Config precision of display. */ precision: Number, /** Syntactic sugar of `formatter`. Config decimal separator of display. */ decimalSeparator: String, onInput: A(), onChange: A(), onPressEnter: A(), onStep: A(), onBlur: A(), onFocus: A() }), Et = Ee({ compatConfig: { MODE: 3 }, name: "InnerInputNumber", inheritAttrs: !1, props: v(v({}, Ue()), { lazy: Boolean }), slots: Object, setup(e, t) { let { attrs: n, slots: a, emit: o, expose: l } = t; const d = M(), c = M(!1), f = M(!1), p = M(!1), s = M(D(e.value)); function w(r) { e.value === void 0 && (s.value = r); } const S = (r, i) => { if (!i) return e.precision >= 0 ? e.precision : Math.max(ne(r), ne(e.step)); }, I = (r) => { const i = String(r); if (e.parser) return e.parser(i); let u = i; return e.decimalSeparator && (u = u.replace(e.decimalSeparator, ".")), u.replace(/[^\w.-]+/g, ""); }, $ = M(""), E = (r, i) => { if (e.formatter) return e.formatter(r, { userTyping: i, input: String($.value) }); let u = typeof r == "number" ? _e(r) : r; if (!i) { const m = S(u, i); if (De(u) && (e.decimalSeparator || m >= 0)) { const y = e.decimalSeparator || "."; u = Ie(u, y, m); } } return u; }, P = (() => { const r = e.value; return s.value.isInvalidate() && ["string", "number"].includes(typeof r) ? Number.isNaN(r) ? "" : r : E(s.value.toString(), !1); })(); $.value = P; function C(r, i) { $.value = E( // Invalidate number is sometime passed by external control, we should let it go // Otherwise is controlled by internal interactive logic which check by userTyping // You can ref 'show limited value when input is not focused' test for more info. r.isInvalidate() ? r.toString(!1) : r.toString(!i), i ); } const _ = j(() => Fe(e.max)), N = j(() => Fe(e.min)), x = j(() => !_.value || !s.value || s.value.isInvalidate() ? !1 : _.value.lessEquals(s.value)), O = j(() => !N.value || !s.value || s.value.isInvalidate() ? !1 : s.value.lessEquals(N.value)), [k, K] = wt(d, c), X = (r) => _.value && !r.lessEquals(_.value) ? _.value : N.value && !N.value.lessEquals(r) ? N.value : null, oe = (r) => !X(r), Y = (r, i) => { var u; let m = r, y = oe(m) || m.isEmpty(); if (!m.isEmpty() && !i && (m = X(m) || m, y = !0), !e.readonly && !e.disabled && y) { const R = m.toString(), q = S(R, i); return q >= 0 && (m = D(Ie(R, ".", q))), m.equals(s.value) || (w(m), (u = e.onChange) === null || u === void 0 || u.call(e, m.isEmpty() ? null : Be(e.stringMode, m)), e.value === void 0 && C(m, i)), m; } return s.value; }, se = xt(), Z = (r) => { var i; if (k(), $.value = r, !p.value) { const u = I(r), m = D(u); m.isNaN() || Y(m, !0); } (i = e.onInput) === null || i === void 0 || i.call(e, r), se(() => { let u = r; e.parser || (u = r.replace(/。/g, ".")), u !== r && Z(u); }); }, h = () => { p.value = !0; }, J = () => { p.value = !1, Z(d.value.value); }, H = (r) => { Z(r.target.value); }, G = (r) => { var i, u; if (r && x.value || !r && O.value) return; f.value = !1; let m = D(e.step); r || (m = m.negate()); const y = (s.value || D(0)).add(m.toString()), R = Y(y, !1); (i = e.onStep) === null || i === void 0 || i.call(e, Be(e.stringMode, R), { offset: e.step, type: r ? "up" : "down" }), (u = d.value) === null || u === void 0 || u.focus(); }, T = (r) => { const i = D(I($.value)); let u = i; i.isNaN() ? u = s.value : u = Y(i, r), e.value !== void 0 ? C(s.value, !1) : u.isNaN() || C(u, !1); }, ue = () => { f.value = !0; }, de = (r) => { var i; const { which: u } = r; f.value = !0, u === ie.ENTER && (p.value || (f.value = !1), T(!1), (i = e.onPressEnter) === null || i === void 0 || i.call(e, r)), e.keyboard !== !1 && !p.value && [ie.UP, ie.DOWN].includes(u) && (G(ie.UP === u), r.preventDefault()); }, ce = () => { f.value = !1; }, re = (r) => { T(!1), c.value = !1, f.value = !1, o("blur", r); }; return ee(() => e.precision, () => { s.value.isInvalidate() || C(s.value, !1); }, { flush: "post" }), ee(() => e.value, () => { const r = D(e.value); s.value = r; const i = D(I($.value)); (!r.equals(i) || !f.value || e.formatter) && C(r, f.value); }, { flush: "post" }), ee($, () => { e.formatter && K(); }, { flush: "post" }), ee(() => e.disabled, (r) => { r && (c.value = !1); }), l({ focus: () => { var r; (r = d.value) === null || r === void 0 || r.focus(); }, blur: () => { var r; (r = d.value) === null || r === void 0 || r.blur(); } }), () => { const r = v(v({}, n), e), { prefixCls: i = "rc-input-number", min: u, max: m, step: y = 1, defaultValue: R, value: q, disabled: ae, readonly: le, keyboard: g, controls: fe = !0, autofocus: B, stringMode: pe, parser: me, formatter: L, precision: ge, decimalSeparator: ve, onChange: he, onInput: Me, onPressEnter: Pe, onStep: Rt, lazy: ke, class: Ke, style: Xe } = r, Ye = It(r, ["prefixCls", "min", "max", "step", "defaultValue", "value", "disabled", "readonly", "keyboard", "controls", "autofocus", "stringMode", "parser", "formatter", "precision", "decimalSeparator", "onChange", "onInput", "onPressEnter", "onStep", "lazy", "class", "style"]), { upHandler: Ze, downHandler: Je } = a, Re = `${i}-input`, be = {}; return ke ? be.onChange = H : be.onInput = H, b("div", { class: W(i, Ke, { [`${i}-focused`]: c.value, [`${i}-disabled`]: ae, [`${i}-readonly`]: le, [`${i}-not-a-number`]: s.value.isNaN(), [`${i}-out-of-range`]: !s.value.isInvalidate() && !oe(s.value) }), style: Xe, onKeydown: de, onKeyup: ce }, [fe && b(yt, { prefixCls: i, upDisabled: x.value, downDisabled: O.value, onStep: G }, { upNode: Ze, downNode: Je }), b("div", { class: `${Re}-wrap` }, [b("input", V(V(V({ autofocus: B, autocomplete: "off", role: "spinbutton", "aria-valuemin": u, "aria-valuemax": m, "aria-valuenow": s.value.isInvalidate() ? null : s.value.toString(), step: y }, Ye), {}, { ref: d, class: Re, value: $.value, disabled: ae, readonly: le, onFocus: (Qe) => { c.value = !0, o("focus", Qe); } }, be), {}, { onBlur: re, onCompositionstart: h, onCompositionend: J, onBeforeinput: ue }), null)])]); }; } }); function Ne(e) { return e != null; } const Ct = (e) => { const { componentCls: t, lineWidth: n, lineType: a, colorBorder: o, borderRadius: l, fontSizeLG: d, controlHeightLG: c, controlHeightSM: f, colorError: p, inputPaddingHorizontalSM: s, colorTextDescription: w, motionDurationMid: S, colorPrimary: I, controlHeight: $, inputPaddingHorizontal: E, colorBgContainer: P, colorTextDisabled: C, borderRadiusSM: _, borderRadiusLG: N, controlWidth: x, handleVisible: O } = e; return [ { [t]: v(v(v(v({}, Ve(e)), We(e)), je(e, t)), { display: "inline-block", width: x, margin: 0, padding: 0, border: `${n}px ${a} ${o}`, borderRadius: l, "&-rtl": { direction: "rtl", [`${t}-input`]: { direction: "rtl" } }, "&-lg": { padding: 0, fontSize: d, borderRadius: N, [`input${t}-input`]: { height: c - 2 * n } }, "&-sm": { padding: 0, borderRadius: _, [`input${t}-input`]: { height: f - 2 * n, padding: `0 ${s}px` } }, "&:hover": v({}, He(e)), "&-focused": v({}, st(e)), "&-disabled": v(v({}, ot(e)), { [`${t}-input`]: { cursor: "not-allowed" } }), // ===================== Out Of Range ===================== "&-out-of-range": { input: { color: p } }, // Style for input-group: input with label, with button or dropdown... "&-group": v(v(v({}, Ve(e)), it(e)), { "&-wrapper": { display: "inline-block", textAlign: "start", verticalAlign: "top", [`${t}-affix-wrapper`]: { width: "100%" }, // Size "&-lg": { [`${t}-group-addon`]: { borderRadius: N } }, "&-sm": { [`${t}-group-addon`]: { borderRadius: _ } } } }), [t]: { "&-input": v(v({ width: "100%", height: $ - 2 * n, padding: `0 ${E}px`, textAlign: "start", backgroundColor: "transparent", border: 0, borderRadius: l, outline: 0, transition: `all ${S} linear`, appearance: "textfield", color: e.colorText, fontSize: "inherit", verticalAlign: "top" }, lt(e.colorTextPlaceholder)), { '&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button': { margin: 0, /* stylelint-disable-next-line property-no-vendor-prefix */ webkitAppearance: "none", appearance: "none" } }) } }) }, // Handler { [t]: { [`&:hover ${t}-handler-wrap, &-focused ${t}-handler-wrap`]: { opacity: 1 }, [`${t}-handler-wrap`]: { position: "absolute", insetBlockStart: 0, insetInlineEnd: 0, width: e.handleWidth, height: "100%", background: P, borderStartStartRadius: 0, borderStartEndRadius: l, borderEndEndRadius: l, borderEndStartRadius: 0, opacity: O === !0 ? 1 : 0, display: "flex", flexDirection: "column", alignItems: "stretch", transition: `opacity ${S} linear ${S}`, // Fix input number inside Menu makes icon too large // We arise the selector priority by nest selector here // https://github.com/ant-design/ant-design/issues/14367 [`${t}-handler`]: { display: "flex", alignItems: "center", justifyContent: "center", flex: "auto", height: "40%", [` ${t}-handler-up-inner, ${t}-handler-down-inner `]: { marginInlineEnd: 0, fontSize: e.handleFontSize } } }, [`${t}-handler`]: { height: "50%", overflow: "hidden", color: w, fontWeight: "bold", lineHeight: 0, textAlign: "center", cursor: "pointer", borderInlineStart: `${n}px ${a} ${o}`, transition: `all ${S} linear`, "&:active": { background: e.colorFillAlter }, // Hover "&:hover": { height: "60%", [` ${t}-handler-up-inner, ${t}-handler-down-inner `]: { color: I } }, "&-up-inner, &-down-inner": v(v({}, ut()), { color: w, transition: `all ${S} linear`, userSelect: "none" }) }, [`${t}-handler-up`]: { borderStartEndRadius: l }, [`${t}-handler-down`]: { borderBlockStart: `${n}px ${a} ${o}`, borderEndEndRadius: l }, // Disabled "&-disabled, &-readonly": { [`${t}-handler-wrap`]: { display: "none" }, [`${t}-input`]: { color: "inherit" } }, [` ${t}-handler-up-disabled, ${t}-handler-down-disabled `]: { cursor: "not-allowed" }, [` ${t}-handler-up-disabled:hover &-handler-up-inner, ${t}-handler-down-disabled:hover &-handler-down-inner `]: { color: C } } }, // Border-less { [`${t}-borderless`]: { borderColor: "transparent", boxShadow: "none", [`${t}-handler-down`]: { borderBlockStartWidth: 0 } } } ]; }, _t = (e) => { const { componentCls: t, inputPaddingHorizontal: n, inputAffixPadding: a, controlWidth: o, borderRadiusLG: l, borderRadiusSM: d } = e; return { [`${t}-affix-wrapper`]: v(v(v({}, We(e)), je(e, `${t}-affix-wrapper`)), { // or number handler will cover form status position: "relative", display: "inline-flex", width: o, padding: 0, paddingInlineStart: n, "&-lg": { borderRadius: l }, "&-sm": { borderRadius: d }, [`&:not(${t}-affix-wrapper-disabled):hover`]: v(v({}, He(e)), { zIndex: 1 }), "&-focused, &:focus": { zIndex: 1 }, "&-disabled": { [`${t}[disabled]`]: { background: "transparent" } }, [`> div${t}`]: { width: "100%", border: "none", outline: "none", [`&${t}-focused`]: { boxShadow: "none !important" } }, [`input${t}-input`]: { padding: 0 }, "&::before": { width: 0, visibility: "hidden", content: '"\\a0"' }, [`${t}-handler-wrap`]: { zIndex: 2 }, [t]: { "&-prefix, &-suffix": { display: "flex", flex: "none", alignItems: "center", pointerEvents: "none" }, "&-prefix": { marginInlineEnd: a }, "&-suffix": { position: "absolute", insetBlockStart: 0, insetInlineEnd: 0, zIndex: 1, height: "100%", marginInlineEnd: n, marginInlineStart: a } } }) }; }, Dt = nt("InputNumber", (e) => { const t = rt(e); return [ Ct(t), _t(t), // ===================================================== // == Space Compact == // ===================================================== at(t) ]; }, (e) => ({ controlWidth: 90, handleWidth: e.controlHeightSM - e.lineWidth * 2, handleFontSize: e.fontSize / 2, handleVisible: "auto" })); var Mt = function(e, t) { var n = {}; for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, a = Object.getOwnPropertySymbols(e); o < a.length; o++) t.indexOf(a[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[o]) && (n[a[o]] = e[a[o]]); return n; }; const ze = Ue(), Pt = () => v(v({}, ze), { size: we(), bordered: F(!0), placeholder: String, name: String, id: String, type: String, addonBefore: $e.any, addonAfter: $e.any, prefix: $e.any, "onUpdate:value": ze.onChange, valueModifiers: Object, status: we() }), ye = Ee({ compatConfig: { MODE: 3 }, name: "AInputNumber", inheritAttrs: !1, props: Pt(), // emits: ['focus', 'blur', 'change', 'input', 'update:value'], slots: Object, setup(e, t) { let { emit: n, expose: a, attrs: o, slots: l } = t; var d; const c = dt(), f = ct.useInject(), p = j(() => ft(f.status, e.status)), { prefixCls: s, size: w, direction: S, disabled: I } = pt("input-number", e), { compactSize: $, compactItemClassnames: E } = mt(s, S), P = gt(), C = j(() => { var h; return (h = I.value) !== null && h !== void 0 ? h : P.value; }), [_, N] = Dt(s), x = j(() => $.value || w.value), O = M((d = e.value) !== null && d !== void 0 ? d : e.defaultValue), k = M(!1); ee(() => e.value, () => { O.value = e.value; }); const K = M(null), X = () => { var h; (h = K.value) === null || h === void 0 || h.focus(); }; a({ focus: X, blur: () => { var h; (h = K.value) === null || h === void 0 || h.blur(); } }); const Y = (h) => { e.value === void 0 && (O.value = h), n("update:value", h), n("change", h), c.onFieldChange(); }, se = (h) => { k.value = !1, n("blur", h), c.onFieldBlur(); }, Z = (h) => { k.value = !0, n("focus", h); }; return () => { var h, J, H, G; const { hasFeedback: T, isFormItemInput: ue, feedbackIcon: de } = f, ce = (h = e.id) !== null && h !== void 0 ? h : c.id.value, re = v(v(v({}, o), e), { id: ce, disabled: C.value }), { class: r, bordered: i, readonly: u, style: m, addonBefore: y = (J = l.addonBefore) === null || J === void 0 ? void 0 : J.call(l), addonAfter: R = (H = l.addonAfter) === null || H === void 0 ? void 0 : H.call(l), prefix: q = (G = l.prefix) === null || G === void 0 ? void 0 : G.call(l), valueModifiers: ae = {} } = re, le = Mt(re, ["class", "bordered", "readonly", "style", "addonBefore", "addonAfter", "prefix", "valueModifiers"]), g = s.value, fe = W({ [`${g}-lg`]: x.value === "large", [`${g}-sm`]: x.value === "small", [`${g}-rtl`]: S.value === "rtl", [`${g}-readonly`]: u, [`${g}-borderless`]: !i, [`${g}-in-form-item`]: ue }, Se(g, p.value), r, E.value, N.value); let B = b(Et, V(V({}, vt(le, ["size", "defaultValue"])), {}, { ref: K, lazy: !!ae.lazy, value: O.value, class: fe, prefixCls: g, readonly: u, onChange: Y, onBlur: se, onFocus: Z }), { upHandler: l.upIcon ? () => b("span", { class: `${g}-handler-up-inner` }, [l.upIcon()]) : () => b(bt, { class: `${g}-handler-up-inner` }, null), downHandler: l.downIcon ? () => b("span", { class: `${g}-handler-down-inner` }, [l.downIcon()]) : () => b(ht, { class: `${g}-handler-down-inner` }, null) }); const pe = Ne(y) || Ne(R), me = Ne(q); if (me || T) { const L = W(`${g}-affix-wrapper`, Se(`${g}-affix-wrapper`, p.value, T), { [`${g}-affix-wrapper-focused`]: k.value, [`${g}-affix-wrapper-disabled`]: C.value, [`${g}-affix-wrapper-sm`]: x.value === "small", [`${g}-affix-wrapper-lg`]: x.value === "large", [`${g}-affix-wrapper-rtl`]: S.value === "rtl", [`${g}-affix-wrapper-readonly`]: u, [`${g}-affix-wrapper-borderless`]: !i, // className will go to addon wrapper [`${r}`]: !pe && r }, N.value); B = b("div", { class: L, style: m, onClick: X }, [me && b("span", { class: `${g}-prefix` }, [q]), B, T && b("span", { class: `${g}-suffix` }, [de])]); } if (pe) { const L = `${g}-group`, ge = `${L}-addon`, ve = y ? b("div", { class: ge }, [y]) : null, he = R ? b("div", { class: ge }, [R]) : null, Me = W(`${g}-wrapper`, L, { [`${L}-rtl`]: S.value === "rtl" }, N.value), Pe = W(`${g}-group-wrapper`, { [`${g}-group-wrapper-sm`]: x.value === "small", [`${g}-group-wrapper-lg`]: x.value === "large", [`${g}-group-wrapper-rtl`]: S.value === "rtl" }, Se(`${s}-group-wrapper`, p.value, T), r, N.value); B = b("div", { class: Pe, style: m }, [b("div", { class: Me }, [ve && b(Oe, null, { default: () => [b(Te, null, { default: () => [ve] })] }), B, he && b(Oe, null, { default: () => [b(Te, null, { default: () => [he] })] })])]); } return _(St(B, { style: m })); }; } }), Ot = v(ye, { install: (e) => (e.component(ye.name, ye), e) }); export { Ot as _ };