"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildContentItems=exports.buildMenuStructure=void 0;const tags_1=require("./tags"),markdown_1=require("./markdown"),utils_1=require("../../utils");function buildMenuStructure(t,e){var i,n,o;const{definition:u}=t,{schemaDefinitionsTagName:s}=e,r=[{id:"",name:(null===(n=null===(i=null==u?void 0:u.info)||void 0===i?void 0:i["x-seo"])||void 0===n?void 0:n.title)||(null===(o=null==u?void 0:u.info)||void 0===o?void 0:o.title)||"Overview",href:"/",depth:1,level:1,type:"section",infoDefinition:u.info,items:[]}],d=[...u.tags||[]];!d.find((t=>(null==t?void 0:t.name)===s))&&s&&d.push({name:s});const l=(0,tags_1.getTagsWithOperations)(t,d),a=u["x-tagGroups"];return r.push(...(0,markdown_1.addMarkdownItems)((0,utils_1.getValueFromMdParsedExtension)(u.info,"description")||"",void 0,1)),a&&a.length>0?r.push(...(0,tags_1.getTagGroupsItems)(t,void 0,a,l,e)):r.push(...(0,tags_1.getTagsItems)(t,l,void 0,void 0,e)),r}function buildContentItems(t,e){const i=buildMenuStructure(t,e);return{contentItems:i,flatItems:(0,utils_1.flattenByProp)(i||[],"items")}}exports.buildMenuStructure=buildMenuStructure,exports.buildContentItems=buildContentItems;
//# sourceMappingURL=builder.js.map