"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("../../../api/user-settings/fetchUserSettings.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@babel/runtime/helpers/defineProperty"),require("../../../../../clients/jsonApi/index.js");var a=n(e),s=n(t),u=function(){var e=a.default(s.default.mark((function e(t,n){var a;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=3;break}return t.setState({loadState:"loaded"}),e.abrupt("return");case 3:return t.setState({loadState:"loading",error:null}),e.prev=4,e.next=7,r.fetchUserSettings(n);case 7:a=e.sent,t.setState({settings:null!=a?a:{},loadState:"loaded",manuallyChanged:a?Object.keys(a).reduce((function(e,t){return e[t]=!0,e}),{}):{}}),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),t.setState({loadState:"error",error:e.t0});case 14:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t,r){return e.apply(this,arguments)}}();exports.loadUserSettings=u;
//# sourceMappingURL=loadUserSettings.js.map
