"use strict";

require("core-js/modules/es.object.define-property.js");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useNamespace = void 0;
require("core-js/modules/es.array.concat.js");
var defaultNamespace = 'fcr';
var statePrefix = 'is-';
var _bem = function _bem(namespace, block, blockSuffix, element, modifier) {
  var cls = "".concat(namespace, "-").concat(block);
  if (blockSuffix) {
    cls += "-".concat(blockSuffix);
  }
  if (element) {
    cls += "__".concat(element);
  }
  if (modifier) {
    cls += "--".concat(modifier);
  }
  return cls;
};
var useNamespace = exports.useNamespace = function useNamespace(block) {
  var namespace = defaultNamespace;
  var b = function b() {
    var blockSuffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
    return _bem(namespace, block, blockSuffix, '', '');
  };
  var e = function e(element) {
    return element ? _bem(namespace, block, '', element, '') : '';
  };
  var m = function m(modifier) {
    return modifier ? _bem(namespace, block, '', '', modifier) : '';
  };
  var be = function be(blockSuffix, element) {
    return blockSuffix && element ? _bem(namespace, block, blockSuffix, element, '') : '';
  };
  var em = function em(element, modifier) {
    return element && modifier ? _bem(namespace, block, '', element, modifier) : '';
  };
  var bm = function bm(blockSuffix, modifier) {
    return blockSuffix && modifier ? _bem(namespace, block, blockSuffix, '', modifier) : '';
  };
  var bem = function bem(blockSuffix, element, modifier) {
    return blockSuffix && element && modifier ? _bem(namespace, block, blockSuffix, element, modifier) : '';
  };
  var is = function is(name) {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    var state = args.length >= 1 ? args[0] : true;
    return name && state ? "".concat(statePrefix).concat(name) : '';
  };
  return {
    namespace: namespace,
    b: b,
    e: e,
    m: m,
    be: be,
    em: em,
    bm: bm,
    bem: bem,
    is: is
  };
};