import{REDOCLY_TEAMS_RBAC as r}from"@redocly/config";import{encodeBackSlashes as d,getOperationId as c,getOperationName as m}from"../../utils/index.js";function N(o,i,s){if(i.operations.length===0)return[];const n=[],a=[];for(const e of i.operations){const t=c(e,o),p={id:t,type:"operation",parent:o,operationDefinition:e,depth:s,name:m(e),httpVerb:e.httpVerb,path:e.pathName,items:[],isAdditionalOperation:e.isAdditionalOperation,isWebhook:e.isWebhook,operationId:e.operationId,badges:e["x-badges"]||[],href:b({id:t}),deprecated:!!e.deprecated,[r]:e[r]||o?.[r]};e.isWebhook?a.push(p):n.push(p)}return[...n.sort((e,t)=>Number(e.deprecated)-Number(t.deprecated)||Number(e.isAdditionalOperation)-Number(t.isAdditionalOperation)),...a.sort((e,t)=>Number(e.deprecated)-Number(t.deprecated))]}function b({id:o}){return d(`/${o}`.toLowerCase())}export{b as getHref,N as getOperationsItems};
