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 FileSystemAttributes_exports = {};
__export(FileSystemAttributes_exports, {
  FileSystemAttributes: () => FileSystemAttributes
});
module.exports = __toCommonJS(FileSystemAttributes_exports);
class FileSystemAttributes {
  /**
   * Creates a FileSystemAttributes from the specified attributes string. This method will throw an
   * Error if it encounters a string that does not correspond to a valid attributes.
   *
   * @param fileAttributes - The value of header x-ms-file-attributes.
   */
  static parse(fileAttributes) {
    if (!fileAttributes) {
      throw new RangeError(`Invalid fileAttributes: '${fileAttributes}'.`);
    }
    const fileSystemAttributes = new FileSystemAttributes();
    const attributes = fileAttributes.trim().split("|");
    for (let str of attributes) {
      str = str.trim();
      switch (str) {
        case "ReadOnly":
          fileSystemAttributes.readonly = true;
          break;
        case "Hidden":
          fileSystemAttributes.hidden = true;
          break;
        case "System":
          fileSystemAttributes.system = true;
          break;
        case "None":
          fileSystemAttributes.none = true;
          break;
        case "Temporary":
          fileSystemAttributes.temporary = true;
          break;
        case "Offline":
          fileSystemAttributes.offline = true;
          break;
        case "Directory":
          fileSystemAttributes.directory = true;
          break;
        case "Archive":
          fileSystemAttributes.archive = true;
          break;
        case "NotContentIndexed":
          fileSystemAttributes.notContentIndexed = true;
          break;
        case "NoScrubData":
          fileSystemAttributes.noScrubData = true;
          break;
        default:
          throw new RangeError(`Invalid attribute: ${str}`);
      }
    }
    return fileSystemAttributes;
  }
  /**
   * Specifies a directory or file that is read-only.
   */
  readonly = false;
  /**
   * Specifies a directory or file is hidden.
   */
  hidden = false;
  /**
   * Specifies a directory or file that the operating system uses a part of, or uses exclusively.
   */
  system = false;
  /**
   * Specifies a directory or file that does not have other attributes set. This attribute is valid only when used alone.
   */
  none = false;
  /**
   * Specifies the handle identifies a directory.
   */
  directory = false;
  /**
   * Specifies a directory or file is an archive. Applications typically use this attribute to mark files for backup or removal.
   */
  archive = false;
  /**
   * Specifies if a file is temporary.
   */
  temporary = false;
  /**
   * Specifies the data of a directory or file is not available immediately.
   * This file system attribute is presented primarily to provide compatibility with Windows - Azure Files does not support with offline storage options.
   */
  offline = false;
  /**
   * Specifies the directory or file is not to be indexed by the content indexing service.
   */
  notContentIndexed = false;
  /**
   * Specifies the user data stream not to be read by the background data integrity scanner.
   * This file system attribute is presented primarily to provide compatibility with Windows.
   * Applicable to directory or file.
   */
  noScrubData = false;
  /**
   * Converts the given attributes to a string.
   *
   * @returns A string which represents the FileSystemAttributes
   */
  toString() {
    const attributes = [];
    if (this.readonly) {
      attributes.push("ReadOnly");
    }
    if (this.hidden) {
      attributes.push("Hidden");
    }
    if (this.system) {
      attributes.push("System");
    }
    if (this.none) {
      attributes.push("None");
    }
    if (this.temporary) {
      attributes.push("Temporary");
    }
    if (this.directory) {
      attributes.push("Directory");
    }
    if (this.archive) {
      attributes.push("Archive");
    }
    if (this.offline) {
      attributes.push("Offline");
    }
    if (this.notContentIndexed) {
      attributes.push("NotContentIndexed");
    }
    if (this.noScrubData) {
      attributes.push("NoScrubData");
    }
    return attributes.join("|");
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FileSystemAttributes
});
//# sourceMappingURL=FileSystemAttributes.js.map
