"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllNestedSchema=void 0;const LinkToField_1=require("../common/LinkToField"),getAllNestedSchema=({schema:e,activeOneOf:i,skipReadOnly:s=!1,skipWriteOnly:t=!1})=>{var l;if(!e||e.isCircular)return{};if(e.oneOf&&e.oneOf.length){const s=e.oneOf[i[e.pointer]||0];return(null==s?void 0:s.isCircular)?{}:(0,exports.getAllNestedSchema)({schema:s,activeOneOf:i})}return(e.fields||(null===(l=e.items)||void 0===l?void 0:l.fields)||[]).reduce(((e,l)=>l.schema.isCircular||l.schema.isPrimitive||s&&l.schema.readOnly||t&&l.schema.writeOnly?e:Object.assign(Object.assign(Object.assign({},e),{[(0,LinkToField_1.generateDeepLink)(l)]:!1}),(0,exports.getAllNestedSchema)({schema:l.schema,activeOneOf:i,skipReadOnly:s,skipWriteOnly:t}))),{})};exports.getAllNestedSchema=getAllNestedSchema;
//# sourceMappingURL=getAllNestedSchema.js.map