@brigad/redux-rest-easy
Advanced tools
Comparing version 2.9.0 to 2.9.1
@@ -1,1 +0,1 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","react","react-redux"],r):r(e.ReduxRestEasy={},e.React,e.ReactRedux)}(this,function(e,r,t){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(e,r){return e(r={exports:{}},r.exports),r.exports}n(function(e){!function(r){var t,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",s=r.regeneratorRuntime;if(s)e.exports=s;else{(s=r.regeneratorRuntime=e.exports).wrap=b;var f="suspendedStart",d="suspendedYield",l="executing",h="completed",p={},v={};v[u]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(S([])));m&&m!==n&&o.call(m,u)&&(v=m);var g=O.prototype=E.prototype=Object.create(v);C.prototype=g.constructor=O,O.constructor=C,O[c]=C.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===C||"GeneratorFunction"===(r.displayName||r.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(g),e},s.awrap=function(e){return{__await:e}},w(I.prototype),I.prototype[i]=function(){return this},s.AsyncIterator=I,s.async=function(e,r,t,n){var o=new I(b(e,r,t,n));return s.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},w(g),g[c]="Generator",g[u]=function(){return this},g.toString=function(){return"[object Generator]"},s.keys=function(e){var r=[];for(var t in e)r.push(t);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},s.values=S,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return i.type="throw",i.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],i=u.completion;if("root"===u.tryLoc)return n("end");if(this.prev>=u.tryLoc){var c=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(c&&s){if(u.catchLoc>this.prev)return n(u.catchLoc,!0);if(u.finallyLoc>this.prev)return n(u.finallyLoc)}else if(c){if(u.catchLoc>this.prev)return n(u.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(u.finallyLoc>this.prev)return n(u.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}!a||"break"!==e&&"continue"!==e||a.tryLoc>r||r>a.finallyLoc||(a=null);var u=a?a.completion:{};return u.type=e,u.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(u)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),x(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;x(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}}}function b(e,r,t,n){var o=Object.create((r&&r.prototype instanceof E?r:E).prototype),a=new q(n||[]);return o._invoke=function(e,r,t){var n=f;return function(o,a){if(n===l)throw Error("Generator is already running");if(n===h){if("throw"===o)throw a;return k()}for(t.method=o,t.arg=a;;){var u=t.delegate;if(u){var i=R(u,t);if(i){if(i===p)continue;return i}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(n===f)throw n=h,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n=l;var c=A(e,r,t);if("normal"===c.type){if(n=t.done?h:d,c.arg===p)continue;return{value:c.arg,done:t.done}}"throw"===c.type&&(n=h,t.method="throw",t.arg=c.arg)}}}(e,t,a),o}function A(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}function E(){}function C(){}function O(){}function w(e){["next","throw","return"].forEach(function(r){e[r]=function(e){return this._invoke(r,e)}})}function I(e){var r;this._invoke=function(t,n){function a(){return new Promise(function(r,a){!function r(t,n,a,u){var i=A(e[t],e,n);if("throw"!==i.type){var c=i.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(e){r("next",e,a,u)},function(e){r("throw",e,a,u)}):Promise.resolve(s).then(function(e){c.value=e,a(c)},u)}u(i.arg)}(t,n,r,a)})}return r=r?r.then(a,a):a()}}function R(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=A(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function j(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function x(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function q(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function S(e){if(e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}}(function(){return this}()||Function("return this")())});var o=n(function(e,r){var t,n,o,a,u,i,c,s;e.exports=(t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,s=(c=Object.getPrototypeOf)&&c(Object),function e(r,f,d){if("string"!=typeof f){if(s){var l=c(f);l&&l!==s&&e(r,l,d)}var h=a(f);u&&(h=h.concat(u(f)));for(var p=0;h.length>p;++p){var v=h[p];if(!(t[v]||n[v]||d&&d[v])){var y=i(f,v);try{o(r,v,y)}catch(e){}}}return r}return r})}),a=function(e){return function(){var r=e.apply(this,arguments);return new Promise(function(e,t){return function n(o,a){try{var u=r[o](a),i=u.value}catch(e){return void t(e)}if(!u.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}("next")})}},u=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},i=Object.assign||function(e){for(var r=1;arguments.length>r;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},c=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r},s=function(e){return function(r,n){for(var o=arguments.length,a=Array(o>2?o-2:0),u=2;o>u;u++)a[u-2]=arguments[u];return t.connect.apply(void 0,[r,n&&"function"==typeof n?function(){var r=n.apply(void 0,arguments);return Object.keys(r).reduce(function(t,n){var o;return i({},t,((o={})[n]=function(){var t=r[n].apply(r,arguments);return t&&t.__actionName&&t.__requestURL&&(e(t.__actionName,t.__requestURL),delete t.__actionName,delete t.__requestURL),t},o))},{})}:n].concat(a))}},f=function(e,r){return function(t){return{type:e,resourceName:r,resourceId:t}}},d=function(e,r,t){return"@@rest-easy/"+e+"/"+r+"/"+t.toUpperCase()},l=function(e){var r=function(e){return{INVALIDATE_RESOURCE:d(e,"@invalidate","INVALIDATE_RESOURCE"),INVALIDATE_ID:d(e,"@invalidate","INVALIDATE_ID"),RESET_RESOURCE:d(e,"@reset","RESET_RESOURCE")}}(e),t=r.INVALIDATE_ID,n=r.RESET_RESOURCE;return{resource:{invalidate:f(r.INVALIDATE_RESOURCE,e),invalidateId:f(t,e),reset:f(n,e)}}},h=function(e,r){return function(t,n,o,a,u){return{type:r,url:t,resourceId:n,payload:o&&Object.keys(o).length?o:void 0,metadata:a,principalResourceIds:"string"==typeof u?[u]:u,cacheLifetime:e}}},p=function(e,r,t){var n=function(e,r){return{REQUEST:d(e,r,"REQUEST"),RECEIVE:d(e,r,"RECEIVE"),FAIL:d(e,r,"FAIL"),RECEIVE_FROM_CACHE:d(e,r,"RECEIVE_FROM_CACHE")}}(e,r),o=n.RECEIVE,a=n.FAIL,u=n.RECEIVE_FROM_CACHE;return{REQUEST:h(t,n.REQUEST),RECEIVE:h(t,o),FAIL:h(t,a),RECEIVE_FROM_CACHE:h(t,u)}},v=Object.prototype.toString,y=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};var m,g=function(e){var r=function e(r,t){var n,o,a,u,i,c,s;if(!0===r)return"true";if(!1===r)return"false";switch(typeof r){case"object":if(null===r)return null;if(r.toJSON&&"function"==typeof r.toJSON)return e(r.toJSON(),t);if("[object Array]"===(s=v.call(r))){for(a="[",o=r.length-1,n=0;o>n;n++)a+=e(r[n],!0)+",";return o>-1&&(a+=e(r[n],!0)),a+"]"}if("[object Object]"===s){for(o=(u=y(r).sort()).length,a="",n=0;o>n;)void 0!==(c=e(r[i=u[n]],!1))&&(a&&(a+=","),a+=JSON.stringify(i)+":"+c),n++;return"{"+a+"}"}return JSON.stringify(r);case"function":case"undefined":return t?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}(e,!1);if(void 0!==r)return""+r},b=n(function(e,r){var t=Object.prototype.hasOwnProperty,n=function(){for(var e=[],r=0;256>r;++r)e.push("%"+((16>r?"0":"")+r.toString(16)).toUpperCase());return e}();r.arrayToObject=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},n=0;e.length>n;++n)void 0!==e[n]&&(t[n]=e[n]);return t},r.merge=function(e,n,o){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!t.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var a=e;return Array.isArray(e)&&!Array.isArray(n)&&(a=r.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,a){t.call(e,a)?e[a]&&"object"==typeof e[a]?e[a]=r.merge(e[a],n,o):e.push(n):e[a]=n}),e):Object.keys(n).reduce(function(e,a){var u=n[a];return e[a]=t.call(e,a)?r.merge(e[a],u,o):u,e},a)},r.assign=function(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},r.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(r){return e}},r.encode=function(e){if(0===e.length)return e;for(var r="string"==typeof e?e:e+"",t="",o=0;r.length>o;++o){var a=r.charCodeAt(o);45!==a&&46!==a&&95!==a&&126!==a&&(48>a||a>57)&&(65>a||a>90)&&(97>a||a>122)?128>a?t+=n[a]:2048>a?t+=n[192|a>>6]+n[128|63&a]:a>=55296&&57344>a?(a=65536+((1023&a)<<10|1023&r.charCodeAt(o+=1)),t+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]):t+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a]:t+=r.charAt(o)}return t},r.compact=function(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;r.length>n;++n)for(var o=r[n],a=o.obj[o.prop],u=Object.keys(a),i=0;u.length>i;++i){var c=u[i],s=a[c];"object"==typeof s&&null!==s&&-1===t.indexOf(s)&&(r.push({obj:a,prop:c}),t.push(s))}return function(e){for(var r;e.length;){var t=e.pop();if(Array.isArray(r=t.obj[t.prop])){for(var n=[],o=0;r.length>o;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}return r}(r)},r.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},r.isBuffer=function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}}),A=String.prototype.replace,E=/%20/g,C={default:"RFC3986",formatters:{RFC1738:function(e){return A.call(e,E,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},O={brackets:function(e){return e+"[]"},indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},w=Date.prototype.toISOString,I={delimiter:"&",encode:!0,encoder:b.encode,encodeValuesOnly:!1,serializeDate:function(e){return w.call(e)},skipNulls:!1,strictNullHandling:!1},R=function e(r,t,n,o,a,u,i,c,s,f,d,l){var h=r;if("function"==typeof i)h=i(t,h);else if(h instanceof Date)h=f(h);else if(null===h){if(o)return u&&!l?u(t,I.encoder):t;h=""}if("string"==typeof h||"number"==typeof h||"boolean"==typeof h||b.isBuffer(h))return u?[d(l?t:u(t,I.encoder))+"="+d(u(h,I.encoder))]:[d(t)+"="+d(h+"")];var p,v=[];if(void 0===h)return v;if(Array.isArray(i))p=i;else{var y=Object.keys(h);p=c?y.sort(c):y}for(var m=0;p.length>m;++m){var g=p[m];a&&null===h[g]||(v=v.concat(e(h[g],Array.isArray(h)?n(t,g):t+(s?"."+g:"["+g+"]"),n,o,a,u,i,c,s,f,d,l)))}return v},j=function(e,r){var t=e,n=r?b.assign({},r):{};if(null!=n.encoder&&"function"!=typeof n.encoder)throw new TypeError("Encoder has to be a function.");var o=void 0===n.delimiter?I.delimiter:n.delimiter,a="boolean"==typeof n.strictNullHandling?n.strictNullHandling:I.strictNullHandling,u="boolean"==typeof n.skipNulls?n.skipNulls:I.skipNulls,i="boolean"==typeof n.encode?n.encode:I.encode,c="function"==typeof n.encoder?n.encoder:I.encoder,s="function"==typeof n.sort?n.sort:null,f=void 0!==n.allowDots&&n.allowDots,d="function"==typeof n.serializeDate?n.serializeDate:I.serializeDate,l="boolean"==typeof n.encodeValuesOnly?n.encodeValuesOnly:I.encodeValuesOnly;if(void 0===n.format)n.format=C.default;else if(!Object.prototype.hasOwnProperty.call(C.formatters,n.format))throw new TypeError("Unknown format option provided.");var h,p,v=C.formatters[n.format];"function"==typeof n.filter?t=(p=n.filter)("",t):Array.isArray(n.filter)&&(h=p=n.filter);var y=[];if("object"!=typeof t||null===t)return"";var m=O[n.arrayFormat in O?n.arrayFormat:"indices"in n?n.indices?"indices":"repeat":"indices"];h||(h=Object.keys(t)),s&&h.sort(s);for(var g=0;h.length>g;++g){var A=h[g];u&&null===t[A]||(y=y.concat(R(t[A],A,m,a,u,i?c:null,p,s,f,d,v,l)))}var E=y.join(o);return E.length>0?(!0===n.addQueryPrefix?"?":"")+E:""},x=function(e){var r,t=(r=e)&&Object.keys(r)?j(r):"";return t?"?"+t:""},q=function(e){return e&&e.restEasy?e.restEasy:(console.error('\n There doesn\'t seem to be a "restEasy" key in your state.\n\n For more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/reducer.md#reducer\n '),null)},S=function(e){return"never"!==e&&(!e||new Date>new Date(e))},k=function(e){return"number"==typeof e?""+e:e},_=function(e,r){return k(e)===k(r)},T=function(e,r){return!!e&&e.map(k).includes(k(r))},L=function(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;r>n;n++)t[n-1]=arguments[n];if(e&&"function"==typeof e)return e.apply(void 0,t)},N=window,F={getToken:function(){return"token"},requestGET:function(){var e=this;return a(regeneratorRuntime.mark(function r(){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=e.getToken,!r.t0){r.next=5;break}return r.next=4,e.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"GET",headers:i({Accept:"application/json"},(t=r.t0)?{Authorization:"Bearer "+t}:{})});case 7:case"end":return r.stop()}},r,e)}))()},requestPATCH:function(e){var r=this;return a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.getToken,!t.t0){t.next=5;break}return t.next=4,r.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"PATCH",headers:i({Accept:"application/json","Content-Type":"application/json"},(n=t.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return t.stop()}},t,r)}))()},requestPUT:function(e){var r=this;return a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.getToken,!t.t0){t.next=5;break}return t.next=4,r.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"PUT",headers:i({Accept:"application/json","Content-Type":"application/json"},(n=t.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return t.stop()}},t,r)}))()},requestPOST:function(e){var r=this;return a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.getToken,!t.t0){t.next=5;break}return t.next=4,r.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"POST",headers:i({Accept:"application/json","Content-Type":"application/json"},(n=t.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return t.stop()}},t,r)}))()},requestDELETE:function(){var e=this;return a(regeneratorRuntime.mark(function r(){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=e.getToken,!r.t0){r.next=5;break}return r.next=4,e.getToken();case 4:r.t0=r.sent;case 5:return t=r.t0,r.abrupt("return",{method:"DELETE",headers:i({Accept:"application/json"},e.getToken&&e.getToken()?{Authorization:"Bearer "+t}:{})});case 7:case"end":return r.stop()}},r,e)}))()},handleStatusCode:function(e){if(e){if(e.status>=200&&300>e.status)return e;var r=Error(e.statusText);throw r.response=e,r}return null},handleError:(m=a(regeneratorRuntime.mark(function e(r,t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!r||!r.response){e.next=8;break}return e.next=4,r.response.json();case 4:console.error(e.sent),e.next=9;break;case 8:console.error(r);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:case"end":return e.stop()}},e,N,[[0,11]])})),function(e,r){return m.apply(this,arguments)})},P=F,H=function(){return P},D=window,U=function(e,r,t,n,o,u,c,s){return function(e,f,d){return function(){var l,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},p=h.query,v=void 0===p?{}:p,y=h.body,m=void 0===y?{}:y,g=h.urlParams,b=void 0===g?{}:g,A=h.onSuccess,E=h.onError,C=function(e,r){var t={};for(var n in e)0>r.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(h,["query","body","urlParams","onSuccess","onError"]);return l=a(regeneratorRuntime.mark(function a(l,h){var p,y,g,O,w,I,R,j;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return p=i({},H(),s||{}),l(r.REQUEST(f,d)),a.prev=2,a.next=5,L(n,b,v,m,C,l);case 5:return y=a.sent||m,a.t0=fetch,a.t1=e,a.next=11,p["request"+t](y);case 11:return a.t2=a.sent,a.next=14,(0,a.t0)(a.t1,a.t2);case 14:if(p.handleStatusCode(g=a.sent),204===g.status){a.next=22;break}return a.next=19,g.json();case 19:a.t3=a.sent,a.next=23;break;case 22:a.t3={};case 23:return O=a.t3,w=o?o(O,q(h()).resources,b,v,y,C):{entities:O},I=w.entities,R=w.result,j=u?u(O,q(h()).resources,b,v,y,C):null,l(r.RECEIVE(f,d,I,j,Array.isArray(R)?R:[R])),a.next=30,L(c,I||{},b,v,y,C,l);case 30:return L(A,I||{},C),a.abrupt("return",{normalizedPayload:I||{},otherArgs:C});case 34:return a.prev=34,a.t4=a.catch(2),l(r.FAIL(f,d)),p.handleError(a.t4,l),L(E,a.t4),a.abrupt("return",{error:a.t4});case 40:case"end":return a.stop()}},a,D,[[2,34]])})),function(e,r){return l.apply(this,arguments)}}}},V=function(e,r,t,n){var o=t[n],a=o.method,u=o.url,i=o.cacheHint,c=o.beforeHook,s=o.normalizer,f=o.metadataNormalizer,d=o.afterHook,l=o.networkHelpers,h=p(e,n,r),v=U(0,h,a,c,s,f,d,l);return function(r){return function(t,o){var c=q(o()),s=r||{},f=s.urlParams,d=s.query,l=s.body,p=s.otherArgs,y=function(e){var r=("string"!=typeof e?e():e).split("/").reverse(),t=r.findIndex(function(e){return e.startsWith("::")});return-1!==t?r.length-1-t:-1}(u),m=function(e,r,t){var n="string"!=typeof e?e():e;r&&Object.keys(r).forEach(function(e){n=n.replace("::"+e,r[e]).replace(":"+e,r[e])});var o=t?x(JSON.parse(g(t))):"";return""+n+o}(u,f,d),b=i?i(f,d,l,p):null,A=function(e,r,t){return(e||"")+(r?":"+r:"")+(t?":"+x(t):"")}(n,m,b),E=function(e,r){if(!e||!r&&0!==r||-1===r)return null;for(var t=0,n=0;r>n;n+=1)t=e.indexOf("/",t+1);var o=e.indexOf("/",t+1);return e.substr(t+1,-1!==o?o-t-1:e.length)}(A,y),C=void 0;(function(e,r){return!(e&&r&&e.requests&&e.requests[r]&&!e.requests[r].endedAt)})(c,A)&&function(e,r,t){if(!("GET"===r&&e&&t&&e.requests&&e.requests[t]))return!0;var n=e.requests[t];return!n.hasSucceeded||n.didInvalidate||S(n.expireAt)}(c,a,A)&&(C=function(e,r,t,n){return!!("GET"===r&&e&&e.requests&&t&&null!==n)&&Object.values(e.requests).some(function(e){var r=e.expireAt,o=e.payloadIds;return e.hasSucceeded&&!e.didInvalidate&&(t===e.resourceName&&_(n,e.resourceId)||o&&o[t]&&T(o[t],n))&&!S(r)})}(c,a,e,E)?function(){var r,n;return t(h.RECEIVE_FROM_CACHE(A,E,((n={})[e]=((r={})[E]=null,r),n),null,[E]))}:function(){return t(v(m,A,E)(r))});var O=C?C():{};return O.__actionName=n,O.__requestURL=A,O}}},B=function(e,r,t,n){var o,a=function(e){return{INVALIDATE_REQUEST:d(e,"@invalidate","INVALIDATE_REQUEST")}}(e).INVALIDATE_REQUEST;return(o={})[n]={perform:V(e,r,t,n),invalidate:function(e,r){return function(t){return{type:e,url:t,resourceName:r}}}(a,e)},o},z=function(e){return"object"==typeof(r=e)&&null!==r&&!Array.isArray(e);var r},G=function(e){return function(r){throw Error("redux-rest-easy: "+e+" "+r)}},M=function(e){return"string"==typeof e},Q=function(e){return"function"==typeof e},J=function(e){return void 0!==e},K=["method","url"],Y=[].concat(K,["cacheHint","beforeHook","normalizer","metadataNormalizer","afterHook","networkHelpers"]),W=["GET","POST","PATCH","PUT","DELETE"],X=function(e){return e+" >"},Z=function(e,r){return e+' "'+r+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'},$=function(e,r){if(r){if(!z(r)||!Object.keys(r).length)G(X(e)+" createResource >")("You have to provide a valid actions configuration.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource.md#createresourceresourcename-optionsactions");Object.keys(r).forEach(function(t){var n=G(X(e)+" "+function(e){return e+" >"}(t)+" createResource >"),o=r[t],a=Object.keys(o);K.forEach(function(e){a.includes(e)||n('Key "'+e+'" is missing.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')}),a.forEach(function(e){Y.includes(e)||n(function(e){return'Unknown key "'+e+'".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(e))});var u=o.method,i=o.url,c=o.cacheHint,s=o.beforeHook,f=o.normalizer,d=o.metadataNormalizer,l=o.afterHook,h=o.networkHelpers;M(u)&&W.includes(u)||n(function(e){return'Method "'+e+'" is invalid. Expected one of: '+W.join(", ")+".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig"}(u)),i&&(M(i)||Q(i))||n(function(e){return'URL "'+e+'" is invalid. Expected a string or a function returning a string.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(i)),J(c)&&!Q(c)&&n(Z("cacheHint",c)),J(s)&&!Q(s)&&n(Z("beforeHook",s)),J(f)&&!Q(f)&&n(Z("normalizer",f)),J(d)&&!Q(d)&&n(Z("metadataNormalizer",d)),J(l)&&!Q(l)&&n(Z("afterHook",l)),J(h)&&!z(h)&&n("networkHelpers"+' "'+h+'" is invalid. Expected a valid object.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'),Object.keys(h||{}).forEach(function(e){J(h[e])&&!Q(h[e])&&n(e+' "networkHelpers.'+h[e]+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')})})}},ee=function(e){return void 0!==e},re=["cacheLifetime","denormalizer"],te=function(e,r){var t,n=(t=function(e){return e+" >"}(e||"[no resource name]")+" createResource >",function(e){throw Error("redux-rest-easy: "+t+" "+e)});if(e&&"string"==typeof e||n("You have to provide a valid resource name."),r){z(r)&&Object.keys(r).length||n("You have to provide a valid resource configuration (or not at all)."),Object.keys(r).forEach(function(e){re.includes(e)||n(function(e){return'Unknown key "'+e+'" in resource config.'}(e))});var o=r.cacheLifetime,a=r.denormalizer;!ee(o)||function(e){return"number"==typeof e}(o)&&o>=0||n(function(e){return'cacheLifetime "'+e+'" in resource config is invalid. Expected a number between 0 and Infinity.'}(o)),ee(a)&&!function(e){return"function"==typeof e}(a)&&n(function(e,r){return e+' "'+r+'" in resource config is invalid. Expected a valid function.'}("denormalizer",a))}};function ne(e,r){return e===r}function oe(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne,t=null,n=null;return function(){return function(e,r,t){if(null===r||null===t||r.length!==t.length)return!1;for(var n=r.length,o=0;n>o;o++)if(!e(r[o],t[o]))return!1;return!0}(r,t,arguments)||(n=e.apply(null,arguments)),t=arguments,n}}function ae(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;r>n;n++)t[n-1]=arguments[n];return function(){for(var r=arguments.length,n=Array(r),o=0;r>o;o++)n[o]=arguments[o];var a=0,u=n.pop(),i=function(e){var r=Array.isArray(e[0])?e[0]:e;if(!r.every(function(e){return"function"==typeof e})){var t=r.map(function(e){return typeof e}).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+t+"]")}return r}(n),c=e.apply(void 0,[function(){return a++,u.apply(null,arguments)}].concat(t)),s=oe(function(){for(var e=[],r=i.length,t=0;r>t;t++)e.push(i[t].apply(null,arguments));return c.apply(null,e)});return s.resultFunc=u,s.recomputations=function(){return a},s.resetRecomputations=function(){return a=0},s}}var ue=ae(oe);var ie=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},ce=function(){function e(){ie(this,e),this._cache={}}return e.prototype.set=function(e,r){this._cache[e]=r},e.prototype.get=function(e){return this._cache[e]},e.prototype.remove=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}},e.prototype.isValidCacheKey=function(e){return"string"==typeof(r=e)||"number"==typeof r;var r},e}(),se=function(){return!0};function fe(){for(var e=arguments.length,r=Array(e),t=0;e>t;t++)r[t]=arguments[t];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"==typeof t)throw Error('[re-reselect] Second argument "options" must be an object. Please use "options.selectorCreator" to provide a custom selectorCreator.');var n=t.cacheObject||new ce,o=t.selectorCreator||ue,a=n.isValidCacheKey||se,u=function(){var t=e.apply(void 0,arguments);if(a(t)){var u=n.get(t);return void 0===u&&(u=o.apply(void 0,r),n.set(t,u)),u.apply(void 0,arguments)}console.warn('[re-reselect] Invalid cache key "'+t+'" has been returned by resolver function.')};return u.getMatchingSelector=function(){var r=e.apply(void 0,arguments);return n.get(r)},u.removeMatchingSelector=function(){var r=e.apply(void 0,arguments);n.remove(r)},u.clearCache=function(){n.clear()},u.resultFunc=r[r.length-1],u}}var de=function(e){return e.split(":")[0]},le=function(e,r,t){return t?t.__requestURLsByActionKey?t.__requestURLsByActionKey[r]:(console.error("You may have forgotten to use redux-rest-easy's connect on a Component which requested "+e+"."+r+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/connect.md#connectconnectargs"),""):(console.error("You may have forgotten to pass ownProps to a selector related to "+e+"."+r+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/selectors.md#actionrequest"),"")},he={selectorCreator:ae(function(e){var r=null;return function(){return r||(r=e.apply(void 0,arguments)),r}})},pe=function(){return he},ve=function(e,r,t){return r?Object.keys(r).reduce(function(n,o){var a;return i({},n,((a={})[o]=o===e?t:Object.keys(r[o]||{}),a))},{}):{}},ye=n(function(e,r){!function(t,n){var o={version:"2.1.2",x86:{},x64:{}};function a(e,r){return(65535&e)*r+(((e>>>16)*r&65535)<<16)}function u(e,r){return e<<r|e>>>32-r}function i(e){return e=a(e^=e>>>16,2246822507),e=a(e^=e>>>13,3266489909),e^=e>>>16}function c(e,r){var t=[0,0,0,0];return t[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]+(r=[r[0]>>>16,65535&r[0],r[1]>>>16,65535&r[1]])[3],t[2]+=t[3]>>>16,t[3]&=65535,t[2]+=e[2]+r[2],t[1]+=t[2]>>>16,t[2]&=65535,t[1]+=e[1]+r[1],t[0]+=t[1]>>>16,t[1]&=65535,t[0]+=e[0]+r[0],t[0]&=65535,[t[0]<<16|t[1],t[2]<<16|t[3]]}function s(e,r){var t=[0,0,0,0];return t[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]*(r=[r[0]>>>16,65535&r[0],r[1]>>>16,65535&r[1]])[3],t[2]+=t[3]>>>16,t[3]&=65535,t[2]+=e[2]*r[3],t[1]+=t[2]>>>16,t[2]&=65535,t[2]+=e[3]*r[2],t[1]+=t[2]>>>16,t[2]&=65535,t[1]+=e[1]*r[3],t[0]+=t[1]>>>16,t[1]&=65535,t[1]+=e[2]*r[2],t[0]+=t[1]>>>16,t[1]&=65535,t[1]+=e[3]*r[1],t[0]+=t[1]>>>16,t[1]&=65535,t[0]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0],t[0]&=65535,[t[0]<<16|t[1],t[2]<<16|t[3]]}function f(e,r){return 32===(r%=64)?[e[1],e[0]]:32>r?[e[0]<<r|e[1]>>>32-r,e[1]<<r|e[0]>>>32-r]:[e[1]<<(r-=32)|e[0]>>>32-r,e[0]<<r|e[1]>>>32-r]}function d(e,r){return 0===(r%=64)?e:32>r?[e[0]<<r|e[1]>>>32-r,e[1]<<r]:[e[1]<<r-32,0]}function l(e,r){return[e[0]^r[0],e[1]^r[1]]}function h(e){return e=l(e=s(e=l(e=s(e=l(e,[0,e[0]>>>1]),[4283543511,3981806797]),[0,e[0]>>>1]),[3301882366,444984403]),[0,e[0]>>>1])}o.x86.hash32=function(e,r){for(var t=(e=e||"").length%4,n=e.length-t,o=r=r||0,c=0,s=3432918353,f=461845907,d=0;n>d;d+=4)o=a(o=u(o^=c=a(c=u(c=a(c=255&e.charCodeAt(d)|(255&e.charCodeAt(d+1))<<8|(255&e.charCodeAt(d+2))<<16|(255&e.charCodeAt(d+3))<<24,s),15),f),13),5)+3864292196;switch(c=0,t){case 3:c^=(255&e.charCodeAt(d+2))<<16;case 2:c^=(255&e.charCodeAt(d+1))<<8;case 1:o^=c=a(c=u(c=a(c^=255&e.charCodeAt(d),s),15),f)}return(o=i(o^=e.length))>>>0},o.x86.hash128=function(e,r){for(var t=(e=e||"").length%16,n=e.length-t,o=r=r||0,c=r,s=r,f=r,d=0,l=0,h=0,p=0,v=597399067,y=2869860233,m=951274213,g=2716044179,b=0;n>b;b+=16)d=255&e.charCodeAt(b)|(255&e.charCodeAt(b+1))<<8|(255&e.charCodeAt(b+2))<<16|(255&e.charCodeAt(b+3))<<24,l=255&e.charCodeAt(b+4)|(255&e.charCodeAt(b+5))<<8|(255&e.charCodeAt(b+6))<<16|(255&e.charCodeAt(b+7))<<24,h=255&e.charCodeAt(b+8)|(255&e.charCodeAt(b+9))<<8|(255&e.charCodeAt(b+10))<<16|(255&e.charCodeAt(b+11))<<24,p=255&e.charCodeAt(b+12)|(255&e.charCodeAt(b+13))<<8|(255&e.charCodeAt(b+14))<<16|(255&e.charCodeAt(b+15))<<24,o=u(o^=d=a(d=u(d=a(d,v),15),y),19),o=a(o+=c,5)+1444728091,c=u(c^=l=a(l=u(l=a(l,y),16),m),17),c=a(c+=s,5)+197830471,s=u(s^=h=a(h=u(h=a(h,m),17),g),15),s=a(s+=f,5)+2530024501,f=u(f^=p=a(p=u(p=a(p,g),18),v),13),f=a(f+=o,5)+850148119;switch(d=0,l=0,h=0,p=0,t){case 15:p^=e.charCodeAt(b+14)<<16;case 14:p^=e.charCodeAt(b+13)<<8;case 13:f^=p=a(p=u(p=a(p^=e.charCodeAt(b+12),g),18),v);case 12:h^=e.charCodeAt(b+11)<<24;case 11:h^=e.charCodeAt(b+10)<<16;case 10:h^=e.charCodeAt(b+9)<<8;case 9:s^=h=a(h=u(h=a(h^=e.charCodeAt(b+8),m),17),g);case 8:l^=e.charCodeAt(b+7)<<24;case 7:l^=e.charCodeAt(b+6)<<16;case 6:l^=e.charCodeAt(b+5)<<8;case 5:c^=l=a(l=u(l=a(l^=e.charCodeAt(b+4),y),16),m);case 4:d^=e.charCodeAt(b+3)<<24;case 3:d^=e.charCodeAt(b+2)<<16;case 2:d^=e.charCodeAt(b+1)<<8;case 1:o^=d=a(d=u(d=a(d^=e.charCodeAt(b),v),15),y)}return o^=e.length,o+=c^=e.length,o+=s^=e.length,c+=o+=f^=e.length,s+=o,f+=o,o=i(o),o+=c=i(c),o+=s=i(s),c+=o+=f=i(f),s+=o,f+=o,("00000000"+(o>>>0).toString(16)).slice(-8)+("00000000"+(c>>>0).toString(16)).slice(-8)+("00000000"+(s>>>0).toString(16)).slice(-8)+("00000000"+(f>>>0).toString(16)).slice(-8)},o.x64.hash128=function(e,r){for(var t=(e=e||"").length%16,n=e.length-t,o=[0,r=r||0],a=[0,r],u=[0,0],i=[0,0],p=[2277735313,289559509],v=[1291169091,658871167],y=0;n>y;y+=16)u=[255&e.charCodeAt(y+4)|(255&e.charCodeAt(y+5))<<8|(255&e.charCodeAt(y+6))<<16|(255&e.charCodeAt(y+7))<<24,255&e.charCodeAt(y)|(255&e.charCodeAt(y+1))<<8|(255&e.charCodeAt(y+2))<<16|(255&e.charCodeAt(y+3))<<24],i=[255&e.charCodeAt(y+12)|(255&e.charCodeAt(y+13))<<8|(255&e.charCodeAt(y+14))<<16|(255&e.charCodeAt(y+15))<<24,255&e.charCodeAt(y+8)|(255&e.charCodeAt(y+9))<<8|(255&e.charCodeAt(y+10))<<16|(255&e.charCodeAt(y+11))<<24],o=c(s(o=c(o=f(o=l(o,u=s(u=f(u=s(u,p),31),v)),27),a),[0,5]),[0,1390208809]),a=c(s(a=c(a=f(a=l(a,i=s(i=f(i=s(i,v),33),p)),31),o),[0,5]),[0,944331445]);switch(u=[0,0],i=[0,0],t){case 15:i=l(i,d([0,e.charCodeAt(y+14)],48));case 14:i=l(i,d([0,e.charCodeAt(y+13)],40));case 13:i=l(i,d([0,e.charCodeAt(y+12)],32));case 12:i=l(i,d([0,e.charCodeAt(y+11)],24));case 11:i=l(i,d([0,e.charCodeAt(y+10)],16));case 10:i=l(i,d([0,e.charCodeAt(y+9)],8));case 9:a=l(a,i=s(i=f(i=s(i=l(i,[0,e.charCodeAt(y+8)]),v),33),p));case 8:u=l(u,d([0,e.charCodeAt(y+7)],56));case 7:u=l(u,d([0,e.charCodeAt(y+6)],48));case 6:u=l(u,d([0,e.charCodeAt(y+5)],40));case 5:u=l(u,d([0,e.charCodeAt(y+4)],32));case 4:u=l(u,d([0,e.charCodeAt(y+3)],24));case 3:u=l(u,d([0,e.charCodeAt(y+2)],16));case 2:u=l(u,d([0,e.charCodeAt(y+1)],8));case 1:o=l(o,u=s(u=f(u=s(u=l(u,[0,e.charCodeAt(y)]),p),31),v))}return o=l(o,[0,e.length]),a=c(a=l(a,[0,e.length]),o=c(o,a)),o=h(o),a=c(a=h(a),o=c(o,a)),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)},e.exports&&(r=e.exports=o),r.murmurHash3=o}()}),me=ye,ge=n(function(e){e.exports={v3:me},function(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}.main===e&&console.log(e.exports.v3)}).v3,be=function(e){return ge.x64.hash128(g(e||null))},Ae=be([]),Ee=function(e,r,t,n,o){var a,u,c=e.requests,s=void 0===c?{}:c,f=e.resources,d=void 0===f?{}:f,l=e.resolversHashes,h=void 0===l?{}:l,p=ve(r,n,o);return i({},h,{requests:i({},h.requests||{},(a={},a[t]=Object.keys(p).reduce(function(e,r){var n;return i({},e,((n={})[r]=s[t]&&s[t].payloadIds&&s[t].payloadIds[r]?be(s[t].payloadIds[r]):Ae,n))},{}),a)),resources:i({},h.resources||{},(u={_getResourcesHash:function(){return be(d)}},u[r]=d[r]?be(d[r]):Ae,u))})},Ce=function(){return Ae},Oe=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,r=void 0===e?{}:e,t=arguments[1],n=arguments[2];return r.requests&&r.requests[t]&&r.requests[t][n]?r.requests[t][n]:Ae},we=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,r=void 0===e?{}:e,t=arguments[1];return r.resources&&r.resources[t]?r.resources[t]:Ae},Ie=[],Re=function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;return!!e.requests&&Object.entries(e.requests).some(function(e){var o=e[1],a=o.resourceName,u=o.resourceId,i=o.endedAt;return de(e[0])===t&&a===r&&(-1===n||null!==u&&_(u,n))&&!i})},je=function(e,r,t,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.requests&&Object.entries(e.requests).filter(function(e){var n=e[1],a=n.resourceName,u=n.resourceId,i=n.endedAt,c=n.payloadIds;return de(e[0])===t&&a===r&&(-1===o||null!==u&&_(u,o)||!!i&&c&&c[r]&&T(c[r],o))}).map(function(e){return e[1]});return!(!a||!a.length)&&a.reduce(function(e,r){return r.endedAt&&e.endedAt&&r.endedAt>e.endedAt?r:e},a[0])[n]},xe=function(e,r){return e.resources&&e.resources[r]?e.resources[r]:null},qe=function(e,r,t){return e.requests&&e.requests[t]&&e.requests[t].payloadIds&&e.requests[t].payloadIds[r]?e.requests[t].payloadIds[r]:null},Se=fe(function(e){return e.resources},xe,qe,function(e,r,t,n){return n},function(e,r,t,n,o){return o},function(e,r,t,n,o){return r&&t?n&&o?o(t,e):t.reduce(function(e,t){return[].concat(e,[r[t]])},[]):Ie})(function(e,r,t,n,o){var a=xe(e,r),u=qe(e,r,t);return a&&u?n&&o?!(!n||!o)+"-"+Object.keys(e.requests[t].payloadIds).map(function(r){return Oe(e,t,r)+"-"+we(e,r)}).join("--"):!(!n||!o)+"-"+Oe(e,t,r)+"-"+we(e,r):Ce()},pe()),ke=function(e,r){return!(!e.requests||!e.requests[r]||e.requests[r].endedAt)},_e=function(e,r,t){return!!(e.requests&&e.requests[r]&&e.requests[r][t])},Te=[],Le=function(e,r){return e.resources&&e.resources[r]?e.resources[r]:null},Ne=fe(function(e){return e.resources},Le,function(e,r,t){return t},function(e,r,t,n){return n},function(e,r,t,n){return r?t&&n?n(Object.keys(r),e):Object.values(r):Te})(function(e,r,t,n){return Le(e,r)?t&&n?!(!t||!n)+"-"+function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,r=void 0===e?{}:e;return r.resources&&r.resources._getResourcesHash?r.resources._getResourcesHash():Ae}(e):!(!t||!n)+"-"+we(e,r):Ce()},pe()),Fe=function(e,r){return{resource:{getResource:function(t){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return Ne(q(t),e,n,r)},getResourceById:function(t,n){var o=2>=arguments.length||void 0===arguments[2]||arguments[2];return function(e,r,t,n,o){var a=e.resources&&e.resources[r]&&e.resources[r][t]?e.resources[r][t]:null;if(!n||!o||!a)return a;var u=Object.entries(e.resources).reduce(function(e,n){var o,u,c=n[0],s=n[1];return i({},e,((u={})[c]=c===r?((o={})[t]=a,o):s,u))},{});return o([t],u)[0]||null}(q(t),e,n,o,r)}}}},Pe=function(e){var r=e.split("/");return{resourceName:r[1],actionName:r[2],caseName:r[3]}},He={},De={REQUEST:function(e,r){var t,n=r.url,o=r.resourceId;return i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{resourceName:Pe(r.type).resourceName,resourceId:o,startedAt:(new Date).toISOString(),endedAt:null,expireAt:null,hasSucceeded:!(!e.requests||!e.requests[n])&&!!e.requests[n].hasSucceeded,hasFailed:!(!e.requests||!e.requests[n])&&!!e.requests[n].hasFailed,didInvalidate:!(!e.requests||!e.requests[n])&&!!e.requests[n].didInvalidate,fromCache:!(!e.requests||!e.requests[n])&&!!e.requests[n].fromCache}),t))})},RECEIVE:function(e,r){var t,n=r.url,o=r.payload,a=r.principalResourceIds,u=r.metadata,c=r.cacheLifetime,s=void 0===c?0:c,f=Pe(r.type).resourceName,d=i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),expireAt:s!==1/0?new Date((new Date).getTime()+1e3*s).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!1,payloadIds:ve(f,o,a),metadata:u}),t)),resources:function(e,r){var t=e&&e.resources?e.resources:{};return r&&z(r)?Object.entries(r).reduce(function(e,r){var n,o=r[0];return i({},e,((n={})[o]=i({},t[o]||{},r[1]),n))},t):t}(e,o)});return i({},d,{resolversHashes:Ee(d,f,n,o,a)})},FAIL:function(e,r){var t,n=r.url;return i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),hasSucceeded:!1,hasFailed:!0}),t))})},RECEIVE_FROM_CACHE:function(e,r){var t,n=r.type,o=r.url,a=r.resourceId,u=r.payload,c=r.principalResourceIds,s=r.metadata,f=r.cacheLifetime,d=void 0===f?0:f,l=Pe(n).resourceName,h=i({},e,{requests:i({},e.requests||{},(t={},t[o]=i({},e.requests&&e.requests[o]?e.requests[o]:{},{resourceName:Pe(n).resourceName,resourceId:a,startedAt:(new Date).toISOString(),endedAt:(new Date).toISOString(),expireAt:d!==1/0?new Date((new Date).getTime()+1e3*d).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!0,payloadIds:ve(l,u,c),metadata:s}),t))});return i({},h,{resolversHashes:Ee(h,l,o,u,c)})},INVALIDATE_RESOURCE:function(e,r){var t=r.resourceName;return i({},e,{requests:i({},Object.entries(e.requests||{}).reduce(function(e,r){var n,o=r[1];return i({},e,((n={})[r[0]]=!o.didInvalidate&&(o.resourceName===t||o.payloadIds&&o.payloadIds[t])?i({},o,{didInvalidate:!0}):o,n))},{}))})},INVALIDATE_ID:function(e,r){var t=r.resourceName,n=r.resourceId;return i({},e,{requests:i({},Object.entries(e.requests||{}).reduce(function(e,r){var o,a=r[1];return i({},e,((o={})[r[0]]=!a.didInvalidate&&(a.resourceName===t&&_(a.resourceId,n)||a.payloadIds&&a.payloadIds[t]&&T(a.payloadIds[t],n))?i({},a,{didInvalidate:!0}):a,o))},{}))})},INVALIDATE_REQUEST:function(e,r){var t,n=r.url;return i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{didInvalidate:!0}),t))})},RESET_RESOURCE:function(e,r){var t,n=r.resourceName,o=i({},e,{requests:i({},Object.entries(e.requests||{}).filter(function(e){var r=e[1],t=r.payloadIds;return!(n===r.resourceName||t&&Object.keys(t).includes(n))}).reduce(function(e,r){var t;return i({},e,((t={})[r[0]]=r[1],t))},{})),resources:i({},e.resources||{},(t={},t[n]=void 0,t))});return i({},o,{resolversHashes:function(e,r){var t,n=e.requests,o=void 0===n?{}:n,a=e.resolversHashes,u=void 0===a?{}:a;return i({},u,{requests:i({},Object.entries(u.requests||{}).reduce(function(e,r){var t,n=r[0],a=r[1];return i({},e,Object.keys(o).includes(n)?((t={})[n]=a,t):{})},{})),resources:i({},u.resources||{},(t={},t[r]=Ae,t))})}(o,n)})},RESET_ALL:function(){return{}}},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:He;return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===r)return e;if(!t.type||!t.type.startsWith("@@rest-easy"))return r;var n=De[Pe(t.type).caseName];return n?n(r,t):r}}(),Ve=function(){var e,r={RESET_ALL:d("@global","@reset","RESET_ALL")};return{resetAll:(e=r.RESET_ALL,function(){return{type:e}})}};e.connect=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",a=function(n){function o(r){u(this,o);var a=c(this,n.call(this,r));return a.onInjectProps=function(e,r){a.setState(function(t){var n;return t.__requestURLsByActionKey[e]!==r?{__requestURLsByActionKey:i({},t.__requestURLsByActionKey,(n={},n[e]=r,n))}:null})},a.getWrappedInstance=function(){return a.innerRef&&a.innerRef.getWrappedInstance?a.innerRef.getWrappedInstance():null},a.state={__requestURLsByActionKey:{}},a.ConnectedComponent=s(a.onInjectProps).apply(void 0,t)(e),a}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}(o,n),o.prototype.render=function(){var e=this,t=this.ConnectedComponent,n=i({},this.props,this.state,{ref:function(r){e.innerRef=r}});return r.createElement(t,n)},o}(r.Component);return a.displayName="EasyConnect("+n+")",o(a,e)}},e.createResource=function(e,r){return function(t){te(e,r),$(e,t);var n=r||{},o=n.cacheLifetime,a=void 0===o?0:o,u=n.denormalizer,c=i({},l(e)),s=i({},Fe(e,u));return Object.keys(t||{}).forEach(function(r){c=i({},c,B(e,a,t||{},r)),s=i({},s,function(e,r,t){var n;return(n={})[r]={resource:{couldPerform:function(t){return!Re(q(t),e,r)},isPerforming:function(t){return Re(q(t),e,r)},hasSucceeded:function(t){return je(q(t),e,r,"hasSucceeded")},hasFailed:function(t){return je(q(t),e,r,"hasFailed")},isValid:function(t){return!je(q(t),e,r,"didInvalidate")},couldPerformOnId:function(t,n){return!Re(q(t),e,r,n)},isPerformingOnId:function(t,n){return Re(q(t),e,r,n)},hasSucceededOnId:function(t,n){return je(q(t),e,r,"hasSucceeded",n)},hasFailedOnId:function(t,n){return je(q(t),e,r,"hasFailed",n)},isValidId:function(t,n){return!je(q(t),e,r,"didInvalidate",n)}},request:{getResource:function(n,o){var a=2>=arguments.length||void 0===arguments[2]||arguments[2];return Se(q(n),e,le(e,r,o),a,t)},getMetadata:function(t,n){return function(e,r){return e.requests&&e.requests[r]&&e.requests[r].metadata?e.requests[r].metadata:{}}(q(t),le(e,r,n))},couldPerform:function(t,n){return!ke(q(t),le(e,r,n))},isPerforming:function(t,n){return ke(q(t),le(e,r,n))},hasSucceeded:function(t,n){return _e(q(t),le(e,r,n),"hasSucceeded")},hasFailed:function(t,n){return _e(q(t),le(e,r,n),"hasFailed")},isValid:function(t,n){return!_e(q(t),le(e,r,n),"didInvalidate")}}},n}(e,r,u))}),{actions:c,selectors:s}}},e.reducer=Ue,e.reset=function(){return(0,Ve().resetAll)()},e.initializeNetworkHelpers=function(e){!function(e){P=e?i({},F,e):F}(e)},e.getPersistableState=function(e,r){return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.alwaysPersist,n=r.neverPersist;if(!e||!Object.keys(e).length)return{};var o="string"==typeof t?[t]:t,a="string"==typeof n?[n]:n,u=Object.entries(e.requests||{}).reduce(function(e,r){var t,n,u=r[0],c=r[1];return i({},e,c&&c.endedAt&&o&&c.payloadIds&&Object.keys(c.payloadIds).some(function(e){return o.includes(e)})?((t={})[u]=c,t):!c||!c.endedAt||c.didInvalidate||S(c.expireAt)||a&&c.payloadIds&&Object.keys(c.payloadIds).some(function(e){return a.includes(e)})?{}:((n={})[u]="never"===c.expireAt?i({},c,{didInvalidate:!0}):c,n))},{}),c=Object.values(u).reduce(function(e,r){return i({},e,Object.entries(r.payloadIds||{}).reduce(function(e,r){var t,n=r[0];return i({},e,((t={})[n]=[].concat(e[n]||[],r[1].map(function(e){return""+e})),t))},{}))},{}),s=Object.entries(e.resources||{}).reduce(function(e,r){var t,n=r[0];return i({},e,((t={})[n]=Object.entries(r[1]||{}).reduce(function(e,r){var t,o=r[0],a=r[1];return i({},e,c[n]&&c[n].includes(o)?((t={})[o]=a,t):{})},{}),t))},{}),f=Object.entries(s).reduce(function(e,r){var t,n=r[0],o=r[1];return i({},e,Object.keys(o).length?((t={})[n]=o,t):{})},{}),d=i({},e.resolversHashes||{},{requests:Object.entries(e.resolversHashes&&e.resolversHashes.requests?e.resolversHashes.requests:{}).reduce(function(e,r){var t,n=r[0];return i({},e,u[n]?((t={})[n]=r[1],t):{})},{}),resources:Object.entries(e.resolversHashes&&e.resolversHashes.resources?e.resolversHashes.resources:{}).reduce(function(r,t){var n,o=t[0],a=t[1];return i({},r,f[o]&&Object.keys(e.resources[o]).length===Object.keys(f[o]).length?((n={})[o]=a,n):{})},{})});return i({},e,{requests:u,resources:f,resolversHashes:d})}(e,r)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","react","react-redux"],r):r(e.ReduxRestEasy={},e.React,e.ReactRedux)}(this,function(e,r,t){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(e,r){return e(r={exports:{}},r.exports),r.exports}n(function(e){!function(r){var t,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",s=r.regeneratorRuntime;if(s)e.exports=s;else{(s=r.regeneratorRuntime=e.exports).wrap=b;var f="suspendedStart",d="suspendedYield",l="executing",h="completed",p={},v={};v[u]=function(){return this};var y=Object.getPrototypeOf,m=y&&y(y(S([])));m&&m!==n&&o.call(m,u)&&(v=m);var g=O.prototype=E.prototype=Object.create(v);C.prototype=g.constructor=O,O.constructor=C,O[c]=C.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===C||"GeneratorFunction"===(r.displayName||r.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(g),e},s.awrap=function(e){return{__await:e}},w(I.prototype),I.prototype[i]=function(){return this},s.AsyncIterator=I,s.async=function(e,r,t,n){var o=new I(b(e,r,t,n));return s.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},w(g),g[c]="Generator",g[u]=function(){return this},g.toString=function(){return"[object Generator]"},s.keys=function(e){var r=[];for(var t in e)r.push(t);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},s.values=S,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return i.type="throw",i.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],i=u.completion;if("root"===u.tryLoc)return n("end");if(this.prev>=u.tryLoc){var c=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(c&&s){if(u.catchLoc>this.prev)return n(u.catchLoc,!0);if(u.finallyLoc>this.prev)return n(u.finallyLoc)}else if(c){if(u.catchLoc>this.prev)return n(u.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(u.finallyLoc>this.prev)return n(u.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}!a||"break"!==e&&"continue"!==e||a.tryLoc>r||r>a.finallyLoc||(a=null);var u=a?a.completion:{};return u.type=e,u.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(u)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),x(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;x(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}}}function b(e,r,t,n){var o=Object.create((r&&r.prototype instanceof E?r:E).prototype),a=new q(n||[]);return o._invoke=function(e,r,t){var n=f;return function(o,a){if(n===l)throw Error("Generator is already running");if(n===h){if("throw"===o)throw a;return k()}for(t.method=o,t.arg=a;;){var u=t.delegate;if(u){var i=R(u,t);if(i){if(i===p)continue;return i}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(n===f)throw n=h,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n=l;var c=A(e,r,t);if("normal"===c.type){if(n=t.done?h:d,c.arg===p)continue;return{value:c.arg,done:t.done}}"throw"===c.type&&(n=h,t.method="throw",t.arg=c.arg)}}}(e,t,a),o}function A(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}function E(){}function C(){}function O(){}function w(e){["next","throw","return"].forEach(function(r){e[r]=function(e){return this._invoke(r,e)}})}function I(e){var r;this._invoke=function(t,n){function a(){return new Promise(function(r,a){!function r(t,n,a,u){var i=A(e[t],e,n);if("throw"!==i.type){var c=i.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(e){r("next",e,a,u)},function(e){r("throw",e,a,u)}):Promise.resolve(s).then(function(e){c.value=e,a(c)},u)}u(i.arg)}(t,n,r,a)})}return r=r?r.then(a,a):a()}}function R(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=A(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function j(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function x(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function q(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function S(e){if(e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}}(function(){return this}()||Function("return this")())});var o=n(function(e,r){var t,n,o,a,u,i,c,s;e.exports=(t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,s=(c=Object.getPrototypeOf)&&c(Object),function e(r,f,d){if("string"!=typeof f){if(s){var l=c(f);l&&l!==s&&e(r,l,d)}var h=a(f);u&&(h=h.concat(u(f)));for(var p=0;h.length>p;++p){var v=h[p];if(!(t[v]||n[v]||d&&d[v])){var y=i(f,v);try{o(r,v,y)}catch(e){}}}return r}return r})}),a=function(e){return function(){var r=e.apply(this,arguments);return new Promise(function(e,t){return function n(o,a){try{var u=r[o](a),i=u.value}catch(e){return void t(e)}if(!u.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}("next")})}},u=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},i=Object.assign||function(e){for(var r=1;arguments.length>r;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},c=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r},s=function(e){return function(r,n){for(var o=arguments.length,a=Array(o>2?o-2:0),u=2;o>u;u++)a[u-2]=arguments[u];return t.connect.apply(void 0,[r,n&&"function"==typeof n?function(){var r=n.apply(void 0,arguments);return Object.keys(r).reduce(function(t,n){var o;return i({},t,((o={})[n]=function(){var t=r[n].apply(r,arguments);return t&&t.__actionName&&t.__requestURL&&(e(t.__actionName,t.__requestURL),delete t.__actionName,delete t.__requestURL),t},o))},{})}:n].concat(a))}},f=function(e,r){return function(t){return{type:e,resourceName:r,resourceId:t}}},d=function(e,r,t){return"@@rest-easy/"+e+"/"+r+"/"+t.toUpperCase()},l=function(e){var r=function(e){return{INVALIDATE_RESOURCE:d(e,"@invalidate","INVALIDATE_RESOURCE"),INVALIDATE_ID:d(e,"@invalidate","INVALIDATE_ID"),RESET_RESOURCE:d(e,"@reset","RESET_RESOURCE")}}(e),t=r.INVALIDATE_ID,n=r.RESET_RESOURCE;return{resource:{invalidate:f(r.INVALIDATE_RESOURCE,e),invalidateId:f(t,e),reset:f(n,e)}}},h=function(e,r){return function(t,n,o,a,u){return{type:r,url:t,resourceId:n,payload:o&&Object.keys(o).length?o:void 0,metadata:a,principalResourceIds:"string"==typeof u?[u]:u,cacheLifetime:e}}},p=function(e,r,t){var n=function(e,r){return{REQUEST:d(e,r,"REQUEST"),RECEIVE:d(e,r,"RECEIVE"),FAIL:d(e,r,"FAIL"),RECEIVE_FROM_CACHE:d(e,r,"RECEIVE_FROM_CACHE")}}(e,r),o=n.RECEIVE,a=n.FAIL,u=n.RECEIVE_FROM_CACHE;return{REQUEST:h(t,n.REQUEST),RECEIVE:h(t,o),FAIL:h(t,a),RECEIVE_FROM_CACHE:h(t,u)}},v=Object.prototype.toString,y=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};var m,g=function(e){var r=function e(r,t){var n,o,a,u,i,c,s;if(!0===r)return"true";if(!1===r)return"false";switch(typeof r){case"object":if(null===r)return null;if(r.toJSON&&"function"==typeof r.toJSON)return e(r.toJSON(),t);if("[object Array]"===(s=v.call(r))){for(a="[",o=r.length-1,n=0;o>n;n++)a+=e(r[n],!0)+",";return o>-1&&(a+=e(r[n],!0)),a+"]"}if("[object Object]"===s){for(o=(u=y(r).sort()).length,a="",n=0;o>n;)void 0!==(c=e(r[i=u[n]],!1))&&(a&&(a+=","),a+=JSON.stringify(i)+":"+c),n++;return"{"+a+"}"}return JSON.stringify(r);case"function":case"undefined":return t?null:void 0;case"string":return JSON.stringify(r);default:return isFinite(r)?r:null}}(e,!1);if(void 0!==r)return""+r},b=n(function(e,r){var t=Object.prototype.hasOwnProperty,n=function(){for(var e=[],r=0;256>r;++r)e.push("%"+((16>r?"0":"")+r.toString(16)).toUpperCase());return e}();r.arrayToObject=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},n=0;e.length>n;++n)void 0!==e[n]&&(t[n]=e[n]);return t},r.merge=function(e,n,o){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!t.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var a=e;return Array.isArray(e)&&!Array.isArray(n)&&(a=r.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,a){t.call(e,a)?e[a]&&"object"==typeof e[a]?e[a]=r.merge(e[a],n,o):e.push(n):e[a]=n}),e):Object.keys(n).reduce(function(e,a){var u=n[a];return e[a]=t.call(e,a)?r.merge(e[a],u,o):u,e},a)},r.assign=function(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},r.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(r){return e}},r.encode=function(e){if(0===e.length)return e;for(var r="string"==typeof e?e:e+"",t="",o=0;r.length>o;++o){var a=r.charCodeAt(o);45!==a&&46!==a&&95!==a&&126!==a&&(48>a||a>57)&&(65>a||a>90)&&(97>a||a>122)?128>a?t+=n[a]:2048>a?t+=n[192|a>>6]+n[128|63&a]:a>=55296&&57344>a?(a=65536+((1023&a)<<10|1023&r.charCodeAt(o+=1)),t+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]):t+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a]:t+=r.charAt(o)}return t},r.compact=function(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;r.length>n;++n)for(var o=r[n],a=o.obj[o.prop],u=Object.keys(a),i=0;u.length>i;++i){var c=u[i],s=a[c];"object"==typeof s&&null!==s&&-1===t.indexOf(s)&&(r.push({obj:a,prop:c}),t.push(s))}return function(e){for(var r;e.length;){var t=e.pop();if(Array.isArray(r=t.obj[t.prop])){for(var n=[],o=0;r.length>o;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}return r}(r)},r.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},r.isBuffer=function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}}),A=String.prototype.replace,E=/%20/g,C={default:"RFC3986",formatters:{RFC1738:function(e){return A.call(e,E,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},O={brackets:function(e){return e+"[]"},indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},w=Date.prototype.toISOString,I={delimiter:"&",encode:!0,encoder:b.encode,encodeValuesOnly:!1,serializeDate:function(e){return w.call(e)},skipNulls:!1,strictNullHandling:!1},R=function e(r,t,n,o,a,u,i,c,s,f,d,l){var h=r;if("function"==typeof i)h=i(t,h);else if(h instanceof Date)h=f(h);else if(null===h){if(o)return u&&!l?u(t,I.encoder):t;h=""}if("string"==typeof h||"number"==typeof h||"boolean"==typeof h||b.isBuffer(h))return u?[d(l?t:u(t,I.encoder))+"="+d(u(h,I.encoder))]:[d(t)+"="+d(h+"")];var p,v=[];if(void 0===h)return v;if(Array.isArray(i))p=i;else{var y=Object.keys(h);p=c?y.sort(c):y}for(var m=0;p.length>m;++m){var g=p[m];a&&null===h[g]||(v=v.concat(e(h[g],Array.isArray(h)?n(t,g):t+(s?"."+g:"["+g+"]"),n,o,a,u,i,c,s,f,d,l)))}return v},j=function(e,r){var t=e,n=r?b.assign({},r):{};if(null!=n.encoder&&"function"!=typeof n.encoder)throw new TypeError("Encoder has to be a function.");var o=void 0===n.delimiter?I.delimiter:n.delimiter,a="boolean"==typeof n.strictNullHandling?n.strictNullHandling:I.strictNullHandling,u="boolean"==typeof n.skipNulls?n.skipNulls:I.skipNulls,i="boolean"==typeof n.encode?n.encode:I.encode,c="function"==typeof n.encoder?n.encoder:I.encoder,s="function"==typeof n.sort?n.sort:null,f=void 0!==n.allowDots&&n.allowDots,d="function"==typeof n.serializeDate?n.serializeDate:I.serializeDate,l="boolean"==typeof n.encodeValuesOnly?n.encodeValuesOnly:I.encodeValuesOnly;if(void 0===n.format)n.format=C.default;else if(!Object.prototype.hasOwnProperty.call(C.formatters,n.format))throw new TypeError("Unknown format option provided.");var h,p,v=C.formatters[n.format];"function"==typeof n.filter?t=(p=n.filter)("",t):Array.isArray(n.filter)&&(h=p=n.filter);var y=[];if("object"!=typeof t||null===t)return"";var m=O[n.arrayFormat in O?n.arrayFormat:"indices"in n?n.indices?"indices":"repeat":"indices"];h||(h=Object.keys(t)),s&&h.sort(s);for(var g=0;h.length>g;++g){var A=h[g];u&&null===t[A]||(y=y.concat(R(t[A],A,m,a,u,i?c:null,p,s,f,d,v,l)))}var E=y.join(o);return E.length>0?(!0===n.addQueryPrefix?"?":"")+E:""},x=function(e){var r,t=(r=e)&&Object.keys(r)?j(r):"";return t?"?"+t:""},q=function(e){return e&&e.restEasy?e.restEasy:(console.error('\n There doesn\'t seem to be a "restEasy" key in your state.\n\n For more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/reducer.md#reducer\n '),null)},S=function(e){return"never"!==e&&(!e||new Date>new Date(e))},k=function(e){return"number"==typeof e?""+e:e},_=function(e,r){return k(e)===k(r)},T=function(e,r){return!!e&&e.map(k).includes(k(r))},L=function(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;r>n;n++)t[n-1]=arguments[n];if(e&&"function"==typeof e)return e.apply(void 0,t)},N="undefined"!=typeof window?window:global,F={getToken:function(){return"token"},requestGET:function(){var e=this;return a(regeneratorRuntime.mark(function r(){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=e.getToken,!r.t0){r.next=5;break}return r.next=4,e.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"GET",headers:i({Accept:"application/json"},(t=r.t0)?{Authorization:"Bearer "+t}:{})});case 7:case"end":return r.stop()}},r,e)}))()},requestPATCH:function(e){var r=this;return a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.getToken,!t.t0){t.next=5;break}return t.next=4,r.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"PATCH",headers:i({Accept:"application/json","Content-Type":"application/json"},(n=t.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return t.stop()}},t,r)}))()},requestPUT:function(e){var r=this;return a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.getToken,!t.t0){t.next=5;break}return t.next=4,r.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"PUT",headers:i({Accept:"application/json","Content-Type":"application/json"},(n=t.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return t.stop()}},t,r)}))()},requestPOST:function(e){var r=this;return a(regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.getToken,!t.t0){t.next=5;break}return t.next=4,r.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"POST",headers:i({Accept:"application/json","Content-Type":"application/json"},(n=t.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return t.stop()}},t,r)}))()},requestDELETE:function(){var e=this;return a(regeneratorRuntime.mark(function r(){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=e.getToken,!r.t0){r.next=5;break}return r.next=4,e.getToken();case 4:r.t0=r.sent;case 5:return t=r.t0,r.abrupt("return",{method:"DELETE",headers:i({Accept:"application/json"},e.getToken&&e.getToken()?{Authorization:"Bearer "+t}:{})});case 7:case"end":return r.stop()}},r,e)}))()},handleStatusCode:function(e){if(e){if(e.status>=200&&300>e.status)return e;var r=Error(e.statusText);throw r.response=e,r}return null},handleError:(m=a(regeneratorRuntime.mark(function e(r,t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!r||!r.response){e.next=8;break}return e.next=4,r.response.json();case 4:console.error(e.sent),e.next=9;break;case 8:console.error(r);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:case"end":return e.stop()}},e,N,[[0,11]])})),function(e,r){return m.apply(this,arguments)})},P=F,H=function(){return P},D="undefined"!=typeof window?window:global,U=function(e,r,t,n,o,u,c,s){return function(e,f,d){return function(){var l,h=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},p=h.query,v=void 0===p?{}:p,y=h.body,m=void 0===y?{}:y,g=h.urlParams,b=void 0===g?{}:g,A=h.onSuccess,E=h.onError,C=function(e,r){var t={};for(var n in e)0>r.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(h,["query","body","urlParams","onSuccess","onError"]);return l=a(regeneratorRuntime.mark(function a(l,h){var p,y,g,O,w,I,R,j;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return p=i({},H(),s||{}),l(r.REQUEST(f,d)),a.prev=2,a.next=5,L(n,b,v,m,C,l);case 5:return y=a.sent||m,a.t0=fetch,a.t1=e,a.next=11,p["request"+t](y);case 11:return a.t2=a.sent,a.next=14,(0,a.t0)(a.t1,a.t2);case 14:if(p.handleStatusCode(g=a.sent),204===g.status){a.next=22;break}return a.next=19,g.json();case 19:a.t3=a.sent,a.next=23;break;case 22:a.t3={};case 23:return O=a.t3,w=o?o(O,q(h()).resources,b,v,y,C):{entities:O},I=w.entities,R=w.result,j=u?u(O,q(h()).resources,b,v,y,C):null,l(r.RECEIVE(f,d,I,j,Array.isArray(R)?R:[R])),a.next=30,L(c,I||{},b,v,y,C,l);case 30:return L(A,I||{},C),a.abrupt("return",{normalizedPayload:I||{},otherArgs:C});case 34:return a.prev=34,a.t4=a.catch(2),l(r.FAIL(f,d)),p.handleError(a.t4,l),L(E,a.t4),a.abrupt("return",{error:a.t4});case 40:case"end":return a.stop()}},a,D,[[2,34]])})),function(e,r){return l.apply(this,arguments)}}}},V=function(e,r,t,n){var o=t[n],a=o.method,u=o.url,i=o.cacheHint,c=o.beforeHook,s=o.normalizer,f=o.metadataNormalizer,d=o.afterHook,l=o.networkHelpers,h=p(e,n,r),v=U(0,h,a,c,s,f,d,l);return function(r){return function(t,o){var c=q(o()),s=r||{},f=s.urlParams,d=s.query,l=s.body,p=s.otherArgs,y=function(e){var r=("string"!=typeof e?e():e).split("/").reverse(),t=r.findIndex(function(e){return e.startsWith("::")});return-1!==t?r.length-1-t:-1}(u),m=function(e,r,t){var n="string"!=typeof e?e():e;r&&Object.keys(r).forEach(function(e){n=n.replace("::"+e,r[e]).replace(":"+e,r[e])});var o=t?x(JSON.parse(g(t))):"";return""+n+o}(u,f,d),b=i?i(f,d,l,p):null,A=function(e,r,t){return(e||"")+(r?":"+r:"")+(t?":"+x(t):"")}(n,m,b),E=function(e,r){if(!e||!r&&0!==r||-1===r)return null;for(var t=0,n=0;r>n;n+=1)t=e.indexOf("/",t+1);var o=e.indexOf("/",t+1);return e.substr(t+1,-1!==o?o-t-1:e.length)}(A,y),C=void 0;(function(e,r){return!(e&&r&&e.requests&&e.requests[r]&&!e.requests[r].endedAt)})(c,A)&&function(e,r,t){if(!("GET"===r&&e&&t&&e.requests&&e.requests[t]))return!0;var n=e.requests[t];return!n.hasSucceeded||n.didInvalidate||S(n.expireAt)}(c,a,A)&&(C=function(e,r,t,n){return!!("GET"===r&&e&&e.requests&&t&&null!==n)&&Object.values(e.requests).some(function(e){var r=e.expireAt,o=e.payloadIds;return e.hasSucceeded&&!e.didInvalidate&&(t===e.resourceName&&_(n,e.resourceId)||o&&o[t]&&T(o[t],n))&&!S(r)})}(c,a,e,E)?function(){var r,n;return t(h.RECEIVE_FROM_CACHE(A,E,((n={})[e]=((r={})[E]=null,r),n),null,[E]))}:function(){return t(v(m,A,E)(r))});var O=C?C():{};return O.__actionName=n,O.__requestURL=A,O}}},B=function(e,r,t,n){var o,a=function(e){return{INVALIDATE_REQUEST:d(e,"@invalidate","INVALIDATE_REQUEST")}}(e).INVALIDATE_REQUEST;return(o={})[n]={perform:V(e,r,t,n),invalidate:function(e,r){return function(t){return{type:e,url:t,resourceName:r}}}(a,e)},o},z=function(e){return"object"==typeof(r=e)&&null!==r&&!Array.isArray(e);var r},G=function(e){return function(r){throw Error("redux-rest-easy: "+e+" "+r)}},M=function(e){return"string"==typeof e},Q=function(e){return"function"==typeof e},J=function(e){return void 0!==e},K=["method","url"],Y=[].concat(K,["cacheHint","beforeHook","normalizer","metadataNormalizer","afterHook","networkHelpers"]),W=["GET","POST","PATCH","PUT","DELETE"],X=function(e){return e+" >"},Z=function(e,r){return e+' "'+r+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'},$=function(e,r){if(r){if(!z(r)||!Object.keys(r).length)G(X(e)+" createResource >")("You have to provide a valid actions configuration.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource.md#createresourceresourcename-optionsactions");Object.keys(r).forEach(function(t){var n=G(X(e)+" "+function(e){return e+" >"}(t)+" createResource >"),o=r[t],a=Object.keys(o);K.forEach(function(e){a.includes(e)||n('Key "'+e+'" is missing.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')}),a.forEach(function(e){Y.includes(e)||n(function(e){return'Unknown key "'+e+'".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(e))});var u=o.method,i=o.url,c=o.cacheHint,s=o.beforeHook,f=o.normalizer,d=o.metadataNormalizer,l=o.afterHook,h=o.networkHelpers;M(u)&&W.includes(u)||n(function(e){return'Method "'+e+'" is invalid. Expected one of: '+W.join(", ")+".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig"}(u)),i&&(M(i)||Q(i))||n(function(e){return'URL "'+e+'" is invalid. Expected a string or a function returning a string.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(i)),J(c)&&!Q(c)&&n(Z("cacheHint",c)),J(s)&&!Q(s)&&n(Z("beforeHook",s)),J(f)&&!Q(f)&&n(Z("normalizer",f)),J(d)&&!Q(d)&&n(Z("metadataNormalizer",d)),J(l)&&!Q(l)&&n(Z("afterHook",l)),J(h)&&!z(h)&&n("networkHelpers"+' "'+h+'" is invalid. Expected a valid object.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'),Object.keys(h||{}).forEach(function(e){J(h[e])&&!Q(h[e])&&n(e+' "networkHelpers.'+h[e]+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')})})}},ee=function(e){return void 0!==e},re=["cacheLifetime","denormalizer"],te=function(e,r){var t,n=(t=function(e){return e+" >"}(e||"[no resource name]")+" createResource >",function(e){throw Error("redux-rest-easy: "+t+" "+e)});if(e&&"string"==typeof e||n("You have to provide a valid resource name."),r){z(r)&&Object.keys(r).length||n("You have to provide a valid resource configuration (or not at all)."),Object.keys(r).forEach(function(e){re.includes(e)||n(function(e){return'Unknown key "'+e+'" in resource config.'}(e))});var o=r.cacheLifetime,a=r.denormalizer;!ee(o)||function(e){return"number"==typeof e}(o)&&o>=0||n(function(e){return'cacheLifetime "'+e+'" in resource config is invalid. Expected a number between 0 and Infinity.'}(o)),ee(a)&&!function(e){return"function"==typeof e}(a)&&n(function(e,r){return e+' "'+r+'" in resource config is invalid. Expected a valid function.'}("denormalizer",a))}};function ne(e,r){return e===r}function oe(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne,t=null,n=null;return function(){return function(e,r,t){if(null===r||null===t||r.length!==t.length)return!1;for(var n=r.length,o=0;n>o;o++)if(!e(r[o],t[o]))return!1;return!0}(r,t,arguments)||(n=e.apply(null,arguments)),t=arguments,n}}function ae(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;r>n;n++)t[n-1]=arguments[n];return function(){for(var r=arguments.length,n=Array(r),o=0;r>o;o++)n[o]=arguments[o];var a=0,u=n.pop(),i=function(e){var r=Array.isArray(e[0])?e[0]:e;if(!r.every(function(e){return"function"==typeof e})){var t=r.map(function(e){return typeof e}).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+t+"]")}return r}(n),c=e.apply(void 0,[function(){return a++,u.apply(null,arguments)}].concat(t)),s=oe(function(){for(var e=[],r=i.length,t=0;r>t;t++)e.push(i[t].apply(null,arguments));return c.apply(null,e)});return s.resultFunc=u,s.recomputations=function(){return a},s.resetRecomputations=function(){return a=0},s}}var ue=ae(oe);var ie=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},ce=function(){function e(){ie(this,e),this._cache={}}return e.prototype.set=function(e,r){this._cache[e]=r},e.prototype.get=function(e){return this._cache[e]},e.prototype.remove=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}},e.prototype.isValidCacheKey=function(e){return"string"==typeof(r=e)||"number"==typeof r;var r},e}(),se=function(){return!0};function fe(){for(var e=arguments.length,r=Array(e),t=0;e>t;t++)r[t]=arguments[t];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"==typeof t)throw Error('[re-reselect] Second argument "options" must be an object. Please use "options.selectorCreator" to provide a custom selectorCreator.');var n=t.cacheObject||new ce,o=t.selectorCreator||ue,a=n.isValidCacheKey||se,u=function(){var t=e.apply(void 0,arguments);if(a(t)){var u=n.get(t);return void 0===u&&(u=o.apply(void 0,r),n.set(t,u)),u.apply(void 0,arguments)}console.warn('[re-reselect] Invalid cache key "'+t+'" has been returned by resolver function.')};return u.getMatchingSelector=function(){var r=e.apply(void 0,arguments);return n.get(r)},u.removeMatchingSelector=function(){var r=e.apply(void 0,arguments);n.remove(r)},u.clearCache=function(){n.clear()},u.resultFunc=r[r.length-1],u}}var de=function(e){return e.split(":")[0]},le=function(e,r,t){return t?t.__requestURLsByActionKey?t.__requestURLsByActionKey[r]:(console.error("You may have forgotten to use redux-rest-easy's connect on a Component which requested "+e+"."+r+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/connect.md#connectconnectargs"),""):(console.error("You may have forgotten to pass ownProps to a selector related to "+e+"."+r+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/selectors.md#actionrequest"),"")},he={selectorCreator:ae(function(e){var r=null;return function(){return r||(r=e.apply(void 0,arguments)),r}})},pe=function(){return he},ve=function(e,r,t){return r?Object.keys(r).reduce(function(n,o){var a;return i({},n,((a={})[o]=o===e?t:Object.keys(r[o]||{}),a))},{}):{}},ye=n(function(e,r){!function(t,n){var o={version:"2.1.2",x86:{},x64:{}};function a(e,r){return(65535&e)*r+(((e>>>16)*r&65535)<<16)}function u(e,r){return e<<r|e>>>32-r}function i(e){return e=a(e^=e>>>16,2246822507),e=a(e^=e>>>13,3266489909),e^=e>>>16}function c(e,r){var t=[0,0,0,0];return t[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]+(r=[r[0]>>>16,65535&r[0],r[1]>>>16,65535&r[1]])[3],t[2]+=t[3]>>>16,t[3]&=65535,t[2]+=e[2]+r[2],t[1]+=t[2]>>>16,t[2]&=65535,t[1]+=e[1]+r[1],t[0]+=t[1]>>>16,t[1]&=65535,t[0]+=e[0]+r[0],t[0]&=65535,[t[0]<<16|t[1],t[2]<<16|t[3]]}function s(e,r){var t=[0,0,0,0];return t[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]*(r=[r[0]>>>16,65535&r[0],r[1]>>>16,65535&r[1]])[3],t[2]+=t[3]>>>16,t[3]&=65535,t[2]+=e[2]*r[3],t[1]+=t[2]>>>16,t[2]&=65535,t[2]+=e[3]*r[2],t[1]+=t[2]>>>16,t[2]&=65535,t[1]+=e[1]*r[3],t[0]+=t[1]>>>16,t[1]&=65535,t[1]+=e[2]*r[2],t[0]+=t[1]>>>16,t[1]&=65535,t[1]+=e[3]*r[1],t[0]+=t[1]>>>16,t[1]&=65535,t[0]+=e[0]*r[3]+e[1]*r[2]+e[2]*r[1]+e[3]*r[0],t[0]&=65535,[t[0]<<16|t[1],t[2]<<16|t[3]]}function f(e,r){return 32===(r%=64)?[e[1],e[0]]:32>r?[e[0]<<r|e[1]>>>32-r,e[1]<<r|e[0]>>>32-r]:[e[1]<<(r-=32)|e[0]>>>32-r,e[0]<<r|e[1]>>>32-r]}function d(e,r){return 0===(r%=64)?e:32>r?[e[0]<<r|e[1]>>>32-r,e[1]<<r]:[e[1]<<r-32,0]}function l(e,r){return[e[0]^r[0],e[1]^r[1]]}function h(e){return e=l(e=s(e=l(e=s(e=l(e,[0,e[0]>>>1]),[4283543511,3981806797]),[0,e[0]>>>1]),[3301882366,444984403]),[0,e[0]>>>1])}o.x86.hash32=function(e,r){for(var t=(e=e||"").length%4,n=e.length-t,o=r=r||0,c=0,s=3432918353,f=461845907,d=0;n>d;d+=4)o=a(o=u(o^=c=a(c=u(c=a(c=255&e.charCodeAt(d)|(255&e.charCodeAt(d+1))<<8|(255&e.charCodeAt(d+2))<<16|(255&e.charCodeAt(d+3))<<24,s),15),f),13),5)+3864292196;switch(c=0,t){case 3:c^=(255&e.charCodeAt(d+2))<<16;case 2:c^=(255&e.charCodeAt(d+1))<<8;case 1:o^=c=a(c=u(c=a(c^=255&e.charCodeAt(d),s),15),f)}return(o=i(o^=e.length))>>>0},o.x86.hash128=function(e,r){for(var t=(e=e||"").length%16,n=e.length-t,o=r=r||0,c=r,s=r,f=r,d=0,l=0,h=0,p=0,v=597399067,y=2869860233,m=951274213,g=2716044179,b=0;n>b;b+=16)d=255&e.charCodeAt(b)|(255&e.charCodeAt(b+1))<<8|(255&e.charCodeAt(b+2))<<16|(255&e.charCodeAt(b+3))<<24,l=255&e.charCodeAt(b+4)|(255&e.charCodeAt(b+5))<<8|(255&e.charCodeAt(b+6))<<16|(255&e.charCodeAt(b+7))<<24,h=255&e.charCodeAt(b+8)|(255&e.charCodeAt(b+9))<<8|(255&e.charCodeAt(b+10))<<16|(255&e.charCodeAt(b+11))<<24,p=255&e.charCodeAt(b+12)|(255&e.charCodeAt(b+13))<<8|(255&e.charCodeAt(b+14))<<16|(255&e.charCodeAt(b+15))<<24,o=u(o^=d=a(d=u(d=a(d,v),15),y),19),o=a(o+=c,5)+1444728091,c=u(c^=l=a(l=u(l=a(l,y),16),m),17),c=a(c+=s,5)+197830471,s=u(s^=h=a(h=u(h=a(h,m),17),g),15),s=a(s+=f,5)+2530024501,f=u(f^=p=a(p=u(p=a(p,g),18),v),13),f=a(f+=o,5)+850148119;switch(d=0,l=0,h=0,p=0,t){case 15:p^=e.charCodeAt(b+14)<<16;case 14:p^=e.charCodeAt(b+13)<<8;case 13:f^=p=a(p=u(p=a(p^=e.charCodeAt(b+12),g),18),v);case 12:h^=e.charCodeAt(b+11)<<24;case 11:h^=e.charCodeAt(b+10)<<16;case 10:h^=e.charCodeAt(b+9)<<8;case 9:s^=h=a(h=u(h=a(h^=e.charCodeAt(b+8),m),17),g);case 8:l^=e.charCodeAt(b+7)<<24;case 7:l^=e.charCodeAt(b+6)<<16;case 6:l^=e.charCodeAt(b+5)<<8;case 5:c^=l=a(l=u(l=a(l^=e.charCodeAt(b+4),y),16),m);case 4:d^=e.charCodeAt(b+3)<<24;case 3:d^=e.charCodeAt(b+2)<<16;case 2:d^=e.charCodeAt(b+1)<<8;case 1:o^=d=a(d=u(d=a(d^=e.charCodeAt(b),v),15),y)}return o^=e.length,o+=c^=e.length,o+=s^=e.length,c+=o+=f^=e.length,s+=o,f+=o,o=i(o),o+=c=i(c),o+=s=i(s),c+=o+=f=i(f),s+=o,f+=o,("00000000"+(o>>>0).toString(16)).slice(-8)+("00000000"+(c>>>0).toString(16)).slice(-8)+("00000000"+(s>>>0).toString(16)).slice(-8)+("00000000"+(f>>>0).toString(16)).slice(-8)},o.x64.hash128=function(e,r){for(var t=(e=e||"").length%16,n=e.length-t,o=[0,r=r||0],a=[0,r],u=[0,0],i=[0,0],p=[2277735313,289559509],v=[1291169091,658871167],y=0;n>y;y+=16)u=[255&e.charCodeAt(y+4)|(255&e.charCodeAt(y+5))<<8|(255&e.charCodeAt(y+6))<<16|(255&e.charCodeAt(y+7))<<24,255&e.charCodeAt(y)|(255&e.charCodeAt(y+1))<<8|(255&e.charCodeAt(y+2))<<16|(255&e.charCodeAt(y+3))<<24],i=[255&e.charCodeAt(y+12)|(255&e.charCodeAt(y+13))<<8|(255&e.charCodeAt(y+14))<<16|(255&e.charCodeAt(y+15))<<24,255&e.charCodeAt(y+8)|(255&e.charCodeAt(y+9))<<8|(255&e.charCodeAt(y+10))<<16|(255&e.charCodeAt(y+11))<<24],o=c(s(o=c(o=f(o=l(o,u=s(u=f(u=s(u,p),31),v)),27),a),[0,5]),[0,1390208809]),a=c(s(a=c(a=f(a=l(a,i=s(i=f(i=s(i,v),33),p)),31),o),[0,5]),[0,944331445]);switch(u=[0,0],i=[0,0],t){case 15:i=l(i,d([0,e.charCodeAt(y+14)],48));case 14:i=l(i,d([0,e.charCodeAt(y+13)],40));case 13:i=l(i,d([0,e.charCodeAt(y+12)],32));case 12:i=l(i,d([0,e.charCodeAt(y+11)],24));case 11:i=l(i,d([0,e.charCodeAt(y+10)],16));case 10:i=l(i,d([0,e.charCodeAt(y+9)],8));case 9:a=l(a,i=s(i=f(i=s(i=l(i,[0,e.charCodeAt(y+8)]),v),33),p));case 8:u=l(u,d([0,e.charCodeAt(y+7)],56));case 7:u=l(u,d([0,e.charCodeAt(y+6)],48));case 6:u=l(u,d([0,e.charCodeAt(y+5)],40));case 5:u=l(u,d([0,e.charCodeAt(y+4)],32));case 4:u=l(u,d([0,e.charCodeAt(y+3)],24));case 3:u=l(u,d([0,e.charCodeAt(y+2)],16));case 2:u=l(u,d([0,e.charCodeAt(y+1)],8));case 1:o=l(o,u=s(u=f(u=s(u=l(u,[0,e.charCodeAt(y)]),p),31),v))}return o=l(o,[0,e.length]),a=c(a=l(a,[0,e.length]),o=c(o,a)),o=h(o),a=c(a=h(a),o=c(o,a)),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)},e.exports&&(r=e.exports=o),r.murmurHash3=o}()}),me=ye,ge=n(function(e){e.exports={v3:me},function(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}.main===e&&console.log(e.exports.v3)}).v3,be=function(e){return ge.x64.hash128(g(e||null))},Ae=be([]),Ee=function(e,r,t,n,o){var a,u,c=e.requests,s=void 0===c?{}:c,f=e.resources,d=void 0===f?{}:f,l=e.resolversHashes,h=void 0===l?{}:l,p=ve(r,n,o);return i({},h,{requests:i({},h.requests||{},(a={},a[t]=Object.keys(p).reduce(function(e,r){var n;return i({},e,((n={})[r]=s[t]&&s[t].payloadIds&&s[t].payloadIds[r]?be(s[t].payloadIds[r]):Ae,n))},{}),a)),resources:i({},h.resources||{},(u={_getResourcesHash:function(){return be(d)}},u[r]=d[r]?be(d[r]):Ae,u))})},Ce=function(){return Ae},Oe=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,r=void 0===e?{}:e,t=arguments[1],n=arguments[2];return r.requests&&r.requests[t]&&r.requests[t][n]?r.requests[t][n]:Ae},we=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,r=void 0===e?{}:e,t=arguments[1];return r.resources&&r.resources[t]?r.resources[t]:Ae},Ie=[],Re=function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;return!!e.requests&&Object.entries(e.requests).some(function(e){var o=e[1],a=o.resourceName,u=o.resourceId,i=o.endedAt;return de(e[0])===t&&a===r&&(-1===n||null!==u&&_(u,n))&&!i})},je=function(e,r,t,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.requests&&Object.entries(e.requests).filter(function(e){var n=e[1],a=n.resourceName,u=n.resourceId,i=n.endedAt,c=n.payloadIds;return de(e[0])===t&&a===r&&(-1===o||null!==u&&_(u,o)||!!i&&c&&c[r]&&T(c[r],o))}).map(function(e){return e[1]});return!(!a||!a.length)&&a.reduce(function(e,r){return r.endedAt&&e.endedAt&&r.endedAt>e.endedAt?r:e},a[0])[n]},xe=function(e,r){return e.resources&&e.resources[r]?e.resources[r]:null},qe=function(e,r,t){return e.requests&&e.requests[t]&&e.requests[t].payloadIds&&e.requests[t].payloadIds[r]?e.requests[t].payloadIds[r]:null},Se=fe(function(e){return e.resources},xe,qe,function(e,r,t,n){return n},function(e,r,t,n,o){return o},function(e,r,t,n,o){return r&&t?n&&o?o(t,e):t.reduce(function(e,t){return[].concat(e,[r[t]])},[]):Ie})(function(e,r,t,n,o){var a=xe(e,r),u=qe(e,r,t);return a&&u?n&&o?!(!n||!o)+"-"+Object.keys(e.requests[t].payloadIds).map(function(r){return Oe(e,t,r)+"-"+we(e,r)}).join("--"):!(!n||!o)+"-"+Oe(e,t,r)+"-"+we(e,r):Ce()},pe()),ke=function(e,r){return!(!e.requests||!e.requests[r]||e.requests[r].endedAt)},_e=function(e,r,t){return!!(e.requests&&e.requests[r]&&e.requests[r][t])},Te=[],Le=function(e,r){return e.resources&&e.resources[r]?e.resources[r]:null},Ne=fe(function(e){return e.resources},Le,function(e,r,t){return t},function(e,r,t,n){return n},function(e,r,t,n){return r?t&&n?n(Object.keys(r),e):Object.values(r):Te})(function(e,r,t,n){return Le(e,r)?t&&n?!(!t||!n)+"-"+function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,r=void 0===e?{}:e;return r.resources&&r.resources._getResourcesHash?r.resources._getResourcesHash():Ae}(e):!(!t||!n)+"-"+we(e,r):Ce()},pe()),Fe=function(e,r){return{resource:{getResource:function(t){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return Ne(q(t),e,n,r)},getResourceById:function(t,n){var o=2>=arguments.length||void 0===arguments[2]||arguments[2];return function(e,r,t,n,o){var a=e.resources&&e.resources[r]&&e.resources[r][t]?e.resources[r][t]:null;if(!n||!o||!a)return a;var u=Object.entries(e.resources).reduce(function(e,n){var o,u,c=n[0],s=n[1];return i({},e,((u={})[c]=c===r?((o={})[t]=a,o):s,u))},{});return o([t],u)[0]||null}(q(t),e,n,o,r)}}}},Pe=function(e){var r=e.split("/");return{resourceName:r[1],actionName:r[2],caseName:r[3]}},He={},De={REQUEST:function(e,r){var t,n=r.url,o=r.resourceId;return i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{resourceName:Pe(r.type).resourceName,resourceId:o,startedAt:(new Date).toISOString(),endedAt:null,expireAt:null,hasSucceeded:!(!e.requests||!e.requests[n])&&!!e.requests[n].hasSucceeded,hasFailed:!(!e.requests||!e.requests[n])&&!!e.requests[n].hasFailed,didInvalidate:!(!e.requests||!e.requests[n])&&!!e.requests[n].didInvalidate,fromCache:!(!e.requests||!e.requests[n])&&!!e.requests[n].fromCache}),t))})},RECEIVE:function(e,r){var t,n=r.url,o=r.payload,a=r.principalResourceIds,u=r.metadata,c=r.cacheLifetime,s=void 0===c?0:c,f=Pe(r.type).resourceName,d=i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),expireAt:s!==1/0?new Date((new Date).getTime()+1e3*s).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!1,payloadIds:ve(f,o,a),metadata:u}),t)),resources:function(e,r){var t=e&&e.resources?e.resources:{};return r&&z(r)?Object.entries(r).reduce(function(e,r){var n,o=r[0];return i({},e,((n={})[o]=i({},t[o]||{},r[1]),n))},t):t}(e,o)});return i({},d,{resolversHashes:Ee(d,f,n,o,a)})},FAIL:function(e,r){var t,n=r.url;return i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),hasSucceeded:!1,hasFailed:!0}),t))})},RECEIVE_FROM_CACHE:function(e,r){var t,n=r.type,o=r.url,a=r.resourceId,u=r.payload,c=r.principalResourceIds,s=r.metadata,f=r.cacheLifetime,d=void 0===f?0:f,l=Pe(n).resourceName,h=i({},e,{requests:i({},e.requests||{},(t={},t[o]=i({},e.requests&&e.requests[o]?e.requests[o]:{},{resourceName:Pe(n).resourceName,resourceId:a,startedAt:(new Date).toISOString(),endedAt:(new Date).toISOString(),expireAt:d!==1/0?new Date((new Date).getTime()+1e3*d).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!0,payloadIds:ve(l,u,c),metadata:s}),t))});return i({},h,{resolversHashes:Ee(h,l,o,u,c)})},INVALIDATE_RESOURCE:function(e,r){var t=r.resourceName;return i({},e,{requests:i({},Object.entries(e.requests||{}).reduce(function(e,r){var n,o=r[1];return i({},e,((n={})[r[0]]=!o.didInvalidate&&(o.resourceName===t||o.payloadIds&&o.payloadIds[t])?i({},o,{didInvalidate:!0}):o,n))},{}))})},INVALIDATE_ID:function(e,r){var t=r.resourceName,n=r.resourceId;return i({},e,{requests:i({},Object.entries(e.requests||{}).reduce(function(e,r){var o,a=r[1];return i({},e,((o={})[r[0]]=!a.didInvalidate&&(a.resourceName===t&&_(a.resourceId,n)||a.payloadIds&&a.payloadIds[t]&&T(a.payloadIds[t],n))?i({},a,{didInvalidate:!0}):a,o))},{}))})},INVALIDATE_REQUEST:function(e,r){var t,n=r.url;return i({},e,{requests:i({},e.requests||{},(t={},t[n]=i({},e.requests&&e.requests[n]?e.requests[n]:{},{didInvalidate:!0}),t))})},RESET_RESOURCE:function(e,r){var t,n=r.resourceName,o=i({},e,{requests:i({},Object.entries(e.requests||{}).filter(function(e){var r=e[1],t=r.payloadIds;return!(n===r.resourceName||t&&Object.keys(t).includes(n))}).reduce(function(e,r){var t;return i({},e,((t={})[r[0]]=r[1],t))},{})),resources:i({},e.resources||{},(t={},t[n]=void 0,t))});return i({},o,{resolversHashes:function(e,r){var t,n=e.requests,o=void 0===n?{}:n,a=e.resolversHashes,u=void 0===a?{}:a;return i({},u,{requests:i({},Object.entries(u.requests||{}).reduce(function(e,r){var t,n=r[0],a=r[1];return i({},e,Object.keys(o).includes(n)?((t={})[n]=a,t):{})},{})),resources:i({},u.resources||{},(t={},t[r]=Ae,t))})}(o,n)})},RESET_ALL:function(){return{}}},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:He;return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===r)return e;if(!t.type||!t.type.startsWith("@@rest-easy"))return r;var n=De[Pe(t.type).caseName];return n?n(r,t):r}}(),Ve=function(){var e,r={RESET_ALL:d("@global","@reset","RESET_ALL")};return{resetAll:(e=r.RESET_ALL,function(){return{type:e}})}};e.connect=function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",a=function(n){function o(r){u(this,o);var a=c(this,n.call(this,r));return a.onInjectProps=function(e,r){a.setState(function(t){var n;return t.__requestURLsByActionKey[e]!==r?{__requestURLsByActionKey:i({},t.__requestURLsByActionKey,(n={},n[e]=r,n))}:null})},a.getWrappedInstance=function(){return a.innerRef&&a.innerRef.getWrappedInstance?a.innerRef.getWrappedInstance():null},a.state={__requestURLsByActionKey:{}},a.ConnectedComponent=s(a.onInjectProps).apply(void 0,t)(e),a}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}(o,n),o.prototype.render=function(){var e=this,t=this.ConnectedComponent,n=i({},this.props,this.state,{ref:function(r){e.innerRef=r}});return r.createElement(t,n)},o}(r.Component);return a.displayName="EasyConnect("+n+")",o(a,e)}},e.createResource=function(e,r){return function(t){te(e,r),$(e,t);var n=r||{},o=n.cacheLifetime,a=void 0===o?0:o,u=n.denormalizer,c=i({},l(e)),s=i({},Fe(e,u));return Object.keys(t||{}).forEach(function(r){c=i({},c,B(e,a,t||{},r)),s=i({},s,function(e,r,t){var n;return(n={})[r]={resource:{couldPerform:function(t){return!Re(q(t),e,r)},isPerforming:function(t){return Re(q(t),e,r)},hasSucceeded:function(t){return je(q(t),e,r,"hasSucceeded")},hasFailed:function(t){return je(q(t),e,r,"hasFailed")},isValid:function(t){return!je(q(t),e,r,"didInvalidate")},couldPerformOnId:function(t,n){return!Re(q(t),e,r,n)},isPerformingOnId:function(t,n){return Re(q(t),e,r,n)},hasSucceededOnId:function(t,n){return je(q(t),e,r,"hasSucceeded",n)},hasFailedOnId:function(t,n){return je(q(t),e,r,"hasFailed",n)},isValidId:function(t,n){return!je(q(t),e,r,"didInvalidate",n)}},request:{getResource:function(n,o){var a=2>=arguments.length||void 0===arguments[2]||arguments[2];return Se(q(n),e,le(e,r,o),a,t)},getMetadata:function(t,n){return function(e,r){return e.requests&&e.requests[r]&&e.requests[r].metadata?e.requests[r].metadata:{}}(q(t),le(e,r,n))},couldPerform:function(t,n){return!ke(q(t),le(e,r,n))},isPerforming:function(t,n){return ke(q(t),le(e,r,n))},hasSucceeded:function(t,n){return _e(q(t),le(e,r,n),"hasSucceeded")},hasFailed:function(t,n){return _e(q(t),le(e,r,n),"hasFailed")},isValid:function(t,n){return!_e(q(t),le(e,r,n),"didInvalidate")}}},n}(e,r,u))}),{actions:c,selectors:s}}},e.reducer=Ue,e.reset=function(){return(0,Ve().resetAll)()},e.initializeNetworkHelpers=function(e){!function(e){P=e?i({},F,e):F}(e)},e.getPersistableState=function(e,r){return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.alwaysPersist,n=r.neverPersist;if(!e||!Object.keys(e).length)return{};var o="string"==typeof t?[t]:t,a="string"==typeof n?[n]:n,u=Object.entries(e.requests||{}).reduce(function(e,r){var t,n,u=r[0],c=r[1];return i({},e,c&&c.endedAt&&o&&c.payloadIds&&Object.keys(c.payloadIds).some(function(e){return o.includes(e)})?((t={})[u]=c,t):!c||!c.endedAt||c.didInvalidate||S(c.expireAt)||a&&c.payloadIds&&Object.keys(c.payloadIds).some(function(e){return a.includes(e)})?{}:((n={})[u]="never"===c.expireAt?i({},c,{didInvalidate:!0}):c,n))},{}),c=Object.values(u).reduce(function(e,r){return i({},e,Object.entries(r.payloadIds||{}).reduce(function(e,r){var t,n=r[0];return i({},e,((t={})[n]=[].concat(e[n]||[],r[1].map(function(e){return""+e})),t))},{}))},{}),s=Object.entries(e.resources||{}).reduce(function(e,r){var t,n=r[0];return i({},e,((t={})[n]=Object.entries(r[1]||{}).reduce(function(e,r){var t,o=r[0],a=r[1];return i({},e,c[n]&&c[n].includes(o)?((t={})[o]=a,t):{})},{}),t))},{}),f=Object.entries(s).reduce(function(e,r){var t,n=r[0],o=r[1];return i({},e,Object.keys(o).length?((t={})[n]=o,t):{})},{}),d=i({},e.resolversHashes||{},{requests:Object.entries(e.resolversHashes&&e.resolversHashes.requests?e.resolversHashes.requests:{}).reduce(function(e,r){var t,n=r[0];return i({},e,u[n]?((t={})[n]=r[1],t):{})},{}),resources:Object.entries(e.resolversHashes&&e.resolversHashes.resources?e.resolversHashes.resources:{}).reduce(function(r,t){var n,o=t[0],a=t[1];return i({},r,f[o]&&Object.keys(e.resources[o]).length===Object.keys(f[o]).length?((n={})[o]=a,n):{})},{})});return i({},e,{requests:u,resources:f,resolversHashes:d})}(e,r)},Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "@brigad/redux-rest-easy", | ||
"version": "2.9.0", | ||
"version": "2.9.1", | ||
"description": "Redux/React/React Native framework generating actions, reducers and selectors to perform network requests", | ||
@@ -5,0 +5,0 @@ "main": "dist/redux-rest-easy.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
459259