import { M as p, L as v, H as s, v as n, ak as m, X as r, g as c } from "./56c67d3b.js";
import "react";
import "react-dom";
const i = (a) => /* @__PURE__ */ s("div", {}), u = function() {
  const a = {
    v1: n(0),
    v2: m,
    vStr: r
  };
  return new p(a, (e) => ({
    v1: e.v1,
    v2: e.v2,
    v3: e.v1 + e.v2,
    vStr: e.vStr
  })).setPropertyViewFn(i).build();
}(), l = {
  value: {
    v1: 11,
    v2: "{{testParam + 10}}"
  }
};
test("without context", () => {
  let a = new u(l);
  a = v(a);
  let e = a.getView();
  expect(e.v1).toEqual(11), expect(e.v2).toEqual(0), expect(e.v3).toEqual(11);
});
test("test with context", () => {
  const a = c(u);
  let e = new a(l);
  e = v(e);
  let t = e.getView()({
    testParam: 100
  });
  expect(t.v1).toEqual(11), expect(t.v2).toEqual(110), expect(t.v3).toEqual(121), t = e.getView()({
    testParam: -100
  }), expect(t.v1).toEqual(11), expect(t.v2).toEqual(-90), expect(t.v3).toEqual(-79);
});
test("test with multi context", () => {
  const a = {
    value: {
      v1: 11,
      v2: "{{param1+param2*2}}"
    }
  }, e = c(u);
  let t = new e(a);
  t = v(t);
  let o = t.getView()({
    param1: 100,
    param2: 102
  });
  expect(o.v1).toEqual(11), expect(o.v2).toEqual(304);
});
test("test with context bad input", () => {
  const a = {
    value: {
      v1: 11,
      v2: "{{tstParam}}"
    }
  }, e = c(u);
  let t = new e(a);
  t = v(t);
  let o = t.getView()({
    testParam: 100
  });
  expect(o.v1).toEqual(11);
});
test("with context Date value", () => {
  const a = {
    value: {
      v1: 11,
      v2: "{{testParam}}",
      vStr: "{{testParam}}"
    }
  }, e = c(u);
  let t = new e(a);
  t = v(t);
  let o = t.getView()({
    testParam: /* @__PURE__ */ new Date(1664887576e3)
    // 2022-10-04T12:46:16.000Z
  });
  expect(o.v1).toEqual(11), expect(o.v2).toEqual(1664887576e3), expect(o.vStr).toEqual("2022-10-04T12:46:16.000Z");
});
test("with context Date method", () => {
  const a = {
    value: {
      v1: 11,
      v2: "{{testParam.getTime()}}",
      vStr: "{{testParam.getTime()}}"
    }
  }, e = c(u);
  let t = new e(a);
  t = v(t);
  let o = t.getView()({
    testParam: /* @__PURE__ */ new Date(1664887576e3)
  });
  expect(o.v1).toEqual(11), expect(o.v2).toEqual(1664887576e3), expect(o.vStr).toEqual("1664887576000");
});
export {
  u as TestComp
};
