import { Field } from "../Field.mjs";
import { FluentTextField } from "../../../UI/inputs/textField/FluentTextField.mjs";
import { PaymentCard } from "./PaymentCard.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { FormControl, InputAdornment, makeStyles } from "@material-ui/core";
import { useTranslation } from "react-i18next";
//#region src/utilities/form/paymentForm/CashForm.tsx
const useStyles = makeStyles((theme) => ({
	formControl: {
		width: "100%",
		marginBottom: "10px"
	},
	formControlCheck: {
		width: "100%",
		marginTop: "5px",
		marginLeft: "3px"
	}
}));
const CashForm = (t0) => {
	const $ = c(27);
	const { isFormDisabled: t1, amountValue: t2 } = t0;
	const isFormDisabled = t1 === void 0 ? false : t1;
	const amountValue = t2 === void 0 ? null : t2;
	const { t } = useTranslation();
	const classes = useStyles();
	const t3 = classes.formControl;
	let t4;
	if ($[0] !== t) {
		t4 = t("Amount");
		$[0] = t;
		$[1] = t4;
	} else t4 = $[1];
	const t5 = isFormDisabled || amountValue || false;
	let t6;
	if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
		t6 = { startAdornment: /* @__PURE__ */ React.createElement(InputAdornment, { position: "start" }, "$") };
		$[2] = t6;
	} else t6 = $[2];
	let t7;
	if ($[3] !== t4 || $[4] !== t5) {
		t7 = {
			label: t4,
			variant: "outlined",
			margin: "none",
			size: "small",
			disabled: t5,
			fullWidth: true,
			InputProps: t6
		};
		$[3] = t4;
		$[4] = t5;
		$[5] = t7;
	} else t7 = $[5];
	const t8 = !isFormDisabled;
	let t9;
	if ($[6] !== amountValue || $[7] !== t7 || $[8] !== t8) {
		t9 = /* @__PURE__ */ React.createElement(Field, {
			component: FluentTextField,
			ComponentProps: t7,
			name: "cashAmount",
			initialValue: amountValue,
			required: t8
		});
		$[6] = amountValue;
		$[7] = t7;
		$[8] = t8;
		$[9] = t9;
	} else t9 = $[9];
	let t10;
	if ($[10] !== classes.formControl || $[11] !== t9) {
		t10 = /* @__PURE__ */ React.createElement(FormControl, { className: t3 }, t9);
		$[10] = classes.formControl;
		$[11] = t9;
		$[12] = t10;
	} else t10 = $[12];
	const t11 = classes.formControl;
	let t12;
	if ($[13] !== t) {
		t12 = t("Description");
		$[13] = t;
		$[14] = t12;
	} else t12 = $[14];
	let t13;
	if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
		t13 = {
			maxLength: 256,
			autocomplete: "off"
		};
		$[15] = t13;
	} else t13 = $[15];
	let t14;
	if ($[16] !== t12) {
		t14 = {
			label: t12,
			variant: "outlined",
			margin: "normal",
			size: "small",
			disabled: false,
			fullWidth: true,
			autoComplete: "off",
			multiline: true,
			rows: 4,
			inputProps: t13
		};
		$[16] = t12;
		$[17] = t14;
	} else t14 = $[17];
	const t15 = t14;
	const t16 = !isFormDisabled;
	let t17;
	if ($[18] !== t15 || $[19] !== t16) {
		t17 = /* @__PURE__ */ React.createElement(Field, {
			component: FluentTextField,
			ComponentProps: t15,
			name: "cashDescription",
			initialValue: "",
			required: t16
		});
		$[18] = t15;
		$[19] = t16;
		$[20] = t17;
	} else t17 = $[20];
	let t18;
	if ($[21] !== classes.formControl || $[22] !== t17) {
		t18 = /* @__PURE__ */ React.createElement(FormControl, { className: t11 }, t17);
		$[21] = classes.formControl;
		$[22] = t17;
		$[23] = t18;
	} else t18 = $[23];
	let t19;
	if ($[24] !== t10 || $[25] !== t18) {
		t19 = /* @__PURE__ */ React.createElement(PaymentCard, null, t10, t18);
		$[24] = t10;
		$[25] = t18;
		$[26] = t19;
	} else t19 = $[26];
	return t19;
};
//#endregion
export { CashForm };

//# sourceMappingURL=CashForm.mjs.map