"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isSameHash=isSameHash,exports.constructFieldDeepFragment=constructFieldDeepFragment,exports.joinWithSeparator=joinWithSeparator,exports.makeDeepLink=makeDeepLink;const utils_1=require("../../utils"),mediaContent_1=require("../../models/mediaContent");function isSameHash(e,t){return e===t||"#"+e===t||e==="#"+t}function getContentTypeName(e,t){var n,o,i,d,s,r,p,l,a,u,v,c,m;if(!e.in)return"request"===e.deps.type&&(null===(i=null===(o=null===(n=e.deps.operation)||void 0===n?void 0:n.requestBody)||void 0===o?void 0:o.content)||void 0===i?void 0:i.mediaTypes)?(null===(r=null===(s=null===(d=e.deps.operation)||void 0===d?void 0:d.requestBody)||void 0===s?void 0:s.content)||void 0===r?void 0:r.mediaTypes.length)>1?(null===(l=null===(p=e.deps.operation)||void 0===p?void 0:p.requestBody)||void 0===l?void 0:l.content)&&(0,mediaContent_1.getActiveMediaType)(e.deps.operation.requestBody.content,t).name:void 0:"response"===e.deps.type&&(null===(u=null===(a=e.deps.response)||void 0===a?void 0:a.content)||void 0===u?void 0:u.mediaTypes)&&(null===(c=null===(v=e.deps.response)||void 0===v?void 0:v.content)||void 0===c?void 0:c.mediaTypes.length)>1?(null===(m=e.deps.response)||void 0===m?void 0:m.content)&&(0,mediaContent_1.getActiveMediaType)(e.deps.response.content,t).name:void 0}function constructFieldDeepFragment(e,t){var n,o;if(!e)return"";const i={t:e.deps.type,in:e.in||e.deps.in,c:"response"===e.deps.type?null===(n=e.deps.response)||void 0===n?void 0:n.code:void 0,cb:(null===(o=e.deps.operation)||void 0===o?void 0:o.isCallback)?e.deps.operation.callbackId:void 0,ct:getContentTypeName(e,t),path:e.fieldFullPath};return utils_1.queryString.stringify(i,{encode:!1,sort:!1})}function joinWithSeparator(e="",t="",n="/"){return e.endsWith(n)&&(e=e.slice(0,-n.length)),t.startsWith(n)&&(t=t.slice(n.length)),e&&t?e+n+t:e+t}function makeDeepLink(e,t){return(`/${e=(0,utils_1.encodeBackSlashes)(e)}#`+joinWithSeparator(e,t)).toLowerCase()}
//# sourceMappingURL=helpers.js.map