New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rest-hooks/normalizr

Package Overview
Dependencies
Maintainers
2
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rest-hooks/normalizr - npm Package Compare versions

Comparing version 7.4.0 to 7.5.0

9

CHANGELOG.md

@@ -6,2 +6,11 @@ # Change Log

## [7.5.0](https://github.com/coinbase/rest-hooks/compare/@rest-hooks/normalizr@7.4.0...@rest-hooks/normalizr@7.5.0) (2021-07-06)
### 🚀 Features
* Allow normalizing entities that are just ids ([#1002](https://github.com/coinbase/rest-hooks/issues/1002)) ([489e1ad](https://github.com/coinbase/rest-hooks/commit/489e1ad3e5e8943ddc3cb24c08947d67379a04c4))
## [7.4.0](https://github.com/coinbase/rest-hooks/compare/@rest-hooks/normalizr@7.3.0...@rest-hooks/normalizr@7.4.0) (2021-06-19)

@@ -8,0 +17,0 @@

20

dist/normalizr.amd.js

@@ -1158,17 +1158,19 @@ define(['exports'], function (exports) { 'use strict';

var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
if (!value || !schema || !['function', 'object'].includes(typeof schema)) {
if (!value || !schema) {
return value;
}
if (!schema.normalize || typeof schema.normalize !== 'function') {
// serializable
if (typeof schema === 'function') {
return new schema(value);
}
if (schema.normalize && typeof schema.normalize === 'function') {
if (typeof value !== 'object') return value;
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
} // serializable
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
if (typeof schema === 'function') {
return new schema(value);
}
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
if (typeof value !== 'object' || typeof schema !== 'object') return value;
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
};

@@ -1175,0 +1177,0 @@

@@ -1,1 +0,1 @@

define(["exports"],(function(e){"use strict";function t(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function n(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=function(){function e(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=e.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(e,n){if(void 0===e)return[e,!1,!1];var r=t(e)?e.get("schema"):e.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[r]):[e,!0,!1]},s(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),u=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},c=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},f=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},l=function(e,t,n,r,i,o,s){return e=u(e),c(t).map((function(t,a){return i(t,n,r,e,o,s)}))},h=function(e,t,n){e=u(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(f).map((function(e){return e[0]})):t,i,r]};function p(e,t,n,r){}var d=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return c(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(f).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(a),y=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},m=function(e,r,i){if(t(r))return n(e,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(e).forEach((function(t){var n=i(o[t],e[t]),r=n[0],u=n[1],c=n[2];void 0!==o[t]&&(o[t]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function v(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var g=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return v(this.schema,e,t,n)},e}();function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var k=Symbol("Defined Members"),w=Symbol("unq"),j=function(){function e(){}return e.prototype.toString=function(){return this[w]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,k,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,w,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[k].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=O(e[k]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[k]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return v(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},s(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();j.schema={};var E=function(e){function r(){return e.apply(this,arguments)||this}return i(r,e),r.toJSON=function(){return Object.assign({},e.toJSON.call(this),{key:this.key})},r.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},r.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},r.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=O(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=O(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",b="substantially different than expected keys";v&&(g+="\n Missing: "+a,b="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,b="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+b+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},r.expiresAt=function(e,t){return e.expiresAt},r.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},r.denormalize=function(e,r){var i=this,o=t(e)?e:this.fromJS(e instanceof j?this.toObjectDefined(e):e);if(null==r.setLocal||r.setLocal(o),t(e)){var s=n(this.schema,e,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(t){var n=i.schema[t],s=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,a=r(s,n),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(e,t)&&!i.defaults[t]||(f=!0),Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==u&&(o[t]=u)})),[o,!0,f]},s(r,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),r}(j);function S(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(E.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return j.fromJS.call(this,e)});var _=Symbol("ENTITY WAS DELETED");function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function N(e,t,n){return(N=A()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return N(e,arguments,z(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}var D=function(){this.children=new WeakMap},V=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return i(t,e),t}(x(Error)),J=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new V;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new D,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),P=function(e,t,n,r){var i=M(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?h:m)(n,e,a)}return null===e?[e,!0,!1]:S(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===_)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=T(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new J);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=T(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},M=function(e){var n=t(e);return function(t,r){var i=r.key;return"object"==typeof t?t:n?e.getIn([i,t]):e[i]&&e[i][t]}};function T(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&S(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var I=function e(t,n,r,i,o,s){return t&&i&&["function","object"].includes(typeof i)?i.normalize&&"function"==typeof i.normalize?i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):(Array.isArray(i)?l:y)(i,t,n,r,e,o,s):t};var L=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(a),R=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(a),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,_,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},s(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),F=Object.freeze({__proto__:null,Union:L,Values:R,Array:d,Object:g,Delete:U}),B=function(e){function t(){return e.apply(this,arguments)||this}return i(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(E);e.DELETED=_,e.Entity=E,e.FlatEntity=B,e.SimpleRecord=j,e.WeakListMap=J,e.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new J),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=P(n,r,i,o);return[].concat(s(e,t),[o])},e.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?p:v)(t,n,r,e):t},e.isEntity=S,e.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=O(s.indexes);!(v=g()).done;){var b=v.value;b in t[c]||(r[c][b]=t[c][b]={});var k=t[c][b];f&&delete k[f[b]],n[c]&&n[c][u]&&n[c][u][b]!==m[b]&&(k[n[c][u][b]]=_),b in m?k[m[b]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+b+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:I(e,e,void 0,t,f,{}),entityMeta:c}},e.schema=F,Object.defineProperty(e,"__esModule",{value:!0})}));
define(["exports"],(function(e){"use strict";function t(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function n(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=function(){function e(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=e.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(e,n){if(void 0===e)return[e,!1,!1];var r=t(e)?e.get("schema"):e.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[r]):[e,!0,!1]},s(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),u=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},c=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},f=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},l=function(e,t,n,r,i,o,s){return e=u(e),c(t).map((function(t,a){return i(t,n,r,e,o,s)}))},h=function(e,t,n){e=u(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(f).map((function(e){return e[0]})):t,i,r]};function p(e,t,n,r){}var d=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return c(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(f).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(a),y=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},m=function(e,r,i){if(t(r))return n(e,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(e).forEach((function(t){var n=i(o[t],e[t]),r=n[0],u=n[1],c=n[2];void 0!==o[t]&&(o[t]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function v(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var g=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return v(this.schema,e,t,n)},e}();function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var k=Symbol("Defined Members"),w=Symbol("unq"),j=function(){function e(){}return e.prototype.toString=function(){return this[w]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,k,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,w,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[k].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=O(e[k]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[k]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return v(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},s(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();j.schema={};var E=function(e){function r(){return e.apply(this,arguments)||this}return i(r,e),r.toJSON=function(){return Object.assign({},e.toJSON.call(this),{key:this.key})},r.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},r.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},r.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=O(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=O(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",b="substantially different than expected keys";v&&(g+="\n Missing: "+a,b="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,b="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+b+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},r.expiresAt=function(e,t){return e.expiresAt},r.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},r.denormalize=function(e,r){var i=this,o=t(e)?e:this.fromJS(e instanceof j?this.toObjectDefined(e):e);if(null==r.setLocal||r.setLocal(o),t(e)){var s=n(this.schema,e,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(t){var n=i.schema[t],s=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,a=r(s,n),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(e,t)&&!i.defaults[t]||(f=!0),Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==u&&(o[t]=u)})),[o,!0,f]},s(r,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),r}(j);function S(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(E.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return j.fromJS.call(this,e)});var _=Symbol("ENTITY WAS DELETED");function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function N(e,t,n){return(N=A()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return N(e,arguments,z(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}var D=function(){this.children=new WeakMap},V=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return i(t,e),t}(x(Error)),J=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new V;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new D,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),P=function(e,t,n,r){var i=M(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?h:m)(n,e,a)}return null===e?[e,!0,!1]:S(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===_)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=T(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new J);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=T(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},M=function(e){var n=t(e);return function(t,r){var i=r.key;return"object"==typeof t?t:n?e.getIn([i,t]):e[i]&&e[i][t]}};function T(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&S(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var I=function e(t,n,r,i,o,s){return t&&i?i.normalize&&"function"==typeof i.normalize?"object"!=typeof t?t:i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):"object"!=typeof t||"object"!=typeof i?t:(Array.isArray(i)?l:y)(i,t,n,r,e,o,s):t};var L=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(a),R=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(a),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,_,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},s(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),F=Object.freeze({__proto__:null,Union:L,Values:R,Array:d,Object:g,Delete:U}),B=function(e){function t(){return e.apply(this,arguments)||this}return i(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(E);e.DELETED=_,e.Entity=E,e.FlatEntity=B,e.SimpleRecord=j,e.WeakListMap=J,e.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new J),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=P(n,r,i,o);return[].concat(s(e,t),[o])},e.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?p:v)(t,n,r,e):t},e.isEntity=S,e.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=O(s.indexes);!(v=g()).done;){var b=v.value;b in t[c]||(r[c][b]=t[c][b]={});var k=t[c][b];f&&delete k[f[b]],n[c]&&n[c][u]&&n[c][u][b]!==m[b]&&(k[n[c][u][b]]=_),b in m?k[m[b]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+b+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:I(e,e,void 0,t,f,{}),entityMeta:c}},e.schema=F,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -1159,17 +1159,19 @@ var rest_hooks_normalizr = (function (exports) {

var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
if (!value || !schema || !['function', 'object'].includes(typeof schema)) {
if (!value || !schema) {
return value;
}
if (!schema.normalize || typeof schema.normalize !== 'function') {
// serializable
if (typeof schema === 'function') {
return new schema(value);
}
if (schema.normalize && typeof schema.normalize === 'function') {
if (typeof value !== 'object') return value;
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
} // serializable
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
if (typeof schema === 'function') {
return new schema(value);
}
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
if (typeof value !== 'object' || typeof schema !== 'object') return value;
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
};

@@ -1176,0 +1178,0 @@

@@ -1,1 +0,1 @@

var rest_hooks_normalizr=function(e){"use strict";function t(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function n(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=function(){function e(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=e.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(e,n){if(void 0===e)return[e,!1,!1];var r=t(e)?e.get("schema"):e.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[r]):[e,!0,!1]},s(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),u=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},c=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},f=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},l=function(e,t,n,r,i,o,s){return e=u(e),c(t).map((function(t,a){return i(t,n,r,e,o,s)}))},h=function(e,t,n){e=u(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(f).map((function(e){return e[0]})):t,i,r]};function p(e,t,n,r){}var d=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return c(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(f).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(a),y=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},m=function(e,r,i){if(t(r))return n(e,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(e).forEach((function(t){var n=i(o[t],e[t]),r=n[0],u=n[1],c=n[2];void 0!==o[t]&&(o[t]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function v(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var g=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return v(this.schema,e,t,n)},e}();function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var k=Symbol("Defined Members"),w=Symbol("unq"),j=function(){function e(){}return e.prototype.toString=function(){return this[w]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,k,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,w,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[k].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=O(e[k]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[k]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return v(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},s(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();j.schema={};var E=function(e){function r(){return e.apply(this,arguments)||this}return i(r,e),r.toJSON=function(){return Object.assign({},e.toJSON.call(this),{key:this.key})},r.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},r.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},r.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=O(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=O(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",b="substantially different than expected keys";v&&(g+="\n Missing: "+a,b="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,b="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+b+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},r.expiresAt=function(e,t){return e.expiresAt},r.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},r.denormalize=function(e,r){var i=this,o=t(e)?e:this.fromJS(e instanceof j?this.toObjectDefined(e):e);if(null==r.setLocal||r.setLocal(o),t(e)){var s=n(this.schema,e,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(t){var n=i.schema[t],s=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,a=r(s,n),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(e,t)&&!i.defaults[t]||(f=!0),Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==u&&(o[t]=u)})),[o,!0,f]},s(r,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),r}(j);function S(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(E.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return j.fromJS.call(this,e)});var _=Symbol("ENTITY WAS DELETED");function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function N(e,t,n){return(N=A()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return N(e,arguments,z(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}var D=function(){this.children=new WeakMap},V=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return i(t,e),t}(x(Error)),J=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new V;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new D,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),P=function(e,t,n,r){var i=M(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?h:m)(n,e,a)}return null===e?[e,!0,!1]:S(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===_)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=T(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new J);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=T(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},M=function(e){var n=t(e);return function(t,r){var i=r.key;return"object"==typeof t?t:n?e.getIn([i,t]):e[i]&&e[i][t]}};function T(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&S(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var I=function e(t,n,r,i,o,s){return t&&i&&["function","object"].includes(typeof i)?i.normalize&&"function"==typeof i.normalize?i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):(Array.isArray(i)?l:y)(i,t,n,r,e,o,s):t};var L=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(a),R=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(a),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,_,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},s(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),F=Object.freeze({__proto__:null,Union:L,Values:R,Array:d,Object:g,Delete:U}),B=function(e){function t(){return e.apply(this,arguments)||this}return i(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(E);return e.DELETED=_,e.Entity=E,e.FlatEntity=B,e.SimpleRecord=j,e.WeakListMap=J,e.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new J),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=P(n,r,i,o);return[].concat(s(e,t),[o])},e.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?p:v)(t,n,r,e):t},e.isEntity=S,e.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=O(s.indexes);!(v=g()).done;){var b=v.value;b in t[c]||(r[c][b]=t[c][b]={});var k=t[c][b];f&&delete k[f[b]],n[c]&&n[c][u]&&n[c][u][b]!==m[b]&&(k[n[c][u][b]]=_),b in m?k[m[b]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+b+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:I(e,e,void 0,t,f,{}),entityMeta:c}},e.schema=F,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var rest_hooks_normalizr=function(e){"use strict";function t(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function n(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=function(){function e(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=e.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(e,n){if(void 0===e)return[e,!1,!1];var r=t(e)?e.get("schema"):e.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[r]):[e,!0,!1]},s(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),u=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},c=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},f=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},l=function(e,t,n,r,i,o,s){return e=u(e),c(t).map((function(t,a){return i(t,n,r,e,o,s)}))},h=function(e,t,n){e=u(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(f).map((function(e){return e[0]})):t,i,r]};function p(e,t,n,r){}var d=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return c(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(f).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(a),y=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},m=function(e,r,i){if(t(r))return n(e,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(e).forEach((function(t){var n=i(o[t],e[t]),r=n[0],u=n[1],c=n[2];void 0!==o[t]&&(o[t]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function v(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var g=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return v(this.schema,e,t,n)},e}();function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var k=Symbol("Defined Members"),w=Symbol("unq"),j=function(){function e(){}return e.prototype.toString=function(){return this[w]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,k,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,w,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[k].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=O(e[k]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[k]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return v(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},s(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();j.schema={};var E=function(e){function r(){return e.apply(this,arguments)||this}return i(r,e),r.toJSON=function(){return Object.assign({},e.toJSON.call(this),{key:this.key})},r.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},r.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},r.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=O(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=O(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",b="substantially different than expected keys";v&&(g+="\n Missing: "+a,b="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,b="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+b+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},r.expiresAt=function(e,t){return e.expiresAt},r.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},r.denormalize=function(e,r){var i=this,o=t(e)?e:this.fromJS(e instanceof j?this.toObjectDefined(e):e);if(null==r.setLocal||r.setLocal(o),t(e)){var s=n(this.schema,e,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(t){var n=i.schema[t],s=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,a=r(s,n),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(e,t)&&!i.defaults[t]||(f=!0),Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==u&&(o[t]=u)})),[o,!0,f]},s(r,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),r}(j);function S(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(E.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return j.fromJS.call(this,e)});var _=Symbol("ENTITY WAS DELETED");function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function N(e,t,n){return(N=A()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return N(e,arguments,z(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}var D=function(){this.children=new WeakMap},V=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return i(t,e),t}(x(Error)),J=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new V;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new D,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),P=function(e,t,n,r){var i=M(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?h:m)(n,e,a)}return null===e?[e,!0,!1]:S(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===_)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=T(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new J);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=T(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},M=function(e){var n=t(e);return function(t,r){var i=r.key;return"object"==typeof t?t:n?e.getIn([i,t]):e[i]&&e[i][t]}};function T(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&S(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var I=function e(t,n,r,i,o,s){return t&&i?i.normalize&&"function"==typeof i.normalize?"object"!=typeof t?t:i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):"object"!=typeof t||"object"!=typeof i?t:(Array.isArray(i)?l:y)(i,t,n,r,e,o,s):t};var L=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(a),R=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(a),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,_,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},s(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),F=Object.freeze({__proto__:null,Union:L,Values:R,Array:d,Object:g,Delete:U}),B=function(e){function t(){return e.apply(this,arguments)||this}return i(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(E);return e.DELETED=_,e.Entity=E,e.FlatEntity=B,e.SimpleRecord=j,e.WeakListMap=J,e.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new J),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=P(n,r,i,o);return[].concat(s(e,t),[o])},e.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?p:v)(t,n,r,e):t},e.isEntity=S,e.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=O(s.indexes);!(v=g()).done;){var b=v.value;b in t[c]||(r[c][b]=t[c][b]={});var k=t[c][b];f&&delete k[f[b]],n[c]&&n[c][u]&&n[c][u][b]!==m[b]&&(k[n[c][u][b]]=_),b in m?k[m[b]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+b+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:I(e,e,void 0,t,f,{}),entityMeta:c}},e.schema=F,Object.defineProperty(e,"__esModule",{value:!0}),e}({});

@@ -1160,17 +1160,19 @@ 'use strict';

var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
if (!value || !schema || !['function', 'object'].includes(typeof schema)) {
if (!value || !schema) {
return value;
}
if (!schema.normalize || typeof schema.normalize !== 'function') {
// serializable
if (typeof schema === 'function') {
return new schema(value);
}
if (schema.normalize && typeof schema.normalize === 'function') {
if (typeof value !== 'object') return value;
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
} // serializable
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
if (typeof schema === 'function') {
return new schema(value);
}
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
if (typeof value !== 'object' || typeof schema !== 'object') return value;
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
};

@@ -1177,0 +1179,0 @@

@@ -1,1 +0,1 @@

"use strict";function e(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function t(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}Object.defineProperty(exports,"__esModule",{value:!0});var s=function(){function t(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=t.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(t,n){if(void 0===t)return[t,!1,!1];var r=e(t)?t.get("schema"):t.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:e(t)?t.get("id"):t.id)||t,this.isSingleSchema?this.schema:this.schema[r]):[t,!0,!1]},o(t,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),t}(),a=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},u=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},c=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},f=function(e,t,n,r,i,o,s){return e=a(e),u(t).map((function(t,a){return i(t,n,r,e,o,s)}))},l=function(e,t,n){e=a(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(c).map((function(e){return e[0]})):t,i,r]};function h(e,t,n,r){}var p=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return u(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(c).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(s),d=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},y=function(n,r,i){if(e(r))return t(n,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(n).forEach((function(e){var t=i(o[e],n[e]),r=t[0],u=t[1],c=t[2];void 0!==o[e]&&(o[e]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function m(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var v=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return m(this.schema,e,t,n)},e}();function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var O=Symbol("Defined Members"),k=Symbol("unq"),w=function(){function e(){}return e.prototype.toString=function(){return this[k]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,O,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,k,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[O].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=b(e[O]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[O]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return m(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},o(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();w.schema={};var j=function(n){function i(){return n.apply(this,arguments)||this}return r(i,n),i.toJSON=function(){return Object.assign({},n.toJSON.call(this),{key:this.key})},i.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},i.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},i.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=b(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=b(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",O="substantially different than expected keys";v&&(g+="\n Missing: "+a,O="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,O="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+O+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},i.expiresAt=function(e,t){return e.expiresAt},i.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},i.denormalize=function(n,r){var i=this,o=e(n)?n:this.fromJS(n instanceof w?this.toObjectDefined(n):n);if(null==r.setLocal||r.setLocal(o),e(n)){var s=t(this.schema,n,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(e){var t=i.schema[e],s=Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,a=r(s,t),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(n,e)&&!i.defaults[e]||(f=!0),Object.prototype.hasOwnProperty.call(n,e)&&n[e]!==u&&(o[e]=u)})),[o,!0,f]},o(i,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),i}(w);function E(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(j.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return w.fromJS.call(this,e)});var S=Symbol("ENTITY WAS DELETED");function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function z(e,t,r){return(z=_()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o}).apply(null,arguments)}function A(e){var t="function"==typeof Map?new Map:void 0;return(A=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return z(e,arguments,x(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,e)})(e)}var N=function(){this.children=new WeakMap},D=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return r(t,e),t}(A(Error)),V=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new D;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new N,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),J=function(e,t,n,r){var i=P(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?l:y)(n,e,a)}return null===e?[e,!0,!1]:E(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===S)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=M(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new V);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=M(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},P=function(t){var n=e(t);return function(e,r){var i=r.key;return"object"==typeof e?e:n?t.getIn([i,e]):t[i]&&t[i][e]}};function M(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&E(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var T=function e(t,n,r,i,o,s){return t&&i&&["function","object"].includes(typeof i)?i.normalize&&"function"==typeof i.normalize?i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):(Array.isArray(i)?f:d)(i,t,n,r,e,o,s):t};var I=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}r(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(s),L=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(s),R=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,S,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},o(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),U=Object.freeze({__proto__:null,Union:I,Values:L,Array:p,Object:v,Delete:R}),F=function(e){function t(){return e.apply(this,arguments)||this}return r(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(j);exports.DELETED=S,exports.Entity=j,exports.FlatEntity=F,exports.SimpleRecord=w,exports.WeakListMap=V,exports.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new V),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=J(n,r,i,o);return[].concat(s(e,t),[o])},exports.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?h:m)(t,n,r,e):t},exports.isEntity=E,exports.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=b(s.indexes);!(v=g()).done;){var O=v.value;O in t[c]||(r[c][O]=t[c][O]={});var k=t[c][O];f&&delete k[f[O]],n[c]&&n[c][u]&&n[c][u][O]!==m[O]&&(k[n[c][u][O]]=S),O in m?k[m[O]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+O+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:T(e,e,void 0,t,f,{}),entityMeta:c}},exports.schema=U;
"use strict";function e(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function t(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}Object.defineProperty(exports,"__esModule",{value:!0});var s=function(){function t(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=t.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(t,n){if(void 0===t)return[t,!1,!1];var r=e(t)?t.get("schema"):t.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:e(t)?t.get("id"):t.id)||t,this.isSingleSchema?this.schema:this.schema[r]):[t,!0,!1]},o(t,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),t}(),a=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},u=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},c=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},f=function(e,t,n,r,i,o,s){return e=a(e),u(t).map((function(t,a){return i(t,n,r,e,o,s)}))},l=function(e,t,n){e=a(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(c).map((function(e){return e[0]})):t,i,r]};function h(e,t,n,r){}var p=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return u(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(c).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(s),d=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},y=function(n,r,i){if(e(r))return t(n,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(n).forEach((function(e){var t=i(o[e],n[e]),r=t[0],u=t[1],c=t[2];void 0!==o[e]&&(o[e]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function m(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var v=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return m(this.schema,e,t,n)},e}();function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var O=Symbol("Defined Members"),k=Symbol("unq"),w=function(){function e(){}return e.prototype.toString=function(){return this[k]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,O,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,k,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[O].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=b(e[O]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[O]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return m(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},o(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();w.schema={};var j=function(n){function i(){return n.apply(this,arguments)||this}return r(i,n),i.toJSON=function(){return Object.assign({},n.toJSON.call(this),{key:this.key})},i.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},i.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},i.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=b(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=b(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",O="substantially different than expected keys";v&&(g+="\n Missing: "+a,O="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,O="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+O+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},i.expiresAt=function(e,t){return e.expiresAt},i.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},i.denormalize=function(n,r){var i=this,o=e(n)?n:this.fromJS(n instanceof w?this.toObjectDefined(n):n);if(null==r.setLocal||r.setLocal(o),e(n)){var s=t(this.schema,n,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(e){var t=i.schema[e],s=Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,a=r(s,t),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(n,e)&&!i.defaults[e]||(f=!0),Object.prototype.hasOwnProperty.call(n,e)&&n[e]!==u&&(o[e]=u)})),[o,!0,f]},o(i,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),i}(w);function E(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(j.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return w.fromJS.call(this,e)});var S=Symbol("ENTITY WAS DELETED");function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function z(e,t,r){return(z=_()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o}).apply(null,arguments)}function A(e){var t="function"==typeof Map?new Map:void 0;return(A=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return z(e,arguments,x(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,e)})(e)}var N=function(){this.children=new WeakMap},D=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return r(t,e),t}(A(Error)),V=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new D;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new N,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),J=function(e,t,n,r){var i=P(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?l:y)(n,e,a)}return null===e?[e,!0,!1]:E(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===S)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=M(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new V);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=M(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},P=function(t){var n=e(t);return function(e,r){var i=r.key;return"object"==typeof e?e:n?t.getIn([i,e]):t[i]&&t[i][e]}};function M(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&E(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var T=function e(t,n,r,i,o,s){return t&&i?i.normalize&&"function"==typeof i.normalize?"object"!=typeof t?t:i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):"object"!=typeof t||"object"!=typeof i?t:(Array.isArray(i)?f:d)(i,t,n,r,e,o,s):t};var I=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}r(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(s),L=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(s),R=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,S,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},o(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),U=Object.freeze({__proto__:null,Union:I,Values:L,Array:p,Object:v,Delete:R}),F=function(e){function t(){return e.apply(this,arguments)||this}return r(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(j);exports.DELETED=S,exports.Entity=j,exports.FlatEntity=F,exports.SimpleRecord=w,exports.WeakListMap=V,exports.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new V),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=J(n,r,i,o);return[].concat(s(e,t),[o])},exports.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?h:m)(t,n,r,e):t},exports.isEntity=E,exports.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=b(s.indexes);!(v=g()).done;){var O=v.value;O in t[c]||(r[c][O]=t[c][O]={});var k=t[c][O];f&&delete k[f[O]],n[c]&&n[c][u]&&n[c][u][O]!==m[O]&&(k[n[c][u][O]]=S),O in m?k[m[O]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+O+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:T(e,e,void 0,t,f,{}),entityMeta:c}},exports.schema=U;

@@ -1162,17 +1162,19 @@ (function (global, factory) {

var visit = function visit(value, parent, key, schema, addEntity, visitedEntities) {
if (!value || !schema || !['function', 'object'].includes(typeof schema)) {
if (!value || !schema) {
return value;
}
if (!schema.normalize || typeof schema.normalize !== 'function') {
// serializable
if (typeof schema === 'function') {
return new schema(value);
}
if (schema.normalize && typeof schema.normalize === 'function') {
if (typeof value !== 'object') return value;
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
} // serializable
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
if (typeof schema === 'function') {
return new schema(value);
}
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
if (typeof value !== 'object' || typeof schema !== 'object') return value;
var method = Array.isArray(schema) ? normalize$1 : _normalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
};

@@ -1179,0 +1181,0 @@

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).rest_hooks_normalizr={})}(this,(function(e){"use strict";function t(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function n(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=function(){function e(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=e.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(e,n){if(void 0===e)return[e,!1,!1];var r=t(e)?e.get("schema"):e.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[r]):[e,!0,!1]},s(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),u=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},c=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},f=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},l=function(e,t,n,r,i,o,s){return e=u(e),c(t).map((function(t,a){return i(t,n,r,e,o,s)}))},h=function(e,t,n){e=u(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(f).map((function(e){return e[0]})):t,i,r]};function p(e,t,n,r){}var d=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return c(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(f).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(a),y=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},m=function(e,r,i){if(t(r))return n(e,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(e).forEach((function(t){var n=i(o[t],e[t]),r=n[0],u=n[1],c=n[2];void 0!==o[t]&&(o[t]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function v(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var g=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return v(this.schema,e,t,n)},e}();function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var k=Symbol("Defined Members"),w=Symbol("unq"),j=function(){function e(){}return e.prototype.toString=function(){return this[w]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,k,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,w,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[k].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=O(e[k]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[k]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return v(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},s(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();j.schema={};var E=function(e){function r(){return e.apply(this,arguments)||this}return i(r,e),r.toJSON=function(){return Object.assign({},e.toJSON.call(this),{key:this.key})},r.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},r.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},r.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=O(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=O(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",b="substantially different than expected keys";v&&(g+="\n Missing: "+a,b="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,b="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+b+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},r.expiresAt=function(e,t){return e.expiresAt},r.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},r.denormalize=function(e,r){var i=this,o=t(e)?e:this.fromJS(e instanceof j?this.toObjectDefined(e):e);if(null==r.setLocal||r.setLocal(o),t(e)){var s=n(this.schema,e,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(t){var n=i.schema[t],s=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,a=r(s,n),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(e,t)&&!i.defaults[t]||(f=!0),Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==u&&(o[t]=u)})),[o,!0,f]},s(r,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),r}(j);function S(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(E.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return j.fromJS.call(this,e)});var _=Symbol("ENTITY WAS DELETED");function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function N(e,t,n){return(N=A()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return N(e,arguments,z(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}var D=function(){this.children=new WeakMap},V=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return i(t,e),t}(x(Error)),J=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new V;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new D,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),P=function(e,t,n,r){var i=M(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?h:m)(n,e,a)}return null===e?[e,!0,!1]:S(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===_)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=T(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new J);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=T(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},M=function(e){var n=t(e);return function(t,r){var i=r.key;return"object"==typeof t?t:n?e.getIn([i,t]):e[i]&&e[i][t]}};function T(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&S(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var I=function e(t,n,r,i,o,s){return t&&i&&["function","object"].includes(typeof i)?i.normalize&&"function"==typeof i.normalize?i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):(Array.isArray(i)?l:y)(i,t,n,r,e,o,s):t};var L=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(a),R=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(a),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,_,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},s(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),F=Object.freeze({__proto__:null,Union:L,Values:R,Array:d,Object:g,Delete:U}),B=function(e){function t(){return e.apply(this,arguments)||this}return i(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(E);e.DELETED=_,e.Entity=E,e.FlatEntity=B,e.SimpleRecord=j,e.WeakListMap=J,e.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new J),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=P(n,r,i,o);return[].concat(s(e,t),[o])},e.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?p:v)(t,n,r,e):t},e.isEntity=S,e.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=O(s.indexes);!(v=g()).done;){var b=v.value;b in t[c]||(r[c][b]=t[c][b]={});var k=t[c][b];f&&delete k[f[b]],n[c]&&n[c][u]&&n[c][u][b]!==m[b]&&(k[n[c][u][b]]=_),b in m?k[m[b]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+b+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:I(e,e,void 0,t,f,{}),entityMeta:c}},e.schema=F,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).rest_hooks_normalizr={})}(this,(function(e){"use strict";function t(e){return!(!e||"function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}function n(e,t,n){var r=!0,i=!1;return[Object.keys(e).reduce((function(t,o){var s=""+o,a=n(t.get(s),e[s]),u=a[0],c=a[1],f=a[2];return c||(r=!1),f&&(i=!0),t.has(s)?t.set(s,u):t}),t),r,i]}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=function(){function e(e,t){t&&(this._schemaAttribute="string"==typeof t?function(e){return e[t]}:t),this.define(e)}var n=e.prototype;return n.define=function(e){this.schema=e},n.getSchemaAttribute=function(e,t,n){return!this.isSingleSchema&&this._schemaAttribute(e,t,n)},n.inferSchema=function(e,t,n){if(this.isSingleSchema)return this.schema;var r=this.getSchemaAttribute(e,t,n);return this.schema[r]},n.normalizeValue=function(e,t,n,r,i,o){var s=this.inferSchema(e,t,n);if(!s){if("production"!==process.env.NODE_ENV){var a=this.getSchemaAttribute(e,t,n);console.warn("Schema attribute "+JSON.stringify(a,void 0,2)+" is not expected.\nExpected one of: "+Object.keys(this.schema).map((function(e){return'"'+e+'"'})).join(", ")+"\n\nValue: "+JSON.stringify(e,void 0,2))}return e}var u=r(e,t,n,s,i,o);return this.isSingleSchema||null==u?u:{id:u,schema:this.getSchemaAttribute(e,t,n)}},n.denormalizeValue=function(e,n){if(void 0===e)return[e,!1,!1];var r=t(e)?e.get("schema"):e.schema;return this.isSingleSchema||r?n((this.isSingleSchema?void 0:t(e)?e.get("id"):e.id)||e,this.isSingleSchema?this.schema:this.schema[r]):[e,!0,!1]},s(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),u=function(e){if(Array.isArray(e)&&e.length>1)throw new Error("Expected schema definition to be a single schema, but found "+e.length+".");return e[0]},c=function(e){return Array.isArray(e)?e:Object.keys(e).map((function(t){return e[t]}))},f=function(e){var t=e[0],n=e[2];return void 0!==t&&!n},l=function(e,t,n,r,i,o,s){return e=u(e),c(t).map((function(t,a){return i(t,n,r,e,o,s)}))},h=function(e,t,n){e=u(e);var r=!1,i=!0;if(void 0===t&&e){var o=n(void 0,e);i=o[1],r=o[2]}return[t&&t.map?t.map((function(t){return n(t,e)})).filter(f).map((function(e){return e[0]})):t,i,r]};function p(e,t,n,r){}var d=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return c(e).map((function(e,a){return s.normalizeValue(e,t,n,r,i,o)})).filter((function(e){return null!=e}))},n.denormalize=function(e,t){var n=this,r=!1,i=!0;if(void 0===e&&this.schema){var o=t(void 0,this.schema);i=o[1],r=o[2]}return[e&&e.map?e.map((function(e){return n.denormalizeValue(e,t)})).filter(f).map((function(e){return e[0]})):e,i,r]},n.infer=function(e,t,n){this.schema},t}(a),y=function(e,t,n,r,i,o,s){var a=Object.assign({},t);return Object.keys(e).forEach((function(n){var r=e[n],u=i(t[n],t,n,r,o,s);null==u?delete a[n]:a[n]=u})),a},m=function(e,r,i){if(t(r))return n(e,r,i);var o=Object.assign({},r),s=!0,a=!1;return Object.keys(e).forEach((function(t){var n=i(o[t],e[t]),r=n[0],u=n[1],c=n[2];void 0!==o[t]&&(o[t]=r),c&&(a=!0),u||(s=!1)})),[o,s,a]};function v(e,t,n,r){for(var i={},o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];i[a]=r(e[a],t,n)}return i}var g=function(){function e(e){this.define(e)}var t=e.prototype;return t.define=function(e){this.schema=Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object.assign({},t,((r={})[n]=i,r))}),this.schema||{})},t.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},t.denormalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.apply(void 0,[this.schema].concat(t))},t.infer=function(e,t,n){return v(this.schema,e,t,n)},e}();function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var k=Symbol("Defined Members"),w=Symbol("unq"),j=function(){function e(){}return e.prototype.toString=function(){return this[w]},e.toJSON=function(){return{name:this.name,schema:this.schema}},e.fromJS=function(t,n,r){void 0===t&&(t={});var i=new this(t);return t instanceof e&&(t=t.constructor.toObjectDefined(t)),Object.assign(i,t),Object.defineProperty(i,k,{value:Object.keys(t),writable:!1}),Object.defineProperty(i,w,{value:""+Math.random(),writable:!1}),i},e.merge=function(e,t){var n=Object.assign(this.toObjectDefined(e),this.toObjectDefined(t));return this.fromJS(n)},e.hasDefined=function(e,t){return e[k].includes(t)},e.toObjectDefined=function(e){for(var t,n={},r=O(e[k]);!(t=r()).done;){var i=t.value;n[i]=e[i]}return n},e.keysDefined=function(e){return e[k]},e.normalize=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.apply(void 0,[this.schema].concat(t))},e.infer=function(e,t,n){return v(this.schema,e,t,n)},e.denormalize=function(e,t){var n=this,r=Object.assign({},e),i=!1,o=!0;return Object.keys(this.schema).forEach((function(e){var s=t(r[e],n.schema[e]),a=s[0],u=s[1],c=s[2];void 0!==r[e]&&(r[e]=a),u||e in n.defaults&&!n.defaults[e]||(o=!1),!c||e in n.defaults&&!n.defaults[e]||(i=!0)})),[this.fromJS(r),o,i]},e.asSchema=function(){return"development"===process.env.NODE_ENV&&console.error("asSchema() is deprecated - use Entity directly instead."),this},s(e,null,[{key:"defaults",get:function(){return Object.prototype.hasOwnProperty.call(this,"__defaults")||(this.__defaults=new this),this.__defaults}}]),e}();j.schema={};var E=function(e){function r(){return e.apply(this,arguments)||this}return i(r,e),r.toJSON=function(){return Object.assign({},e.toJSON.call(this),{key:this.key})},r.pk=function(e,t,n){return this.prototype.pk.call(e,t,n)||n},r.normalize=function(e,t,n,r,i,o){var s=this;if("string"==typeof e)return e;var a=this.fromJS(e,t,n);this.validate(a,e);var u=a.pk(t,n);if(void 0!==u&&""!==u){var c=this.key;return c in o||(o[c]={}),u in o[c]||(o[c][u]=[]),o[c][u].some((function(t){return t===e}))?u:(o[c][u].push(e),Object.keys(this.schema).forEach((function(e){if(Object.prototype.hasOwnProperty.call(a,e)){var t=s.schema[e];a[e]=r(a[e],a,e,t,i,o)}else if("production"!==process.env.NODE_ENV){var n=new Error("Schema key is missing in Entity\n\n Be sure all schema members are also part of the entity\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about nesting schemas: https://resthooks.io/docs/guides/nested-response\n\n Entity keys: "+Object.keys(a)+"\n Schema key(missing): "+e+"\n ");throw n.status=400,n}})),i(this,a,u),u)}if("production"!==process.env.NODE_ENV){var f=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Entity: "+this.name+"\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw f.status=400,f}},r.validate=function(e,t){if("production"!==process.env.NODE_ENV&&"silent"!==this.automaticValidation){for(var n,r=new Set(Object.keys(this.defaults)),i=this.keysDefined(e),o=[[],[],[]],s=o[0],a=o[1],u=o[2],c=O(i);!(n=c()).done;){var f=n.value;r.has(f)?s.push(f):u.push(f)}for(var l,h=O(r);!(l=h()).done;){var p=l.value;s.includes(p)||a.push(p)}if(r.size){if(Array.isArray(t)&&u.length){var d="Attempted to initialize "+this.name+" with an array, but named members were expected\n\nThis is likely due to a malformed response.\nTry inspecting the network response or fetch() return value.\nOr use debugging tools: https://resthooks.io/docs/guides/debugging\nLearn more about schemas: https://resthooks.io/docs/api/schema\nIf this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\nMissing: "+a+"\nFirst three members: "+JSON.stringify(t.slice(0,3),null,2);if("warn"!==this.automaticValidation){var y=new Error(d);throw y.status=400,y}console.warn(d)}var m=Math.max(i.length/2,1)<=u.length&&r.size>Math.max(u.length,2)&&Math.pow(s.length,1.5)/2<=u.length,v=s.length<Math.min(1,r.size/2);if(m||v){var g="",b="substantially different than expected keys";v&&(g+="\n Missing: "+a,b="no matching keys found"),m&&(g+="\n Unexpected keys: "+u,b="a large number of unexpected keys found");var k="Attempted to initialize "+this.name+" with "+b+"\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n If this is a mistake, you can disable this check by setting static automaticValidation = 'silent'\n\n Expected keys:\n Found: "+s+g+"\n Value: "+JSON.stringify(this.toObjectDefined(e),null,2);if(!(s.length>=4&&m||"warn"===this.automaticValidation)){var w=new Error(k);throw w.status=400,w}console.warn(k)}}}},r.expiresAt=function(e,t){return e.expiresAt},r.infer=function(e,t,n){if(e[0]){var r=this.pk(e[0],void 0,"");if(void 0!==r&&""!==r)return r;var i=function(e,t){return t?t.find((function(t){return Object.prototype.hasOwnProperty.call(e,t)})):void 0}(e[0],this.indexes);return i&&t[this.key]?t[this.key][i][e[0][i]]:void 0}},r.denormalize=function(e,r){var i=this,o=t(e)?e:this.fromJS(e instanceof j?this.toObjectDefined(e):e);if(null==r.setLocal||r.setLocal(o),t(e)){var s=n(this.schema,e,r),a=s[0],u=s[1],c=s[2];return[this.fromJS(a.toObject()),u,c]}var f=!1;return Object.keys(this.schema).forEach((function(t){var n=i.schema[t],s=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,a=r(s,n),u=a[0];!a[2]||Object.prototype.hasOwnProperty.call(e,t)&&!i.defaults[t]||(f=!0),Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==u&&(o[t]=u)})),[o,!0,f]},s(r,null,[{key:"key",get:function(){if("production"!==process.env.NODE_ENV&&(""===this.name||"Entity"===this.name||"_temp"===this.name))throw new Error("Entity classes without a name must define `static get key()`");return this.name}}]),r}(j);function S(e){return null!==e&&void 0!==e.pk}"production"!==process.env.NODE_ENV&&(E.fromJS=function(e){if(void 0===this.prototype.pk)throw new Error("cannot construct on abstract types");return j.fromJS.call(this,e)});var _=Symbol("ENTITY WAS DELETED");function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function N(e,t,n){return(N=A()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o}).apply(null,arguments)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return N(e,arguments,z(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)})(e)}var D=function(){this.children=new WeakMap},V=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).message="Keys must include at least one member",t}return i(t,e),t}(x(Error)),J=function(){function e(){this.first=new WeakMap}var t=e.prototype;return t.delete=function(e){var t=this.traverse(e);return null==t||delete t.value,!!t},t.get=function(e){var t=this.traverse(e);return null==t?void 0:t.value},t.has=function(e){var t=this.traverse(e);return!!t&&Object.prototype.hasOwnProperty.call(t,"value")},t.set=function(e,t){if(e.length<1)throw new V;for(var n,r=this.first,i=0;i<e.length;i++)r.has(e[i])?n=r.get(e[i]):(n=new D,r.set(e[i],n)),r=n.children,i===e.length-1&&(n.value=t);return this},t.traverse=function(e){for(var t,n=this.first,r=0;r<e.length;r++){if(!(t=n.get(e[r])))return;n=t.children}return t},e}(),P=function(e,t,n,r){var i=M(e);function o(e,n){if(!n)return[e,!0,!1];if(!n.denormalize||"function"!=typeof n.denormalize){if("function"==typeof n)return e instanceof n?[e,!0,!1]:[new n(e),!0,!1];if("object"==typeof n)return(Array.isArray(n)?h:m)(n,e,a)}return null===e?[e,!0,!1]:S(n)?void 0===e?[e,!1,!1]:function(e,t,n,r,i,o){var s=r(e,t);if(s===_)return[void 0,!0,!0];if("object"!=typeof s||null===s)return[s,!1,!1];void 0===i[t.key]&&(i[t.key]={});var a=!0,u=!1;if(!i[t.key][e]){var c=[s],f=T(n,c);f.setLocal=function(n){return i[t.key][e]=n},o[t.key]||(o[t.key]={}),o[t.key][e]||(o[t.key][e]=new J);var l=o[t.key][e],h=t.denormalize(s,f);i[t.key][e]=h[0],a=h[1],u=h[2],l.has(c)?i[t.key][e]=l.get(c):l.set(c,i[t.key][e])}return[i[t.key][e],a,u]}(e,n,a,i,r,t):"function"==typeof n.denormalize?n.denormalize(e,a):[e,!0,!1]}var s=[],a=T(o,s);return function(e,t){s.push(e);var r=o(e,t);return Object(e)!==e?r:n.has(s)?[n.get(s),r[1],r[2]]:(n.set(s,r[0]),r)}},M=function(e){var n=t(e);return function(t,r){var i=r.key;return"object"==typeof t?t:n?e.getIn([i,t]):e[i]&&e[i][t]}};function T(e,t){var n=e.og||e,r=function(e,r){var i=n(e,r);if(i[0]&&r&&S(r))if(Object(i[0])===i[0])t.push(i[0]);else if("production"!==process.env.NODE_ENV)throw new Error("Unexpected primitive found during denormalization\nFound: "+i[0]+"\nExpected entity: "+r);return i};return r.og=e,r}var I=function e(t,n,r,i,o,s){return t&&i?i.normalize&&"function"==typeof i.normalize?"object"!=typeof t?t:i.normalize(t,n,r,e,o,s):"function"==typeof i?new i(t):"object"!=typeof t||"object"!=typeof i?t:(Array.isArray(i)?l:y)(i,t,n,r,e,o,s):t};var L=function(e){function t(t,n){if(!n)throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');return e.call(this,t,n)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){return this.normalizeValue(e,t,n,r,i,o)},n.denormalize=function(e,t){return this.denormalizeValue(e,t)},n.infer=function(e,t,n){var r=this.getSchemaAttribute(e[0],void 0,""),i=this.schema[r];if(void 0!==i)return{id:n(i,e,t),schema:r}},t}(a),R=function(e){function t(){return e.apply(this,arguments)||this}i(t,e);var n=t.prototype;return n.normalize=function(e,t,n,r,i,o){var s=this;return Object.keys(e).reduce((function(t,n,a){var u,c=e[n];return null!=c?Object.assign({},t,((u={})[n]=s.normalizeValue(c,e,n,r,i,o),u)):t}),{})},n.denormalize=function(e,t){var n=this,r=!0,i=!1;return[Object.keys(e).reduce((function(o,s){var a,u=e[s],c=n.denormalizeValue(u,t),f=c[0],l=c[1],h=c[2];return l||(r=!1),h&&(i=!0),!l||h?o:Object.assign({},o,((a={})[s]=f,a))}),{}),r,i]},n.infer=function(e,t,n){},t}(a),U=function(){function e(e){if("production"!==process.env.NODE_ENV&&!e)throw new Error('Expected option "entity" not found on DeleteSchema.');this._entity=e}var t=e.prototype;return t.normalize=function(e,t,n,r,i,o){if("string"==typeof e)return e;var s=this._entity.fromJS(e,t,n).pk(t,n);if("production"!==process.env.NODE_ENV&&(void 0===s||""===s)){var a,u=new Error("Missing usable primary key when normalizing response.\n\n This is likely due to a malformed response.\n Try inspecting the network response or fetch() return value.\n Or use debugging tools: https://resthooks.io/docs/guides/debugging\n Learn more about schemas: https://resthooks.io/docs/api/schema\n\n Delete(Entity): Delete("+(null!=(a=this._entity.name)?a:this._entity)+")\n Value: "+(e&&JSON.stringify(e,null,2))+"\n ");throw u.status=400,u}return i(this,_,s),s},t.infer=function(e,t,n){},t.denormalize=function(e,t){return t(e,this._entity)},t._denormalizeNullable=function(){return[]},t._normalizeNullable=function(){return[]},t.merge=function(e,t){return t},s(e,[{key:"key",get:function(){return this._entity.key}}]),e}(),F=Object.freeze({__proto__:null,Union:L,Values:R,Array:d,Object:g,Delete:U}),B=function(e){function t(){return e.apply(this,arguments)||this}return i(t,e),t.denormalize=function(e,t){return[e,!0,!1]},t}(E);e.DELETED=_,e.Entity=E,e.FlatEntity=B,e.SimpleRecord=j,e.WeakListMap=J,e.denormalize=function(e,t,n,r,i){if(void 0===r&&(r={}),void 0===i&&(i=new J),void 0===t)return[e,!0,!1,{}];if(void 0===e)return[void 0,!1,!1,{}];var o={},s=P(n,r,i,o);return[].concat(s(e,t),[o])},e.inferResults=function e(t,n,r){return function(e){return!!e&&"function"==typeof e.infer}(t)?t.infer(n,r,e):"object"==typeof t&&t?(Array.isArray(t)?p:v)(t,n,r,e):t},e.isEntity=S,e.normalize=function(e,t,n,r,i,o){if(void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o={date:Date.now(),expiresAt:1/0}),void 0===t)return{entities:n,indexes:r,result:e,entityMeta:i};var s=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(t);if(null===e||typeof e!==s){if("production"!==process.env.NODE_ENV){throw"string"==typeof e&&function(e){try{return"string"!=typeof JSON.parse(e)}catch(e){return!1}}(e)?new Error('Normalizing a string, but this does match schema.\n\nParsing this input string as JSON worked. This likely indicates fetch function did not parse\nthe JSON. By default, this only happens if "content-type" header includes "json".\nSee https://resthooks.io/docs/guides/custom-networking for more information\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"'):new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".\n\n Schema: '+JSON.stringify(t,void 0,2)+'\n Input: "'+e+'"')}throw new Error('Unexpected input given to normalize. Expected type to be "'+s+'", found "'+(null===e?"null":typeof e)+'".')}var a=Object.assign({},n),u=Object.assign({},r),c=Object.assign({},i),f=function(e,t,n,r,i,o){return function(s,a,u){var c=s.key;c in e||(e[c]={},n[c]=Object.assign({},n[c]),i[c]=Object.assign({},i[c]));var f=e[c][u];if(f)e[c][u]=s.merge(f,a);else{var l=s.expiresAt?s.expiresAt(o,a):o.expiresAt,h=n[c][u];if(h){var p,d,y=(null==(p=i[c][u])?void 0:p.date)>o.date;e[c][u]=typeof a!=typeof h?y?h:a:y?s.merge(a,h):s.merge(h,a),i[c][u]=(null==(d=i[c][u])?void 0:d.expiresAt)>=l?i[c][u]:{expiresAt:l,date:o.date}}else e[c][u]=a,i[c][u]={expiresAt:l,date:o.date}}if(Array.isArray(s.indexes)){var m=e[c][u];c in t||(t[c]={},r[c]=Object.assign({},r[c]));for(var v,g=O(s.indexes);!(v=g()).done;){var b=v.value;b in t[c]||(r[c][b]=t[c][b]={});var k=t[c][b];f&&delete k[f[b]],n[c]&&n[c][u]&&n[c][u][b]!==m[b]&&(k[n[c][u][b]]=_),b in m?k[m[b]]=u:"production"!==process.env.NODE_ENV&&console.warn("Index not found in entity. Indexes must be top-level members of your entity.\nIndex: "+b+"\nEntity: "+JSON.stringify(m,void 0,2))}}n[c][u]=e[c][u]}}({},{},a,u,c,o);return{entities:a,indexes:u,result:I(e,e,void 0,t,f,{}),entityMeta:c}},e.schema=F,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -6,17 +6,19 @@ import { normalize as arrayNormalize } from './schemas/Array';

const visit = (value, parent, key, schema, addEntity, visitedEntities) => {
if (!value || !schema || !['function', 'object'].includes(typeof schema)) {
if (!value || !schema) {
return value;
}
if (!schema.normalize || typeof schema.normalize !== 'function') {
// serializable
if (typeof schema === 'function') {
return new schema(value);
}
if (schema.normalize && typeof schema.normalize === 'function') {
if (typeof value !== 'object') return value;
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
} // serializable
const method = Array.isArray(schema) ? arrayNormalize : objectNormalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
if (typeof schema === 'function') {
return new schema(value);
}
return schema.normalize(value, parent, key, visit, addEntity, visitedEntities);
if (typeof value !== 'object' || typeof schema !== 'object') return value;
const method = Array.isArray(schema) ? arrayNormalize : objectNormalize;
return method(schema, value, parent, key, visit, addEntity, visitedEntities);
};

@@ -183,2 +185,2 @@

};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub3JtYWxpemUudHMiXSwibmFtZXMiOlsibm9ybWFsaXplIiwiYXJyYXlOb3JtYWxpemUiLCJvYmplY3ROb3JtYWxpemUiLCJERUxFVEVEIiwidmlzaXQiLCJ2YWx1ZSIsInBhcmVudCIsImtleSIsInNjaGVtYSIsImFkZEVudGl0eSIsInZpc2l0ZWRFbnRpdGllcyIsImluY2x1ZGVzIiwibWV0aG9kIiwiQXJyYXkiLCJpc0FycmF5IiwiYWRkRW50aXRpZXMiLCJlbnRpdGllcyIsImluZGV4ZXMiLCJleGlzdGluZ0VudGl0aWVzIiwiZXhpc3RpbmdJbmRleGVzIiwiZW50aXR5TWV0YSIsIm1ldGEiLCJwcm9jZXNzZWR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m91bmQgXCIke1xuICAgICAgICAgIGlucHV0ID09PSBudWxsID8gJ251bGwnIDogdHlwZW9mIGlucHV0XG4gICAgICAgIH1cIi5gLFxuICAgICAgKTtcbiAgICB9XG4gIH1cblxuICBjb25zdCBuZXdFbnRpdGllczogRSA9IHt9IGFzIGFueTtcbiAgY29uc3QgbmV3SW5kZXhlczogTm9ybWFsaXplZEluZGV4ID0ge30gYXMgYW55O1xuICBjb25zdCBlbnRpdGllczogRSA9IHsgLi4uZXhpc3RpbmdFbnRpdGllcyB9IGFzIGFueTtcbiAgY29uc3QgaW5kZXhlczogTm9ybWFsaXplZEluZGV4ID0geyAuLi5leGlzdGluZ0luZGV4ZXMgfTtcbiAgY29uc3QgZW50aXR5TWV0YTogYW55ID0geyAuLi5leGlzdGluZ0VudGl0eU1ldGEgfTtcbiAgY29uc3QgYWRkRW50aXR5ID0gYWRkRW50aXRpZXMoXG4gICAgbmV3RW50aXRpZXMsXG4gICAgbmV3SW5kZXhlcyxcbiAgICBlbnRpdGllcyxcbiAgICBpbmRleGVzLFxuICAgIGVudGl0eU1ldGEsXG4gICAgbWV0YSxcbiAgKTtcbiAgY29uc3QgdmlzaXRlZEVudGl0aWVzID0ge307XG5cbiAgY29uc3QgcmVzdWx0ID0gdmlzaXQoXG4gICAgaW5wdXQsXG4gICAgaW5wdXQsXG4gICAgdW5kZWZpbmVkLFxuICAgIHNjaGVtYSxcbiAgICBhZGRFbnRpdHksXG4gICAgdmlzaXRlZEVudGl0aWVzLFxuICApO1xuICByZXR1cm4geyBlbnRpdGllcywgaW5kZXhlcywgcmVzdWx0LCBlbnRpdHlNZXRhIH07XG59O1xuIl19
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub3JtYWxpemUudHMiXSwibmFtZXMiOlsibm9ybWFsaXplIiwiYXJyYXlOb3JtYWxpemUiLCJvYmplY3ROb3JtYWxpemUiLCJERUxFVEVEIiwidml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vbnN0IGluZGV4IG9mIHNjaGVtYS5pbmRleGVzKSB7XG4gICAgICAgIGlmICghKGluZGV4IGluIGluZGV4ZXNbc2NoZW1hS2V5XSkpIHtcbiAgICAgICAgICBleGlzdGluZ0luZGV4ZXNbc2NoZW1hS2V5XVtpbmRleF0gPSBpbmRleGVzW3NjaGVtYUtleV1baW5kZXhdID0ge307XG4gICAgICAgIH1cbiAgICAgICAgY29uc3QgaW5kZXhNYXAgPSBpbmRleGVzW3NjaGVtYUtleV1baW5kZXhdO1xuICAgICAgICBpZiAoZXhpc3RpbmdFbnRpdHkpIHtcbiAgICAgICAgICBkZWxldGUgaW5kZXhNYXBbZXhpc3RpbmdFbnRpdHlbaW5kZXhdXTtcbiAgICAgICAgfVxuICAgICAgICAvLyBlbnRpdHkgYWxyZWFkeSBpbiBjYWNoZSBidXQgdGhlIGluZGV4IGNoYW5nZWRcbiAgICAgICAgaWYgKFxuICAgICAgICAgIGV4aXN0aW5nRW50aXRpZXNbc2NoZW1hS2V5XSAmJlxuICAgICAgICAgIGV4aXN0aW5nRW50aXRpZXNbc2NoZW1hS2V5XVtpZF0gJiZcbiAgICAgICAgICBleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdW2luZGV4XSAhPT0gZW50aXR5W2luZGV4XVxuICAgICAgICApIHtcbiAgICAgICAgICBpbmRleE1hcFtleGlzdGluZ0VudGl0aWVzW3NjaGVtYUtleV1baWRdW2luZGV4XV0gPSBERUxFVEVEO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpbmRleCBpbiBlbnRpdHkpIHtcbiAgICAgICAgICBpbmRleE1hcFtlbnRpdHlbaW5kZXhdXSA9IGlkO1xuICAgICAgICB9IC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovIGVsc2UgaWYgKFxuICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlZlxuICAgICAgICAgIHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJv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aWVzID0ge307XG5cbiAgY29uc3QgcmVzdWx0ID0gdmlzaXQoXG4gICAgaW5wdXQsXG4gICAgaW5wdXQsXG4gICAgdW5kZWZpbmVkLFxuICAgIHNjaGVtYSxcbiAgICBhZGRFbnRpdHksXG4gICAgdmlzaXRlZEVudGl0aWVzLFxuICApO1xuICByZXR1cm4geyBlbnRpdGllcywgaW5kZXhlcywgcmVzdWx0LCBlbnRpdHlNZXRhIH07XG59O1xuIl19
{
"name": "@rest-hooks/normalizr",
"version": "7.4.0",
"version": "7.5.0",
"description": "Normalizes and denormalizes JSON according to schema for Redux and Flux applications",

@@ -89,3 +89,3 @@ "homepage": "https://github.com/coinbase/rest-hooks/tree/master/packages/normalizr#readme",

},
"gitHead": "36abc2165ec756e3ae9d3796eae004686af708e0"
"gitHead": "3381921609330c7fcd311e4543f3e1e45b40bf69"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc