import { __exports as o } from "../../../../../../../../_virtual/items.js";
import { __require as b } from "../../compile/codegen/index.js";
import { __require as k } from "../../compile/util.js";
import { __require as S } from "../code.js";
var p;
function E() {
  if (p) return o;
  p = 1, Object.defineProperty(o, "__esModule", { value: !0 }), o.validateTuple = void 0;
  const l = b(), n = k(), _ = S(), h = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "array", "boolean"],
    before: "uniqueItems",
    code(e) {
      const { schema: a, it: t } = e;
      if (Array.isArray(a))
        return d(e, "additionalItems", a);
      t.items = !0, !(0, n.alwaysValidSchema)(t, a) && e.ok((0, _.validateArray)(e));
    }
  };
  function d(e, a, t = e.schema) {
    const { gen: u, parentSchema: y, data: v, keyword: c, it: r } = e;
    g(y), r.opts.unevaluated && t.length && r.items !== !0 && (r.items = n.mergeEvaluated.items(u, t.length, r.items));
    const f = u.name("valid"), q = u.const("len", (0, l._)`${v}.length`);
    t.forEach((s, i) => {
      (0, n.alwaysValidSchema)(r, s) || (u.if((0, l._)`${q} > ${i}`, () => e.subschema({
        keyword: c,
        schemaProp: i,
        dataProp: i
      }, f)), e.ok(f));
    });
    function g(s) {
      const { opts: i, errSchemaPath: T } = r, m = t.length, I = m === s.minItems && (m === s.maxItems || s[a] === !1);
      if (i.strictTuples && !I) {
        const $ = `"${c}" is ${m}-tuple, but minItems or maxItems/${a} are not specified or different at path "${T}"`;
        (0, n.checkStrictMode)(r, $, i.strictTuples);
      }
    }
  }
  return o.validateTuple = d, o.default = h, o;
}
export {
  E as __require
};
//# sourceMappingURL=items.js.map
