import { DataTable } from "../data-table/DataTable.js";
import { c } from "react/compiler-runtime";
import React, { useCallback } from "react";
import { jsx } from "react/jsx-runtime";
var ListView_default = (t) => {
	let n = c(61), { loading: r, error: i, items: a, totalItems: o, columns: s, filterConfig: l, deleteItem: u, onClick: d, handleNew: f, handleEdit: p, setPage: m, setRowsPerPage: h, setOrderBy: g, setOrder: _, setSearchTerm: v, setFilters: ae, orderBy: oe, order: se, searchTerm: ce, filters: y, page: b, rowsPerPage: x, batchActions: S, batchDelete: C, enableBatchActions: le, rowActions: w, deleteConfirmTitle: T, deleteConfirmDescription: E, newButtonLabel: D } = t, O = ce === void 0 ? "" : ce, k;
	n[0] === S ? k = n[1] : (k = S === void 0 ? [] : S, n[0] = S, n[1] = k);
	let A = k, j = le === void 0 ? !0 : le, M;
	n[2] === w ? M = n[3] : (M = w === void 0 ? [] : w, n[2] = w, n[3] = M);
	let N = M, P;
	n[4] === s ? P = n[5] : (P = s.map(_temp), n[4] = s, n[5] = P);
	let F = P, I;
	n[6] === A ? I = n[7] : (I = A.map(_temp2), n[6] = A, n[7] = I);
	let ue = I, L;
	n[8] === N ? L = n[9] : (L = N.map(_temp3), n[8] = N, n[9] = L);
	let R = L, z;
	n[10] === m ? z = n[11] : (z = (e) => {
		m(e);
	}, n[10] = m, n[11] = z);
	let B = z, V;
	n[12] !== m || n[13] !== h ? (V = (e) => {
		h(e), m(0);
	}, n[12] = m, n[13] = h, n[14] = V) : V = n[14];
	let H = V, U;
	n[15] !== _ || n[16] !== g ? (U = (e, ie) => {
		g(e), _(ie);
	}, n[15] = _, n[16] = g, n[17] = U) : U = n[17];
	let W = U, G;
	n[18] !== m || n[19] !== v ? (G = (e) => {
		v(e), m(0);
	}, n[18] = m, n[19] = v, n[20] = G) : G = n[20];
	let K = G, q;
	n[21] !== ae || n[22] !== m ? (q = (e) => {
		ae(e), m(0);
	}, n[21] = ae, n[22] = m, n[23] = q) : q = n[23];
	let J = q, Y;
	n[24] === d ? Y = n[25] : (Y = (e) => {
		d?.(e.id);
	}, n[24] = d, n[25] = Y);
	let de = Y, X;
	n[26] === p ? X = n[27] : (X = (e) => {
		p?.(e);
	}, n[26] = p, n[27] = X);
	let fe = X, Z;
	n[28] === u ? Z = n[29] : (Z = (e) => {
		u?.(e);
	}, n[28] = u, n[29] = Z);
	let pe = Z, Q;
	n[30] === C ? Q = n[31] : (Q = async (e) => {
		C && await C(e);
	}, n[30] = C, n[31] = Q);
	let me = Q, he = d ? de : void 0, ge = p ? fe : void 0, _e = u ? pe : void 0, $;
	return n[32] !== E || n[33] !== T || n[34] !== j || n[35] !== i || n[36] !== l || n[37] !== y || n[38] !== me || n[39] !== J || n[40] !== f || n[41] !== B || n[42] !== H || n[43] !== K || n[44] !== W || n[45] !== a || n[46] !== r || n[47] !== D || n[48] !== se || n[49] !== oe || n[50] !== b || n[51] !== x || n[52] !== O || n[53] !== he || n[54] !== ge || n[55] !== _e || n[56] !== o || n[57] !== ue || n[58] !== F || n[59] !== R ? ($ = /* @__PURE__ */ jsx("div", {
		className: "w-full",
		children: /* @__PURE__ */ jsx(DataTable, {
			data: a,
			columns: F,
			totalItems: o,
			loading: r,
			error: i,
			page: b,
			pageSize: x,
			onPageChange: B,
			onPageSizeChange: H,
			sortBy: oe,
			sortOrder: se,
			onSortChange: W,
			searchTerm: O,
			onSearchChange: K,
			filters: y,
			filterConfig: l,
			onFiltersChange: J,
			onRowClick: he,
			onEdit: ge,
			onDelete: _e,
			onNew: f,
			newButtonLabel: D,
			enableBatchActions: j,
			batchActions: ue,
			onBatchDelete: me,
			rowActions: R,
			deleteConfirmTitle: T,
			deleteConfirmDescription: E
		})
	}), n[32] = E, n[33] = T, n[34] = j, n[35] = i, n[36] = l, n[37] = y, n[38] = me, n[39] = J, n[40] = f, n[41] = B, n[42] = H, n[43] = K, n[44] = W, n[45] = a, n[46] = r, n[47] = D, n[48] = se, n[49] = oe, n[50] = b, n[51] = x, n[52] = O, n[53] = he, n[54] = ge, n[55] = _e, n[56] = o, n[57] = ue, n[58] = F, n[59] = R, n[60] = $) : $ = n[60], $;
};
function _temp(e) {
	return {
		id: e.id,
		label: e.label,
		minWidth: e.minWidth,
		align: e.align,
		sortable: !0,
		format: e.format ? (ie) => {
			let t = e.format(ie);
			return typeof t == "string" && t.includes("<") ? /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: t } }) : t;
		} : void 0
	};
}
function _temp2(e) {
	return {
		id: e.id,
		label: e.label,
		icon: e.icon,
		variant: e.variant,
		action: e.action
	};
}
function _temp3(e) {
	return {
		id: e.id,
		label: e.label,
		icon: e.icon,
		variant: e.variant,
		action: e.action,
		condition: e.condition,
		disabled: e.disabled,
		className: e.className
	};
}
export { ListView_default as default };
