// Force strict mode and setup for ESM
"use strict";
import {
  init_esbuild_shims
} from "./chunk-A4BMJM77.js";
import {
  __name
} from "./chunk-J2S4EL5Y.js";

// packages/cli/src/utils/resolvePath.ts
init_esbuild_shims();
import * as os from "node:os";
import * as path from "node:path";
function resolvePath(p) {
  if (!p) {
    return "";
  }
  let expandedPath = p;
  if (p.toLowerCase().startsWith("%userprofile%")) {
    expandedPath = os.homedir() + p.substring("%userprofile%".length);
  } else if (p === "~" || p.startsWith("~/")) {
    expandedPath = os.homedir() + p.substring(1);
  } else if (p.startsWith("~\\")) {
    expandedPath = path.join(
      os.homedir(),
      ...p.substring(2).split(/[/\\]+/).filter(Boolean)
    );
  }
  return path.normalize(expandedPath);
}
__name(resolvePath, "resolvePath");

export {
  resolvePath
};
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
