import{REDOCLY_TEAMS_RBAC as o}from"@redocly/config";import{joinWithSeparator as d}from"../services/index.js";import{getValueFromMdParsedExtension as v,safeSlugify as n}from"../utils/index.js";import{getHref as w}from"../services/menu/operation.js";import{saveTextBeforeHeading as C}from"../utils/saveTextBeforeHeading.js";function B(i,e,s){let m;if(s?.id&&(i==="schema"||i==="tool"||i==="rsrc"||i==="prompt"))m=d(s.id,n(e.name));else if(s?.id&&s?.type==="tag"&&i==="tag"){const S=n(e.name);m=d(s.id,S)}else m=e.id||n(e.name);const c=e.summary||e["x-displayName"]||e.name,f=e.level||1,t=e.isSchema,l=e.ast||void 0,a=C(v(e,"description")||""),x=e.items||[],h=e.externalDocs;return{id:m.toLowerCase(),type:i,parent:s,name:c,level:f,depth:0,isSchema:t,description:a,items:x,ast:l,externalDocs:h,href:w({id:m}),[o]:e[o]||s?.[o],keywords:i==="tag"?e["x-keywords"]:void 0}}export{B as getTagOrGroup};
