import { operationToHar as u } from "@scalar/oas-utils/helpers/operation-to-har";
import { isReference as d } from "@scalar/workspace-store/schemas/v3.1/type-guard";
import { getSnippet as l } from "@scalar/api-client/views/Components/CodeSnippet";
const S = ({
  clientId: t,
  operation: e,
  method: o,
  path: n,
  example: i,
  contentType: p,
  server: s,
  securitySchemes: a
}) => {
  if (d(e))
    return "";
  const c = u({
    operation: e,
    contentType: p,
    method: o,
    path: n,
    server: s,
    securitySchemes: a,
    example: i
  }), [m, f] = t.split("/"), [r, g] = l(m, f, c);
  return r ? r.message ?? "Error generating code snippet" : g;
};
export {
  S as generateCodeSnippet
};
