import CJS_COMPAT_NODE_URL from 'node:url';
import CJS_COMPAT_NODE_PATH from 'node:path';
import CJS_COMPAT_NODE_MODULE from "node:module";

const __filename = CJS_COMPAT_NODE_URL.fileURLToPath(import.meta.url);
const __dirname = CJS_COMPAT_NODE_PATH.dirname(__filename);
const require = CJS_COMPAT_NODE_MODULE.createRequire(import.meta.url);
// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------
import {
  b as r
} from "../_node-chunks/chunk-LGXXNKGQ.js";
import {
  a as o
} from "../_node-chunks/chunk-HRN2KQZP.js";

// src/bin/loader.ts
import { readFile as a } from "node:fs/promises";
import { fileURLToPath as i } from "node:url";
import { transform as d } from "esbuild";
var W = /* @__PURE__ */ o(async (t, e, s) => {
  if (t.endsWith(".ts") || t.endsWith(".tsx") || t.endsWith(".mts") || t.endsWith(".cts") || t.endsWith(".mtsx") || t.endsWith(".ctsx")) {
    let m = await a(i(t), "utf-8");
    return {
      format: "module",
      shortCircuit: !0,
      source: (await d(m, {
        loader: "ts",
        target: r,
        format: "esm",
        platform: "neutral"
      })).code
    };
  }
  return s(t, e);
}, "load");
export {
  W as load
};
