"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const extpath = require("./extpath.js");
const network = require("./network.js");
const platform = require("./platform.js");
const resources = require("./resources.js");
const uri = require("./uri.js");
function getBaseLabel(resource) {
  if (!resource) {
    return void 0;
  }
  if (typeof resource === "string") {
    resource = uri.URI.file(resource);
  }
  const base = resources.basename(resource) || (resource.scheme === network.Schemas.file ? resource.fsPath : resource.path);
  if (platform.isWindows && extpath.isRootOrDriveLetter(base)) {
    return normalizeDriveLetter(base);
  }
  return base;
}
function normalizeDriveLetter(path, continueAsWindows) {
  if (extpath.hasDriveLetter(path, continueAsWindows)) {
    return path.charAt(0).toUpperCase() + path.slice(1);
  }
  return path;
}
exports.getBaseLabel = getBaseLabel;
exports.normalizeDriveLetter = normalizeDriveLetter;
