import { __exports as a } from "../../../../../../../../_virtual/properties.js";
import { __require as y } from "../../compile/validate/index.js";
import { __require as v } from "../code.js";
import { __require as w } from "../../compile/util.js";
import { __require as b } from "./additionalProperties.js";
var c;
function A() {
  if (c) return a;
  c = 1, Object.defineProperty(a, "__esModule", { value: !0 });
  const m = y(), n = v(), s = w(), l = b(), _ = {
    keyword: "properties",
    type: "object",
    schemaType: "object",
    code(t) {
      const { gen: o, schema: p, parentSchema: P, data: h, it: r } = t;
      r.opts.removeAdditional === "all" && P.additionalProperties === void 0 && l.default.code(new m.KeywordCxt(r, l.default, "additionalProperties"));
      const i = (0, n.allSchemaProperties)(p);
      for (const e of i)
        r.definedProperties.add(e);
      r.opts.unevaluated && i.length && r.props !== !0 && (r.props = s.mergeEvaluated.props(o, (0, s.toHash)(i), r.props));
      const u = i.filter((e) => !(0, s.alwaysValidSchema)(r, p[e]));
      if (u.length === 0)
        return;
      const d = o.name("valid");
      for (const e of u)
        q(e) ? f(e) : (o.if((0, n.propertyInData)(o, h, e, r.opts.ownProperties)), f(e), r.allErrors || o.else().var(d, !0), o.endIf()), t.it.definedProperties.add(e), t.ok(d);
      function q(e) {
        return r.opts.useDefaults && !r.compositeRule && p[e].default !== void 0;
      }
      function f(e) {
        t.subschema({
          keyword: "properties",
          schemaProp: e,
          dataProp: e
        }, d);
      }
    }
  };
  return a.default = _, a;
}
export {
  A as __require
};
//# sourceMappingURL=properties.js.map
