import{encodeBackSlashes as o,queryString as s}from"../../utils/index.js";import{getActiveMediaType as r}from"../../models/mediaContent.js";function p(e,n){if(!e.in){if(e.deps.type==="request"&&e.deps.operation?.requestBody?.content?.mediaTypes)return e.deps.operation?.requestBody?.content?.mediaTypes.length>1?e.deps.operation?.requestBody?.content&&r(e.deps.operation.requestBody.content,n).name:void 0;if(e.deps.type==="response"&&e.deps.response?.content?.mediaTypes)return e.deps.response?.content?.mediaTypes.length>1?e.deps.response?.content&&r(e.deps.response.content,n).name:void 0}}function d(e,n){if(!e)return"";const t={t:e.deps.type,in:e.in||e.deps.in,c:e.deps.type==="response"?e.deps.response?.code:void 0,cb:e.deps.operation?.isCallback?e.deps.operation.callbackId:void 0,ct:p(e,n),path:e.fieldFullPath};return s.stringify(t,{encode:!1,sort:!1})}function c(e="",n="",t="/"){return e.endsWith(t)&&e!==t&&(e=e.slice(0,-t.length)),n.startsWith(t)&&(n=n.slice(t.length)),!e||!n||e===t?e+n:e+t+n}function y(e,n){return e=o(e),(`/${e}#`+c(e,n)).toLowerCase()}export{d as constructFieldDeepFragment,c as joinWithSeparator,y as makeDeepLink};
