/* Socket Lib - Built with esbuild */
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var globs_exports = {};
__export(globs_exports, {
  defaultIgnore: () => defaultIgnore,
  getGlobMatcher: () => getGlobMatcher,
  globStreamLicenses: () => globStreamLicenses
});
module.exports = __toCommonJS(globs_exports);
var import_objects = require("./objects");
const defaultIgnore = (0, import_objects.objectFreeze)([
  // Most of these ignored files can be included specifically if included in the
  // files globs. Exceptions to this are:
  // https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files
  // These can NOT be included.
  // https://github.com/npm/npm-packlist/blob/v10.0.0/lib/index.js#L280
  "**/.git",
  "**/.npmrc",
  // '**/bun.lockb?',
  "**/node_modules",
  // '**/package-lock.json',
  // '**/pnpm-lock.ya?ml',
  // '**/yarn.lock',
  // Include npm-packlist defaults:
  // https://github.com/npm/npm-packlist/blob/v10.0.0/lib/index.js#L15-L38
  "**/.DS_Store",
  "**/.gitignore",
  "**/.hg",
  "**/.lock-wscript",
  "**/.npmignore",
  "**/.svn",
  "**/.wafpickle-*",
  "**/.*.swp",
  "**/._*/**",
  "**/archived-packages/**",
  "**/build/config.gypi",
  "**/CVS",
  "**/npm-debug.log",
  "**/*.orig",
  // Inline generic socket-registry .gitignore entries.
  "**/.env",
  "**/.eslintcache",
  "**/.nvm",
  "**/.tap",
  "**/.vscode",
  "**/*.tsbuildinfo",
  "**/Thumbs.db",
  // Inline additional ignores.
  "**/bower_components"
]);
let _picomatch;
// @__NO_SIDE_EFFECTS__
function getPicomatch() {
  if (_picomatch === void 0) {
    _picomatch = require("../external/picomatch");
  }
  return _picomatch;
}
let _fastGlob;
// @__NO_SIDE_EFFECTS__
function getFastGlob() {
  if (_fastGlob === void 0) {
    const globExport = require("../external/fast-glob");
    _fastGlob = globExport.default || globExport;
  }
  return _fastGlob;
}
// @__NO_SIDE_EFFECTS__
function globStreamLicenses(dirname, options) {
  const {
    ignore: ignoreOpt,
    ignoreOriginals,
    recursive,
    ...globOptions
  } = { __proto__: null, ...options };
  const ignore = [
    ...Array.isArray(ignoreOpt) ? ignoreOpt : defaultIgnore,
    "**/*.{cjs,cts,js,json,mjs,mts,ts}"
  ];
  if (ignoreOriginals) {
    ignore.push(
      /*@__INLINE__*/
      require("../constants/paths").LICENSE_ORIGINAL_GLOB_RECURSIVE
    );
  }
  const fastGlob = /* @__PURE__ */ getFastGlob();
  return fastGlob.globStream(
    [
      recursive ? (
        /*@__INLINE__*/
        require("../constants/paths").LICENSE_GLOB_RECURSIVE
      ) : (
        /*@__INLINE__*/
        require("../constants/paths").LICENSE_GLOB
      )
    ],
    {
      __proto__: null,
      absolute: true,
      caseSensitiveMatch: false,
      cwd: dirname,
      ...globOptions,
      ...ignore ? { ignore } : {}
    }
  );
}
const matcherCache = /* @__PURE__ */ new Map();
// @__NO_SIDE_EFFECTS__
function getGlobMatcher(glob, options) {
  const patterns = Array.isArray(glob) ? glob : [glob];
  const key = JSON.stringify({ patterns, options });
  let matcher = matcherCache.get(key);
  if (matcher) {
    return matcher;
  }
  const positivePatterns = patterns.filter((p) => !p.startsWith("!"));
  const negativePatterns = patterns.filter((p) => p.startsWith("!")).map((p) => p.slice(1));
  const picomatch = /* @__PURE__ */ getPicomatch();
  const matchOptions = {
    dot: true,
    nocase: true,
    ...options,
    ...negativePatterns.length > 0 ? { ignore: negativePatterns } : {}
  };
  matcher = picomatch(
    positivePatterns.length > 0 ? positivePatterns : patterns,
    matchOptions
  );
  matcherCache.set(key, matcher);
  return matcher;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  defaultIgnore,
  getGlobMatcher,
  globStreamLicenses
});
//# sourceMappingURL=globs.js.map
