Comparing version 0.1.0 to 0.1.1-alpha.1
import React from 'react'; | ||
import { FetchInstance } from '../defineFetch'; | ||
/** | ||
* @docs `Guard` | ||
* | ||
* The Guard component takes in a [fetch instance](./define-fetch.md) and a | ||
* [render prop](https://reactjs.org/docs/render-props.html). This component calls your render prop | ||
* with data when the data becomes available effectively guarding you against nullish data. | ||
*/ | ||
declare function Guard<FetchArgs extends any[], Data = any>( | ||
props: Props<FetchArgs, Data>, | ||
): JSX.Element; | ||
/** | ||
* @docs Guard `Props` | ||
*/ | ||
interface Props<FetchArgs extends any[], Data = any> { | ||
/** | ||
* the [fetch](../main-concepts/whats-a-fetch.md) | ||
*/ | ||
fetch: FetchInstance<FetchArgs, Data>; | ||
/** | ||
* a [render prop](https://reactjs.org/docs/render-props.html) that is invoked when there is data | ||
* available. | ||
*/ | ||
children: (data: Data) => JSX.Element; | ||
} | ||
declare function Guard<FetchArgs extends any[], Data = any>( | ||
props: Props<FetchArgs, Data>, | ||
): JSX.Element; | ||
export default Guard; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-redux"),require("redux")):"function"==typeof define&&define.amd?define(["react","react-redux","redux"],e):"object"==typeof exports?exports.Resift=e(require("react"),require("react-redux"),require("redux")):t.Resift=e(t.react,t["react-redux"],t.redux)}(window,function(t,e,r){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=22)}([function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e,r){"use strict";var n,o,i,a=r(9),u="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function s(){i=!1}function c(t){if(t){if(t!==n){if(t.length!==u.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter(function(t,e,r){return e!==r.lastIndexOf(t)});if(e.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. These characters were not unique: "+e.join(", "));n=t,s()}}else n!==u&&(n=u,s())}function l(){return i||(i=function(){n||c(u);for(var t,e=n.split(""),r=[],o=a.nextValue();e.length>0;)o=a.nextValue(),t=Math.floor(o*e.length),r.push(e.splice(t,1)[0]);return r.join("")}())}t.exports={get:function(){return n||u},characters:function(t){return c(t),n},seed:function(t){a.seed(t),o!==t&&(s(),o=t)},lookup:function(t){return l()[t]},shuffled:l}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!==t&&"object"===n(t)}},function(t,e,r){"use strict";t.exports=r(8)},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;var i=r(16),a=r(17),u=r(18),s=r(4),c=r(19),l=r(21);function f(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var p=e=t.exports;e.Request=w,p.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var h="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function d(t){if(!s(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&y(e,r,t[r]);return e.join("&")}function y(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach(function(r){y(t,e,r)});else if(s(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&y(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(r));else t.push(encodeURIComponent(e))}function v(t){for(var e,r,n={},o=t.split("&"),i=0,a=o.length;i<a;++i)-1===(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function m(t){return/[\/+]json($|[^-\w])/.test(t)}function b(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),a={},u=0,s=i.length;u<s;++u)-1!==(e=(r=i[u]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=h(r.slice(e+1)),a[n]=o);return a}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t,e=null,n=null;try{n=new b(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)})}function g(t,e,r){var n=p("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}p.serializeObject=d,p.parseString=v,p.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},p.serialize={"application/x-www-form-urlencoded":d,"application/json":a},p.parse={"application/x-www-form-urlencoded":v,"application/json":JSON.parse},c(b.prototype),b.prototype._parseBody=function(t){var e=p.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&m(this.type)&&(e=p.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},b.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},p.Response=b,i(w.prototype),u(w.prototype),w.prototype.type=function(t){return this.set("Content-Type",p.types[t]||t),this},w.prototype.accept=function(t){return this.set("Accept",p.types[t]||t),this},w.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var o=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,o)},w.prototype.query=function(t){return"string"!=typeof t&&(t=d(t)),t&&this._query.push(t),this},w.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},w.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},w.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.buffer=w.prototype.ca,w.prototype.ca=w.prototype.agent,w.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},w.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||f,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=p.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||p.serialize[o?o.split(";")[0]:""];!i&&m(o)&&(i=p.serialize["application/json"]),i&&(r=i(r))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},p.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){l.prototype[t.toLowerCase()]=function(e,r){var n=new p.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),l.prototype.del=l.prototype.delete,p.get=function(t,e,r){var n=p("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.head=function(t,e,r){var n=p("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.options=function(t,e,r){var n=p("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.del=g,p.delete=g,p.patch=function(t,e,r){var n=p("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.post=function(t,e,r){var n=p("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.put=function(t,e,r){var n=p("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e){t.exports=function t(e,n,o){o=o||{};n=n||[];var i=o.strict;var a=!1!==o.end;var u=o.sensitive?"":"i";var s=0;var c=n.length;var l=0;var f=0;var p;if(e instanceof RegExp){for(;p=r.exec(e.source);)n.push({name:f++,optional:!1,offset:p.index});return e}if(Array.isArray(e))return e=e.map(function(e){return t(e,n,o).source}),new RegExp("(?:"+e.join("|")+")",u);e=("^"+e+(i?"":"/"===e[e.length-1]?"?":"/?")).replace(/\/\(/g,"/(?:").replace(/([\/\.])/g,"\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g,function(t,e,r,o,i,a,u,c){e=e||"",r=r||"",i=i||"([^\\/"+r+"]+?)",u=u||"",n.push({name:o,optional:!!u,offset:c+s});var l=(u?"":e)+"(?:"+r+(u?e:"")+i+(a?"((?:[\\/"+r+"].+?)?)":"")+")"+u;return s+=l.length-t.length,l}).replace(/\*/g,function(t,e){for(var r=n.length;r-- >c&&n[r].offset>e;)n[r].offset+=3;return"(.*)"});for(;p=r.exec(e);){for(var h=0,d=p.index;"\\"===e.charAt(--d);)h++;h%2!=1&&((c+l===n.length||n[c+l].offset>p.index)&&n.splice(c+l,0,{name:f++,optional:!1,offset:p.index}),l++)}e+=a?"$":"/"===e[e.length-1]?"":"(?=\\/|$)";return new RegExp(e,u)};var r=/\((?!\?)/g},function(t,e,r){"use strict";var n=r(3),o=r(10),i=r(14),a=r(15)||0;function u(){return o(a)}t.exports=u,t.exports.generate=u,t.exports.seed=function(e){return n.seed(e),t.exports},t.exports.worker=function(e){return a=e,t.exports},t.exports.characters=function(t){return void 0!==t&&n.characters(t),n.shuffled()},t.exports.isValid=i},function(t,e,r){"use strict";var n=1;t.exports={nextValue:function(){return(n=(9301*n+49297)%233280)/233280},seed:function(t){n=t}}},function(t,e,r){"use strict";var n,o,i=r(11),a=(r(3),1459707606518),u=6;t.exports=function(t){var e="",r=Math.floor(.001*(Date.now()-a));return r===o?n++:(n=0,o=r),e+=i(u),e+=i(t),n>0&&(e+=i(n)),e+=i(r)}},function(t,e,r){"use strict";var n=r(3),o=r(12),i=r(13);t.exports=function(t){for(var e,r=0,a="";!e;)a+=i(o,n.get(),1),e=t<Math.pow(16,r+1),r++;return a}},function(t,e,r){"use strict";var n,o="object"==typeof window&&(window.crypto||window.msCrypto);n=o&&o.getRandomValues?function(t){return o.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],r=0;r<t;r++)e.push(Math.floor(256*Math.random()));return e},t.exports=n},function(t,e){t.exports=function(t,e,r){var n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=Math.ceil(1.6*n*r/e.length);r=+r;for(var i="";;)for(var a=t(o),u=0;u<o;u++){var s=a[u]&n;if(e[s]&&(i+=e[s]).length===r)return i}}},function(t,e,r){"use strict";var n=r(3);t.exports=function(t){return!(!t||"string"!=typeof t||t.length<6||new RegExp("[^"+n.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t))}},function(t,e,r){"use strict";t.exports=0},function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){t.exports=n,n.default=n,n.stable=i,n.stableStringify=i;var r=[];function n(t,e,n){!function t(e,n,o,i){var a;if("object"==typeof e&&null!==e){for(a=0;a<o.length;a++)if(o[a]===e)return i[n]="[Circular]",void r.push([i,n,e]);if(o.push(e),Array.isArray(e))for(a=0;a<e.length;a++)t(e[a],a,o,e);else{var u=Object.keys(e);for(a=0;a<u.length;a++){var s=u[a];t(e[s],s,o,e)}}o.pop()}}(t,"",[],void 0);for(var o=JSON.stringify(t,e,n);0!==r.length;){var i=r.pop();i[0][i[1]]=i[2]}return o}function o(t,e){return t<e?-1:t>e?1:0}function i(t,e,n){for(var i=function t(e,n,i,a){var u;if("object"==typeof e&&null!==e){for(u=0;u<i.length;u++)if(i[u]===e)return a[n]="[Circular]",void r.push([a,n,e]);if("function"==typeof e.toJSON)return;if(i.push(e),Array.isArray(e))for(u=0;u<e.length;u++)t(e[u],u,i,e);else{var s={},c=Object.keys(e).sort(o);for(u=0;u<c.length;u++){var l=c[u];t(e[l],l,i,e),s[l]=e[l]}if(void 0===a)return s;r.push([a,n,e]),a[n]=s}i.pop()}}(t,"",[],void 0)||t,a=JSON.stringify(i,e,n);0!==r.length;){var u=r.pop();u[0][u[1]]=u[2]}return a}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(4);function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}t.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},i.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var a=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];i.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&-1!==a.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){n.on("abort",function(){var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}),n.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(o(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(o(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},i.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},i.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=o(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&o(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)?this:(r||this.type("json"),this)},i.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},i.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.substring(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,e)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(t,e,r){"use strict";var n=r(20);function o(t){if(t)return function(t){for(var e in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,e)&&(t[e]=o.prototype[e]);return t}(t)}t.exports=o,o.prototype.get=function(t){return this.header[t.toLowerCase()]},o.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this[o]=r[o]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},o.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},function(t,e,r){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce(function(t,e){var r=e.split(/ *= */),n=r.shift(),o=r.shift();return n&&o&&(t[n]=o),t},{})},e.parseLinks=function(t){return t.split(/ *, */).reduce(function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t},{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(t){o.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}}),o.prototype._setDefaults=function(t){this._defaults.forEach(function(e){t[e.fn].apply(t,n(e.args))})},t.exports=o},function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"CLEAR",function(){return o}),r.d(n,"FETCH",function(){return i}),r.d(n,"ERROR",function(){return a}),r.d(n,"SUCCESS",function(){return u});var o="@@RESIFT/CLEAR",i="@@RESIFT/FETCH",a="@@RESIFT/ERROR",u="@@RESIFT/SUCCESS";function s(t){this.message=t,this.isCanceledError=!0}s.prototype=Object.create(Error.prototype),s.prototype.name="CanceledError",s.prototype=new Error;var c=s,l=4,f=2,p=1,h=r(0),d=r.n(h),y=r(1),v=r(2);function m(t,e){return"".concat(t," | ").concat(e)}function b(){return(new Date).toISOString()}var w=r(5),g=r.n(w);function _(t,e){return"".concat(t," | ").concat(e.displayName," | ").concat(e.fetchFactoryId)}function x(t){for(var e=1;e<arguments.length;e++)if(e%2){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){E(t,e,r[e])})}else Object.defineProperties(t,Object.getOwnPropertyDescriptors(arguments[e]));return t}function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S(t,e){return e}function T(t,e){if(!t)return E({},e,S);if("function"==typeof t)return E({},e,t);if("object"===O(t))return t[e]?t:x({},t,E({},e,S));throw new Error("[sharedReducer] Could not match typeof merge. See here for how to define merges: https://resift.org/docs/main-concepts/making-state-consistent#merges")}function j(t){return!!t&&(!!t.type&&t.type.startsWith(i))}function k(t){var e=t.displayName,r=t.share,n=t.conflict,o=void 0===n?"cancel":n,a=t.make,u=t.staticFetchFactoryId||g()();if(!e)throw new Error("`displayName` is required in `defineFetch`");if(!a)throw new Error("`make` is required in `defineFetch`");if(r&&!r.namespace)throw new Error("`namespace` is required in `share");var s=function(t,e,r,n){var o={};return function(){for(var i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];var s=r.apply(void 0,a);if("object"!==O(s))throw new Error("[defineFetch]: `make` must return an object");var c=s.request;if(!a.every(function(t){return"string"==typeof t||"number"==typeof t}))throw new Error('[defineFetch] make arguments must be either a string or a number. Check calls to the fetch factory "'.concat(t,'" See here https://resift.org/docs/main-concepts/whats-a-fetch#making-a-fetch-and-pulling-data-from-it'));if("function"!=typeof c)throw new Error("[defineFetch] `request` must be a function in the object that `make` returns`");var l="key:".concat([].concat(a,[n]).join(" | "));return o[l]?o[l]:(o[l]=e.apply(void 0,a),o[l])}}(e,function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];var c=a.apply(void 0,n),l={fetchFactoryId:u,key:"key:".concat(n.join(" | ")),displayName:e,share:r&&x({},r,{mergeObj:T(r.merge,r.namespace)}),conflict:o};function f(){var t=c.request.apply(c,arguments);if("function"!=typeof t)throw new Error("[defineFetch] Expected `fetch` to return a curried function. https://resift.org/docs/main-concepts/how-to-define-a-fetch#the-request-function");var e={canceled:!1},r=[];return t.cancel=function(){e.canceled=!0;for(var t=0,n=r;t<n.length;t++)(0,n[t])()},t.getCanceled=function(){return e.canceled},t.onCancel=function(t){r.push(t)},{type:_(i,l),meta:l,payload:t}}return f.meta=x({},l,{type:"FETCH_INSTANCE"}),f},a,o);return s.meta={fetchFactoryId:u,displayName:e,type:"FETCH_INSTANCE_FACTORY"},s}var C=function(){return function(t){return t}};function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function R(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q(t){return"object"===P(t)&&("string"==typeof t.type&&t.type.startsWith(u))}function D(t){return"object"===P(t)&&("string"==typeof t.type&&t.type.startsWith(a))}var F=new WeakSet;function N(){var t;return t=regeneratorRuntime.mark(function t(e){var r,n,o,i,s,l,f,p,h,d,y,v,b,w,g,x,O,E,S,T,j,k;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.state,n=e.services,o=e.dispatch,i=e.action,s=e.getState,l=i.payload,f=i.meta,p=f.displayName,h=f.fetchFactoryId,d=f.key,y=f.conflict,t.prev=3,g=m(p,h),!(x=null==r?void 0:null===(v=r.actions)||void 0===v?void 0:null===(b=v[g])||void 0===b?void 0:null===(w=b[d])||void 0===w?void 0:w.inflight)){t.next=11;break}if("ignore"!==y){t.next=9;break}return t.abrupt("return");case 9:x.cancel(),F.add(x);case 11:return O=function(t){if(l.getCanceled())throw new c;return o(t)},E=function(){if(l.getCanceled())throw new c;return s()},S=Object.entries(n).reduce(function(t,e){var r=A(e,2),n=r[0],o=r[1];return t[n]=o({getCanceled:l.getCanceled,onCancel:l.onCancel}),t},{dispatch:O,getState:E}),t.prev=14,t.next=17,l(S);case 17:if(T=t.sent,!F.has(l)){t.next=20;break}return t.abrupt("return");case 20:j={type:_(u,f),meta:f,payload:T},o(j),t.next=31;break;case 24:if(t.prev=24,t.t0=t.catch(14),!t.t0.isCanceledError){t.next=28;break}return t.abrupt("return");case 28:if(!F.has(l)){t.next=30;break}return t.abrupt("return");case 30:throw t.t0;case 31:t.next=38;break;case 33:throw t.prev=33,t.t1=t.catch(3),k={type:_(a,f),meta:f,payload:t.t1,error:!0},o(k),t.t1;case 38:case"end":return t.stop()}},t,null,[[3,33],[14,24]])}),(N=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){R(i,n,o,a,u,"next",t)}function u(t){R(i,n,o,a,u,"throw",t)}a(void 0)})}).apply(this,arguments)}function I(t){var e=t.services,r=t.onError;if(!e)throw new Error("`services` key required");if(!r)throw new Error("`onError` callback required");return function(t){return function(n){return function(o){if(!j(o))return n(o);var i=function(t){return N.apply(this,arguments)}({state:t.getState().dataService,services:e,dispatch:t.dispatch,action:o,getState:t.getState}).catch(function(t){throw r(t),t});return n(o),i}}}}function H(t){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t){return"object"===H(t)&&("string"==typeof t.type&&t.type.startsWith(o))}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function U(t){for(var e=1;e<arguments.length;e++)if(e%2){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){X(t,e,r[e])})}else Object.defineProperties(t,Object.getOwnPropertyDescriptors(arguments[e]));return t}function X(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function W(t){for(var e=1;e<arguments.length;e++)if(e%2){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),n.forEach(function(e){B(t,e,r[e])})}else Object.defineProperties(t,Object.getOwnPropertyDescriptors(arguments[e]));return t}function B(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var G={data:{},parents:{},merges:{}};var V=Object(v.combineReducers)({shared:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G,e=arguments.length>1?arguments[1]:void 0;if(j(e)){var r=e.meta,n=r.displayName,o=r.fetchFactoryId,i=r.key,a=r.share;if(!a)return t;for(var u=a.namespace,s=a.mergeObj,c=W({},null==t?void 0:t.merges),l=0,f=Object.entries(s);l<f.length;l++){var p=$(f[l],2),h=p[0],d=p[1],y=W({},null==c?void 0:c[h]);y[u]=d,c[h]=y}var v=W({},null==t?void 0:t.parents),m=W({},null==v?void 0:v[u]);return m["".concat(n," | ").concat(i," | ").concat(o)]={fetchFactoryId:o,key:i,displayName:n},v[u]=m,W({},t,{merges:c,parents:v})}if(q(e)){var b=function(){var r,n=e.meta,o=e.payload,i=n.key,a=n.share;if(!a)return{v:t};for(var u=a.namespace,s=(null==t?void 0:null===(r=t.merges)||void 0===r?void 0:r[u])||{},c=W({},null==t?void 0:t.data),l=function(){var e,r,n,a,s=$(p[f],2),l=s[0],h=s[1];if(l===u)return c[l]=W({},null===(r=t.data)||void 0===r?void 0:r[l],B({},i,h(null===(n=t.data)||void 0===n?void 0:null===(a=n[l])||void 0===a?void 0:a[i],o))),"continue";var d=Object.entries((null==t?void 0:null===(e=t.data)||void 0===e?void 0:e[l])||{}).reduce(function(t,e){var r=$(e,2),n=r[0],i=r[1];return t[n]=h(i,o),t},{});c[l]=d},f=0,p=Object.entries(s);f<p.length;f++)l();return{v:W({},t,{data:c})}}();if("object"===z(b))return b.v}if(M(e)){var w=e.meta,g=w.displayName,_=w.fetchFactoryId,x=w.key,O=w.share;if(!O)return t;for(var E=O.namespace,S=O.mergeObj,T=W({},null==t?void 0:t.merges),k=0,C=Object.keys(S);k<C.length;k++){h=C[k];var A=W({},null==T?void 0:T[h]);delete A[E],T[h]=A}var R=W({},null==t?void 0:t.parents),P=W({},null==R?void 0:R[E]);delete P["".concat(g," | ").concat(x," | ").concat(_)],Object.keys(P||{}).length<=0?delete R[E]:R[E]=P;var D=W({},null==t?void 0:t.data);return delete D[E],W({},t,{data:D,merges:T,parents:R})}return t},actions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(!(j(e)||q(e)||D(e)||M(e)))return t;var r,n,o,i=e.meta,a=i.displayName,u=i.fetchFactoryId,s=i.key,c=i.share,l=m(a,u);return j(e)?U({},t,X({},l,U({},t[l],X({},s,U({},null==t?void 0:null===(r=t[l])||void 0===r?void 0:r[s],{shared:!!c,inflight:e.payload,meta:i,updatedAt:b()}))))):q(e)?U({},t,X({},l,U({},t[l],X({},s,U({},null==t?void 0:null===(n=t[l])||void 0===n?void 0:n[s],{inflight:void 0,shared:!!c,hadSuccess:!0,data:e.payload,errorData:null,error:!1,meta:i,updatedAt:b()}))))):D(e)?U({},t,X({},l,U({},t[l],X({},s,U({},null==t?void 0:null===(o=t[l])||void 0===o?void 0:o[s],{inflight:void 0,shared:!!c,errorData:e.payload,error:!0,meta:i,updatedAt:b()}))))):U({},t,X({},l,Object.entries((null==t?void 0:t[l])||{}).filter(function(t){return L(t,1)[0]!==s}).reduce(function(t,e){var r=L(e,2),n=r[0],o=r[1];return t[n]=o,t},{})))}});var J=function(t){var e=t.children,r=t.dataService;if(t.suppressOutsideReduxWarning,Object(h.useContext)(y.ReactReduxContext),!r)throw new Error("[ResiftProvider] `dataService` missing from props.");var n=Object(h.useMemo)(function(){return function(t){var e=Object(v.combineReducers)({dataService:V}),r=(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||v.compose)(Object(v.applyMiddleware)(t));return Object(v.createStore)(e,r)}(r)},[r]);return d.a.createElement(y.Provider,{store:n},e)},K=0;function Q(t){return 0!=(t&p)}function Y(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.every(Q)}function Z(t){return 0!=(t&f)}function tt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.some(Z)}function et(t){return 0!=(t&l)}function rt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.some(et)}function nt(t){return t===K}function ot(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.every(nt)}function it(){return ot.apply(void 0,arguments)?K:(tt.apply(void 0,arguments)?f:K)|(Y.apply(void 0,arguments)?p:K)|(rt.apply(void 0,arguments)?l:K)}function at(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function ut(t){if(!t)return K;var e=t.hadSuccess,r=t.inflight,n=t.error;return(r?f:K)|(n?l:K)|(e&&!n?p:K)}var st=function(t,e){return function(r){var n,o,i,a;if(!t)return K;if(!("FETCH_INSTANCE"===(null==t?void 0:null===(n=t.meta)||void 0===n?void 0:n.type)))throw new Error("[useStatus] expected to see a fetch instance in get fetch.");if(!r.dataService)throw new Error('[useStatus] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation');var u=t.meta,s=u.fetchFactoryId,c=u.displayName,h=u.key,d=u.share,y=m(c,s),v=ut(null==r?void 0:null===(o=r.dataService)||void 0===o?void 0:null===(i=o.actions)||void 0===i?void 0:null===(a=i[y])||void 0===a?void 0:a[h]);if(!d)return v;var b=d.namespace,w=d.mergeObj;if((null==e?void 0:e.isolatedStatus)||!1)return v;var g=Object.keys(w),_=g.map(function(t){var e,n,o,i=null==r?void 0:null===(e=r.dataService)||void 0===e?void 0:null===(n=e.shared)||void 0===n?void 0:null===(o=n.parents)||void 0===o?void 0:o[t];return i?t!==b?null:Object.values(i).filter(function(t){return t.key===h}):null}).filter(function(t){return!!t}).reduce(function(t,e){var r=!0,n=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var u=i.value;t.push(u)}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return t},[]),x=g.map(function(t){var e,n,o,i=null==r?void 0:null===(e=r.dataService)||void 0===e?void 0:null===(n=e.shared)||void 0===n?void 0:null===(o=n.parents)||void 0===o?void 0:o[t];return i?t===b?null:Object.values(i):null}).filter(function(t){return!!t}).reduce(function(t,e){var r=!0,n=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var u=i.value;t.push(u)}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return t},[]),O=_.map(function(t){var e,n,o,i=m(t.displayName,t.fetchFactoryId);return ut(null==r?void 0:null===(e=r.dataService)||void 0===e?void 0:null===(n=e.actions)||void 0===n?void 0:null===(o=n[i])||void 0===o?void 0:o[t.key])}).filter(function(t){return null!==t});return(x.map(function(t){var e,n,o,i=m(t.displayName,t.fetchFactoryId);return ut(null==r?void 0:null===(e=r.dataService)||void 0===e?void 0:null===(n=e.actions)||void 0===n?void 0:null===(o=n[i])||void 0===o?void 0:o[t.key])}).filter(function(t){return null!==t}).some(function(t){return tt(t)})?f:K)|function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.every(function(t){return ot(t)})?K:(tt.apply(void 0,e)?f:K)|(e.some(function(t){return Y(t)})?p:K)|(rt.apply(void 0,e)?l:K)}.apply(void 0,at(O))}};var ct=function(t,e){var r=null==e?void 0:e.isolatedStatus,n=Object(h.useMemo)(function(){return{isolatedStatus:r}},[r]),o=Object(h.useMemo)(function(){return st(t,n)},[t,n]);return Object(y.useSelector)(o)},lt=function(t){return function(e){var r,n,o,i,a,u,s,c;if(!t)return null;if(!("FETCH_INSTANCE"===(null==t?void 0:null===(r=t.meta)||void 0===r?void 0:r.type)))throw new Error("[useData] expected to see a fetch instance.");if(!e.dataService)throw new Error('[useData] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation');var l=t.meta,f=l.fetchFactoryId,p=l.displayName,h=l.key,d=l.share,y=m(p,f),v=null==e?void 0:null===(n=e.dataService)||void 0===n?void 0:null===(o=n.actions)||void 0===o?void 0:null===(i=o[y])||void 0===i?void 0:i[h];if(!d)return v?void 0===v.data?null:v.data:null;var b=d.namespace;return(null==e?void 0:null===(a=e.dataService)||void 0===a?void 0:null===(u=a.shared)||void 0===u?void 0:null===(s=u.data)||void 0===s?void 0:null===(c=s[b])||void 0===c?void 0:c[h])||null}};var ft=function(t){var e=Object(h.useMemo)(function(){return lt(t)},[t]);return Object(y.useSelector)(e)};function pt(t){var e=Object(h.createContext)(null);return e.displayName="FetchProvider".concat(t.meta.displayName.split(" ").map(function(t){return t.replace(/\W/g,"")}).map(function(t){return t.substring(0,1).toUpperCase()+t.substring(1)}).join("")),{ContextFetchProvider:function(r){var n=r.children,o=ft(t),i=ct(t),a=Object(h.useMemo)(function(){return[o,i]},[o,i]);return d.a.createElement(e.Provider,{value:a},n)},useContextFetch:function(){var t=Object(h.useContext)(e);if(!t)throw new Error("[createContextFetch] could not find global fetch context. Did you forget to wrap this tree with the provider?");return t},ContextFetchConsumer:function(t){var r=t.children;return d.a.createElement(e.Consumer,null,r)}}}function ht(t,e){return{matchParams:t,handler:e}}var dt=r(6),yt=r.n(dt),vt=r(7),mt=r.n(vt);function bt(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var wt={},gt=1e4,_t=0;var xt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};("string"==typeof e||Array.isArray(e))&&(e={path:e});var r=e,n=r.path,o=r.exact,i=void 0!==o&&o,a=r.strict,u=void 0!==a&&a,s=r.sensitive,c=void 0!==s&&s;return[].concat(n).reduce(function(e,r){if(!r)return null;if(e)return e;var n=function(t,e){var r="".concat(e.end).concat(e.strict).concat(e.sensitive),n=wt[r]||(wt[r]={});if(n[t])return n[t];var o=[],i={regexp:mt()(t,o,e),keys:o};return _t<gt&&(n[t]=i,_t++),i}(r,{end:i,strict:u,sensitive:c}),o=n.regexp,a=n.keys,s=o.exec(t);if(!s)return null;var l=bt(s),f=l[0],p=l.slice(1),h=t===f;return i&&!h?null:{path:r,url:"/"===r&&""===f?"/":f,isExact:h,params:a.reduce(function(t,e,r){return t[e.name]=p[r],t},{})}},null)};function Ot(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Et(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function St(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Et(i,n,o,a,u,"next",t)}function u(t){Et(i,n,o,a,u,"throw",t)}a(void 0)})}}function Tt(t,e){return jt.apply(this,arguments)}function jt(){return(jt=St(regeneratorRuntime.mark(function t(e,r){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=2;break}return t.abrupt("return",e);case 2:if("function"!=typeof r){t.next=7;break}return t.next=5,r();case 5:return n=t.sent,t.abrupt("return",n);case 7:return t.abrupt("return","");case 8:case"end":return t.stop()}},t)}))).apply(this,arguments)}function kt(t,e){return Ct.apply(this,arguments)}function Ct(){return(Ct=St(regeneratorRuntime.mark(function t(e,r){var n,o,i,a,u,s,c,l,f,p,h,d,y,v,m,b,w,g,_;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(n=e.method,o=e.query,i=e.route,a=e.ok,u=e.req,s=e.data,c=r.headers,l=r.onCancel,f=r.prefix,p=n.toLowerCase(),h="".concat(f).concat(i),d=yt.a[p](h).accept("application/json"),y=Object.entries(c),v=0,m=y;v<m.length;v++)b=Ot(m[v],2),w=b[0],g=b[1],d.set(w,g);return l(function(){d.abort()}),o&&d.query(o),a&&d.ok(a),u&&u(d),s&&d.send(s),t.next=14,d;case 14:return _=t.sent,t.abrupt("return",_.body);case 16:case"end":return t.stop()}},t)}))).apply(this,arguments)}function At(t){var e=t.prefix,r=t.getHeaders,n=void 0===r?function(){return{}}:r,o=t.getPrefix,i=t.proxies,a=void 0===i?[]:i;return function(t){var r=t.onCancel,i=t.getCanceled;return function(){var t=St(regeneratorRuntime.mark(function t(u){var s,l,f,p,h,d,y;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s=u.route,t.prev=2,!i()){t.next=5;break}throw new c;case 5:return t.next=7,n();case 7:return l=t.sent,t.next=10,Tt(e,o);case 10:if(f=t.sent,p={headers:l,prefix:f,onCancel:r},!(h=a.find(function(t){return xt(s,t.matchParams)}))){t.next=16;break}return d=xt(s,h.matchParams),t.abrupt("return",h.handler({match:d,requestParams:u,headers:l,onCancel:r,getCanceled:i,http:function(t){return kt(t,p)}}));case 16:return t.next=18,kt(u,p);case 18:return y=t.sent,t.abrupt("return",y);case 22:if(t.prev=22,t.t0=t.catch(2),"ABORTED"!==t.t0.code){t.next=26;break}throw new c;case 26:throw t.t0;case 27:case"end":return t.stop()}},t,null,[[2,22]])}));return function(e){return t.apply(this,arguments)}}()}}function Rt(){var t=Object(h.useContext)(y.ReactReduxContext);if(!t)throw new Error("[useDispatch] Could not find the respective context. In order to `useDispatch` you must add the respective provider. https://resift.org/docs/introduction/installation#adding-the-resiftprovider");var e=t.store;return e.dispatch}function Pt(){var t=Rt();return Object(h.useCallback)(function(e){t(function(t){var e;if("FETCH_INSTANCE_FACTORY"===(null==t?void 0:null===(e=t.meta)||void 0===e?void 0:e.type))throw new Error("[clearFetch] you tried to pass an action creatorFactory to clearFetch. Ask rico until he write docs.");return{type:_(o,t.meta),meta:t.meta}}(e))},[t])}var qt=function(t){var e=t.fetch,r=t.children,n=ft(e);return Y(ct(e))?null===n?null:void 0===n?null:r(n):null};var Dt=function(t,e){var r=ft(t),n=ct(t,e);return Object(h.useMemo)(function(){return[r,n]},[r,n])},Ft=function(t){return function(e){var r,n,o,i;if(!t)return null;if(!("FETCH_INSTANCE"===(null==t?void 0:null===(r=t.meta)||void 0===r?void 0:r.type)))throw new Error("[useError] expected to see a fetch instance.");if(!e.dataService)throw new Error('[useError] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation');var a=t.meta,u=a.fetchFactoryId,s=a.displayName,c=a.key,l=m(s,u),f=null==e?void 0:null===(n=e.dataService)||void 0===n?void 0:null===(o=n.actions)||void 0===o?void 0:null===(i=o[l])||void 0===i?void 0:i[c];return f?void 0===f.errorData?null:f.errorData:null}};var Nt=function(t){var e=Object(h.useMemo)(function(){return Ft(t)},[t]);return Object(y.useSelector)(e)};r.d(e,"PREFIXES",function(){return n}),r.d(e,"CanceledError",function(){return c}),r.d(e,"ERROR",function(){return l}),r.d(e,"LOADING",function(){return f}),r.d(e,"NORMAL",function(){return p}),r.d(e,"ResiftProvider",function(){return J}),r.d(e,"UNKNOWN",function(){return K}),r.d(e,"combineStatuses",function(){return it}),r.d(e,"createActionType",function(){return _}),r.d(e,"createContextFetch",function(){return pt}),r.d(e,"createDataService",function(){return I}),r.d(e,"createHttpProxy",function(){return ht}),r.d(e,"createStoreKey",function(){return m}),r.d(e,"createHttpService",function(){return At}),r.d(e,"dataServiceReducer",function(){return V}),r.d(e,"defineFetch",function(){return k}),r.d(e,"typedFetchFactory",function(){return C}),r.d(e,"isError",function(){return rt}),r.d(e,"isLoading",function(){return tt}),r.d(e,"isNormal",function(){return Y}),r.d(e,"isUnknown",function(){return ot}),r.d(e,"useClearFetch",function(){return Pt}),r.d(e,"useDispatch",function(){return Rt}),r.d(e,"useData",function(){return ft}),r.d(e,"useStatus",function(){return ct}),r.d(e,"Guard",function(){return qt}),r.d(e,"useFetch",function(){return Dt}),r.d(e,"useError",function(){return Nt})}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-redux"),require("redux")):"function"==typeof define&&define.amd?define(["react","react-redux","redux"],e):"object"==typeof exports?exports.Resift=e(require("react"),require("react-redux"),require("redux")):t.Resift=e(t.react,t["react-redux"],t.redux)}(window,(function(t,e,r){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=22)}([function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e,r){"use strict";var n,o,i,a=r(9),u="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";function s(){i=!1}function c(t){if(t){if(t!==n){if(t.length!==u.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter((function(t,e,r){return e!==r.lastIndexOf(t)}));if(e.length)throw new Error("Custom alphabet for shortid must be "+u.length+" unique characters. These characters were not unique: "+e.join(", "));n=t,s()}}else n!==u&&(n=u,s())}function l(){return i||(i=function(){n||c(u);for(var t,e=n.split(""),r=[],o=a.nextValue();e.length>0;)o=a.nextValue(),t=Math.floor(o*e.length),r.push(e.splice(t,1)[0]);return r.join("")}())}t.exports={get:function(){return n||u},characters:function(t){return c(t),n},seed:function(t){a.seed(t),o!==t&&(s(),o=t)},lookup:function(t){return l()[t]},shuffled:l}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!==t&&"object"===n(t)}},function(t,e,r){"use strict";t.exports=r(8)},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;var i=r(16),a=r(17),u=r(18),s=r(4),c=r(19),l=r(21);function f(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var p=e=t.exports;e.Request=g,p.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var h="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function d(t){if(!s(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&y(e,r,t[r]);return e.join("&")}function y(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){y(t,e,r)}));else if(s(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&y(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function v(t){for(var e,r,n={},o=t.split("&"),i=0,a=o.length;i<a;++i)-1===(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function m(t){return/[/+]json($|[^-\w])/.test(t)}function b(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),a={},u=0,s=i.length;u<s;++u)-1!==(e=(r=i[u]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=h(r.slice(e+1)),a[n]=o);return a}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function g(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new b(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function w(t,e,r){var n=p("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}p.serializeObject=d,p.parseString=v,p.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},p.serialize={"application/x-www-form-urlencoded":d,"application/json":a},p.parse={"application/x-www-form-urlencoded":v,"application/json":JSON.parse},c(b.prototype),b.prototype._parseBody=function(t){var e=p.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&m(this.type)&&(e=p.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},b.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},p.Response=b,i(g.prototype),u(g.prototype),g.prototype.type=function(t){return this.set("Content-Type",p.types[t]||t),this},g.prototype.accept=function(t){return this.set("Accept",p.types[t]||t),this},g.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var o=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,o)},g.prototype.query=function(t){return"string"!=typeof t&&(t=d(t)),t&&this._query.push(t),this},g.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},g.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},g.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},g.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},g.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},g.prototype.ca=g.prototype.agent,g.prototype.buffer=g.prototype.ca,g.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},g.prototype.pipe=g.prototype.write,g.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},g.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||f,this._finalizeQueryString(),this._end()},g.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},g.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=p.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||p.serialize[o?o.split(";")[0]:""];!i&&m(o)&&(i=p.serialize["application/json"]),i&&(r=i(r))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},p.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){var n=new p.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),l.prototype.del=l.prototype.delete,p.get=function(t,e,r){var n=p("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.head=function(t,e,r){var n=p("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.options=function(t,e,r){var n=p("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.del=w,p.delete=w,p.patch=function(t,e,r){var n=p("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.post=function(t,e,r){var n=p("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.put=function(t,e,r){var n=p("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e){t.exports=function t(e,n,o){n=n||[];var i,a=(o=o||{}).strict,u=!1!==o.end,s=o.sensitive?"":"i",c=0,l=n.length,f=0,p=0;if(e instanceof RegExp){for(;i=r.exec(e.source);)n.push({name:p++,optional:!1,offset:i.index});return e}if(Array.isArray(e))return e=e.map((function(e){return t(e,n,o).source})),new RegExp("(?:"+e.join("|")+")",s);e=("^"+e+(a?"":"/"===e[e.length-1]?"?":"/?")).replace(/\/\(/g,"/(?:").replace(/([\/\.])/g,"\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g,(function(t,e,r,o,i,a,u,s){e=e||"",r=r||"",i=i||"([^\\/"+r+"]+?)",u=u||"",n.push({name:o,optional:!!u,offset:s+c});var l=(u?"":e)+"(?:"+r+(u?e:"")+i+(a?"((?:[\\/"+r+"].+?)?)":"")+")"+u;return c+=l.length-t.length,l})).replace(/\*/g,(function(t,e){for(var r=n.length;r-- >l&&n[r].offset>e;)n[r].offset+=3;return"(.*)"}));for(;i=r.exec(e);){for(var h=0,d=i.index;"\\"===e.charAt(--d);)h++;h%2!=1&&((l+f===n.length||n[l+f].offset>i.index)&&n.splice(l+f,0,{name:p++,optional:!1,offset:i.index}),f++)}return e+=u?"$":"/"===e[e.length-1]?"":"(?=\\/|$)",new RegExp(e,s)};var r=/\((?!\?)/g},function(t,e,r){"use strict";var n=r(3),o=r(10),i=r(14),a=r(15)||0;function u(){return o(a)}t.exports=u,t.exports.generate=u,t.exports.seed=function(e){return n.seed(e),t.exports},t.exports.worker=function(e){return a=e,t.exports},t.exports.characters=function(t){return void 0!==t&&n.characters(t),n.shuffled()},t.exports.isValid=i},function(t,e,r){"use strict";var n=1;t.exports={nextValue:function(){return(n=(9301*n+49297)%233280)/233280},seed:function(t){n=t}}},function(t,e,r){"use strict";var n,o,i=r(11);r(3);t.exports=function(t){var e="",r=Math.floor(.001*(Date.now()-1567752802062));return r===o?n++:(n=0,o=r),e+=i(7),e+=i(t),n>0&&(e+=i(n)),e+=i(r)}},function(t,e,r){"use strict";var n=r(3),o=r(12),i=r(13);t.exports=function(t){for(var e,r=0,a="";!e;)a+=i(o,n.get(),1),e=t<Math.pow(16,r+1),r++;return a}},function(t,e,r){"use strict";var n,o="object"==typeof window&&(window.crypto||window.msCrypto);n=o&&o.getRandomValues?function(t){return o.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],r=0;r<t;r++)e.push(Math.floor(256*Math.random()));return e},t.exports=n},function(t,e){t.exports=function(t,e,r){for(var n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*r/e.length),i="";;)for(var a=t(o),u=o;u--;)if((i+=e[a[u]&n]||"").length===+r)return i}},function(t,e,r){"use strict";var n=r(3);t.exports=function(t){return!(!t||"string"!=typeof t||t.length<6)&&!new RegExp("[^"+n.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t)}},function(t,e,r){"use strict";t.exports=0},function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){t.exports=o,o.default=o,o.stable=a,o.stableStringify=a;var r=[],n=[];function o(t,e,o){var i;for(!function t(e,o,i,a){var u;if("object"==typeof e&&null!==e){for(u=0;u<i.length;u++)if(i[u]===e){var s=Object.getOwnPropertyDescriptor(a,o);return void(void 0!==s.get?s.configurable?(Object.defineProperty(a,o,{value:"[Circular]"}),r.push([a,o,e,s])):n.push([e,o]):(a[o]="[Circular]",r.push([a,o,e])))}if(i.push(e),Array.isArray(e))for(u=0;u<e.length;u++)t(e[u],u,i,e);else{var c=Object.keys(e);for(u=0;u<c.length;u++){var l=c[u];t(e[l],l,i,e)}}i.pop()}}(t,"",[],void 0),i=0===n.length?JSON.stringify(t,e,o):JSON.stringify(t,u(e),o);0!==r.length;){var a=r.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}return i}function i(t,e){return t<e?-1:t>e?1:0}function a(t,e,o){var a,s=function t(e,o,a,u){var s;if("object"==typeof e&&null!==e){for(s=0;s<a.length;s++)if(a[s]===e){var c=Object.getOwnPropertyDescriptor(u,o);return void(void 0!==c.get?c.configurable?(Object.defineProperty(u,o,{value:"[Circular]"}),r.push([u,o,e,c])):n.push([e,o]):(u[o]="[Circular]",r.push([u,o,e])))}if("function"==typeof e.toJSON)return;if(a.push(e),Array.isArray(e))for(s=0;s<e.length;s++)t(e[s],s,a,e);else{var l={},f=Object.keys(e).sort(i);for(s=0;s<f.length;s++){var p=f[s];t(e[p],p,a,e),l[p]=e[p]}if(void 0===u)return l;r.push([u,o,e]),u[o]=l}a.pop()}}(t,"",[],void 0)||t;for(a=0===n.length?JSON.stringify(s,e,o):JSON.stringify(s,u(e),o);0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}return a}function u(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===e&&i[0]===r){r="[Circular]",n.splice(o,1);break}}return t.call(this,e,r)}}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(4);function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}t.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},i.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var a=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];i.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&a.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},i.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(o(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(o(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},i.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=o(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&o(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},i.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},i.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},function(t,e,r){"use strict";var n=r(20);function o(t){if(t)return function(t){for(var e in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,e)&&(t[e]=o.prototype[e]);return t}(t)}t.exports=o,o.prototype.get=function(t){return this.header[t.toLowerCase()]},o.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this[o]=r[o]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},o.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},function(t,e,r){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce((function(t,e){var r=e.split(/ *= */),n=r.shift(),o=r.shift();return n&&o&&(t[n]=o),t}),{})},e.parseLinks=function(t){return t.split(/ *, */).reduce((function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t}),{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){o.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}})),o.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,n(e.args))}))},t.exports=o},function(t,e,r){"use strict";r.r(e),r.d(e,"PREFIXES",(function(){return n})),r.d(e,"CanceledError",(function(){return c})),r.d(e,"ERROR",(function(){return l})),r.d(e,"LOADING",(function(){return f})),r.d(e,"NORMAL",(function(){return p})),r.d(e,"ResiftProvider",(function(){return rt})),r.d(e,"UNKNOWN",(function(){return nt})),r.d(e,"combineStatuses",(function(){return pt})),r.d(e,"createActionType",(function(){return O})),r.d(e,"createContextFetch",(function(){return wt})),r.d(e,"createDataService",(function(){return L})),r.d(e,"createHttpProxy",(function(){return Ot})),r.d(e,"createStoreKey",(function(){return m})),r.d(e,"createHttpService",(function(){return Lt})),r.d(e,"dataServiceReducer",(function(){return et})),r.d(e,"defineFetch",(function(){return C})),r.d(e,"typedFetchFactory",(function(){return A})),r.d(e,"isError",(function(){return ct})),r.d(e,"isLoading",(function(){return ut})),r.d(e,"isNormal",(function(){return it})),r.d(e,"isUnknown",(function(){return ft})),r.d(e,"useClearFetch",(function(){return Xt})),r.d(e,"useDispatch",(function(){return Ut})),r.d(e,"useData",(function(){return gt})),r.d(e,"useStatus",(function(){return bt})),r.d(e,"Guard",(function(){return $t})),r.d(e,"useFetch",(function(){return zt})),r.d(e,"useError",(function(){return Wt}));var n={};r.r(n),r.d(n,"CLEAR",(function(){return o})),r.d(n,"FETCH",(function(){return i})),r.d(n,"ERROR",(function(){return a})),r.d(n,"SUCCESS",(function(){return u}));var o="@@RESIFT/CLEAR",i="@@RESIFT/FETCH",a="@@RESIFT/ERROR",u="@@RESIFT/SUCCESS";function s(t){this.message=t,this.isCanceledError=!0}s.prototype=Object.create(Error.prototype),s.prototype.name="CanceledError",s.prototype=new Error;var c=s,l=4,f=2,p=1,h=r(0),d=r.n(h),y=r(1),v=r(2);function m(t,e){return"".concat(t," | ").concat(e)}function b(){return(new Date).toISOString()}var g=r(5),w=r.n(g);function O(t,e){return"".concat(t," | ").concat(e.displayName," | ").concat(e.fetchFactoryId)}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){j(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t,e){return e}function T(t,e){if(!t)return j({},e,E);if("function"==typeof t)return j({},e,t);if("object"===S(t))return t[e]?t:x({},t,j({},e,E));throw new Error("[sharedReducer] Could not match typeof merge. See here for how to define merges: https://resift.org/docs/main-concepts/making-state-consistent#merges")}function k(t){return!!t&&(!!t.type&&t.type.startsWith(i))}function C(t){var e=t.displayName,r=t.share,n=t.conflict,o=void 0===n?"cancel":n,a=t.make,u=t.staticFetchFactoryId||w()();if(!e)throw new Error("`displayName` is required in `defineFetch`");if(!a)throw new Error("`make` is required in `defineFetch`");if(r&&!r.namespace)throw new Error("`namespace` is required in `share");var s=function(t,e,r,n){var o={};return function(){for(var i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];var s=r.apply(void 0,a);if("object"!==S(s))throw new Error("[defineFetch]: `make` must return an object");var c=s.request;if(!a.every((function(t){return"string"==typeof t||"number"==typeof t})))throw new Error('[defineFetch] make arguments must be either a string or a number. Check calls to the fetch factory "'.concat(t,'" See here https://resift.org/docs/main-concepts/whats-a-fetch#making-a-fetch-and-pulling-data-from-it'));if("function"!=typeof c)throw new Error("[defineFetch] `request` must be a function in the object that `make` returns`");var l="key:".concat([].concat(a,[n]).join(" | "));return o[l]||(o[l]=e.apply(void 0,a)),o[l]}}(e,(function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];var c=a.apply(void 0,n),l={fetchFactoryId:u,key:"key:".concat(n.join(" | ")),displayName:e,share:r&&x({},r,{mergeObj:T(r.merge,r.namespace)}),conflict:o};function f(){var t=c.request.apply(c,arguments);if("function"!=typeof t)throw new Error("[defineFetch] Expected `fetch` to return a curried function. https://resift.org/docs/main-concepts/how-to-define-a-fetch#the-request-function");var e={canceled:!1},r=[];t.cancel=function(){e.canceled=!0;var t=!0,n=!1,o=void 0;try{for(var i,a=r[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){(0,i.value)()}}catch(t){n=!0,o=t}finally{try{t||null==a.return||a.return()}finally{if(n)throw o}}},t.getCanceled=function(){return e.canceled},t.onCancel=function(t){r.push(t)};var n={type:O(i,l),meta:l,payload:t};return n}return f.meta=x({},l,{type:"FETCH_INSTANCE"}),f}),a,o);return s.meta={fetchFactoryId:u,displayName:e,type:"FETCH_INSTANCE_FACTORY"},s}var A=function(){return function(t){return t}};function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function D(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function I(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){D(i,n,o,a,u,"next",t)}function u(t){D(i,n,o,a,u,"throw",t)}a(void 0)}))}}function q(t){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(t){return"object"===q(t)&&("string"==typeof t.type&&t.type.startsWith(u))}function F(t){return"object"===q(t)&&("string"==typeof t.type&&t.type.startsWith(a))}var M=new WeakSet;function H(){return(H=I(regeneratorRuntime.mark((function t(e){var r,n,o,i,s,l,f,p,h,d,y,v,b,g,w,_,x,S,j,E,T,k;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.state,n=e.services,o=e.dispatch,i=e.action,s=e.getState,l=i.payload,f=i.meta,p=f.displayName,h=f.fetchFactoryId,d=f.key,y=f.conflict,t.prev=3,w=m(p,h),!(_=null==r||null===(v=r.actions)||void 0===v||null===(b=v[w])||void 0===b||null===(g=b[d])||void 0===g?void 0:g.inflight)){t.next=11;break}if("ignore"!==y){t.next=9;break}return t.abrupt("return");case 9:_.cancel(),M.add(_);case 11:return x=function(t){if(l.getCanceled())throw new c;return o(t)},S=function(){if(l.getCanceled())throw new c;return s()},j=Object.entries(n).reduce((function(t,e){var r=P(e,2),n=r[0],o=r[1];return t[n]=o({getCanceled:l.getCanceled,onCancel:l.onCancel}),t}),{dispatch:x,getState:S}),t.prev=14,t.next=17,l(j);case 17:if(E=t.sent,!M.has(l)){t.next=20;break}return t.abrupt("return");case 20:T={type:O(u,f),meta:f,payload:E},o(T),t.next=31;break;case 24:if(t.prev=24,t.t0=t.catch(14),!t.t0.isCanceledError){t.next=28;break}return t.abrupt("return");case 28:if(!M.has(l)){t.next=30;break}return t.abrupt("return");case 30:throw t.t0;case 31:t.next=38;break;case 33:throw t.prev=33,t.t1=t.catch(3),k={type:O(a,f),meta:f,payload:t.t1,error:!0},o(k),t.t1;case 38:case"end":return t.stop()}}),t,null,[[3,33],[14,24]])})))).apply(this,arguments)}function L(t){var e=t.services,r=t.onError;if(!e)throw new Error("`services` key required");if(!r)throw new Error("`onError` callback required");return function(t){return function(n){return function(o){if(!k(o))return n(o);var i=function(t){return H.apply(this,arguments)}({state:t.getState().dataService,services:e,dispatch:t.dispatch,action:o,getState:t.getState}).catch((function(t){throw r(t),t}));return n(o),i}}}}function U(t){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function X(t){return"object"===U(t)&&("string"==typeof t.type&&t.type.startsWith(o))}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){V(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function J(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(r),!0).forEach((function(e){Z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var tt={data:{},parents:{},merges:{}};var et=Object(v.combineReducers)({shared:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tt,e=arguments.length>1?arguments[1]:void 0;if(k(e)){var r=e.meta,n=r.displayName,o=r.fetchFactoryId,i=r.key,a=r.share;if(!a)return t;for(var u=a.namespace,s=a.mergeObj,c=Y({},null==t?void 0:t.merges),l=0,f=Object.entries(s);l<f.length;l++){var p=J(f[l],2),h=p[0],d=p[1],y=Y({},null==c?void 0:c[h]);y[u]=d,c[h]=y}var v=Y({},null==t?void 0:t.parents),m=Y({},null==v?void 0:v[u]);return m["".concat(n," | ").concat(i," | ").concat(o)]={fetchFactoryId:o,key:i,displayName:n},v[u]=m,Y({},t,{merges:c,parents:v})}if(N(e)){var b=function(){var r,n=e.meta,o=e.payload,i=n.key,a=n.share;if(!a)return{v:t};for(var u=a.namespace,s=(null==t||null===(r=t.merges)||void 0===r?void 0:r[u])||{},c=Y({},null==t?void 0:t.data),l=function(){var e,r,n,a,s=J(p[f],2),l=s[0],h=s[1];if(l===u)return c[l]=Y({},null===(r=t.data)||void 0===r?void 0:r[l],Z({},i,h(null===(n=t.data)||void 0===n||null===(a=n[l])||void 0===a?void 0:a[i],o))),"continue";var d=Object.entries((null==t||null===(e=t.data)||void 0===e?void 0:e[l])||{}).reduce((function(t,e){var r=J(e,2),n=r[0],i=r[1];return t[n]=h(i,o),t}),{});c[l]=d},f=0,p=Object.entries(s);f<p.length;f++)l();return{v:Y({},t,{data:c})}}();if("object"===G(b))return b.v}if(X(e)){var g=e.meta,w=g.displayName,O=g.fetchFactoryId,_=g.key,x=g.share;if(!x)return t;for(var S=x.namespace,j=x.mergeObj,E=Y({},null==t?void 0:t.merges),T=0,C=Object.keys(j);T<C.length;T++){var A=C[T],P=Y({},null==E?void 0:E[A]);delete P[S],E[A]=P}var R=Y({},null==t?void 0:t.parents),D=Y({},null==R?void 0:R[S]),I="".concat(w," | ").concat(_," | ").concat(O);delete D[I],Object.keys(D||{}).length<=0?delete R[S]:R[S]=D;var q=Y({},null==t?void 0:t.data);return delete q[S],Y({},t,{data:q,merges:E,parents:R})}return t},actions:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(!(k(e)||N(e)||F(e)||X(e)))return t;var r,n,o,i=e.meta,a=i.displayName,u=i.fetchFactoryId,s=i.key,c=i.share,l=m(a,u);return k(e)?B({},t,V({},l,B({},t[l],V({},s,B({},null==t||null===(r=t[l])||void 0===r?void 0:r[s],{shared:!!c,inflight:e.payload,meta:i,updatedAt:b()}))))):N(e)?B({},t,V({},l,B({},t[l],V({},s,B({},null==t||null===(n=t[l])||void 0===n?void 0:n[s],{inflight:void 0,shared:!!c,hadSuccess:!0,data:e.payload,errorData:null,error:!1,meta:i,updatedAt:b()}))))):F(e)?B({},t,V({},l,B({},t[l],V({},s,B({},null==t||null===(o=t[l])||void 0===o?void 0:o[s],{inflight:void 0,shared:!!c,errorData:e.payload,error:!0,meta:i,updatedAt:b()}))))):B({},t,V({},l,Object.entries((null==t?void 0:t[l])||{}).filter((function(t){return $(t,1)[0]!==s})).reduce((function(t,e){var r=$(e,2),n=r[0],o=r[1];return t[n]=o,t}),{})))}});var rt=function(t){var e=t.children,r=t.dataService;if(t.suppressOutsideReduxWarning,Object(h.useContext)(y.ReactReduxContext),!r)throw new Error("[ResiftProvider] `dataService` missing from props.");var n=Object(h.useMemo)((function(){return function(t){var e=Object(v.combineReducers)({dataService:et}),r=("undefined"!=typeof __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:v.compose)(Object(v.applyMiddleware)(t));return Object(v.createStore)(e,r)}(r)}),[r]);return d.a.createElement(y.Provider,{store:n},e)},nt=0;function ot(t){return 0!=(t&p)}function it(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.every(ot)}function at(t){return 0!=(t&f)}function ut(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.some(at)}function st(t){return 0!=(t&l)}function ct(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.some(st)}function lt(t){return t===nt}function ft(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.every(lt)}function pt(){if(ft.apply(void 0,arguments))return nt;var t=ut.apply(void 0,arguments)?f:nt,e=it.apply(void 0,arguments)?p:nt,r=ct.apply(void 0,arguments)?l:nt;return t|e|r}function ht(t){return function(t){if(Array.isArray(t))return dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(e.every((function(t){return ft(t)})))return nt;var n=ut.apply(void 0,e)?f:nt,o=e.some((function(t){return it(t)}))?p:nt,i=ct.apply(void 0,e)?l:nt;return n|o|i}function vt(t){if(!t)return nt;var e=t.hadSuccess,r=t.inflight,n=t.error;return(r?f:nt)|(n?l:nt)|(e&&!n?p:nt)}var mt=function(t,e){return function(r){var n,o,i,a;if(!t)return nt;if(!("FETCH_INSTANCE"===(null==t||null===(n=t.meta)||void 0===n?void 0:n.type)))throw new Error("[useStatus] expected to see a fetch instance in get fetch.");if(!r.dataService)throw new Error('[useStatus] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation');var u=t.meta,s=u.fetchFactoryId,c=u.displayName,l=u.key,p=u.share,h=m(c,s),d=vt(null==r||null===(o=r.dataService)||void 0===o||null===(i=o.actions)||void 0===i||null===(a=i[h])||void 0===a?void 0:a[l]);if(!p)return d;var y=p.namespace,v=p.mergeObj;if((null==e?void 0:e.isolatedStatus)||!1)return d;var b=Object.keys(v),g=b.map((function(t){var e,n,o,i=null==r||null===(e=r.dataService)||void 0===e||null===(n=e.shared)||void 0===n||null===(o=n.parents)||void 0===o?void 0:o[t];return i?t!==y?null:Object.values(i).filter((function(t){return t.key===l})):null})).filter((function(t){return!!t})).reduce((function(t,e){var r=!0,n=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var u=i.value;t.push(u)}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return t}),[]),w=b.map((function(t){var e,n,o,i=null==r||null===(e=r.dataService)||void 0===e||null===(n=e.shared)||void 0===n||null===(o=n.parents)||void 0===o?void 0:o[t];return i?t===y?null:Object.values(i):null})).filter((function(t){return!!t})).reduce((function(t,e){var r=!0,n=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var u=i.value;t.push(u)}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return t}),[]),O=g.map((function(t){var e,n,o,i=m(t.displayName,t.fetchFactoryId);return vt(null==r||null===(e=r.dataService)||void 0===e||null===(n=e.actions)||void 0===n||null===(o=n[i])||void 0===o?void 0:o[t.key])})).filter((function(t){return null!==t}));return(w.map((function(t){var e,n,o,i=m(t.displayName,t.fetchFactoryId);return vt(null==r||null===(e=r.dataService)||void 0===e||null===(n=e.actions)||void 0===n||null===(o=n[i])||void 0===o?void 0:o[t.key])})).filter((function(t){return null!==t})).some((function(t){return ut(t)}))?f:nt)|yt.apply(void 0,ht(O))}};var bt=function(t,e){var r=null==e?void 0:e.isolatedStatus,n=Object(h.useMemo)((function(){return{isolatedStatus:r}}),[r]),o=Object(h.useMemo)((function(){return mt(t,n)}),[t,n]);return Object(y.useSelector)(o)};var gt=function(t){var e=Object(h.useMemo)((function(){return function(t){return function(e){var r,n,o,i,a,u,s,c;if(!t)return null;if(!("FETCH_INSTANCE"===(null==t||null===(r=t.meta)||void 0===r?void 0:r.type)))throw new Error("[useData] expected to see a fetch instance.");if(!e.dataService)throw new Error('[useData] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation');var l=t.meta,f=l.fetchFactoryId,p=l.displayName,h=l.key,d=l.share,y=m(p,f),v=null==e||null===(n=e.dataService)||void 0===n||null===(o=n.actions)||void 0===o||null===(i=o[y])||void 0===i?void 0:i[h];if(!d)return v?void 0===v.data?null:v.data:null;var b=d.namespace;return(null==e||null===(a=e.dataService)||void 0===a||null===(u=a.shared)||void 0===u||null===(s=u.data)||void 0===s||null===(c=s[b])||void 0===c?void 0:c[h])||null}}(t)}),[t]);return Object(y.useSelector)(e)};function wt(t){var e=Object(h.createContext)(null);return e.displayName="FetchProvider".concat(t.meta.displayName.split(" ").map((function(t){return t.replace(/\W/g,"")})).map((function(t){return t.substring(0,1).toUpperCase()+t.substring(1)})).join("")),{ContextFetchProvider:function(r){var n=r.children,o=gt(t),i=bt(t),a=Object(h.useMemo)((function(){return[o,i]}),[o,i]);return d.a.createElement(e.Provider,{value:a},n)},useContextFetch:function(){var t=Object(h.useContext)(e);if(!t)throw new Error("[createContextFetch] could not find global fetch context. Did you forget to wrap this tree with the provider?");return t},ContextFetchConsumer:function(t){var r=t.children;return d.a.createElement(e.Consumer,null,r)}}}function Ot(t,e){return{matchParams:t,handler:e}}var _t=r(6),xt=r.n(_t),St=r(7),jt=r.n(St);function Et(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var kt={},Ct=0;function At(t,e){var r="".concat(e.end).concat(e.strict).concat(e.sensitive),n=kt[r]||(kt[r]={});if(n[t])return n[t];var o=[],i={regexp:jt()(t,o,e),keys:o};return Ct<1e4&&(n[t]=i,Ct++),i}var Pt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};("string"==typeof e||Array.isArray(e))&&(e={path:e});var r=e,n=r.path,o=r.exact,i=void 0!==o&&o,a=r.strict,u=void 0!==a&&a,s=r.sensitive,c=void 0!==s&&s,l=[].concat(n);return l.reduce((function(e,r){if(!r)return null;if(e)return e;var n=At(r,{end:i,strict:u,sensitive:c}),o=n.regexp,a=n.keys,s=o.exec(t);if(!s)return null;var l=Et(s),f=l[0],p=l.slice(1),h=t===f;return i&&!h?null:{path:r,url:"/"===r&&""===f?"/":f,isExact:h,params:a.reduce((function(t,e,r){return t[e.name]=p[r],t}),{})}}),null)};function Rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function It(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function qt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){It(i,n,o,a,u,"next",t)}function u(t){It(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Nt(t,e){return Ft.apply(this,arguments)}function Ft(){return(Ft=qt(regeneratorRuntime.mark((function t(e,r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=2;break}return t.abrupt("return",e);case 2:if("function"!=typeof r){t.next=7;break}return t.next=5,r();case 5:return n=t.sent,t.abrupt("return",n);case 7:return t.abrupt("return","");case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Mt(t,e){return Ht.apply(this,arguments)}function Ht(){return(Ht=qt(regeneratorRuntime.mark((function t(e,r){var n,o,i,a,u,s,c,l,f,p,h,d,y,v,m,b,g,w,O;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=e.method,o=e.query,i=e.route,a=e.ok,u=e.req,s=e.data,c=r.headers,l=r.onCancel,f=r.prefix,p=n.toLowerCase(),h="".concat(f).concat(i),d=xt.a[p](h).accept("application/json"),y=Object.entries(c),v=0,m=y;v<m.length;v++)b=Rt(m[v],2),g=b[0],w=b[1],d.set(g,w);return l((function(){d.abort()})),o&&d.query(o),a&&d.ok(a),u&&u(d),s&&d.send(s),t.next=14,d;case 14:return O=t.sent,t.abrupt("return",O.body);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Lt(t){var e=t.prefix,r=t.getHeaders,n=void 0===r?function(){return{}}:r,o=t.getPrefix,i=t.proxies,a=void 0===i?[]:i;return function(t){var r=t.onCancel,i=t.getCanceled;return function(){var t=qt(regeneratorRuntime.mark((function t(u){var s,l,f,p,h,d,y;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=u.route,t.prev=2,!i()){t.next=5;break}throw new c;case 5:return t.next=7,n();case 7:return l=t.sent,t.next=10,Nt(e,o);case 10:if(f=t.sent,p={headers:l,prefix:f,onCancel:r},!(h=a.find((function(t){return Pt(s,t.matchParams)})))){t.next=16;break}return d=Pt(s,h.matchParams),t.abrupt("return",h.handler({match:d,requestParams:u,headers:l,onCancel:r,getCanceled:i,http:function(t){return Mt(t,p)}}));case 16:return t.next=18,Mt(u,p);case 18:return y=t.sent,t.abrupt("return",y);case 22:if(t.prev=22,t.t0=t.catch(2),"ABORTED"!==t.t0.code){t.next=26;break}throw new c;case 26:throw t.t0;case 27:case"end":return t.stop()}}),t,null,[[2,22]])})));return function(e){return t.apply(this,arguments)}}()}}function Ut(){var t=Object(h.useContext)(y.ReactReduxContext);if(!t)throw new Error("[useDispatch] Could not find the respective context. In order to `useDispatch` you must add the respective provider. https://resift.org/docs/introduction/installation#adding-the-resiftprovider");var e=t.store;return e.dispatch}function Xt(){var t=Ut();return Object(h.useCallback)((function(e){t(function(t){var e;if("FETCH_INSTANCE_FACTORY"===(null==t||null===(e=t.meta)||void 0===e?void 0:e.type))throw new Error("[clearFetch] you tried to pass an action creatorFactory to clearFetch. Ask rico until he write docs.");return{type:O(o,t.meta),meta:t.meta}}(e))}),[t])}var $t=function(t){var e=t.fetch,r=t.children,n=gt(e);return it(bt(e))?null==n?null:r(n):null};var zt=function(t,e){var r=gt(t),n=bt(t,e);return Object(h.useMemo)((function(){return[r,n]}),[r,n])};var Wt=function(t){var e=Object(h.useMemo)((function(){return function(t){return function(e){var r,n,o,i;if(!t)return null;if(!("FETCH_INSTANCE"===(null==t||null===(r=t.meta)||void 0===r?void 0:r.type)))throw new Error("[useError] expected to see a fetch instance.");if(!e.dataService)throw new Error('[useError] "dataService" is a required key. Double check with the installation guide here: https://resift.org/docs/introduction/installation');var a=t.meta,u=a.fetchFactoryId,s=a.displayName,c=a.key,l=m(s,u),f=null==e||null===(n=e.dataService)||void 0===n||null===(o=n.actions)||void 0===o||null===(i=o[l])||void 0===i?void 0:i[c];return f?void 0===f.errorData?null:f.errorData:null}}(t)}),[t]);return Object(y.useSelector)(e)}}])})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"author": "team@justsift.com", | ||
"version": "0.1.0", | ||
"version": "0.1.1-alpha.1", | ||
"description": "A state management for data fetches in React", | ||
@@ -23,10 +23,10 @@ "keywords": [ | ||
"react": "^16.8.0", | ||
"redux": "^4.0.4", | ||
"react-redux": "^7.1.0" | ||
"redux": "^4.0.5", | ||
"react-redux": "^7.2.0" | ||
}, | ||
"dependencies": { | ||
"@types/superagent": "^4.1.2", | ||
"@types/superagent": "^4.1.7", | ||
"delay": "^4.3.0", | ||
"shortid": "^2.2.14", | ||
"superagent": "^5.1.0" | ||
"shortid": "^2.2.15", | ||
"superagent": "^5.2.2" | ||
}, | ||
@@ -33,0 +33,0 @@ "name": "resift", |
Sorry, the diff of this file is not supported yet
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
370710
1011
Updated@types/superagent@^4.1.7
Updatedshortid@^2.2.15
Updatedsuperagent@^5.2.2