var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};
import { M as e, cl as t, cm as o, cn as a, co as c, P as s, cp as r, cq as n, c8 as i, v as l, a0 as p, w as v, _ as u } from "./index-f927b013.js";
import "./lodash-b5661970.js";
import { lz as m } from "./ant-design-icons-6bfdc7d5.js";
import "./loglevel-b4003767.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 "./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";
const d = (e2) => m("div", {}), j = function() {
  const t2 = { v1: l("abc") };
  return new e(t2, (e2) => e2.v1).setPropertyViewFn(d).build();
}();
function x(e2) {
  return JSON.stringify(e2.toJsonValue());
}
test("test object create", () => {
  const e2 = new class {
    constructor() {
      __publicField(this, "a", 1);
      __publicField(this, "b", "abc");
    }
    getValue() {
      return this.a + 10;
    }
  }();
  expect(e2.a).toEqual(1), expect(e2.getValue()).toEqual(11);
  const t2 = Object.create(e2);
  t2.a = 2, expect(t2.a).toEqual(2), expect(t2.getValue()).toEqual(12), expect(e2.a).toEqual(1), expect(e2.getValue()).toEqual(11);
}), test("test action and reduce", () => {
  let e2 = new j({});
  expect(x(e2)).toEqual('{"v1":"abc"}'), e2 = e2.reduce(e2.changeChildAction("v1", "changed")), expect(x(e2)).toEqual('{"v1":"changed"}'), e2 = e2.reduce(e2.changeChildAction("v1", "changedXXXX")), expect(x(e2)).toEqual('{"v1":"changedXXXX"}');
}), test("test value constructor", () => {
  let e2 = new j({ value: { v1: "changed" } });
  expect(x(e2)).toEqual('{"v1":"changed"}');
});
const b = function() {
  const t2 = { v1: l("abc"), v2: j };
  return new e(t2, (e2) => e2).setPropertyViewFn(d).build();
}();
test("test multi2 toJson", () => {
  let e2 = new b({});
  const o2 = JSON.stringify(e2.toJsonValue());
  expect(o2).toEqual('{"v1":"abc","v2":{"v1":"abc"}}'), e2 = e2.reduce(t("v2", e2.children.v2.changeChildAction("v1", "changed"))), expect(x(e2)).toEqual('{"v1":"abc","v2":{"v1":"changed"}}');
  let a2 = new b({ value: JSON.parse(x(e2)) });
  expect(x(a2)).toEqual(x(e2));
}), test("test multi change action", () => {
  let e2 = new b({});
  expect(e2.getView().v1).toEqual("abc"), expect(e2.getView().v2).toEqual("abc");
  const t2 = o({ v1: a("v1_value", true), v2: c("v1", "xxxy", true) });
  e2 = e2.reduce(t2), expect(e2.getView().v1).toEqual("v1_value"), expect(e2.getView().v2).toEqual("xxxy");
});
const g = function() {
  const t2 = { v1: l("abc"), v2: b, v3: p };
  return new e(t2, (e2) => e2.v3).setPropertyViewFn(d).build();
}();
test("test multi toNode", () => {
  const e2 = new g({}).node().evaluate();
  expect(e2.v3.value).toEqual("");
}), test("test comp don't change if no value change", () => {
  let e2 = new g({});
  expect(s(e2)).toBe(e2);
}), test("test cache", () => {
  let e2 = s(new g({}));
  const t2 = e2.children.v1, o2 = e2.children.v2;
  e2 = e2.reduce(e2.changeChildAction("v1", "XXX")), expect(e2.children.v1.getView()).toEqual("XXX"), expect(e2.children.v1).not.toBe(t2), expect(e2.children.v2).toBe(o2), e2 = s(e2), expect(e2.node()).toBe(e2.node());
  const a2 = e2.node().evaluate();
  e2 = e2.reduce(r(a2));
  const c2 = e2.reduce(r(a2));
  expect(c2).toBe(e2), expect(e2.node().evaluate()).toBe(e2.node().evaluate()), expect(s(e2)).toBe(e2);
}), test("test code", () => {
  let t2 = new (function() {
    const t3 = { v1: v(p, "{{a.b}}") };
    return new e(t3, (e2) => e2.v1).setPropertyViewFn(d).build();
  }())({});
  const o2 = { a: n({ b: i("abc") }) };
  t2 = s(t2, o2), expect(t2.getView()).toEqual("abc");
}), test("removeDefault", () => {
  const t2 = function() {
    const t3 = { v0: p, v1: v(p, "{{a.b}}"), v2: u, v3: u.DEFAULT_TRUE };
    return new e(t3, (e2) => e2).setPropertyViewFn(d).build();
  }();
  expect(s(new t2({})).toJsonValue()).toEqual({ v1: "{{a.b}}", v3: true }), expect(s(new t2({ value: { v0: "", v1: "{{a.b}}", v2: false, v3: true } })).toJsonValue()).toEqual({ v1: "{{a.b}}", v3: true }), expect(s(new t2({ value: { v0: "bc", v1: "", v2: true, v3: false } })).toJsonValue()).toEqual({ v0: "bc", v1: "", v2: true, v3: false }), expect(s(new t2({ value: { v0: "bc", v1: "{{a.b}}", v2: true, v3: true } })).toJsonValue()).toEqual({ v0: "bc", v1: "{{a.b}}", v2: true, v3: true });
});
