var c = Object.defineProperty, d = Object.defineProperties;
var f = Object.getOwnPropertyDescriptors;
var i = Object.getOwnPropertySymbols;
var j = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
var n = (e, t, o) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, r = (e, t) => {
  for (var o in t || (t = {}))
    j.call(t, o) && n(e, o, t[o]);
  if (i)
    for (var o of i(t))
      m.call(t, o) && n(e, o, t[o]);
  return e;
}, s = (e, t) => d(e, f(t));
import { isDev as v, isNextGET16 as g } from "@code-inspector/core";
import y from "path";
import { fileURLToPath as b } from "url";
function q(e) {
  if (e.close || !v(e.dev, process.env.NODE_ENV === "development"))
    return {};
  const t = {
    port: 0,
    entry: "",
    output: e.output
  };
  let o = null;
  if (typeof require != "undefined" && typeof require.resolve == "function" && (o = require.resolve("@code-inspector/webpack")), typeof import.meta.resolve == "function") {
    const u = import.meta.resolve(
      "@code-inspector/webpack"
    );
    o = b(u);
  }
  const l = y.resolve(o, ".."), a = [
    "*.jsx",
    "*.tsx",
    "layout.js",
    "layout.ts",
    "page.js",
    "page.ts",
    "loading.js",
    "loading.ts",
    "not-found.js",
    "not-found.ts",
    "error.js",
    "error.ts",
    "global-error.js",
    "global-error.ts",
    "template.js",
    "template.ts",
    "default.js",
    "default.ts"
  ], p = "**/{".concat(a.join(","), "}");
  return {
    [g() ? "**/*.{jsx,tsx,js,ts,mjs,mts}" : p]: {
      loaders: [
        {
          loader: "".concat(l, "/loader.js"),
          options: s(r({}, e), {
            record: t
          })
        },
        {
          loader: "".concat(l, "/inject-loader.js"),
          options: s(r({}, e), {
            record: t
          })
        }
      ]
    }
  };
}
export {
  q as TurbopackCodeInspectorPlugin
};
