import { M as a, gl as i, H as c, v as g, fJ as n } from "./56c67d3b.js";
import "react";
import "react-dom";
const p = (e) => /* @__PURE__ */ c("div", {}), w = function() {
  const e = {
    v1: g("abc")
  };
  return new a(e, (t) => t.v1).setPropertyViewFn(p).build();
}(), u = n(w);
function o(e) {
  let t = new u({
    value: e.toJsonValue()
  });
  expect(t.getView().length).toEqual(e.getView().length);
  for (let l = 0; l < t.getView().length; l++)
    expect(t.getView()[l].getView()).toEqual(e.getView()[l].getView());
}
test("array move", () => {
  const e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
  expect(i(e, 8, 3)).toEqual([0, 1, 2, 8, 3, 4, 5, 6, 7, 9]), expect(i(e, 0, 4)).toEqual([1, 2, 3, 4, 0, 5, 6, 7, 8, 9]);
});
test("list actions", () => {
  let e = new u({
    value: []
  });
  expect(e.getView().length).toEqual(0), e = e.reduce(e.pushAction({
    v1: "value1"
  })), expect(e.getView().length).toEqual(1), expect(e.getView()[0].getView()).toEqual("value1"), e = e.reduce(e.pushAction({
    v1: "value2"
  })), expect(e.getView().length).toEqual(2), expect(e.getView()[1].getView()).toEqual("value2"), o(e), e = e.reduce(e.pushAction({
    v1: "value3"
  })), expect(e.getView().length).toEqual(3), e = e.reduce(e.arrayMoveAction(2, 0)), expect(e.getView().length).toEqual(3), expect(e.getView()[0].getView()).toEqual("value3"), expect(e.getView()[1].getView()).toEqual("value1"), expect(e.getView()[2].getView()).toEqual("value2"), o(e), e = e.reduce(e.deleteAction(1)), expect(e.getView().length).toEqual(2), expect(e.getView()[0].getView()).toEqual("value3"), expect(e.getView()[1].getView()).toEqual("value2");
  const t = e.getView()[0];
  e = e.reduce(e.clearAction()), expect(e.getView().length).toEqual(0), e = e.reduce(e.pushCompAction(t)), expect(e.getView().length).toEqual(1), expect(e.getView()[0].getView()).toEqual("value3");
});
test("list multi action", () => {
  let e = new u({
    value: []
  });
  expect(e.getView().length).toEqual(0), e = e.reduce(e.pushAction({
    v1: "value1"
  })), e = e.reduce(e.pushAction({
    v1: "value2"
  })), expect(e.getView().length).toEqual(2), e = e.reduce(e.multiAction([e.deleteAction(0), e.pushAction({
    v1: "value3"
  })])), expect(e.getView().length).toEqual(2), expect(e.getView()[0].getView()).toEqual("value2"), expect(e.getView()[1].getView()).toEqual("value3");
});
