@brigad/redux-rest-easy
Advanced tools
Comparing version 2.6.0 to 2.7.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","react","react-redux"],t):t(e.ReduxRestEasy={},e.React,e.ReactRedux)}(this,function(e,t,r){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}o(function(e){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",s=t.regeneratorRuntime;if(s)e.exports=s;else{(s=t.regeneratorRuntime=e.exports).wrap=m;var f="suspendedStart",l="suspendedYield",d="executing",p="completed",h={},v={};v[u]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==n&&o.call(g,u)&&(v=g);var b=j.prototype=_.prototype=Object.create(v);E.prototype=b.constructor=j,j.constructor=E,j[c]=E.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,j):(e.__proto__=j,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(b),e},s.awrap=function(e){return{__await:e}},O(w.prototype),w.prototype[a]=function(){return this},s.AsyncIterator=w,s.async=function(e,t,r,n){var o=new w(m(e,t,r,n));return s.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},O(b),b[c]="Generator",b[u]=function(){return this},b.toString=function(){return"[object Generator]"},s.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},s.values=S,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},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 t=this;function n(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],a=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,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var i=n;break}}!i||"break"!==e&&"continue"!==e||i.tryLoc>t||t>i.finallyLoc||(i=null);var u=i?i.completion:{};return u.type=e,u.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(u)},complete:function(e,t){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&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),h}}}function m(e,t,r,n){var o=Object.create((t&&t.prototype instanceof _?t:_).prototype),i=new R(n||[]);return o._invoke=function(e,t,r){var n=f;return function(o,i){if(n===d)throw Error("Generator is already running");if(n===p){if("throw"===o)throw i;return q()}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var a=C(u,r);if(a){if(a===h)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=A(e,t,r);if("normal"===c.type){if(n=r.done?p:l,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,i),o}function A(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function _(){}function E(){}function j(){}function O(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(e){var t;this._invoke=function(r,n){function i(){return new Promise(function(t,i){!function t(r,n,i,u){var a=A(e[r],e,n);if("throw"!==a.type){var c=a.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(e){t("next",e,i,u)},function(e){t("throw",e,i,u)}):Promise.resolve(s).then(function(e){c.value=e,i(c)},u)}u(a.arg)}(r,n,t,i)})}return t=t?t.then(i,i):i()}}function C(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=A(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}return{next:q}}function q(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())});var i,u,a,c,s=function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,i){try{var u=t[o](i),a=u.value}catch(e){return void r(e)}if(!u.done)return Promise.resolve(a).then(function(e){n("next",e)},function(e){n("throw",e)});e(a)}("next")})}},f=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(e){return function(t,n){for(var o=arguments.length,i=Array(o>2?o-2:0),u=2;o>u;u++)i[u-2]=arguments[u];return r.connect.apply(void 0,[t,n&&"function"==typeof n?function(){var t=n.apply(void 0,arguments);return Object.keys(t).reduce(function(r,n){var o;return l({},r,((o={})[n]=function(){var r=t[n].apply(t,arguments);return r&&r.__actionName&&r.__requestURL&&(e(r.__actionName,r.__requestURL),delete r.__actionName,delete r.__requestURL),r},o))},{})}:n].concat(i))}},h=function(e,t){return function(r){return{type:e,resourceName:t,resourceId:r}}},v=function(e,t,r){return"@@rest-easy/"+e+"/"+t+"/"+r.toUpperCase()},y=function(e){var t=function(e){return{INVALIDATE_RESOURCE:v(e,"@invalidate","INVALIDATE_RESOURCE"),INVALIDATE_ID:v(e,"@invalidate","INVALIDATE_ID"),RESET_RESOURCE:v(e,"@reset","RESET_RESOURCE")}}(e),r=t.INVALIDATE_ID,n=t.RESET_RESOURCE;return{resource:{invalidate:h(t.INVALIDATE_RESOURCE,e),invalidateId:h(r,e),reset:h(n,e)}}},g=function(e,t){return function(r,n,o,i){return{type:t,url:r,resourceId:n,payload:o&&Object.keys(o).length?o:void 0,principalResourceIds:"string"==typeof i?[i]:i,cacheLifetime:e}}},b=function(e,t,r){var n=function(e,t){return{REQUEST:v(e,t,"REQUEST"),RECEIVE:v(e,t,"RECEIVE"),FAIL:v(e,t,"FAIL"),RECEIVE_FROM_CACHE:v(e,t,"RECEIVE_FROM_CACHE")}}(e,t),o=n.RECEIVE,i=n.FAIL,u=n.RECEIVE_FROM_CACHE;return{REQUEST:g(r,n.REQUEST),RECEIVE:g(r,o),FAIL:g(r,i),RECEIVE_FROM_CACHE:g(r,u)}},m={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},A=function(e){throw{name:"SyntaxError",message:e,at:i,text:a}},_=function(e){return e&&e!==u&&A("Expected '"+e+"' instead of '"+u+"'"),u=a.charAt(i),i+=1,u},E=function(){var e,t="";for("-"===u&&(t="-",_("-"));u>="0"&&"9">=u;)t+=u,_();if("."===u)for(t+=".";_()&&u>="0"&&"9">=u;)t+=u;if("e"===u||"E"===u)for(t+=u,_(),"-"!==u&&"+"!==u||(t+=u,_());u>="0"&&"9">=u;)t+=u,_();if(isFinite(e=+t))return e;A("Bad number")},j=function(){var e,t,r,n="";if('"'===u)for(;_();){if('"'===u)return _(),n;if("\\"===u)if(_(),"u"===u){for(r=0,t=0;4>t&&(e=parseInt(_(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof m[u])break;n+=m[u]}else n+=u}A("Bad string")},O=function(){for(;u&&" ">=u;)_()};c=function(){switch(O(),u){case"{":return function(){var e,t={};if("{"===u){if(_("{"),O(),"}"===u)return _("}"),t;for(;u;){if(e=j(),O(),_(":"),Object.hasOwnProperty.call(t,e)&&A('Duplicate key "'+e+'"'),t[e]=c(),O(),"}"===u)return _("}"),t;_(","),O()}}A("Bad object")}();case"[":return function(){var e=[];if("["===u){if(_("["),O(),"]"===u)return _("]"),e;for(;u;){if(e.push(c()),O(),"]"===u)return _("]"),e;_(","),O()}}A("Bad array")}();case'"':return j();case"-":return E();default:return"0">u||u>"9"?function(){switch(u){case"t":return _("t"),_("r"),_("u"),_("e"),!0;case"f":return _("f"),_("a"),_("l"),_("s"),_("e"),!1;case"n":return _("n"),_("u"),_("l"),_("l"),null}A("Unexpected '"+u+"'")}():E()}};var w,C,x,I=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,R={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function S(e){return I.lastIndex=0,I.test(e)?'"'+e.replace(I,function(e){var t=R[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}var q,k=void 0!==JSON?JSON:{parse:function(e,t){var r;return a=e,i=0,u=" ",r=c(),O(),u&&A("Syntax error"),"function"==typeof t?function e(r,n){var o,i,u=r[n];if(u&&"object"==typeof u)for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(void 0!==(i=e(u,o))?u[o]=i:delete u[o]);return t.call(r,n,u)}({"":r},""):r},stringify:function(e,t,r){var n;if(w="",C="","number"==typeof r)for(n=0;r>n;n+=1)C+=" ";else"string"==typeof r&&(C=r);if(x=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return function e(t,r){var n,o,i,u,a,c=w,s=r[t];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(t)),"function"==typeof x&&(s=x.call(r,t,s)),typeof s){case"string":return S(s);case"number":return isFinite(s)?s+"":"null";case"boolean":case"null":return s+"";case"object":if(!s)return"null";if(w+=C,a=[],"[object Array]"===Object.prototype.toString.apply(s)){for(u=s.length,n=0;u>n;n+=1)a[n]=e(n,s)||"null";return i=0===a.length?"[]":w?"[\n"+w+a.join(",\n"+w)+"\n"+c+"]":"["+a.join(",")+"]",w=c,i}if(x&&"object"==typeof x)for(u=x.length,n=0;u>n;n+=1)"string"==typeof(o=x[n])&&(i=e(o,s))&&a.push(S(o)+(w?": ":":")+i);else for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(i=e(o,s))&&a.push(S(o)+(w?": ":":")+i);return i=0===a.length?"{}":w?"{\n"+w+a.join(",\n"+w)+"\n"+c+"}":"{"+a.join(",")+"}",w=c,i}}("",{"":e})}},T=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var n,o="boolean"==typeof t.cycles&&t.cycles,i=t.replacer||function(e,t){return t},u=t.cmp&&(n=t.cmp,function(e){return function(t,r){return n({key:t,value:e[t]},{key:r,value:e[r]})}}),a=[];return function e(t,n,c,s){var f=r?"\n"+Array(s+1).join(r):"",l=r?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=i.call(t,n,c))){if("object"!=typeof c||null===c)return k.stringify(c);if(L(c)){for(var d=[],p=0;c.length>p;p++){var h=e(c,p,c[p],s+1)||k.stringify(null);d.push(f+r+h)}return"["+d.join(",")+f+"]"}if(-1!==a.indexOf(c)){if(o)return k.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}a.push(c);var v=N(c).sort(u&&u(c));for(d=[],p=0;v.length>p;p++){var y=e(c,n=v[p],c[n],s+1);if(y){var g=k.stringify(n)+l+y;d.push(f+r+g)}}return a.splice(a.indexOf(c),1),"{"+d.join(",")+f+"}"}}({"":e},"",e,0)},L=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},N=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r},F=o(function(e,t){var r=Object.prototype.hasOwnProperty,n=function(){for(var e=[],t=0;256>t;++t)e.push("%"+((16>t?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;e.length>n;++n)void 0!==e[n]&&(r[n]=e[n]);return r},t.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||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var i=e;return Array.isArray(e)&&!Array.isArray(n)&&(i=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,i){r.call(e,i)?e[i]&&"object"==typeof e[i]?e[i]=t.merge(e[i],n,o):e.push(n):e[i]=n}),e):Object.keys(n).reduce(function(e,i){var u=n[i];return e[i]=r.call(e,i)?t.merge(e[i],u,o):u,e},i)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:e+"",r="",o=0;t.length>o;++o){var i=t.charCodeAt(o);45!==i&&46!==i&&95!==i&&126!==i&&(48>i||i>57)&&(65>i||i>90)&&(97>i||i>122)?128>i?r+=n[i]:2048>i?r+=n[192|i>>6]+n[128|63&i]:i>=55296&&57344>i?(i=65536+((1023&i)<<10|1023&t.charCodeAt(o+=1)),r+=n[240|i>>18]+n[128|i>>12&63]+n[128|i>>6&63]+n[128|63&i]):r+=n[224|i>>12]+n[128|i>>6&63]+n[128|63&i]:r+=t.charAt(o)}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;t.length>n;++n)for(var o=t[n],i=o.obj[o.prop],u=Object.keys(i),a=0;u.length>a;++a){var c=u[a],s=i[c];"object"==typeof s&&null!==s&&-1===r.indexOf(s)&&(t.push({obj:i,prop:c}),r.push(s))}return function(e){for(var t;e.length;){var r=e.pop();if(Array.isArray(t=r.obj[r.prop])){for(var n=[],o=0;t.length>o;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}}),P=String.prototype.replace,H=/%20/g,U={default:"RFC3986",formatters:{RFC1738:function(e){return P.call(e,H,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},D={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},z=Date.prototype.toISOString,B={delimiter:"&",encode:!0,encoder:F.encode,encodeValuesOnly:!1,serializeDate:function(e){return z.call(e)},skipNulls:!1,strictNullHandling:!1},V=function e(t,r,n,o,i,u,a,c,s,f,l,d){var p=t;if("function"==typeof a)p=a(r,p);else if(p instanceof Date)p=f(p);else if(null===p){if(o)return u&&!d?u(r,B.encoder):r;p=""}if("string"==typeof p||"number"==typeof p||"boolean"==typeof p||F.isBuffer(p))return u?[l(d?r:u(r,B.encoder))+"="+l(u(p,B.encoder))]:[l(r)+"="+l(p+"")];var h,v=[];if(void 0===p)return v;if(Array.isArray(a))h=a;else{var y=Object.keys(p);h=c?y.sort(c):y}for(var g=0;h.length>g;++g){var b=h[g];i&&null===p[b]||(v=v.concat(e(p[b],Array.isArray(p)?n(r,b):r+(s?"."+b:"["+b+"]"),n,o,i,u,a,c,s,f,l,d)))}return v},M=function(e,t){var r=e,n=t?F.assign({},t):{};if(null!=n.encoder&&"function"!=typeof n.encoder)throw new TypeError("Encoder has to be a function.");var o=void 0===n.delimiter?B.delimiter:n.delimiter,i="boolean"==typeof n.strictNullHandling?n.strictNullHandling:B.strictNullHandling,u="boolean"==typeof n.skipNulls?n.skipNulls:B.skipNulls,a="boolean"==typeof n.encode?n.encode:B.encode,c="function"==typeof n.encoder?n.encoder:B.encoder,s="function"==typeof n.sort?n.sort:null,f=void 0!==n.allowDots&&n.allowDots,l="function"==typeof n.serializeDate?n.serializeDate:B.serializeDate,d="boolean"==typeof n.encodeValuesOnly?n.encodeValuesOnly:B.encodeValuesOnly;if(void 0===n.format)n.format=U.default;else if(!Object.prototype.hasOwnProperty.call(U.formatters,n.format))throw new TypeError("Unknown format option provided.");var p,h,v=U.formatters[n.format];"function"==typeof n.filter?r=(h=n.filter)("",r):Array.isArray(n.filter)&&(p=h=n.filter);var y=[];if("object"!=typeof r||null===r)return"";var g=D[n.arrayFormat in D?n.arrayFormat:"indices"in n?n.indices?"indices":"repeat":"indices"];p||(p=Object.keys(r)),s&&p.sort(s);for(var b=0;p.length>b;++b){var m=p[b];u&&null===r[m]||(y=y.concat(V(r[m],m,g,i,u,a?c:null,h,s,f,l,v,d)))}var A=y.join(o);return A.length>0?(!0===n.addQueryPrefix?"?":"")+A:""},G=function(e){var t,r=(t=e)&&Object.keys(t)?M(t):"";return r?"?"+r:""},J=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)},Q=function(e){return"never"!==e&&(!e||new Date>new Date(e))},K=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];if(e&&"function"==typeof e)return e.apply(void 0,r)},Y=window,$={getToken:function(){return"token"},requestGET:function(){var e=this;return s(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"GET",headers:l({Accept:"application/json"},(r=t.t0)?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},requestPATCH:function(e){var t=this;return s(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PATCH",headers:l({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPUT:function(e){var t=this;return s(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PUT",headers:l({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPOST:function(e){var t=this;return s(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"POST",headers:l({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestDELETE:function(){var e=this;return s(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return r=t.t0,t.abrupt("return",{method:"DELETE",headers:l({Accept:"application/json"},e.getToken&&e.getToken()?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},handleStatusCode:function(e){if(e){if(e.status>=200&&300>e.status)return e;var t=Error(e.statusText);throw t.response=e,t}return null},handleError:(q=s(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t||!t.response){e.next=8;break}return e.next=4,t.response.json();case 4:console.error(e.sent),e.next=9;break;case 8:console.error(t);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,Y,[[0,11]])})),function(e,t){return q.apply(this,arguments)})},W=$,X=function(){return W},Z=window,ee=function(e,t,r,n,o,i,u){return function(e,a,c){return function(){var f,d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},p=d.query,h=void 0===p?{}:p,v=d.body,y=void 0===v?{}:v,g=d.urlParams,b=void 0===g?{}:g,m=d.onSuccess,A=d.onError,_=function(e,t){var r={};for(var n in e)0>t.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(d,["query","body","urlParams","onSuccess","onError"]);return f=s(regeneratorRuntime.mark(function s(f,d){var p,v,g,E,j,O,w;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return p=l({},X(),u||{}),f(t.REQUEST(a,c)),s.prev=2,s.next=5,K(n,b,h,y,_,f);case 5:return v=s.sent||y,s.t0=fetch,s.t1=e,s.next=11,p["request"+r](v);case 11:return s.t2=s.sent,s.next=14,(0,s.t0)(s.t1,s.t2);case 14:if(p.handleStatusCode(g=s.sent),204===g.status){s.next=22;break}return s.next=19,g.json();case 19:s.t3=s.sent,s.next=23;break;case 22:s.t3={};case 23:return E=s.t3,j=o?o(E,J(d()).resources,b,h,v,_):{entities:E},f(t.RECEIVE(a,c,O=j.entities,Array.isArray(w=j.result)?w:[w])),s.next=29,K(i,O||{},b,h,v,_,f);case 29:return K(m,O||{},_),s.abrupt("return",{normalizedPayload:O||{},otherArgs:_});case 33:return s.prev=33,s.t4=s.catch(2),f(t.FAIL(a,c)),p.handleError(s.t4,f),K(A,s.t4),s.abrupt("return",{error:s.t4});case 39:case"end":return s.stop()}},s,Z,[[2,33]])})),function(e,t){return f.apply(this,arguments)}}}},te=function(e,t,r,n){var o=r[n],i=o.method,u=o.url,a=o.beforeHook,c=o.normalizer,s=o.afterHook,f=o.networkHelpers,l=b(e,n,t),d=ee(0,l,i,a,c,s,f);return function(t){return function(r,o){var a=J(o()),c=t||{},s=c.urlParams,f=c.query,p=function(e){var t=("string"!=typeof e?e():e).split("/").reverse(),r=t.findIndex(function(e){return e.startsWith("::")});return-1!==r?t.length-1-r:-1}(u),h=function(e,t,r){var n="string"!=typeof e?e():e;t&&Object.keys(t).forEach(function(e){n=n.replace("::"+e,t[e]).replace(":"+e,t[e])});var o=r?G(JSON.parse(T(r))):"";return""+n+o}(u,s,f),v=function(e,t){return(e||"")+":"+(t||"")}(n,h),y=function(e,t){if(!e||!t&&0!==t||-1===t)return null;for(var r=0,n=0;t>n;n+=1)r=e.indexOf("/",r+1);var o=e.indexOf("/",r+1);return e.substr(r+1,-1!==o?o-r-1:e.length)}(v,p),g=void 0;(function(e,t){return!(e&&t&&e.requests&&e.requests[t]&&!e.requests[t].endedAt)})(a,v)&&function(e,t,r){if(!("GET"===t&&e&&r&&e.requests&&e.requests[r]))return!0;var n=e.requests[r];return!n.hasSucceeded||n.didInvalidate||Q(n.expireAt)}(a,i,v)&&(g=function(e,t,r,n){return!!("GET"===t&&e&&e.requests&&r&&null!==n)&&Object.values(e.requests).some(function(e){var t=e.expireAt,o=e.payloadIds;return e.hasSucceeded&&!e.didInvalidate&&(r===e.resourceName&&n===e.resourceId||o&&o[r]&&o[r].includes(n))&&!Q(t)})}(a,i,e,y)?function(){var t,n;return r(l.RECEIVE_FROM_CACHE(v,y,((n={})[e]=((t={})[y]=null,t),n),[y]))}:function(){return r(d(h,v,y)(t))});var b=g?g():{};return b.__actionName=n,b.__requestURL=v,b}}},re=function(e,t,r,n){var o,i=function(e){return{INVALIDATE_REQUEST:v(e,"@invalidate","INVALIDATE_REQUEST")}}(e).INVALIDATE_REQUEST;return(o={})[n]={perform:te(e,t,r,n),invalidate:function(e,t){return function(r){return{type:e,url:r,resourceName:t}}}(i,e)},o},ne="[object Object]";var oe,ie,ue=Object.prototype,ae=Function.prototype.toString,ce=ue.hasOwnProperty,se=ae.call(Object),fe=ue.toString,le=(oe=Object.getPrototypeOf,ie=Object,function(e){return oe(ie(e))});var de,pe=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||fe.call(e)!=ne||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=le(e);if(null===t)return!0;var r=ce.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ae.call(r)==se},he=function(e){return function(t){throw Error("redux-rest-easy: "+e+" "+t)}},ve=function(e){return"string"==typeof e},ye=function(e){return"function"==typeof e},ge=function(e){return void 0!==e},be=["method","url"],me=[].concat(be,["beforeHook","normalizer","afterHook","networkHelpers"]),Ae=["GET","POST","PATCH","PUT","DELETE"],_e=function(e){return e+" >"},Ee=function(e,t){return e+' "'+t+'" 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'},je=function(e,t){if(t){if(!pe(t)||!Object.keys(t).length)he(_e(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(t).forEach(function(r){var n=he(_e(e)+" "+function(e){return e+" >"}(r)+" createResource >"),o=t[r],i=Object.keys(o);be.forEach(function(e){i.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')}),i.forEach(function(e){me.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,a=o.url,c=o.beforeHook,s=o.normalizer,f=o.afterHook,l=o.networkHelpers;ve(u)&&Ae.includes(u)||n(function(e){return'Method "'+e+'" is invalid. Expected one of: '+Ae.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)),a&&(ve(a)||ye(a))||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'}(a)),ge(c)&&!ye(c)&&n(Ee("beforeHook",c)),ge(s)&&!ye(s)&&n(Ee("normalizer",s)),ge(f)&&!ye(f)&&n(Ee("afterHook",f)),ge(l)&&!pe(l)&&n("networkHelpers"+' "'+l+'" 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(l||{}).forEach(function(e){ge(l[e])&&!ye(l[e])&&n(e+' "networkHelpers.'+l[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')})})}},Oe=function(e){return void 0!==e},we=["cacheLifetime","denormalizer"],Ce=function(e,t){var r,n=(r=function(e){return e+" >"}(e||"[no resource name]")+" createResource >",function(e){throw Error("redux-rest-easy: "+r+" "+e)});if(e&&"string"==typeof e||n("You have to provide a valid resource name."),t){pe(t)&&Object.keys(t).length||n("You have to provide a valid resource configuration (or not at all)."),Object.keys(t).forEach(function(e){we.includes(e)||n(function(e){return'Unknown key "'+e+'" in resource config.'}(e))});var o=t.cacheLifetime,i=t.denormalizer;!Oe(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)),Oe(i)&&!function(e){return"function"==typeof e}(i)&&n(function(e,t){return e+' "'+t+'" in resource config is invalid. Expected a valid function.'}("denormalizer",i))}},xe=o(function(e,t){function r(e,t){return e===t}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return function(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!e(t[o],r[o]))return!1;return!0}(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),i=0;t>i;i++)o[i]=arguments[i];var u=0,a=o.pop(),c=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var r=t.map(function(e){return typeof e}).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}(o),s=e.apply(void 0,[function(){return u++,a.apply(null,arguments)}].concat(r)),f=n(function(){for(var e=[],t=c.length,r=0;t>r;r++)e.push(c[r].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=a,f.recomputations=function(){return u},f.resetRecomputations=function(){return u=0},f}}t.__esModule=!0,t.defaultMemoize=n,t.createSelectorCreator=o,t.createStructuredSelector=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;if("object"!=typeof e)throw Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.reduce(function(e,t,n){return e[r[n]]=t,e},{})})};var i=t.createSelector=o(n)});(de=xe)&&de.__esModule&&Object.prototype.hasOwnProperty.call(de,"default");var Ie=xe.createSelectorCreator,Re=xe.createSelector,Se=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qe=function(){function e(){Se(this,e),this._cache={}}return e.prototype.set=function(e,t){this._cache[e]=t},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}();function ke(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=qe;return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=void 0,i=void 0;"function"==typeof r?(console.warn('[re-reselect] Deprecation warning: "selectorCreator" argument is discouraged and will be removed in the upcoming major release. Please use "options.selectorCreator" instead.'),o=new n,i=r):(o=r.cacheObject||new n,i=r.selectorCreator||Re);var u=function(){var r=e.apply(void 0,arguments);if("string"==typeof r||"number"==typeof r){var n=o.get(r);return void 0===n&&(n=i.apply(void 0,t),o.set(r,n)),n.apply(void 0,arguments)}};return u.getMatchingSelector=function(){var t=e.apply(void 0,arguments);return o.get(t)},u.removeMatchingSelector=function(){var t=e.apply(void 0,arguments);o.remove(t)},u.clearCache=function(){o.clear()},u.resultFunc=t[t.length-1],u}}var Te=function(e){return e.split(":")[0]},Le=function(e,t,r){return r?r.__requestURLsByActionKey?r.__requestURLsByActionKey[t]:(console.error("You may have forgotten to use redux-rest-easy's connect on a Component which requested "+e+"."+t+"\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+"."+t+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/selectors.md#actionrequest"),"")},Ne={selectorCreator:Ie(function(e){var t=null;return function(){return t||(t=e.apply(void 0,arguments)),t}})},Fe=function(){return Ne},Pe=function(e,t,r){return t?Object.keys(t).reduce(function(n,o){var i;return l({},n,((i={})[o]=o===e?r:Object.keys(t[o]||{}),i))},{}):{}},He=o(function(e,t){!function(r,n){var o={version:"2.1.2",x86:{},x64:{}};function i(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function u(e,t){return e<<t|e>>>32-t}function a(e){return e=i(e^=e>>>16,2246822507),e=i(e^=e>>>13,3266489909),e^=e>>>16}function c(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]+(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function s(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]*(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function f(e,t){return 32===(t%=64)?[e[1],e[0]]:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:[e[1]<<(t-=32)|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t]}function l(e,t){return 0===(t%=64)?e:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function d(e,t){return[e[0]^t[0],e[1]^t[1]]}function p(e){return e=d(e=s(e=d(e=s(e=d(e,[0,e[0]>>>1]),[4283543511,3981806797]),[0,e[0]>>>1]),[3301882366,444984403]),[0,e[0]>>>1])}o.x86.hash32=function(e,t){for(var r=(e=e||"").length%4,n=e.length-r,o=t=t||0,c=0,s=3432918353,f=461845907,l=0;n>l;l+=4)o=i(o=u(o^=c=i(c=u(c=i(c=255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24,s),15),f),13),5)+3864292196;switch(c=0,r){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:o^=c=i(c=u(c=i(c^=255&e.charCodeAt(l),s),15),f)}return(o=a(o^=e.length))>>>0},o.x86.hash128=function(e,t){for(var r=(e=e||"").length%16,n=e.length-r,o=t=t||0,c=t,s=t,f=t,l=0,d=0,p=0,h=0,v=597399067,y=2869860233,g=951274213,b=2716044179,m=0;n>m;m+=16)l=255&e.charCodeAt(m)|(255&e.charCodeAt(m+1))<<8|(255&e.charCodeAt(m+2))<<16|(255&e.charCodeAt(m+3))<<24,d=255&e.charCodeAt(m+4)|(255&e.charCodeAt(m+5))<<8|(255&e.charCodeAt(m+6))<<16|(255&e.charCodeAt(m+7))<<24,p=255&e.charCodeAt(m+8)|(255&e.charCodeAt(m+9))<<8|(255&e.charCodeAt(m+10))<<16|(255&e.charCodeAt(m+11))<<24,h=255&e.charCodeAt(m+12)|(255&e.charCodeAt(m+13))<<8|(255&e.charCodeAt(m+14))<<16|(255&e.charCodeAt(m+15))<<24,o=u(o^=l=i(l=u(l=i(l,v),15),y),19),o=i(o+=c,5)+1444728091,c=u(c^=d=i(d=u(d=i(d,y),16),g),17),c=i(c+=s,5)+197830471,s=u(s^=p=i(p=u(p=i(p,g),17),b),15),s=i(s+=f,5)+2530024501,f=u(f^=h=i(h=u(h=i(h,b),18),v),13),f=i(f+=o,5)+850148119;switch(l=0,d=0,p=0,h=0,r){case 15:h^=e.charCodeAt(m+14)<<16;case 14:h^=e.charCodeAt(m+13)<<8;case 13:f^=h=i(h=u(h=i(h^=e.charCodeAt(m+12),b),18),v);case 12:p^=e.charCodeAt(m+11)<<24;case 11:p^=e.charCodeAt(m+10)<<16;case 10:p^=e.charCodeAt(m+9)<<8;case 9:s^=p=i(p=u(p=i(p^=e.charCodeAt(m+8),g),17),b);case 8:d^=e.charCodeAt(m+7)<<24;case 7:d^=e.charCodeAt(m+6)<<16;case 6:d^=e.charCodeAt(m+5)<<8;case 5:c^=d=i(d=u(d=i(d^=e.charCodeAt(m+4),y),16),g);case 4:l^=e.charCodeAt(m+3)<<24;case 3:l^=e.charCodeAt(m+2)<<16;case 2:l^=e.charCodeAt(m+1)<<8;case 1:o^=l=i(l=u(l=i(l^=e.charCodeAt(m),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=a(o),o+=c=a(c),o+=s=a(s),c+=o+=f=a(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,t){for(var r=(e=e||"").length%16,n=e.length-r,o=[0,t=t||0],i=[0,t],u=[0,0],a=[0,0],h=[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],a=[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=d(o,u=s(u=f(u=s(u,h),31),v)),27),i),[0,5]),[0,1390208809]),i=c(s(i=c(i=f(i=d(i,a=s(a=f(a=s(a,v),33),h)),31),o),[0,5]),[0,944331445]);switch(u=[0,0],a=[0,0],r){case 15:a=d(a,l([0,e.charCodeAt(y+14)],48));case 14:a=d(a,l([0,e.charCodeAt(y+13)],40));case 13:a=d(a,l([0,e.charCodeAt(y+12)],32));case 12:a=d(a,l([0,e.charCodeAt(y+11)],24));case 11:a=d(a,l([0,e.charCodeAt(y+10)],16));case 10:a=d(a,l([0,e.charCodeAt(y+9)],8));case 9:i=d(i,a=s(a=f(a=s(a=d(a,[0,e.charCodeAt(y+8)]),v),33),h));case 8:u=d(u,l([0,e.charCodeAt(y+7)],56));case 7:u=d(u,l([0,e.charCodeAt(y+6)],48));case 6:u=d(u,l([0,e.charCodeAt(y+5)],40));case 5:u=d(u,l([0,e.charCodeAt(y+4)],32));case 4:u=d(u,l([0,e.charCodeAt(y+3)],24));case 3:u=d(u,l([0,e.charCodeAt(y+2)],16));case 2:u=d(u,l([0,e.charCodeAt(y+1)],8));case 1:o=d(o,u=s(u=f(u=s(u=d(u,[0,e.charCodeAt(y)]),h),31),v))}return o=d(o,[0,e.length]),i=c(i=d(i,[0,e.length]),o=c(o,i)),o=p(o),i=c(i=p(i),o=c(o,i)),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)},e.exports&&(t=e.exports=o),t.murmurHash3=o}()}),Ue=He,De=o(function(e){e.exports={v3:Ue},function(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}.main===e&&console.log(e.exports.v3)}).v3,ze=function(e){return De.x64.hash128(T(e||null))},Be=ze([]),Ve=function(e,t,r,n,o){var i,u,a=e.requests,c=void 0===a?{}:a,s=e.resources,f=void 0===s?{}:s,d=e.resolversHashes,p=void 0===d?{}:d,h=Pe(t,n,o);return l({},p,{requests:l({},p.requests||{},(i={},i[r]=Object.keys(h).reduce(function(e,t){var n;return l({},e,((n={})[t]=c[r]&&c[r].payloadIds&&c[r].payloadIds[t]?ze(c[r].payloadIds[t]):Be,n))},{}),i)),resources:l({},p.resources||{},(u={_getResourcesHash:function(){return ze(f)}},u[t]=f[t]?ze(f[t]):Be,u))})},Me=function(){return Be},Ge=function(e,t,r){return e&&e.requests&&e.requests[t]&&e.requests[t][r]?e.requests[t][r]:Be},Je=function(e,t){return e&&e.resources&&e.resources[t]?e.resources[t]:Be},Qe=[],Ke=function(e,t){return("number"==typeof e?""+e:e)===("number"==typeof t?""+t:t)},Ye=function(e,t,r){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],i=o.resourceName,u=o.resourceId,a=o.endedAt;return Te(e[0])===r&&i===t&&(-1===n||null!==u&&Ke(u,n))&&!a})},$e=function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,i=e.requests&&Object.entries(e.requests).filter(function(e){var n=e[1],i=n.resourceName,u=n.resourceId,a=n.endedAt,c=n.payloadIds;return Te(e[0])===r&&i===t&&(-1===o||null!==u&&Ke(u,o)||!!a&&c&&c[t]&&c[t].includes(o))}).map(function(e){return e[1]});return!(!i||!i.length)&&i.reduce(function(e,t){return t.endedAt&&e.endedAt&&t.endedAt>e.endedAt?t:e},i[0])[n]},We=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},Xe=function(e,t,r){return e.requests&&e.requests[r]&&e.requests[r].payloadIds&&e.requests[r].payloadIds[t]?e.requests[r].payloadIds[t]:null},Ze=ke(function(e){return e.resources},We,Xe,function(e,t,r,n){return n},function(e,t,r,n,o){return o},function(e,t,r,n,o){return t&&r?n&&o?o(r,e):r.reduce(function(e,r){return[].concat(e,[t[r]])},[]):Qe})(function(e,t,r,n,o){var i=We(e,t),u=Xe(e,t,r),a=function(e){return e.resolversHashes}(e);return i&&u?n&&o?n+"-"+Object.keys(e.requests[r].payloadIds).map(function(e){return Ge(a,r,e)+"-"+Je(a,e)}).join("--"):n+"-"+Ge(a,r,t)+"-"+Je(a,t):Me()},Fe()),et=function(e,t){return!(!e.requests||!e.requests[t]||e.requests[t].endedAt)},tt=function(e,t,r){return!!(e.requests&&e.requests[t]&&e.requests[t][r])},rt=[],nt=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},ot=ke(function(e){return e.resources},nt,function(e,t,r){return r},function(e,t,r,n){return n},function(e,t,r,n){return t?r&&n?n(Object.keys(t),e):Object.values(t):rt})(function(e,t,r,n){var o=nt(e,t),i=function(e){return e.resolversHashes}(e);return o?r&&n?r+"-"+function(e){return e&&e.resources&&e.resources._getResourcesHash?e.resources._getResourcesHash():Be}(i):r+"-"+Je(i,t):Me()},Fe()),it=function(e){var t=e.split("/");return{resourceName:t[1],actionName:t[2],caseName:t[3]}},ut=o(function(e,t){var r=200,o="__lodash_hash_undefined__",i=800,u=16,a=9007199254740991,c="[object Arguments]",s="[object AsyncFunction]",f="[object Function]",l="[object GeneratorFunction]",d="[object Null]",p="[object Object]",h="[object Proxy]",v="[object Undefined]",y=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,b={};b["[object Float32Array]"]=b["[object Float64Array]"]=b["[object Int8Array]"]=b["[object Int16Array]"]=b["[object Int32Array]"]=b["[object Uint8Array]"]=b["[object Uint8ClampedArray]"]=b["[object Uint16Array]"]=b["[object Uint32Array]"]=!0,b[c]=b["[object Array]"]=b["[object ArrayBuffer]"]=b["[object Boolean]"]=b["[object DataView]"]=b["[object Date]"]=b["[object Error]"]=b[f]=b["[object Map]"]=b["[object Number]"]=b[p]=b["[object RegExp]"]=b["[object Set]"]=b["[object String]"]=b["[object WeakMap]"]=!1;var m="object"==typeof n&&n&&n.Object===Object&&n,A="object"==typeof self&&self&&self.Object===Object&&self,_=m||A||Function("return this")(),E=t&&!t.nodeType&&t,j=E&&e&&!e.nodeType&&e,O=j&&j.exports===E,w=O&&m.process,C=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),x=C&&C.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var R,S,q,k=Array.prototype,T=Object.prototype,L=_["__core-js_shared__"],N=Function.prototype.toString,F=T.hasOwnProperty,P=(R=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"",H=T.toString,U=N.call(Object),D=RegExp("^"+N.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=O?_.Buffer:void 0,B=_.Symbol,V=_.Uint8Array,M=z?z.allocUnsafe:void 0,G=(S=Object.getPrototypeOf,q=Object,function(e){return S(q(e))}),J=Object.create,Q=T.propertyIsEnumerable,K=k.splice,Y=B?B.toStringTag:void 0,$=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=z?z.isBuffer:void 0,X=Math.max,Z=Date.now,ee=_e(_,"Map"),te=_e(Object,"create"),re=function(){function e(){}return function(t){if(!ke(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ue(e){var t=this.__data__=new oe(e);this.size=t.size}function ae(e,t){var r=xe(e),n=!r&&Ce(e),o=!r&&!n&&Re(e),i=!r&&!n&&!o&&Le(e),u=r||n||o||i,a=u?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=a.length;for(var s in e)!t&&!F.call(e,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ee(s,c))||a.push(s);return a}function ce(e,t,r){(void 0===r||we(e[t],r))&&(void 0!==r||t in e)||le(e,t,r)}function se(e,t,r){var n=e[t];F.call(e,t)&&we(n,r)&&(void 0!==r||t in e)||le(e,t,r)}function fe(e,t){for(var r=e.length;r--;)if(we(e[r][0],t))return r;return-1}function le(e,t,r){"__proto__"==t&&$?$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===o?void 0:r}return F.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:F.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?o:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=fe(t,e);return r>=0&&(r==t.length-1?t.pop():K.call(t,r,1),--this.size,!0)},oe.prototype.get=function(e){var t=this.__data__,r=fe(t,e);return 0>r?void 0:t[r][1]},oe.prototype.has=function(e){return fe(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=fe(r,e);return 0>n?(++this.size,r.push([e,t])):r[n][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ie.prototype.delete=function(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return Ae(this,e).get(e)},ie.prototype.has=function(e){return Ae(this,e).has(e)},ie.prototype.set=function(e,t){var r=Ae(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ue.prototype.clear=function(){this.__data__=new oe,this.size=0},ue.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ue.prototype.get=function(e){return this.__data__.get(e)},ue.prototype.has=function(e){return this.__data__.has(e)},ue.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||r-1>o.length)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ie(o)}return n.set(e,t),this.size=n.size,this};var de,pe=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),u=i.length;u--;){var a=i[de?u:++n];if(!1===t(o[a],a,o))break}return e};function he(e){return null==e?void 0===e?v:d:Y&&Y in Object(e)?function(e){var t=F.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=H.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return H.call(e)}(e)}function ve(e){return Te(e)&&he(e)==c}function ye(e){return!(!ke(e)||P&&P in e)&&(Se(e)?D:y).test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ke(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=je(e),r=[];for(var n in e)("constructor"!=n||!t&&F.call(e,n))&&r.push(n);return r}function be(e,t,r,n,o){e!==t&&pe(t,function(i,u){if(ke(i))o||(o=new ue),function(e,t,r,n,o,i,u){var a=I(e,r),c=I(t,r),s=u.get(c);if(s)return void ce(e,r,s);var f=i?i(a,c,r+"",e,t,u):void 0,l=void 0===f;if(l){var d=xe(c),h=!d&&Re(c),v=!d&&!h&&Le(c);f=c,d||h||v?xe(a)?f=a:Te(A=a)&&Ie(A)?f=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(a):h?(l=!1,f=function(e,t){if(t)return e.slice();var r=e.length,n=M?M(r):new e.constructor(r);return e.copy(n),n}(c,!0)):v?(l=!1,y=c,g=!0?(new V(m=new(b=y.buffer).constructor(b.byteLength)).set(new V(b)),m):y.buffer,f=new y.constructor(g,y.byteOffset,y.length)):f=[]:function(e){if(!Te(e)||he(e)!=p)return!1;var t=G(e);if(null===t)return!0;var r=F.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&N.call(r)==U}(c)||Ce(c)?(f=a,Ce(a)?f=function(e){return function(e,t,r,n){var o=!r;r||(r={});var i=-1,u=t.length;for(;++i<u;){var a=t[i],c=n?n(r[a],e[a],a,r,e):void 0;void 0===c&&(c=e[a]),o?le(r,a,c):se(r,a,c)}return r}(e,Ne(e))}(a):(!ke(a)||n&&Se(a))&&(f=function(e){return"function"!=typeof e.constructor||je(e)?{}:re(G(e))}(c))):l=!1}var y,g,b,m;var A;l&&(u.set(c,f),o(f,c,n,i,u),u.delete(c));ce(e,r,f)}(e,t,u,r,be,n,o);else{var a=n?n(I(e,u),i,u+"",e,t,o):void 0;void 0===a&&(a=i),ce(e,u,a)}},Ne)}function me(e,t){return Oe(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=X(n.length-t,0),u=Array(i);++o<i;)u[o]=n[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=n[o];return a[t]=r(u),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,t,He),e+"")}function Ae(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function _e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function Ee(e,t){var r=typeof e;return!!(t=null==t?a:t)&&("number"==r||"symbol"!=r&&g.test(e))&&e>-1&&e%1==0&&t>e}function je(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||T)}var Oe=function(e){var t=0,r=0;return function(){var n=Z(),o=u-(n-r);if(r=n,o>0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}($?function(e,t){return $(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:He);function we(e,t){return e===t||e!=e&&t!=t}var Ce=ve(function(){return arguments}())?ve:function(e){return Te(e)&&F.call(e,"callee")&&!Q.call(e,"callee")},xe=Array.isArray;function Ie(e){return null!=e&&qe(e.length)&&!Se(e)}var Re=W||function(){return!1};function Se(e){if(!ke(e))return!1;var t=he(e);return t==f||t==l||t==s||t==h}function qe(e){return"number"==typeof e&&e>-1&&e%1==0&&a>=e}function ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Le=x?function(e){return function(t){return e(t)}}(x):function(e){return Te(e)&&qe(e.length)&&!!b[he(e)]};function Ne(e){return Ie(e)?ae(e,!0):ge(e)}var Fe,Pe=(Fe=function(e,t,r,n){be(e,t,r,n)},me(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,i=n>2?t[2]:void 0;for(o=Fe.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(e,t,r){if(!ke(r))return!1;var n=typeof t;return!!("number"==n?Ie(r)&&Ee(t,r.length):"string"==n&&t in r)&&we(r[t],e)}(t[0],t[1],i)&&(o=3>n?void 0:o,n=1),e=Object(e);++r<n;){var u=t[r];u&&Fe(e,u,r,o)}return e}));function He(e){return e}e.exports=Pe}),at=function(e,t){return ut(e.resources,t,function(e,t){return pe(e)?l({},e,t):void 0})},ct={},st={REQUEST:function(e,t){var r,n=t.url,o=t.resourceId;return l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{resourceName:it(t.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}),r))})},RECEIVE:function(e,t){var r,n=t.url,o=t.payload,i=t.principalResourceIds,u=t.cacheLifetime,a=void 0===u?0:u,c=it(t.type).resourceName,s=l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),expireAt:a!==1/0?new Date((new Date).getTime()+1e3*a).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!1,payloadIds:Pe(c,o,i)}),r)),resources:at(e,o)});return l({},s,{resolversHashes:Ve(s,c,n,o,i)})},FAIL:function(e,t){var r,n=t.url;return l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),hasSucceeded:!1,hasFailed:!0}),r))})},RECEIVE_FROM_CACHE:function(e,t){var r,n=t.type,o=t.url,i=t.resourceId,u=t.payload,a=t.principalResourceIds,c=t.cacheLifetime,s=void 0===c?0:c,f=it(n).resourceName,d=l({},e,{requests:l({},e.requests||{},(r={},r[o]=l({},e.requests&&e.requests[o]?e.requests[o]:{},{resourceName:it(n).resourceName,resourceId:i,startedAt:(new Date).toISOString(),endedAt:(new Date).toISOString(),expireAt:s!==1/0?new Date((new Date).getTime()+1e3*s).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!0,payloadIds:Pe(f,u,a)}),r)),resources:at(e,u)});return l({},d,{resolversHashes:Ve(d,f,o,u,a)})},INVALIDATE_RESOURCE:function(e,t){var r=t.resourceName;return l({},e,{requests:l({},Object.entries(e.requests||{}).reduce(function(e,t){var n,o=t[1];return l({},e,((n={})[t[0]]=!o.didInvalidate&&(o.resourceName===r||o.payloadIds&&o.payloadIds[r])?l({},o,{didInvalidate:!0}):o,n))},{}))})},INVALIDATE_ID:function(e,t){var r=t.resourceName,n=t.resourceId;return l({},e,{requests:l({},Object.entries(e.requests||{}).reduce(function(e,t){var o,i=t[1];return l({},e,((o={})[t[0]]=!i.didInvalidate&&(i.resourceName===r&&i.resourceId===n||i.payloadIds&&i.payloadIds[r]&&i.payloadIds[r].map(function(e){return""+e}).includes(""+n))?l({},i,{didInvalidate:!0}):i,o))},{}))})},INVALIDATE_REQUEST:function(e,t){var r,n=t.url;return l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{didInvalidate:!0}),r))})},RESET_RESOURCE:function(e,t){var r,n=t.resourceName,o=l({},e,{requests:l({},Object.entries(e.requests||{}).filter(function(e){var t=e[1],r=t.payloadIds;return!(n===t.resourceName||r&&Object.keys(r).includes(n))}).reduce(function(e,t){var r;return l({},e,((r={})[t[0]]=t[1],r))},{})),resources:l({},e.resources||{},(r={},r[n]=void 0,r))});return l({},o,{resolversHashes:function(e,t){var r,n=e.requests,o=void 0===n?{}:n,i=e.resolversHashes,u=void 0===i?{}:i;return l({},u,{requests:l({},Object.entries(u.requests||{}).reduce(function(e,t){var r,n=t[0],i=t[1];return l({},e,Object.keys(o).includes(n)?((r={})[n]=i,r):{})},{})),resources:l({},u.resources||{},(r={},r[t]=Be,r))})}(o,n)})},RESET_ALL:function(){return{}}},ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ct;return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===t)return e;if(!r.type||!r.type.startsWith("@@rest-easy"))return t;var n=st[it(r.type).caseName];return n?n(t,r):t}}(),lt=function(){var e,t={RESET_ALL:v("@global","@reset","RESET_ALL")};return{resetAll:(e=t.RESET_ALL,function(){return{type:e}})}};e.connect=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",o=function(n){function o(t){f(this,o);var i=d(this,n.call(this,t));return i.onInjectProps=function(e,t){i.setState(function(r){var n;return r.__requestURLsByActionKey[e]!==t?{__requestURLsByActionKey:l({},r.__requestURLsByActionKey,(n={},n[e]=t,n))}:null})},i.getWrappedInstance=function(){return i.innerRef&&i.innerRef.getWrappedInstance?i.innerRef.getWrappedInstance():null},i.state={__requestURLsByActionKey:{}},i.ConnectedComponent=p(i.onInjectProps).apply(void 0,r)(e),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype.render=function(){var e=this,r=this.ConnectedComponent,n=l({},this.props,this.state);return t.createElement(r,l({ref:function(t){e.innerRef=t}},n))},o}(t.Component);return o.displayName="EasyConnect("+n+")",o}},e.createResource=function(e,t){return function(r){Ce(e,t),je(e,r);var n=t||{},o=n.cacheLifetime,i=void 0===o?0:o,u=n.denormalizer,a=l({},y(e)),c=l({},function(e,t){return{resource:{getResource:function(r){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return ot(J(r),e,n,t)},getResourceById:function(r,n){var o=2>=arguments.length||void 0===arguments[2]||arguments[2];return function(e,t,r,n,o){return n&&o?o([r],e.resources)[0]||null:e.resources&&e.resources[t]&&e.resources[t][r]?e.resources[t][r]:null}(J(r),e,n,o,t)}}}}(e,u));return Object.keys(r||{}).forEach(function(t){a=l({},a,re(e,i,r||{},t)),c=l({},c,function(e,t,r){var n;return(n={})[t]={resource:{couldPerform:function(r){return!Ye(J(r),e,t)},isPerforming:function(r){return Ye(J(r),e,t)},isValid:function(r){return!$e(J(r),e,t,"didInvalidate")},hasSucceeded:function(r){return $e(J(r),e,t,"hasSucceeded")},hasFailed:function(r){return $e(J(r),e,t,"hasFailed")},couldPerformOnId:function(r,n){return!Ye(J(r),e,t,n)},isPerformingOnId:function(r,n){return Ye(J(r),e,t,n)},hasSucceededOnId:function(r,n){return $e(J(r),e,t,"hasSucceeded",n)},hasFailedOnId:function(r,n){return $e(J(r),e,t,"hasFailed",n)},isValidId:function(r,n){return!$e(J(r),e,t,"didInvalidate",n)}},request:{getResource:function(n,o){var i=2>=arguments.length||void 0===arguments[2]||arguments[2];return Ze(J(n),e,Le(e,t,o),i,r)},couldPerform:function(r,n){return!et(J(r),Le(e,t,n))},isPerforming:function(r,n){return et(J(r),Le(e,t,n))},isValid:function(r,n){return!tt(J(r),Le(e,t,n),"didInvalidate")},hasSucceeded:function(r,n){return tt(J(r),Le(e,t,n),"hasSucceeded")},hasFailed:function(r,n){return tt(J(r),Le(e,t,n),"hasFailed")}}},n}(e,t,u))}),{actions:a,selectors:c}}},e.reducer=ft,e.reset=function(){return(0,lt().resetAll)()},e.initializeNetworkHelpers=function(e){!function(e){W=e?l({},$,e):$}(e)},e.getPersistableState=function(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.alwaysPersist,n=t.neverPersist;if(!e||!Object.keys(e).length)return{};var o="string"==typeof r?[r]:r,i="string"==typeof n?[n]:n,u=Object.entries(e.requests||{}).reduce(function(e,t){var r,n,u=t[0],a=t[1];return l({},e,a.endedAt&&o&&a.payloadIds&&Object.keys(a.payloadIds).some(function(e){return o.includes(e)})?((r={})[u]=a,r):i&&a.payloadIds&&Object.keys(a.payloadIds).some(function(e){return i.includes(e)})||!a.endedAt||a.didInvalidate||Q(a.expireAt)?{}:((n={})[u]="never"===a.expireAt?l({},a,{didInvalidate:!0}):a,n))},{}),a=Object.values(u||{}).reduce(function(e,t){return l({},e,Object.entries(t.payloadIds||{}).reduce(function(e,t){var r,n=t[0];return l({},e,((r={})[n]=[].concat(e[n]||[],t[1].map(function(e){return""+e})),r))},{}))},{}),c=Object.entries(e.resources||{}).reduce(function(e,t){var r,n=t[0];return l({},e,((r={})[n]=Object.entries(t[1]||{}).reduce(function(e,t){var r,o=t[0],i=t[1];return l({},e,a[n]&&a[n].includes(o)?((r={})[o]=i,r):{})},{}),r))},{}),s=Object.entries(c||{}).reduce(function(e,t){var r,n=t[0],o=t[1];return l({},e,Object.keys(o).length?((r={})[n]=o,r):{})},{}),f=l({},e.resolversHashes||{},{requests:Object.entries(e.resolversHashes&&e.resolversHashes.requests?e.resolversHashes.requests:{}).reduce(function(e,t){var r,n=t[0];return l({},e,u[n]?((r={})[n]=t[1],r):{})},{}),resources:Object.entries(e.resolversHashes&&e.resolversHashes.resources?e.resolversHashes.resources:{}).reduce(function(t,r){var n,o=r[0],i=r[1];return l({},t,s[o]&&Object.keys(e.resources&&e.resources[o]?e.resources[o]:{}).length===Object.keys(s[o]||{}).length?((n={})[o]=i,n):{})},{})});return l({},e,{requests:u,resources:s,resolversHashes:f})}(e,t)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","react","react-redux"],t):t(e.ReduxRestEasy={},e.React,e.ReactRedux)}(this,function(e,t,r){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}o(function(e){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",s=t.regeneratorRuntime;if(s)e.exports=s;else{(s=t.regeneratorRuntime=e.exports).wrap=b;var f="suspendedStart",l="suspendedYield",d="executing",p="completed",h={},v={};v[u]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==n&&o.call(g,u)&&(v=g);var m=j.prototype=_.prototype=Object.create(v);E.prototype=m.constructor=j,j.constructor=E,j[c]=E.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,j):(e.__proto__=j,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},s.awrap=function(e){return{__await:e}},O(w.prototype),w.prototype[i]=function(){return this},s.AsyncIterator=w,s.async=function(e,t,r,n){var o=new w(b(e,t,r,n));return s.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},O(m),m[c]="Generator",m[u]=function(){return this},m.toString=function(){return"[object Generator]"},s.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},s.values=S,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},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 t=this;function n(n,o){return i.type="throw",i.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!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,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}!a||"break"!==e&&"continue"!==e||a.tryLoc>t||t>a.finallyLoc||(a=null);var u=a?a.completion:{};return u.type=e,u.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(u)},complete:function(e,t){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&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),h}}}function b(e,t,r,n){var o=Object.create((t&&t.prototype instanceof _?t:_).prototype),a=new R(n||[]);return o._invoke=function(e,t,r){var n=f;return function(o,a){if(n===d)throw Error("Generator is already running");if(n===p){if("throw"===o)throw a;return q()}for(r.method=o,r.arg=a;;){var u=r.delegate;if(u){var i=C(u,r);if(i){if(i===h)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=A(e,t,r);if("normal"===c.type){if(n=r.done?p:l,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,a),o}function A(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function _(){}function E(){}function j(){}function O(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(e){var t;this._invoke=function(r,n){function a(){return new Promise(function(t,a){!function t(r,n,a,u){var i=A(e[r],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){t("next",e,a,u)},function(e){t("throw",e,a,u)}):Promise.resolve(s).then(function(e){c.value=e,a(c)},u)}u(i.arg)}(r,n,t,a)})}return t=t?t.then(a,a):a()}}function C(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=A(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}return{next:q}}function q(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())});var a,u,i,c,s=function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,a){try{var u=t[o](a),i=u.value}catch(e){return void r(e)}if(!u.done)return Promise.resolve(i).then(function(e){n("next",e)},function(e){n("throw",e)});e(i)}("next")})}},f=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},l=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},p=function(e){return function(t,n){for(var o=arguments.length,a=Array(o>2?o-2:0),u=2;o>u;u++)a[u-2]=arguments[u];return r.connect.apply(void 0,[t,n&&"function"==typeof n?function(){var t=n.apply(void 0,arguments);return Object.keys(t).reduce(function(r,n){var o;return l({},r,((o={})[n]=function(){var r=t[n].apply(t,arguments);return r&&r.__actionName&&r.__requestURL&&(e(r.__actionName,r.__requestURL),delete r.__actionName,delete r.__requestURL),r},o))},{})}:n].concat(a))}},h=function(e,t){return function(r){return{type:e,resourceName:t,resourceId:r}}},v=function(e,t,r){return"@@rest-easy/"+e+"/"+t+"/"+r.toUpperCase()},y=function(e){var t=function(e){return{INVALIDATE_RESOURCE:v(e,"@invalidate","INVALIDATE_RESOURCE"),INVALIDATE_ID:v(e,"@invalidate","INVALIDATE_ID"),RESET_RESOURCE:v(e,"@reset","RESET_RESOURCE")}}(e),r=t.INVALIDATE_ID,n=t.RESET_RESOURCE;return{resource:{invalidate:h(t.INVALIDATE_RESOURCE,e),invalidateId:h(r,e),reset:h(n,e)}}},g=function(e,t){return function(r,n,o,a,u){return{type:t,url:r,resourceId:n,payload:o&&Object.keys(o).length?o:void 0,metadata:a,principalResourceIds:"string"==typeof u?[u]:u,cacheLifetime:e}}},m=function(e,t,r){var n=function(e,t){return{REQUEST:v(e,t,"REQUEST"),RECEIVE:v(e,t,"RECEIVE"),FAIL:v(e,t,"FAIL"),RECEIVE_FROM_CACHE:v(e,t,"RECEIVE_FROM_CACHE")}}(e,t),o=n.RECEIVE,a=n.FAIL,u=n.RECEIVE_FROM_CACHE;return{REQUEST:g(r,n.REQUEST),RECEIVE:g(r,o),FAIL:g(r,a),RECEIVE_FROM_CACHE:g(r,u)}},b={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},A=function(e){throw{name:"SyntaxError",message:e,at:a,text:i}},_=function(e){return e&&e!==u&&A("Expected '"+e+"' instead of '"+u+"'"),u=i.charAt(a),a+=1,u},E=function(){var e,t="";for("-"===u&&(t="-",_("-"));u>="0"&&"9">=u;)t+=u,_();if("."===u)for(t+=".";_()&&u>="0"&&"9">=u;)t+=u;if("e"===u||"E"===u)for(t+=u,_(),"-"!==u&&"+"!==u||(t+=u,_());u>="0"&&"9">=u;)t+=u,_();if(isFinite(e=+t))return e;A("Bad number")},j=function(){var e,t,r,n="";if('"'===u)for(;_();){if('"'===u)return _(),n;if("\\"===u)if(_(),"u"===u){for(r=0,t=0;4>t&&(e=parseInt(_(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof b[u])break;n+=b[u]}else n+=u}A("Bad string")},O=function(){for(;u&&" ">=u;)_()};c=function(){switch(O(),u){case"{":return function(){var e,t={};if("{"===u){if(_("{"),O(),"}"===u)return _("}"),t;for(;u;){if(e=j(),O(),_(":"),Object.hasOwnProperty.call(t,e)&&A('Duplicate key "'+e+'"'),t[e]=c(),O(),"}"===u)return _("}"),t;_(","),O()}}A("Bad object")}();case"[":return function(){var e=[];if("["===u){if(_("["),O(),"]"===u)return _("]"),e;for(;u;){if(e.push(c()),O(),"]"===u)return _("]"),e;_(","),O()}}A("Bad array")}();case'"':return j();case"-":return E();default:return"0">u||u>"9"?function(){switch(u){case"t":return _("t"),_("r"),_("u"),_("e"),!0;case"f":return _("f"),_("a"),_("l"),_("s"),_("e"),!1;case"n":return _("n"),_("u"),_("l"),_("l"),null}A("Unexpected '"+u+"'")}():E()}};var w,C,x,I=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,R={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function S(e){return I.lastIndex=0,I.test(e)?'"'+e.replace(I,function(e){var t=R[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}var q,k=void 0!==JSON?JSON:{parse:function(e,t){var r;return i=e,a=0,u=" ",r=c(),O(),u&&A("Syntax error"),"function"==typeof t?function e(r,n){var o,a,u=r[n];if(u&&"object"==typeof u)for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(void 0!==(a=e(u,o))?u[o]=a:delete u[o]);return t.call(r,n,u)}({"":r},""):r},stringify:function(e,t,r){var n;if(w="",C="","number"==typeof r)for(n=0;r>n;n+=1)C+=" ";else"string"==typeof r&&(C=r);if(x=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return function e(t,r){var n,o,a,u,i,c=w,s=r[t];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(t)),"function"==typeof x&&(s=x.call(r,t,s)),typeof s){case"string":return S(s);case"number":return isFinite(s)?s+"":"null";case"boolean":case"null":return s+"";case"object":if(!s)return"null";if(w+=C,i=[],"[object Array]"===Object.prototype.toString.apply(s)){for(u=s.length,n=0;u>n;n+=1)i[n]=e(n,s)||"null";return a=0===i.length?"[]":w?"[\n"+w+i.join(",\n"+w)+"\n"+c+"]":"["+i.join(",")+"]",w=c,a}if(x&&"object"==typeof x)for(u=x.length,n=0;u>n;n+=1)"string"==typeof(o=x[n])&&(a=e(o,s))&&i.push(S(o)+(w?": ":":")+a);else for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(a=e(o,s))&&i.push(S(o)+(w?": ":":")+a);return a=0===i.length?"{}":w?"{\n"+w+i.join(",\n"+w)+"\n"+c+"}":"{"+i.join(",")+"}",w=c,a}}("",{"":e})}},T=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var n,o="boolean"==typeof t.cycles&&t.cycles,a=t.replacer||function(e,t){return t},u=t.cmp&&(n=t.cmp,function(e){return function(t,r){return n({key:t,value:e[t]},{key:r,value:e[r]})}}),i=[];return function e(t,n,c,s){var f=r?"\n"+Array(s+1).join(r):"",l=r?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=a.call(t,n,c))){if("object"!=typeof c||null===c)return k.stringify(c);if(L(c)){for(var d=[],p=0;c.length>p;p++){var h=e(c,p,c[p],s+1)||k.stringify(null);d.push(f+r+h)}return"["+d.join(",")+f+"]"}if(-1!==i.indexOf(c)){if(o)return k.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}i.push(c);var v=N(c).sort(u&&u(c));for(d=[],p=0;v.length>p;p++){var y=e(c,n=v[p],c[n],s+1);if(y){var g=k.stringify(n)+l+y;d.push(f+r+g)}}return i.splice(i.indexOf(c),1),"{"+d.join(",")+f+"}"}}({"":e},"",e,0)},L=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},N=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r},F=o(function(e,t){var r=Object.prototype.hasOwnProperty,n=function(){for(var e=[],t=0;256>t;++t)e.push("%"+((16>t?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;e.length>n;++n)void 0!==e[n]&&(r[n]=e[n]);return r},t.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||!r.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=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,a){r.call(e,a)?e[a]&&"object"==typeof e[a]?e[a]=t.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]=r.call(e,a)?t.merge(e[a],u,o):u,e},a)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:e+"",r="",o=0;t.length>o;++o){var a=t.charCodeAt(o);45!==a&&46!==a&&95!==a&&126!==a&&(48>a||a>57)&&(65>a||a>90)&&(97>a||a>122)?128>a?r+=n[a]:2048>a?r+=n[192|a>>6]+n[128|63&a]:a>=55296&&57344>a?(a=65536+((1023&a)<<10|1023&t.charCodeAt(o+=1)),r+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]):r+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a]:r+=t.charAt(o)}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;t.length>n;++n)for(var o=t[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===r.indexOf(s)&&(t.push({obj:a,prop:c}),r.push(s))}return function(e){for(var t;e.length;){var r=e.pop();if(Array.isArray(t=r.obj[r.prop])){for(var n=[],o=0;t.length>o;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}}),P=String.prototype.replace,H=/%20/g,U={default:"RFC3986",formatters:{RFC1738:function(e){return P.call(e,H,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},z={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},D=Date.prototype.toISOString,B={delimiter:"&",encode:!0,encoder:F.encode,encodeValuesOnly:!1,serializeDate:function(e){return D.call(e)},skipNulls:!1,strictNullHandling:!1},V=function e(t,r,n,o,a,u,i,c,s,f,l,d){var p=t;if("function"==typeof i)p=i(r,p);else if(p instanceof Date)p=f(p);else if(null===p){if(o)return u&&!d?u(r,B.encoder):r;p=""}if("string"==typeof p||"number"==typeof p||"boolean"==typeof p||F.isBuffer(p))return u?[l(d?r:u(r,B.encoder))+"="+l(u(p,B.encoder))]:[l(r)+"="+l(p+"")];var h,v=[];if(void 0===p)return v;if(Array.isArray(i))h=i;else{var y=Object.keys(p);h=c?y.sort(c):y}for(var g=0;h.length>g;++g){var m=h[g];a&&null===p[m]||(v=v.concat(e(p[m],Array.isArray(p)?n(r,m):r+(s?"."+m:"["+m+"]"),n,o,a,u,i,c,s,f,l,d)))}return v},M=function(e,t){var r=e,n=t?F.assign({},t):{};if(null!=n.encoder&&"function"!=typeof n.encoder)throw new TypeError("Encoder has to be a function.");var o=void 0===n.delimiter?B.delimiter:n.delimiter,a="boolean"==typeof n.strictNullHandling?n.strictNullHandling:B.strictNullHandling,u="boolean"==typeof n.skipNulls?n.skipNulls:B.skipNulls,i="boolean"==typeof n.encode?n.encode:B.encode,c="function"==typeof n.encoder?n.encoder:B.encoder,s="function"==typeof n.sort?n.sort:null,f=void 0!==n.allowDots&&n.allowDots,l="function"==typeof n.serializeDate?n.serializeDate:B.serializeDate,d="boolean"==typeof n.encodeValuesOnly?n.encodeValuesOnly:B.encodeValuesOnly;if(void 0===n.format)n.format=U.default;else if(!Object.prototype.hasOwnProperty.call(U.formatters,n.format))throw new TypeError("Unknown format option provided.");var p,h,v=U.formatters[n.format];"function"==typeof n.filter?r=(h=n.filter)("",r):Array.isArray(n.filter)&&(p=h=n.filter);var y=[];if("object"!=typeof r||null===r)return"";var g=z[n.arrayFormat in z?n.arrayFormat:"indices"in n?n.indices?"indices":"repeat":"indices"];p||(p=Object.keys(r)),s&&p.sort(s);for(var m=0;p.length>m;++m){var b=p[m];u&&null===r[b]||(y=y.concat(V(r[b],b,g,a,u,i?c:null,h,s,f,l,v,d)))}var A=y.join(o);return A.length>0?(!0===n.addQueryPrefix?"?":"")+A:""},G=function(e){var t,r=(t=e)&&Object.keys(t)?M(t):"";return r?"?"+r:""},J=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)},Q=function(e){return"never"!==e&&(!e||new Date>new Date(e))},K=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];if(e&&"function"==typeof e)return e.apply(void 0,r)},Y=window,$={getToken:function(){return"token"},requestGET:function(){var e=this;return s(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"GET",headers:l({Accept:"application/json"},(r=t.t0)?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},requestPATCH:function(e){var t=this;return s(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PATCH",headers:l({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPUT:function(e){var t=this;return s(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PUT",headers:l({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPOST:function(e){var t=this;return s(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"POST",headers:l({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestDELETE:function(){var e=this;return s(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return r=t.t0,t.abrupt("return",{method:"DELETE",headers:l({Accept:"application/json"},e.getToken&&e.getToken()?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},handleStatusCode:function(e){if(e){if(e.status>=200&&300>e.status)return e;var t=Error(e.statusText);throw t.response=e,t}return null},handleError:(q=s(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t||!t.response){e.next=8;break}return e.next=4,t.response.json();case 4:console.error(e.sent),e.next=9;break;case 8:console.error(t);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,Y,[[0,11]])})),function(e,t){return q.apply(this,arguments)})},W=$,X=function(){return W},Z=window,ee=function(e,t,r,n,o,a,u,i){return function(e,c,f){return function(){var d,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=p.query,v=void 0===h?{}:h,y=p.body,g=void 0===y?{}:y,m=p.urlParams,b=void 0===m?{}:m,A=p.onSuccess,_=p.onError,E=function(e,t){var r={};for(var n in e)0>t.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(p,["query","body","urlParams","onSuccess","onError"]);return d=s(regeneratorRuntime.mark(function s(d,p){var h,y,m,j,O,w,C,x;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return h=l({},X(),i||{}),d(t.REQUEST(c,f)),s.prev=2,s.next=5,K(n,b,v,g,E,d);case 5:return y=s.sent||g,s.t0=fetch,s.t1=e,s.next=11,h["request"+r](y);case 11:return s.t2=s.sent,s.next=14,(0,s.t0)(s.t1,s.t2);case 14:if(h.handleStatusCode(m=s.sent),204===m.status){s.next=22;break}return s.next=19,m.json();case 19:s.t3=s.sent,s.next=23;break;case 22:s.t3={};case 23:return j=s.t3,O=o?o(j,J(p()).resources,b,v,y,E):{entities:j},w=O.entities,C=O.result,x=a?a(j,J(p()).resources,b,v,y,E):null,d(t.RECEIVE(c,f,w,x,Array.isArray(C)?C:[C])),s.next=30,K(u,w||{},b,v,y,E,d);case 30:return K(A,w||{},E),s.abrupt("return",{normalizedPayload:w||{},otherArgs:E});case 34:return s.prev=34,s.t4=s.catch(2),d(t.FAIL(c,f)),h.handleError(s.t4,d),K(_,s.t4),s.abrupt("return",{error:s.t4});case 40:case"end":return s.stop()}},s,Z,[[2,34]])})),function(e,t){return d.apply(this,arguments)}}}},te=function(e,t,r,n){var o=r[n],a=o.method,u=o.url,i=o.beforeHook,c=o.normalizer,s=o.metadataNormalizer,f=o.afterHook,l=o.networkHelpers,d=m(e,n,t),p=ee(0,d,a,i,c,s,f,l);return function(t){return function(r,o){var i=J(o()),c=t||{},s=c.urlParams,f=c.query,l=function(e){var t=("string"!=typeof e?e():e).split("/").reverse(),r=t.findIndex(function(e){return e.startsWith("::")});return-1!==r?t.length-1-r:-1}(u),h=function(e,t,r){var n="string"!=typeof e?e():e;t&&Object.keys(t).forEach(function(e){n=n.replace("::"+e,t[e]).replace(":"+e,t[e])});var o=r?G(JSON.parse(T(r))):"";return""+n+o}(u,s,f),v=function(e,t){return(e||"")+":"+(t||"")}(n,h),y=function(e,t){if(!e||!t&&0!==t||-1===t)return null;for(var r=0,n=0;t>n;n+=1)r=e.indexOf("/",r+1);var o=e.indexOf("/",r+1);return e.substr(r+1,-1!==o?o-r-1:e.length)}(v,l),g=void 0;(function(e,t){return!(e&&t&&e.requests&&e.requests[t]&&!e.requests[t].endedAt)})(i,v)&&function(e,t,r){if(!("GET"===t&&e&&r&&e.requests&&e.requests[r]))return!0;var n=e.requests[r];return!n.hasSucceeded||n.didInvalidate||Q(n.expireAt)}(i,a,v)&&(g=function(e,t,r,n){return!!("GET"===t&&e&&e.requests&&r&&null!==n)&&Object.values(e.requests).some(function(e){var t=e.expireAt,o=e.payloadIds;return e.hasSucceeded&&!e.didInvalidate&&(r===e.resourceName&&n===e.resourceId||o&&o[r]&&o[r].includes(n))&&!Q(t)})}(i,a,e,y)?function(){var t,n;return r(d.RECEIVE_FROM_CACHE(v,y,((n={})[e]=((t={})[y]=null,t),n),null,[y]))}:function(){return r(p(h,v,y)(t))});var m=g?g():{};return m.__actionName=n,m.__requestURL=v,m}}},re=function(e,t,r,n){var o,a=function(e){return{INVALIDATE_REQUEST:v(e,"@invalidate","INVALIDATE_REQUEST")}}(e).INVALIDATE_REQUEST;return(o={})[n]={perform:te(e,t,r,n),invalidate:function(e,t){return function(r){return{type:e,url:r,resourceName:t}}}(a,e)},o},ne="[object Object]";var oe,ae,ue=Object.prototype,ie=Function.prototype.toString,ce=ue.hasOwnProperty,se=ie.call(Object),fe=ue.toString,le=(oe=Object.getPrototypeOf,ae=Object,function(e){return oe(ae(e))});var de,pe=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||fe.call(e)!=ne||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=le(e);if(null===t)return!0;var r=ce.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ie.call(r)==se},he=function(e){return function(t){throw Error("redux-rest-easy: "+e+" "+t)}},ve=function(e){return"string"==typeof e},ye=function(e){return"function"==typeof e},ge=function(e){return void 0!==e},me=["method","url"],be=[].concat(me,["beforeHook","normalizer","metadataNormalizer","afterHook","networkHelpers"]),Ae=["GET","POST","PATCH","PUT","DELETE"],_e=function(e){return e+" >"},Ee=function(e,t){return e+' "'+t+'" 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'},je=function(e,t){if(t){if(!pe(t)||!Object.keys(t).length)he(_e(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(t).forEach(function(r){var n=he(_e(e)+" "+function(e){return e+" >"}(r)+" createResource >"),o=t[r],a=Object.keys(o);me.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){be.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.beforeHook,s=o.normalizer,f=o.metadataNormalizer,l=o.afterHook,d=o.networkHelpers;ve(u)&&Ae.includes(u)||n(function(e){return'Method "'+e+'" is invalid. Expected one of: '+Ae.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&&(ve(i)||ye(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)),ge(c)&&!ye(c)&&n(Ee("beforeHook",c)),ge(s)&&!ye(s)&&n(Ee("normalizer",s)),ge(f)&&!ye(f)&&n(Ee("metadataNormalizer",f)),ge(l)&&!ye(l)&&n(Ee("afterHook",l)),ge(d)&&!pe(d)&&n("networkHelpers"+' "'+d+'" 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(d||{}).forEach(function(e){ge(d[e])&&!ye(d[e])&&n(e+' "networkHelpers.'+d[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')})})}},Oe=function(e){return void 0!==e},we=["cacheLifetime","denormalizer"],Ce=function(e,t){var r,n=(r=function(e){return e+" >"}(e||"[no resource name]")+" createResource >",function(e){throw Error("redux-rest-easy: "+r+" "+e)});if(e&&"string"==typeof e||n("You have to provide a valid resource name."),t){pe(t)&&Object.keys(t).length||n("You have to provide a valid resource configuration (or not at all)."),Object.keys(t).forEach(function(e){we.includes(e)||n(function(e){return'Unknown key "'+e+'" in resource config.'}(e))});var o=t.cacheLifetime,a=t.denormalizer;!Oe(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)),Oe(a)&&!function(e){return"function"==typeof e}(a)&&n(function(e,t){return e+' "'+t+'" in resource config is invalid. Expected a valid function.'}("denormalizer",a))}},xe=o(function(e,t){function r(e,t){return e===t}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return function(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!e(t[o],r[o]))return!1;return!0}(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),a=0;t>a;a++)o[a]=arguments[a];var u=0,i=o.pop(),c=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var r=t.map(function(e){return typeof e}).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}(o),s=e.apply(void 0,[function(){return u++,i.apply(null,arguments)}].concat(r)),f=n(function(){for(var e=[],t=c.length,r=0;t>r;r++)e.push(c[r].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=i,f.recomputations=function(){return u},f.resetRecomputations=function(){return u=0},f}}t.__esModule=!0,t.defaultMemoize=n,t.createSelectorCreator=o,t.createStructuredSelector=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if("object"!=typeof e)throw Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.reduce(function(e,t,n){return e[r[n]]=t,e},{})})};var a=t.createSelector=o(n)});(de=xe)&&de.__esModule&&Object.prototype.hasOwnProperty.call(de,"default");var Ie=xe.createSelectorCreator,Re=xe.createSelector,Se=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},qe=function(){function e(){Se(this,e),this._cache={}}return e.prototype.set=function(e,t){this._cache[e]=t},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}();function ke(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=qe;return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=void 0,a=void 0;"function"==typeof r?(console.warn('[re-reselect] Deprecation warning: "selectorCreator" argument is discouraged and will be removed in the upcoming major release. Please use "options.selectorCreator" instead.'),o=new n,a=r):(o=r.cacheObject||new n,a=r.selectorCreator||Re);var u=function(){var r=e.apply(void 0,arguments);if("string"==typeof r||"number"==typeof r){var n=o.get(r);return void 0===n&&(n=a.apply(void 0,t),o.set(r,n)),n.apply(void 0,arguments)}};return u.getMatchingSelector=function(){var t=e.apply(void 0,arguments);return o.get(t)},u.removeMatchingSelector=function(){var t=e.apply(void 0,arguments);o.remove(t)},u.clearCache=function(){o.clear()},u.resultFunc=t[t.length-1],u}}var Te=function(e){return e.split(":")[0]},Le=function(e,t,r){return r?r.__requestURLsByActionKey?r.__requestURLsByActionKey[t]:(console.error("You may have forgotten to use redux-rest-easy's connect on a Component which requested "+e+"."+t+"\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+"."+t+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/selectors.md#actionrequest"),"")},Ne={selectorCreator:Ie(function(e){var t=null;return function(){return t||(t=e.apply(void 0,arguments)),t}})},Fe=function(){return Ne},Pe=function(e,t,r){return t?Object.keys(t).reduce(function(n,o){var a;return l({},n,((a={})[o]=o===e?r:Object.keys(t[o]||{}),a))},{}):{}},He=o(function(e,t){!function(r,n){var o={version:"2.1.2",x86:{},x64:{}};function a(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function u(e,t){return e<<t|e>>>32-t}function i(e){return e=a(e^=e>>>16,2246822507),e=a(e^=e>>>13,3266489909),e^=e>>>16}function c(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]+(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function s(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]*(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function f(e,t){return 32===(t%=64)?[e[1],e[0]]:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:[e[1]<<(t-=32)|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t]}function l(e,t){return 0===(t%=64)?e:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function d(e,t){return[e[0]^t[0],e[1]^t[1]]}function p(e){return e=d(e=s(e=d(e=s(e=d(e,[0,e[0]>>>1]),[4283543511,3981806797]),[0,e[0]>>>1]),[3301882366,444984403]),[0,e[0]>>>1])}o.x86.hash32=function(e,t){for(var r=(e=e||"").length%4,n=e.length-r,o=t=t||0,c=0,s=3432918353,f=461845907,l=0;n>l;l+=4)o=a(o=u(o^=c=a(c=u(c=a(c=255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24,s),15),f),13),5)+3864292196;switch(c=0,r){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:o^=c=a(c=u(c=a(c^=255&e.charCodeAt(l),s),15),f)}return(o=i(o^=e.length))>>>0},o.x86.hash128=function(e,t){for(var r=(e=e||"").length%16,n=e.length-r,o=t=t||0,c=t,s=t,f=t,l=0,d=0,p=0,h=0,v=597399067,y=2869860233,g=951274213,m=2716044179,b=0;n>b;b+=16)l=255&e.charCodeAt(b)|(255&e.charCodeAt(b+1))<<8|(255&e.charCodeAt(b+2))<<16|(255&e.charCodeAt(b+3))<<24,d=255&e.charCodeAt(b+4)|(255&e.charCodeAt(b+5))<<8|(255&e.charCodeAt(b+6))<<16|(255&e.charCodeAt(b+7))<<24,p=255&e.charCodeAt(b+8)|(255&e.charCodeAt(b+9))<<8|(255&e.charCodeAt(b+10))<<16|(255&e.charCodeAt(b+11))<<24,h=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^=l=a(l=u(l=a(l,v),15),y),19),o=a(o+=c,5)+1444728091,c=u(c^=d=a(d=u(d=a(d,y),16),g),17),c=a(c+=s,5)+197830471,s=u(s^=p=a(p=u(p=a(p,g),17),m),15),s=a(s+=f,5)+2530024501,f=u(f^=h=a(h=u(h=a(h,m),18),v),13),f=a(f+=o,5)+850148119;switch(l=0,d=0,p=0,h=0,r){case 15:h^=e.charCodeAt(b+14)<<16;case 14:h^=e.charCodeAt(b+13)<<8;case 13:f^=h=a(h=u(h=a(h^=e.charCodeAt(b+12),m),18),v);case 12:p^=e.charCodeAt(b+11)<<24;case 11:p^=e.charCodeAt(b+10)<<16;case 10:p^=e.charCodeAt(b+9)<<8;case 9:s^=p=a(p=u(p=a(p^=e.charCodeAt(b+8),g),17),m);case 8:d^=e.charCodeAt(b+7)<<24;case 7:d^=e.charCodeAt(b+6)<<16;case 6:d^=e.charCodeAt(b+5)<<8;case 5:c^=d=a(d=u(d=a(d^=e.charCodeAt(b+4),y),16),g);case 4:l^=e.charCodeAt(b+3)<<24;case 3:l^=e.charCodeAt(b+2)<<16;case 2:l^=e.charCodeAt(b+1)<<8;case 1:o^=l=a(l=u(l=a(l^=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,t){for(var r=(e=e||"").length%16,n=e.length-r,o=[0,t=t||0],a=[0,t],u=[0,0],i=[0,0],h=[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=d(o,u=s(u=f(u=s(u,h),31),v)),27),a),[0,5]),[0,1390208809]),a=c(s(a=c(a=f(a=d(a,i=s(i=f(i=s(i,v),33),h)),31),o),[0,5]),[0,944331445]);switch(u=[0,0],i=[0,0],r){case 15:i=d(i,l([0,e.charCodeAt(y+14)],48));case 14:i=d(i,l([0,e.charCodeAt(y+13)],40));case 13:i=d(i,l([0,e.charCodeAt(y+12)],32));case 12:i=d(i,l([0,e.charCodeAt(y+11)],24));case 11:i=d(i,l([0,e.charCodeAt(y+10)],16));case 10:i=d(i,l([0,e.charCodeAt(y+9)],8));case 9:a=d(a,i=s(i=f(i=s(i=d(i,[0,e.charCodeAt(y+8)]),v),33),h));case 8:u=d(u,l([0,e.charCodeAt(y+7)],56));case 7:u=d(u,l([0,e.charCodeAt(y+6)],48));case 6:u=d(u,l([0,e.charCodeAt(y+5)],40));case 5:u=d(u,l([0,e.charCodeAt(y+4)],32));case 4:u=d(u,l([0,e.charCodeAt(y+3)],24));case 3:u=d(u,l([0,e.charCodeAt(y+2)],16));case 2:u=d(u,l([0,e.charCodeAt(y+1)],8));case 1:o=d(o,u=s(u=f(u=s(u=d(u,[0,e.charCodeAt(y)]),h),31),v))}return o=d(o,[0,e.length]),a=c(a=d(a,[0,e.length]),o=c(o,a)),o=p(o),a=c(a=p(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&&(t=e.exports=o),t.murmurHash3=o}()}),Ue=He,ze=o(function(e){e.exports={v3:Ue},function(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}.main===e&&console.log(e.exports.v3)}).v3,De=function(e){return ze.x64.hash128(T(e||null))},Be=De([]),Ve=function(e,t,r,n,o){var a,u,i=e.requests,c=void 0===i?{}:i,s=e.resources,f=void 0===s?{}:s,d=e.resolversHashes,p=void 0===d?{}:d,h=Pe(t,n,o);return l({},p,{requests:l({},p.requests||{},(a={},a[r]=Object.keys(h).reduce(function(e,t){var n;return l({},e,((n={})[t]=c[r]&&c[r].payloadIds&&c[r].payloadIds[t]?De(c[r].payloadIds[t]):Be,n))},{}),a)),resources:l({},p.resources||{},(u={_getResourcesHash:function(){return De(f)}},u[t]=f[t]?De(f[t]):Be,u))})},Me=function(){return Be},Ge=function(e,t,r){return e&&e.requests&&e.requests[t]&&e.requests[t][r]?e.requests[t][r]:Be},Je=function(e,t){return e&&e.resources&&e.resources[t]?e.resources[t]:Be},Qe=[],Ke=function(e,t){return("number"==typeof e?""+e:e)===("number"==typeof t?""+t:t)},Ye=function(e,t,r){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 Te(e[0])===r&&a===t&&(-1===n||null!==u&&Ke(u,n))&&!i})},$e=function(e,t,r,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 Te(e[0])===r&&a===t&&(-1===o||null!==u&&Ke(u,o)||!!i&&c&&c[t]&&c[t].includes(o))}).map(function(e){return e[1]});return!(!a||!a.length)&&a.reduce(function(e,t){return t.endedAt&&e.endedAt&&t.endedAt>e.endedAt?t:e},a[0])[n]},We=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},Xe=function(e,t,r){return e.requests&&e.requests[r]&&e.requests[r].payloadIds&&e.requests[r].payloadIds[t]?e.requests[r].payloadIds[t]:null},Ze=ke(function(e){return e.resources},We,Xe,function(e,t,r,n){return n},function(e,t,r,n,o){return o},function(e,t,r,n,o){return t&&r?n&&o?o(r,e):r.reduce(function(e,r){return[].concat(e,[t[r]])},[]):Qe})(function(e,t,r,n,o){var a=We(e,t),u=Xe(e,t,r),i=function(e){return e.resolversHashes}(e);return a&&u?n&&o?n+"-"+Object.keys(e.requests[r].payloadIds).map(function(e){return Ge(i,r,e)+"-"+Je(i,e)}).join("--"):n+"-"+Ge(i,r,t)+"-"+Je(i,t):Me()},Fe()),et=function(e,t){return!(!e.requests||!e.requests[t]||e.requests[t].endedAt)},tt=function(e,t,r){return!!(e.requests&&e.requests[t]&&e.requests[t][r])},rt=[],nt=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},ot=ke(function(e){return e.resources},nt,function(e,t,r){return r},function(e,t,r,n){return n},function(e,t,r,n){return t?r&&n?n(Object.keys(t),e):Object.values(t):rt})(function(e,t,r,n){var o=nt(e,t),a=function(e){return e.resolversHashes}(e);return o?r&&n?r+"-"+function(e){return e&&e.resources&&e.resources._getResourcesHash?e.resources._getResourcesHash():Be}(a):r+"-"+Je(a,t):Me()},Fe()),at=function(e){var t=e.split("/");return{resourceName:t[1],actionName:t[2],caseName:t[3]}},ut=o(function(e,t){var r=200,o="__lodash_hash_undefined__",a=800,u=16,i=9007199254740991,c="[object Arguments]",s="[object AsyncFunction]",f="[object Function]",l="[object GeneratorFunction]",d="[object Null]",p="[object Object]",h="[object Proxy]",v="[object Undefined]",y=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,m={};m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m[c]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m[f]=m["[object Map]"]=m["[object Number]"]=m[p]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1;var b="object"==typeof n&&n&&n.Object===Object&&n,A="object"==typeof self&&self&&self.Object===Object&&self,_=b||A||Function("return this")(),E=t&&!t.nodeType&&t,j=E&&e&&!e.nodeType&&e,O=j&&j.exports===E,w=O&&b.process,C=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),x=C&&C.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var R,S,q,k=Array.prototype,T=Object.prototype,L=_["__core-js_shared__"],N=Function.prototype.toString,F=T.hasOwnProperty,P=(R=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"",H=T.toString,U=N.call(Object),z=RegExp("^"+N.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D=O?_.Buffer:void 0,B=_.Symbol,V=_.Uint8Array,M=D?D.allocUnsafe:void 0,G=(S=Object.getPrototypeOf,q=Object,function(e){return S(q(e))}),J=Object.create,Q=T.propertyIsEnumerable,K=k.splice,Y=B?B.toStringTag:void 0,$=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=D?D.isBuffer:void 0,X=Math.max,Z=Date.now,ee=_e(_,"Map"),te=_e(Object,"create"),re=function(){function e(){}return function(t){if(!ke(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ue(e){var t=this.__data__=new oe(e);this.size=t.size}function ie(e,t){var r=xe(e),n=!r&&Ce(e),o=!r&&!n&&Re(e),a=!r&&!n&&!o&&Le(e),u=r||n||o||a,i=u?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=i.length;for(var s in e)!t&&!F.call(e,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ee(s,c))||i.push(s);return i}function ce(e,t,r){(void 0===r||we(e[t],r))&&(void 0!==r||t in e)||le(e,t,r)}function se(e,t,r){var n=e[t];F.call(e,t)&&we(n,r)&&(void 0!==r||t in e)||le(e,t,r)}function fe(e,t){for(var r=e.length;r--;)if(we(e[r][0],t))return r;return-1}function le(e,t,r){"__proto__"==t&&$?$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===o?void 0:r}return F.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:F.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?o:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=fe(t,e);return r>=0&&(r==t.length-1?t.pop():K.call(t,r,1),--this.size,!0)},oe.prototype.get=function(e){var t=this.__data__,r=fe(t,e);return 0>r?void 0:t[r][1]},oe.prototype.has=function(e){return fe(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=fe(r,e);return 0>n?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ae(this,e).get(e)},ae.prototype.has=function(e){return Ae(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ae(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ue.prototype.clear=function(){this.__data__=new oe,this.size=0},ue.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ue.prototype.get=function(e){return this.__data__.get(e)},ue.prototype.has=function(e){return this.__data__.has(e)},ue.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||r-1>o.length)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var de,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),u=a.length;u--;){var i=a[de?u:++n];if(!1===t(o[i],i,o))break}return e};function he(e){return null==e?void 0===e?v:d:Y&&Y in Object(e)?function(e){var t=F.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=H.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return H.call(e)}(e)}function ve(e){return Te(e)&&he(e)==c}function ye(e){return!(!ke(e)||P&&P in e)&&(Se(e)?z:y).test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ke(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=je(e),r=[];for(var n in e)("constructor"!=n||!t&&F.call(e,n))&&r.push(n);return r}function me(e,t,r,n,o){e!==t&&pe(t,function(a,u){if(ke(a))o||(o=new ue),function(e,t,r,n,o,a,u){var i=I(e,r),c=I(t,r),s=u.get(c);if(s)return void ce(e,r,s);var f=a?a(i,c,r+"",e,t,u):void 0,l=void 0===f;if(l){var d=xe(c),h=!d&&Re(c),v=!d&&!h&&Le(c);f=c,d||h||v?xe(i)?f=i:Te(A=i)&&Ie(A)?f=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(i):h?(l=!1,f=function(e,t){if(t)return e.slice();var r=e.length,n=M?M(r):new e.constructor(r);return e.copy(n),n}(c,!0)):v?(l=!1,y=c,g=!0?(new V(b=new(m=y.buffer).constructor(m.byteLength)).set(new V(m)),b):y.buffer,f=new y.constructor(g,y.byteOffset,y.length)):f=[]:function(e){if(!Te(e)||he(e)!=p)return!1;var t=G(e);if(null===t)return!0;var r=F.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&N.call(r)==U}(c)||Ce(c)?(f=i,Ce(i)?f=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,u=t.length;for(;++a<u;){var i=t[a],c=n?n(r[i],e[i],i,r,e):void 0;void 0===c&&(c=e[i]),o?le(r,i,c):se(r,i,c)}return r}(e,Ne(e))}(i):(!ke(i)||n&&Se(i))&&(f=function(e){return"function"!=typeof e.constructor||je(e)?{}:re(G(e))}(c))):l=!1}var y,g,m,b;var A;l&&(u.set(c,f),o(f,c,n,a,u),u.delete(c));ce(e,r,f)}(e,t,u,r,me,n,o);else{var i=n?n(I(e,u),a,u+"",e,t,o):void 0;void 0===i&&(i=a),ce(e,u,i)}},Ne)}function be(e,t){return Oe(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=X(n.length-t,0),u=Array(a);++o<a;)u[o]=n[t+o];o=-1;for(var i=Array(t+1);++o<t;)i[o]=n[o];return i[t]=r(u),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,i)}}(e,t,He),e+"")}function Ae(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function _e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function Ee(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&g.test(e))&&e>-1&&e%1==0&&t>e}function je(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||T)}var Oe=function(e){var t=0,r=0;return function(){var n=Z(),o=u-(n-r);if(r=n,o>0){if(++t>=a)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}($?function(e,t){return $(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:He);function we(e,t){return e===t||e!=e&&t!=t}var Ce=ve(function(){return arguments}())?ve:function(e){return Te(e)&&F.call(e,"callee")&&!Q.call(e,"callee")},xe=Array.isArray;function Ie(e){return null!=e&&qe(e.length)&&!Se(e)}var Re=W||function(){return!1};function Se(e){if(!ke(e))return!1;var t=he(e);return t==f||t==l||t==s||t==h}function qe(e){return"number"==typeof e&&e>-1&&e%1==0&&i>=e}function ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Le=x?function(e){return function(t){return e(t)}}(x):function(e){return Te(e)&&qe(e.length)&&!!m[he(e)]};function Ne(e){return Ie(e)?ie(e,!0):ge(e)}var Fe,Pe=(Fe=function(e,t,r,n){me(e,t,r,n)},be(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Fe.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!ke(r))return!1;var n=typeof t;return!!("number"==n?Ie(r)&&Ee(t,r.length):"string"==n&&t in r)&&we(r[t],e)}(t[0],t[1],a)&&(o=3>n?void 0:o,n=1),e=Object(e);++r<n;){var u=t[r];u&&Fe(e,u,r,o)}return e}));function He(e){return e}e.exports=Pe}),it=function(e,t){return ut(e.resources,t,function(e,t){return pe(e)?l({},e,t):void 0})},ct={},st={REQUEST:function(e,t){var r,n=t.url,o=t.resourceId;return l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{resourceName:at(t.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}),r))})},RECEIVE:function(e,t){var r,n=t.url,o=t.payload,a=t.principalResourceIds,u=t.metadata,i=t.cacheLifetime,c=void 0===i?0:i,s=at(t.type).resourceName,f=l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),expireAt:c!==1/0?new Date((new Date).getTime()+1e3*c).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!1,payloadIds:Pe(s,o,a),metadata:u}),r)),resources:it(e,o)});return l({},f,{resolversHashes:Ve(f,s,n,o,a)})},FAIL:function(e,t){var r,n=t.url;return l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),hasSucceeded:!1,hasFailed:!0}),r))})},RECEIVE_FROM_CACHE:function(e,t){var r,n=t.type,o=t.url,a=t.resourceId,u=t.payload,i=t.principalResourceIds,c=t.metadata,s=t.cacheLifetime,f=void 0===s?0:s,d=at(n).resourceName,p=l({},e,{requests:l({},e.requests||{},(r={},r[o]=l({},e.requests&&e.requests[o]?e.requests[o]:{},{resourceName:at(n).resourceName,resourceId:a,startedAt:(new Date).toISOString(),endedAt:(new Date).toISOString(),expireAt:f!==1/0?new Date((new Date).getTime()+1e3*f).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!0,payloadIds:Pe(d,u,i),metadata:c}),r)),resources:it(e,u)});return l({},p,{resolversHashes:Ve(p,d,o,u,i)})},INVALIDATE_RESOURCE:function(e,t){var r=t.resourceName;return l({},e,{requests:l({},Object.entries(e.requests||{}).reduce(function(e,t){var n,o=t[1];return l({},e,((n={})[t[0]]=!o.didInvalidate&&(o.resourceName===r||o.payloadIds&&o.payloadIds[r])?l({},o,{didInvalidate:!0}):o,n))},{}))})},INVALIDATE_ID:function(e,t){var r=t.resourceName,n=t.resourceId;return l({},e,{requests:l({},Object.entries(e.requests||{}).reduce(function(e,t){var o,a=t[1];return l({},e,((o={})[t[0]]=!a.didInvalidate&&(a.resourceName===r&&a.resourceId===n||a.payloadIds&&a.payloadIds[r]&&a.payloadIds[r].map(function(e){return""+e}).includes(""+n))?l({},a,{didInvalidate:!0}):a,o))},{}))})},INVALIDATE_REQUEST:function(e,t){var r,n=t.url;return l({},e,{requests:l({},e.requests||{},(r={},r[n]=l({},e.requests&&e.requests[n]?e.requests[n]:{},{didInvalidate:!0}),r))})},RESET_RESOURCE:function(e,t){var r,n=t.resourceName,o=l({},e,{requests:l({},Object.entries(e.requests||{}).filter(function(e){var t=e[1],r=t.payloadIds;return!(n===t.resourceName||r&&Object.keys(r).includes(n))}).reduce(function(e,t){var r;return l({},e,((r={})[t[0]]=t[1],r))},{})),resources:l({},e.resources||{},(r={},r[n]=void 0,r))});return l({},o,{resolversHashes:function(e,t){var r,n=e.requests,o=void 0===n?{}:n,a=e.resolversHashes,u=void 0===a?{}:a;return l({},u,{requests:l({},Object.entries(u.requests||{}).reduce(function(e,t){var r,n=t[0],a=t[1];return l({},e,Object.keys(o).includes(n)?((r={})[n]=a,r):{})},{})),resources:l({},u.resources||{},(r={},r[t]=Be,r))})}(o,n)})},RESET_ALL:function(){return{}}},ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ct;return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===t)return e;if(!r.type||!r.type.startsWith("@@rest-easy"))return t;var n=st[at(r.type).caseName];return n?n(t,r):t}}(),lt=function(){var e,t={RESET_ALL:v("@global","@reset","RESET_ALL")};return{resetAll:(e=t.RESET_ALL,function(){return{type:e}})}};e.connect=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",o=function(n){function o(t){f(this,o);var a=d(this,n.call(this,t));return a.onInjectProps=function(e,t){a.setState(function(r){var n;return r.__requestURLsByActionKey[e]!==t?{__requestURLsByActionKey:l({},r.__requestURLsByActionKey,(n={},n[e]=t,n))}:null})},a.getWrappedInstance=function(){return a.innerRef&&a.innerRef.getWrappedInstance?a.innerRef.getWrappedInstance():null},a.state={__requestURLsByActionKey:{}},a.ConnectedComponent=p(a.onInjectProps).apply(void 0,r)(e),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype.render=function(){var e=this,r=this.ConnectedComponent,n=l({},this.props,this.state);return t.createElement(r,l({ref:function(t){e.innerRef=t}},n))},o}(t.Component);return o.displayName="EasyConnect("+n+")",o}},e.createResource=function(e,t){return function(r){Ce(e,t),je(e,r);var n=t||{},o=n.cacheLifetime,a=void 0===o?0:o,u=n.denormalizer,i=l({},y(e)),c=l({},function(e,t){return{resource:{getResource:function(r){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return ot(J(r),e,n,t)},getResourceById:function(r,n){var o=2>=arguments.length||void 0===arguments[2]||arguments[2];return function(e,t,r,n,o){return n&&o?o([r],e.resources)[0]||null:e.resources&&e.resources[t]&&e.resources[t][r]?e.resources[t][r]:null}(J(r),e,n,o,t)}}}}(e,u));return Object.keys(r||{}).forEach(function(t){i=l({},i,re(e,a,r||{},t)),c=l({},c,function(e,t,r){var n;return(n={})[t]={resource:{couldPerform:function(r){return!Ye(J(r),e,t)},isPerforming:function(r){return Ye(J(r),e,t)},isValid:function(r){return!$e(J(r),e,t,"didInvalidate")},hasSucceeded:function(r){return $e(J(r),e,t,"hasSucceeded")},hasFailed:function(r){return $e(J(r),e,t,"hasFailed")},couldPerformOnId:function(r,n){return!Ye(J(r),e,t,n)},isPerformingOnId:function(r,n){return Ye(J(r),e,t,n)},hasSucceededOnId:function(r,n){return $e(J(r),e,t,"hasSucceeded",n)},hasFailedOnId:function(r,n){return $e(J(r),e,t,"hasFailed",n)},isValidId:function(r,n){return!$e(J(r),e,t,"didInvalidate",n)}},request:{getResource:function(n,o){var a=2>=arguments.length||void 0===arguments[2]||arguments[2];return Ze(J(n),e,Le(e,t,o),a,r)},getMetadata:function(r,n){return function(e,t){return e.requests&&e.requests[t]&&e.requests[t].metadata?e.requests[t].metadata:{}}(J(r),Le(e,t,n))},couldPerform:function(r,n){return!et(J(r),Le(e,t,n))},isPerforming:function(r,n){return et(J(r),Le(e,t,n))},isValid:function(r,n){return!tt(J(r),Le(e,t,n),"didInvalidate")},hasSucceeded:function(r,n){return tt(J(r),Le(e,t,n),"hasSucceeded")},hasFailed:function(r,n){return tt(J(r),Le(e,t,n),"hasFailed")}}},n}(e,t,u))}),{actions:i,selectors:c}}},e.reducer=ft,e.reset=function(){return(0,lt().resetAll)()},e.initializeNetworkHelpers=function(e){!function(e){W=e?l({},$,e):$}(e)},e.getPersistableState=function(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.alwaysPersist,n=t.neverPersist;if(!e||!Object.keys(e).length)return{};var o="string"==typeof r?[r]:r,a="string"==typeof n?[n]:n,u=Object.entries(e.requests||{}).reduce(function(e,t){var r,n,u=t[0],i=t[1];return l({},e,i.endedAt&&o&&i.payloadIds&&Object.keys(i.payloadIds).some(function(e){return o.includes(e)})?((r={})[u]=i,r):a&&i.payloadIds&&Object.keys(i.payloadIds).some(function(e){return a.includes(e)})||!i.endedAt||i.didInvalidate||Q(i.expireAt)?{}:((n={})[u]="never"===i.expireAt?l({},i,{didInvalidate:!0}):i,n))},{}),i=Object.values(u||{}).reduce(function(e,t){return l({},e,Object.entries(t.payloadIds||{}).reduce(function(e,t){var r,n=t[0];return l({},e,((r={})[n]=[].concat(e[n]||[],t[1].map(function(e){return""+e})),r))},{}))},{}),c=Object.entries(e.resources||{}).reduce(function(e,t){var r,n=t[0];return l({},e,((r={})[n]=Object.entries(t[1]||{}).reduce(function(e,t){var r,o=t[0],a=t[1];return l({},e,i[n]&&i[n].includes(o)?((r={})[o]=a,r):{})},{}),r))},{}),s=Object.entries(c||{}).reduce(function(e,t){var r,n=t[0],o=t[1];return l({},e,Object.keys(o).length?((r={})[n]=o,r):{})},{}),f=l({},e.resolversHashes||{},{requests:Object.entries(e.resolversHashes&&e.resolversHashes.requests?e.resolversHashes.requests:{}).reduce(function(e,t){var r,n=t[0];return l({},e,u[n]?((r={})[n]=t[1],r):{})},{}),resources:Object.entries(e.resolversHashes&&e.resolversHashes.resources?e.resolversHashes.resources:{}).reduce(function(t,r){var n,o=r[0],a=r[1];return l({},t,s[o]&&Object.keys(e.resources&&e.resources[o]?e.resources[o]:{}).length===Object.keys(s[o]||{}).length?((n={})[o]=a,n):{})},{})});return l({},e,{requests:u,resources:s,resolversHashes:f})}(e,t)},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -20,2 +20,3 @@ import generateActionCreatorActions from '../actions/generateActionCreatorActions'; | ||
normalizer = _actionsConfig$action.normalizer, | ||
metadataNormalizer = _actionsConfig$action.metadataNormalizer, | ||
afterHook = _actionsConfig$action.afterHook, | ||
@@ -25,3 +26,3 @@ networkHelpers = _actionsConfig$action.networkHelpers; | ||
var actionCreatorActions = generateActionCreatorActions(resourceName, actionName, cacheLifetime); | ||
var actionCreator = generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, afterHook, networkHelpers); | ||
var actionCreator = generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, metadataNormalizer, afterHook, networkHelpers); | ||
@@ -49,3 +50,3 @@ return function (args) { | ||
return dispatch(actionCreatorActions.RECEIVE_FROM_CACHE(normalizedURL, resourceId, (_actionCreatorActions = {}, _actionCreatorActions[resourceName] = (_resourceName = {}, _resourceName[resourceId] = null, _resourceName), _actionCreatorActions), [resourceId])); | ||
return dispatch(actionCreatorActions.RECEIVE_FROM_CACHE(normalizedURL, resourceId, (_actionCreatorActions = {}, _actionCreatorActions[resourceName] = (_resourceName = {}, _resourceName[resourceId] = null, _resourceName), _actionCreatorActions), null, [resourceId])); | ||
}; | ||
@@ -52,0 +53,0 @@ } else { |
@@ -14,3 +14,3 @@ var _this = this; | ||
var generateActionCreator = function generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, afterHook, networkHelpers) { | ||
var generateActionCreator = function generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, metadataNormalizer, afterHook, networkHelpers) { | ||
return function (formattedURL, normalizedURL, resourceId) { | ||
@@ -32,3 +32,3 @@ return function () { | ||
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch, getState) { | ||
var combinedNetworkHelpers, beforeHookReturn, finalBody, res, data, _ref3, normalizedPayload, principalResourceIds, principalResourceIdsArray; | ||
var combinedNetworkHelpers, beforeHookReturn, finalBody, res, data, _ref3, normalizedPayload, principalResourceIds, metadata, principalResourceIdsArray; | ||
@@ -85,16 +85,17 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
_ref3 = normalizer ? normalizer(data, getRestEasyState(getState()).resources, urlParams, query, finalBody, otherArgs) : { entities: data }, normalizedPayload = _ref3.entities, principalResourceIds = _ref3.result; | ||
metadata = metadataNormalizer ? metadataNormalizer(data, getRestEasyState(getState()).resources, urlParams, query, finalBody, otherArgs) : null; | ||
principalResourceIdsArray = Array.isArray(principalResourceIds) ? principalResourceIds : [principalResourceIds]; | ||
dispatch(actionCreatorActions.RECEIVE(normalizedURL, resourceId, normalizedPayload, principalResourceIdsArray)); | ||
dispatch(actionCreatorActions.RECEIVE(normalizedURL, resourceId, normalizedPayload, metadata, principalResourceIdsArray)); | ||
_context.next = 29; | ||
_context.next = 30; | ||
return safeCall(afterHook, normalizedPayload || {}, urlParams, query, finalBody, otherArgs, dispatch); | ||
case 29: | ||
case 30: | ||
safeCall(onSuccess, normalizedPayload || {}, otherArgs); | ||
return _context.abrupt('return', { normalizedPayload: normalizedPayload || {}, otherArgs: otherArgs }); | ||
case 33: | ||
_context.prev = 33; | ||
case 34: | ||
_context.prev = 34; | ||
_context.t4 = _context['catch'](2); | ||
@@ -108,3 +109,3 @@ | ||
case 39: | ||
case 40: | ||
case 'end': | ||
@@ -114,3 +115,3 @@ return _context.stop(); | ||
} | ||
}, _callee, _this, [[2, 33]]); | ||
}, _callee, _this, [[2, 34]]); | ||
})); | ||
@@ -117,0 +118,0 @@ |
var generateActionCreatorAction = function generateActionCreatorAction(cacheLifetime, actionType) { | ||
return function (normalizedURL, resourceId, normalizedPayload, principalResourceIds) { | ||
return function (normalizedURL, resourceId, normalizedPayload, metadata, principalResourceIds) { | ||
return { | ||
@@ -8,2 +8,3 @@ type: actionType, | ||
payload: normalizedPayload && Object.keys(normalizedPayload).length ? normalizedPayload : undefined, | ||
metadata: metadata, | ||
principalResourceIds: typeof principalResourceIds === 'string' ? [principalResourceIds] : principalResourceIds, | ||
@@ -10,0 +11,0 @@ cacheLifetime: cacheLifetime |
@@ -22,3 +22,3 @@ import isPlainObject from 'lodash.isplainobject'; | ||
var MANDATORY_KEYS = ['method', 'url']; | ||
var OPTIONAL_KEYS = ['beforeHook', 'normalizer', 'afterHook', 'networkHelpers']; | ||
var OPTIONAL_KEYS = ['beforeHook', 'normalizer', 'metadataNormalizer', 'afterHook', 'networkHelpers']; | ||
var VALID_KEYS = [].concat(MANDATORY_KEYS, OPTIONAL_KEYS); | ||
@@ -101,2 +101,3 @@ var VALID_METHODS = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE']; | ||
normalizer = action.normalizer, | ||
metadataNormalizer = action.metadataNormalizer, | ||
afterHook = action.afterHook, | ||
@@ -118,2 +119,5 @@ networkHelpers = action.networkHelpers; | ||
} | ||
if (isDefined(metadataNormalizer) && !isFunction(metadataNormalizer)) { | ||
throwError(invalidFunctionError('metadataNormalizer', metadataNormalizer)); | ||
} | ||
if (isDefined(afterHook) && !isFunction(afterHook)) { | ||
@@ -120,0 +124,0 @@ throwError(invalidFunctionError('afterHook', afterHook)); |
@@ -36,2 +36,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
principalResourceIds = _ref2.principalResourceIds, | ||
metadata = _ref2.metadata, | ||
_ref2$cacheLifetime = _ref2.cacheLifetime, | ||
@@ -51,3 +52,4 @@ cacheLifetime = _ref2$cacheLifetime === undefined ? 0 : _ref2$cacheLifetime; | ||
fromCache: false, | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds) | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds), | ||
metadata: metadata | ||
}), _extends3)), | ||
@@ -83,2 +85,3 @@ resources: shallowMergeResources(state, normalizedPayload) | ||
principalResourceIds = _ref4.principalResourceIds, | ||
metadata = _ref4.metadata, | ||
_ref4$cacheLifetime = _ref4.cacheLifetime, | ||
@@ -101,3 +104,4 @@ cacheLifetime = _ref4$cacheLifetime === undefined ? 0 : _ref4$cacheLifetime; | ||
fromCache: true, | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds) | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds), | ||
metadata: metadata | ||
}), _extends5)), | ||
@@ -104,0 +108,0 @@ resources: shallowMergeResources(state, normalizedPayload) |
@@ -113,2 +113,6 @@ import createCachedSelector from 're-reselect'; | ||
var getRequestMetadata = function getRequestMetadata(state, normalizedURL) { | ||
return state.requests && state.requests[normalizedURL] && state.requests[normalizedURL].metadata ? state.requests[normalizedURL].metadata : {}; | ||
}; | ||
var isPerformingRequest = function isPerformingRequest(state, normalizedURL) { | ||
@@ -163,2 +167,5 @@ return !!(state.requests && state.requests[normalizedURL] && !state.requests[normalizedURL].endedAt); | ||
}, | ||
getMetadata: function getMetadata(state, ownProps) { | ||
return getRequestMetadata(getState(state), getNormalizedURLFromOwnProps(resourceName, actionName, ownProps)); | ||
}, | ||
couldPerform: function couldPerform(state, ownProps) { | ||
@@ -165,0 +172,0 @@ return !isPerformingRequest(getState(state), getNormalizedURLFromOwnProps(resourceName, actionName, ownProps)); |
@@ -20,2 +20,3 @@ import generateActionCreatorActions from '../actions/generateActionCreatorActions'; | ||
normalizer = _actionsConfig$action.normalizer, | ||
metadataNormalizer = _actionsConfig$action.metadataNormalizer, | ||
afterHook = _actionsConfig$action.afterHook, | ||
@@ -25,3 +26,3 @@ networkHelpers = _actionsConfig$action.networkHelpers; | ||
var actionCreatorActions = generateActionCreatorActions(resourceName, actionName, cacheLifetime); | ||
var actionCreator = generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, afterHook, networkHelpers); | ||
var actionCreator = generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, metadataNormalizer, afterHook, networkHelpers); | ||
@@ -49,3 +50,3 @@ return function (args) { | ||
return dispatch(actionCreatorActions.RECEIVE_FROM_CACHE(normalizedURL, resourceId, (_actionCreatorActions = {}, _actionCreatorActions[resourceName] = (_resourceName = {}, _resourceName[resourceId] = null, _resourceName), _actionCreatorActions), [resourceId])); | ||
return dispatch(actionCreatorActions.RECEIVE_FROM_CACHE(normalizedURL, resourceId, (_actionCreatorActions = {}, _actionCreatorActions[resourceName] = (_resourceName = {}, _resourceName[resourceId] = null, _resourceName), _actionCreatorActions), null, [resourceId])); | ||
}; | ||
@@ -52,0 +53,0 @@ } else { |
@@ -14,3 +14,3 @@ var _this = this; | ||
var generateActionCreator = function generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, afterHook, networkHelpers) { | ||
var generateActionCreator = function generateActionCreator(actionName, actionCreatorActions, method, beforeHook, normalizer, metadataNormalizer, afterHook, networkHelpers) { | ||
return function (formattedURL, normalizedURL, resourceId) { | ||
@@ -32,3 +32,3 @@ return function () { | ||
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch, getState) { | ||
var combinedNetworkHelpers, beforeHookReturn, finalBody, res, data, _ref3, normalizedPayload, principalResourceIds, principalResourceIdsArray; | ||
var combinedNetworkHelpers, beforeHookReturn, finalBody, res, data, _ref3, normalizedPayload, principalResourceIds, metadata, principalResourceIdsArray; | ||
@@ -85,16 +85,17 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
_ref3 = normalizer ? normalizer(data, getRestEasyState(getState()).resources, urlParams, query, finalBody, otherArgs) : { entities: data }, normalizedPayload = _ref3.entities, principalResourceIds = _ref3.result; | ||
metadata = metadataNormalizer ? metadataNormalizer(data, getRestEasyState(getState()).resources, urlParams, query, finalBody, otherArgs) : null; | ||
principalResourceIdsArray = Array.isArray(principalResourceIds) ? principalResourceIds : [principalResourceIds]; | ||
dispatch(actionCreatorActions.RECEIVE(normalizedURL, resourceId, normalizedPayload, principalResourceIdsArray)); | ||
dispatch(actionCreatorActions.RECEIVE(normalizedURL, resourceId, normalizedPayload, metadata, principalResourceIdsArray)); | ||
_context.next = 29; | ||
_context.next = 30; | ||
return safeCall(afterHook, normalizedPayload || {}, urlParams, query, finalBody, otherArgs, dispatch); | ||
case 29: | ||
case 30: | ||
safeCall(onSuccess, normalizedPayload || {}, otherArgs); | ||
return _context.abrupt('return', { normalizedPayload: normalizedPayload || {}, otherArgs: otherArgs }); | ||
case 33: | ||
_context.prev = 33; | ||
case 34: | ||
_context.prev = 34; | ||
_context.t4 = _context['catch'](2); | ||
@@ -108,3 +109,3 @@ | ||
case 39: | ||
case 40: | ||
case 'end': | ||
@@ -114,3 +115,3 @@ return _context.stop(); | ||
} | ||
}, _callee, _this, [[2, 33]]); | ||
}, _callee, _this, [[2, 34]]); | ||
})); | ||
@@ -117,0 +118,0 @@ |
var generateActionCreatorAction = function generateActionCreatorAction(cacheLifetime, actionType) { | ||
return function (normalizedURL, resourceId, normalizedPayload, principalResourceIds) { | ||
return function (normalizedURL, resourceId, normalizedPayload, metadata, principalResourceIds) { | ||
return { | ||
@@ -8,2 +8,3 @@ type: actionType, | ||
payload: normalizedPayload && Object.keys(normalizedPayload).length ? normalizedPayload : undefined, | ||
metadata: metadata, | ||
principalResourceIds: typeof principalResourceIds === 'string' ? [principalResourceIds] : principalResourceIds, | ||
@@ -10,0 +11,0 @@ cacheLifetime: cacheLifetime |
@@ -22,3 +22,3 @@ import isPlainObject from 'lodash.isplainobject'; | ||
var MANDATORY_KEYS = ['method', 'url']; | ||
var OPTIONAL_KEYS = ['beforeHook', 'normalizer', 'afterHook', 'networkHelpers']; | ||
var OPTIONAL_KEYS = ['beforeHook', 'normalizer', 'metadataNormalizer', 'afterHook', 'networkHelpers']; | ||
var VALID_KEYS = [].concat(MANDATORY_KEYS, OPTIONAL_KEYS); | ||
@@ -101,2 +101,3 @@ var VALID_METHODS = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE']; | ||
normalizer = action.normalizer, | ||
metadataNormalizer = action.metadataNormalizer, | ||
afterHook = action.afterHook, | ||
@@ -118,2 +119,5 @@ networkHelpers = action.networkHelpers; | ||
} | ||
if (isDefined(metadataNormalizer) && !isFunction(metadataNormalizer)) { | ||
throwError(invalidFunctionError('metadataNormalizer', metadataNormalizer)); | ||
} | ||
if (isDefined(afterHook) && !isFunction(afterHook)) { | ||
@@ -120,0 +124,0 @@ throwError(invalidFunctionError('afterHook', afterHook)); |
@@ -36,2 +36,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
principalResourceIds = _ref2.principalResourceIds, | ||
metadata = _ref2.metadata, | ||
_ref2$cacheLifetime = _ref2.cacheLifetime, | ||
@@ -51,3 +52,4 @@ cacheLifetime = _ref2$cacheLifetime === undefined ? 0 : _ref2$cacheLifetime; | ||
fromCache: false, | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds) | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds), | ||
metadata: metadata | ||
}), _extends3)), | ||
@@ -83,2 +85,3 @@ resources: shallowMergeResources(state, normalizedPayload) | ||
principalResourceIds = _ref4.principalResourceIds, | ||
metadata = _ref4.metadata, | ||
_ref4$cacheLifetime = _ref4.cacheLifetime, | ||
@@ -101,3 +104,4 @@ cacheLifetime = _ref4$cacheLifetime === undefined ? 0 : _ref4$cacheLifetime; | ||
fromCache: true, | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds) | ||
payloadIds: getResourceIdsByResourceNameFromNormalizedPayload(resourceName, normalizedPayload, principalResourceIds), | ||
metadata: metadata | ||
}), _extends5)), | ||
@@ -104,0 +108,0 @@ resources: shallowMergeResources(state, normalizedPayload) |
@@ -113,2 +113,6 @@ import createCachedSelector from 're-reselect'; | ||
var getRequestMetadata = function getRequestMetadata(state, normalizedURL) { | ||
return state.requests && state.requests[normalizedURL] && state.requests[normalizedURL].metadata ? state.requests[normalizedURL].metadata : {}; | ||
}; | ||
var isPerformingRequest = function isPerformingRequest(state, normalizedURL) { | ||
@@ -163,2 +167,5 @@ return !!(state.requests && state.requests[normalizedURL] && !state.requests[normalizedURL].endedAt); | ||
}, | ||
getMetadata: function getMetadata(state, ownProps) { | ||
return getRequestMetadata(getState(state), getNormalizedURLFromOwnProps(resourceName, actionName, ownProps)); | ||
}, | ||
couldPerform: function couldPerform(state, ownProps) { | ||
@@ -165,0 +172,0 @@ return !isPerformingRequest(getState(state), getNormalizedURLFromOwnProps(resourceName, actionName, ownProps)); |
{ | ||
"name": "@brigad/redux-rest-easy", | ||
"version": "2.6.0", | ||
"version": "2.7.0", | ||
"description": "Redux/React/React Native framework generating actions, reducers and selectors to perform network requests", | ||
@@ -45,3 +45,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"prepublishOnly": "yarn build:clean && yarn build", | ||
"prepare": "yarn build:clean && yarn build", | ||
"modules:clean": "rimraf node_modules", | ||
@@ -79,7 +79,7 @@ "build": "yarn build:commonjs && yarn build:es && yarn build:umd && yarn build:umd:min", | ||
"devDependencies": { | ||
"all-contributors-cli": "4.10.1", | ||
"all-contributors-cli": "4.11.1", | ||
"babel-cli": "6.26.0", | ||
"babel-core": "6.26.0", | ||
"babel-eslint": "8.2.1", | ||
"babel-jest": "22.2.0", | ||
"babel-eslint": "8.2.2", | ||
"babel-jest": "22.4.3", | ||
"babel-plugin-external-helpers": "6.22.0", | ||
@@ -90,23 +90,23 @@ "babel-preset-env": "1.6.1", | ||
"codecov": "3.0.0", | ||
"cross-env": "5.1.3", | ||
"eslint": "4.17.0", | ||
"cross-env": "5.1.4", | ||
"eslint": "4.19.1", | ||
"eslint-config-airbnb": "16.1.0", | ||
"eslint-config-prettier": "2.9.0", | ||
"eslint-plugin-import": "2.8.0", | ||
"eslint-plugin-import": "2.9.0", | ||
"eslint-plugin-jsx-a11y": "6.0.3", | ||
"eslint-plugin-react": "7.6.1", | ||
"jest-cli": "22.2.1", | ||
"jest-junit": "3.5.0", | ||
"eslint-plugin-react": "7.7.0", | ||
"jest-cli": "22.4.3", | ||
"jest-junit": "3.6.0", | ||
"mockdate": "2.0.2", | ||
"moment": "2.20.1", | ||
"prettier-eslint-cli": "4.7.0", | ||
"moment": "2.21.0", | ||
"prettier-eslint-cli": "4.7.1", | ||
"rimraf": "2.6.2", | ||
"rollup": "0.55.3", | ||
"rollup": "0.57.1", | ||
"rollup-plugin-babel": "3.0.3", | ||
"rollup-plugin-commonjs": "8.3.0", | ||
"rollup-plugin-commonjs": "9.1.0", | ||
"rollup-plugin-node-builtins": "2.1.2", | ||
"rollup-plugin-node-resolve": "3.0.2", | ||
"rollup-plugin-node-resolve": "3.3.0", | ||
"rollup-plugin-replace": "2.0.0", | ||
"rollup-plugin-uglify": "3.0.0", | ||
"semantic-release": "12.4.1" | ||
"semantic-release": "15.1.4" | ||
}, | ||
@@ -113,0 +113,0 @@ "peerDependencies": { |
@@ -25,2 +25,3 @@ import generateActionCreatorActions from '../actions/generateActionCreatorActions'; | ||
normalizer, | ||
metadataNormalizer, | ||
afterHook, | ||
@@ -40,2 +41,3 @@ networkHelpers, | ||
normalizer, | ||
metadataNormalizer, | ||
afterHook, | ||
@@ -70,2 +72,3 @@ networkHelpers, | ||
}, | ||
null, | ||
[resourceId], | ||
@@ -72,0 +75,0 @@ ), |
@@ -12,2 +12,3 @@ import getRestEasyState from '../../utils/getState'; | ||
normalizer, | ||
metadataNormalizer, | ||
afterHook, | ||
@@ -43,3 +44,3 @@ networkHelpers, | ||
formattedURL, | ||
(await combinedNetworkHelpers[`request${method}`](finalBody)), | ||
await combinedNetworkHelpers[`request${method}`](finalBody), | ||
); | ||
@@ -61,2 +62,12 @@ combinedNetworkHelpers.handleStatusCode(res); | ||
: { entities: data }; | ||
const metadata = metadataNormalizer | ||
? metadataNormalizer( | ||
data, | ||
getRestEasyState(getState()).resources, | ||
urlParams, | ||
query, | ||
finalBody, | ||
otherArgs, | ||
) | ||
: null; | ||
@@ -72,2 +83,3 @@ const principalResourceIdsArray = Array.isArray(principalResourceIds) | ||
normalizedPayload, | ||
metadata, | ||
principalResourceIdsArray, | ||
@@ -74,0 +86,0 @@ ), |
@@ -5,2 +5,3 @@ const generateActionCreatorAction = (cacheLifetime, actionType) => ( | ||
normalizedPayload, | ||
metadata, | ||
principalResourceIds, | ||
@@ -15,2 +16,3 @@ ) => ({ | ||
: undefined, | ||
metadata, | ||
principalResourceIds: | ||
@@ -17,0 +19,0 @@ typeof principalResourceIds === 'string' |
@@ -17,2 +17,3 @@ import isPlainObject from 'lodash.isplainobject'; | ||
'normalizer', | ||
'metadataNormalizer', | ||
'afterHook', | ||
@@ -105,2 +106,3 @@ 'networkHelpers', | ||
normalizer, | ||
metadataNormalizer, | ||
afterHook, | ||
@@ -122,2 +124,7 @@ networkHelpers, | ||
} | ||
if (isDefined(metadataNormalizer) && !isFunction(metadataNormalizer)) { | ||
throwError( | ||
invalidFunctionError('metadataNormalizer', metadataNormalizer), | ||
); | ||
} | ||
if (isDefined(afterHook) && !isFunction(afterHook)) { | ||
@@ -124,0 +131,0 @@ throwError(invalidFunctionError('afterHook', afterHook)); |
@@ -49,2 +49,3 @@ import getInfosFromActionType from '../../utils/getInfosFromActionType'; | ||
principalResourceIds, | ||
metadata, | ||
cacheLifetime = 0, | ||
@@ -78,2 +79,3 @@ }, | ||
), | ||
metadata, | ||
}, | ||
@@ -119,2 +121,3 @@ }, | ||
principalResourceIds, | ||
metadata, | ||
cacheLifetime = 0, | ||
@@ -151,2 +154,3 @@ }, | ||
), | ||
metadata, | ||
}, | ||
@@ -153,0 +157,0 @@ }, |
@@ -172,2 +172,9 @@ import createCachedSelector from 're-reselect'; | ||
const getRequestMetadata = (state, normalizedURL) => | ||
state.requests | ||
&& state.requests[normalizedURL] | ||
&& state.requests[normalizedURL].metadata | ||
? state.requests[normalizedURL].metadata | ||
: {}; | ||
const isPerformingRequest = (state, normalizedURL) => | ||
@@ -263,2 +270,7 @@ !!( | ||
), | ||
getMetadata: (state, ownProps) => | ||
getRequestMetadata( | ||
getState(state), | ||
getNormalizedURLFromOwnProps(resourceName, actionName, ownProps), | ||
), | ||
couldPerform: (state, ownProps) => | ||
@@ -265,0 +277,0 @@ !isPerformingRequest( |
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
505469
10731