"use strict";

exports.__esModule = true;
exports.getRequestStateInfo = void 0;

var _reselect = require("reselect");

var _lodash = require("lodash");

var _constants = require("../constants");

(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 requestStateData = function requestStateData(state) {
  return state.get("requestStates");
};

var getRequestStateInfo = function getRequestStateInfo(operation, keys) {
  return (0, _reselect.createSelector)(requestStateData, function (data) {
    var _data$getIn;

    var firstSegment = _constants.requestStateOperationMap[operation];
    return (_data$getIn = data.getIn([firstSegment].concat((0, _lodash.castArray)(keys), ["state"]))) != null ? _data$getIn : {};
  });
};

exports.getRequestStateInfo = getRequestStateInfo;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(requestStateData, "requestStateData", "/home/vsts/work/1/s/src/selectors/requestStates.js");
  reactHotLoader.register(getRequestStateInfo, "getRequestStateInfo", "/home/vsts/work/1/s/src/selectors/requestStates.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(requestStateData, "requestStateData", "/home/vsts/work/1/s/src/selectors/requestStates.js");
  reactHotLoader.register(getRequestStateInfo, "getRequestStateInfo", "/home/vsts/work/1/s/src/selectors/requestStates.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();