"use strict";

exports.__esModule = true;
exports.partialDeepEqual = exports.getBooleanValue = exports.doesObjectContainsTextCaseInsensitive = exports.compareTextCaseInsensitive = exports.compareNumeric = exports.compareBoolean = exports.areGuidsEquals = exports.areEqualCaseInsensitive = void 0;
var _lodash = _interopRequireDefault(require("lodash"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var partialDeepEqual = exports.partialDeepEqual = function partialDeepEqual(x, y, ignoredRootProps) {
  if (ignoredRootProps === void 0) {
    ignoredRootProps = null;
  }
  if (x == null || y == null) return x === y;
  var keys = Object.keys(x);
  if (!_lodash.default.isEqual(keys, Object.keys(y))) {
    return false;
  }
  for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
    var key = _keys[_i];
    if (ignoredRootProps && ignoredRootProps.includes(key)) {
      continue;
    }
    if (!_lodash.default.isEqual(x[key], y[key])) {
      return false;
    }
  }
  return true;
};
var areGuidsEquals = exports.areGuidsEquals = function areGuidsEquals(first, second) {
  function stripDash(value) {
    return value == null ? void 0 : value.replace(/-/g, "");
  }
  return areEqualCaseInsensitive(stripDash(first), stripDash(second));
};
var areEqualCaseInsensitive = exports.areEqualCaseInsensitive = function areEqualCaseInsensitive(first, second) {
  var isFirstNullish = first === null || first === undefined;
  var isSecondNullish = second === null || second === undefined;
  if (isFirstNullish || isSecondNullish) {
    return isFirstNullish && isSecondNullish;
  }
  return first.localeCompare(second, undefined, {
    sensitivity: "accent"
  }) === 0;
};
var processOrderResult = function processOrderResult(ascendingOrder, compareResult) {
  if (!ascendingOrder && compareResult != 0) {
    return compareResult * -1;
  }
  return compareResult;
};
var compareTextCaseInsensitive = exports.compareTextCaseInsensitive = function compareTextCaseInsensitive(first, second, ascendingOrder, nullValue) {
  if (ascendingOrder === void 0) {
    ascendingOrder = true;
  }
  if (nullValue === void 0) {
    nullValue = "";
  }
  return processOrderResult(ascendingOrder, (first != null ? first : nullValue).localeCompare(second != null ? second : nullValue, undefined, {
    sensitivity: "accent"
  }));
};
var getBooleanValue = exports.getBooleanValue = function getBooleanValue(value) {
  var result = null;
  if (typeof value === "string") {
    if (areEqualCaseInsensitive(value, "true")) {
      result = true;
    } else if (areEqualCaseInsensitive(value, "false")) {
      result = false;
    }
  } else if (typeof value === "boolean") {
    result = value === true;
  }
  return result;
};
var compareBoolean = exports.compareBoolean = function compareBoolean(first, second) {
  var firstBool = getBooleanValue(first);
  var secondBool = getBooleanValue(second);
  if (firstBool === null && secondBool === null) {
    return false;
  }
  return firstBool === secondBool;
};
var compareNumeric = exports.compareNumeric = function compareNumeric(first, second, ascendingOrder, nullValue) {
  if (ascendingOrder === void 0) {
    ascendingOrder = true;
  }
  if (nullValue === void 0) {
    nullValue = 0.0;
  }
  if (typeof first === "string" || first instanceof String || typeof second === "string" || second instanceof String) {
    return processOrderResult(ascendingOrder, (first != null ? first : nullValue.toString()).localeCompare(second != null ? second : nullValue.toString(), undefined, {
      numeric: true
    }));
  }
  var result = 0;
  if ((first != null ? first : nullValue) < (second != null ? second : nullValue)) {
    result = -1;
  } else if ((first != null ? first : nullValue) > (second != null ? second : nullValue)) {
    result = 1;
  }
  return processOrderResult(ascendingOrder, result);
};
var doesObjectContainsTextCaseInsensitive = exports.doesObjectContainsTextCaseInsensitive = function doesObjectContainsTextCaseInsensitive(obj, searchTerm, properties) {
  if (properties === void 0) {
    properties = [];
  }
  var caseInsensitiveIncludes = function caseInsensitiveIncludes(a, b) {
    return a == null ? void 0 : a.toLowerCase().includes(b);
  };
  if (!obj) {
    return false;
  }
  if (searchTerm === null || searchTerm === undefined || searchTerm === "") {
    return true;
  }
  var loweredSearchTerm = searchTerm.toLowerCase();
  var propertiesToSearch = properties.length > 0 ? properties : Object.keys(obj);
  var result = propertiesToSearch.find(function (key) {
    if (typeof obj[key] === "string") {
      return caseInsensitiveIncludes(obj[key], loweredSearchTerm);
    }
    if (typeof obj[key] === "object" && obj[key]) {
      var objectValues = Object.values(obj[key]);
      return objectValues.find(function (ovKey) {
        return typeof ovKey === "string" && caseInsensitiveIncludes(ovKey, loweredSearchTerm);
      });
    }
    return false;
  }) !== undefined;
  return result;
};
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(partialDeepEqual, "partialDeepEqual", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(areGuidsEquals, "areGuidsEquals", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(areEqualCaseInsensitive, "areEqualCaseInsensitive", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(processOrderResult, "processOrderResult", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(compareTextCaseInsensitive, "compareTextCaseInsensitive", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(getBooleanValue, "getBooleanValue", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(compareBoolean, "compareBoolean", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(compareNumeric, "compareNumeric", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(doesObjectContainsTextCaseInsensitive, "doesObjectContainsTextCaseInsensitive", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(partialDeepEqual, "partialDeepEqual", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(areGuidsEquals, "areGuidsEquals", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(areEqualCaseInsensitive, "areEqualCaseInsensitive", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(processOrderResult, "processOrderResult", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(compareTextCaseInsensitive, "compareTextCaseInsensitive", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(getBooleanValue, "getBooleanValue", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(compareBoolean, "compareBoolean", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(compareNumeric, "compareNumeric", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
  reactHotLoader.register(doesObjectContainsTextCaseInsensitive, "doesObjectContainsTextCaseInsensitive", "/home/vsts/work/1/s/src/utils/comparisonHelper.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();