import { a5 as e, P as t, c8 as r, T as a, dX as o, dY as s } from "./index-f927b013.js";
import { _ as i } from "./lodash-b5661970.js";
import "./ant-design-icons-6bfdc7d5.js";
import "./axios-04f95181.js";
import "./redux-devtools-8dd21e4f.js";
import "./alasql-f60045ee.js";
import "./antd-2abdded3.js";
import "react";
import "react-dom";
import "./dayjs-2035e031.js";
import "./fontawesome-3904a214.js";
import "./dnd-kit-8227a2db.js";
import "./moment-059406e8.js";
import "./styled-components-7cfa37e6.js";
import "./numbro-47982265.js";
import "./papaparse-07642d76.js";
import "./uuid-bd83cae2.js";
import "./supabase-b2e314d0.js";
import "./fetch-648a91f6.js";
import "./react-draggable-ed505bfc.js";
import "./remark-gfm-18306abe.js";
import "./buffer-d3713d77.js";
import "./rehype-raw-6ebcba88.js";
import "./parse5-f837f753.js";
import "./rehype-sanitize-953d0761.js";
import "./simplebar-react-2133d981.js";
import "./react-best-gradient-color-picker-92c01739.js";
import "./ua-parser-js-c952c07b.js";
import "./clsx-469c2c43.js";
import "./loglevel-b4003767.js";
import "./file-saver-55285fc1.js";
import "./codemirror-8412b963.js";
import "./really-relaxed-json-056be70b.js";
import "./immer-c0428a8d.js";
import "./hotkeys-js-699906bc.js";
import "./cnchar-e1339167.js";
import "./react-documents-041601c7.js";
import "./react-sortable-hoc-4fbe0c32.js";
import "./sql-formatter-577b4ab0.js";
import "./rc-trigger-3f038851.js";
import "./react-json-view-5330ce92.js";
import "./qrcode-react-d377d762.js";
test("test column", () => {
  const r2 = { title: "name" };
  let a2 = new e({ value: r2 });
  a2 = t(a2);
  const o2 = a2.getView();
  expect(o2.title).toEqual(r2.title);
}), test("test column render", () => {
  let r2 = new e({ value: { render: { compType: "text", comp: { text: "{{currentRow.id}}" } } } });
  r2 = t(r2);
  const a2 = r2.getView();
  expect(a2.render({ currentCell: null, currentIndex: null, currentRow: { id: "hello" }, currentOriginalIndex: null }, "0").getView().view({}).props.normalView).toEqual("hello");
}), test("test table", async () => {
  const e2 = { data: JSON.stringify([{ a: 1 }]), columns: [{ dataIndex: "a", hide: true }, { title: "custom", dataIndex: "", isCustom: true }] }, o2 = { query1: r({ data: [{ q: 1 }] }), query2: r({ data: [{ q2: 2 }] }) };
  let s2 = new a({ dispatch: (e3) => {
    s2 = t(s2.reduce(e3), o2);
  }, value: e2 });
  s2 = t(s2);
  let i2 = s2.children.columns.getView();
  expect(i2.length).toEqual(2), s2 = t(s2.reduce(s2.changeChildAction("data", '[{"a":1, "c":2, "d":3}]'))), await new Promise((e3) => setTimeout(e3, 20)), i2 = s2.children.columns.getView(), expect(i2.length).toEqual(4), expect(i2[0].getView().dataIndex).toEqual("a"), expect(i2[0].getView().hide).toBe(true), expect(i2[1].getView().title).toEqual("custom"), expect(i2[2].getView().title).toEqual("c"), expect(i2[3].getView().title).toEqual("d");
}, 1e3), test("test mock table render", () => {
  let e2 = new o({});
  e2 = t(e2);
}), test("test table data transform", () => {
  function e2(e3, t2) {
    const r3 = t2.exposingValues.displayData, { data: a2 } = t2.getProps(), o3 = t2.filterData;
    return expect(a2.length).toEqual(3), expect(r3.length).toEqual(e3), expect(r3.map((e4) => i.omit(e4, "custom"))).toEqual(i.map(o3, (e4) => i.omit(e4, s))), { transformedData: o3, data: a2, displayData: r3 };
  }
  const r2 = { data: JSON.stringify([{ id: 1, name: "gg" }, { id: 5, name: "gg2" }, { id: 3, name: "jjj" }]), columns: [{ dataIndex: "id", isCustom: false, sortable: true, render: { compType: "text", comp: { text: "{{currentCell}}" } } }, { dataIndex: "name", isCustom: false, render: { compType: "text", comp: { text: "{{currentCell}}" } } }, { title: "custom", dataIndex: "ealekfg", isCustom: true, render: { compType: "image", comp: { src: "{{currentRow.id}}" } } }] };
  let o2 = new a({ dispatch: (e3) => {
    o2 = t(o2.reduce(e3));
  }, value: r2 });
  o2 = t(o2), o2 = t(o2.reduce(o2.changeChildAction("sort", [{ column: "id", desc: true }])));
  let { transformedData: l, data: m, displayData: c } = e2(3, o2);
  expect(l.map((e3) => e3.id)).toEqual([5, 3, 1]), o2 = t(o2.reduce(o2.changeChildAction("toolbar", { searchText: "gg" }))), e2(2, o2), o2 = t(o2.reduce(o2.changeChildAction("toolbar", { showFilter: true, filter: { stackType: "and", filters: [{ columnKey: "id", filterValue: "4", operator: "gt" }, { columnKey: "id", filterValue: "5", operator: "lte" }] } }))), e2(1, o2);
});
