import { PromptInput, PromptInputBody, PromptInputFooter, PromptInputSubmit, PromptInputTextarea } from "../../ai-elements/prompt-input.js";
import { c } from "react/compiler-runtime";
import { useState } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { Pill } from "lucide-react";
function AiPromptInput(d) {
	let f = c(18), { transition: p, onSubmit: m, disabled: h, ui: g } = d, [_, v] = useState(""), y = g?.label ?? p, b;
	f[0] === m ? b = f[1] : (b = (e, u) => {
		u.preventDefault(), e.text && (m(e.text), v(""));
	}, f[0] = m, f[1] = b);
	let x;
	f[2] === Symbol.for("react.memo_cache_sentinel") ? (x = (e) => v(e.target.value), f[2] = x) : x = f[2];
	let S = h || !1, C;
	f[3] !== _ || f[4] !== S ? (C = /* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
		value: _,
		onChange: x,
		placeholder: "Type your message...",
		disabled: S,
		rows: 1,
		className: "flex-1"
	}) }), f[3] = _, f[4] = S, f[5] = C) : C = f[5];
	let w;
	f[6] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Pill, {
		size: "16",
		className: "mr-2"
	}), f[6] = w) : w = f[6];
	let T;
	f[7] === y ? T = f[8] : (T = /* @__PURE__ */ jsxs("div", {
		className: "mr-4 flex items-center",
		children: [w, y]
	}), f[7] = y, f[8] = T);
	let E = h || !1, D;
	f[9] === E ? D = f[10] : (D = /* @__PURE__ */ jsx(PromptInputSubmit, { disabled: E }), f[9] = E, f[10] = D);
	let O;
	f[11] !== T || f[12] !== D ? (O = /* @__PURE__ */ jsxs(PromptInputFooter, { children: [T, D] }), f[11] = T, f[12] = D, f[13] = O) : O = f[13];
	let k;
	return f[14] !== b || f[15] !== C || f[16] !== O ? (k = /* @__PURE__ */ jsxs(PromptInput, {
		onSubmit: b,
		children: [C, O]
	}), f[14] = b, f[15] = C, f[16] = O, f[17] = k) : k = f[17], k;
}
var AiPromptInput_default = AiPromptInput;
export { AiPromptInput_default as default };
