(self["webpackJsonp@lyrio/ui"]=self["webpackJsonp@lyrio/ui"]||[]).push([[36],{758:function(t,e,n){"use strict";(function(n){function r(t){return"object"!==typeof t||"toString"in t?t:Object.prototype.toString.call(t).slice(8,-1)}Object.defineProperty(e,"__esModule",{value:!0});var o="object"===typeof n&&!0;function a(t,e){if(!t){if(o)throw new Error("Invariant failed");throw new Error(e())}}e.invariant=a;var u=Object.prototype.hasOwnProperty,c=Array.prototype.splice,i=Object.prototype.toString;function p(t){return i.call(t).slice(8,-1)}var f=Object.assign||function(t,e){return s(e).forEach((function(n){u.call(e,n)&&(t[n]=e[n])})),t},s="function"===typeof Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.keys(t)};function d(t){return Array.isArray(t)?f(t.constructor(t.length),t):"Map"===p(t)?new Map(t):"Set"===p(t)?new Set(t):t&&"object"===typeof t?f(Object.create(Object.getPrototypeOf(t)),t):t}var y=function(){function t(){this.commands=f({},l),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(t,e){return t===e},this.update.newContext=function(){return(new t).update}}return Object.defineProperty(t.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(t){this.update.isEquals=t},enumerable:!0,configurable:!0}),t.prototype.extend=function(t,e){this.commands[t]=e},t.prototype.update=function(t,e){var n=this,r="function"===typeof e?{$apply:e}:e;Array.isArray(t)&&Array.isArray(r)||a(!Array.isArray(r),(function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."})),a("object"===typeof r&&null!==r,(function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the following commands: "+Object.keys(n.commands).join(", ")+"."}));var o=t;return s(r).forEach((function(e){if(u.call(n.commands,e)){var a=t===o;o=n.commands[e](r[e],o,r,t),a&&n.isEquals(o,t)&&(o=t)}else{var c="Map"===p(t)?n.update(t.get(e),r[e]):n.update(t[e],r[e]),i="Map"===p(o)?o.get(e):o[e];n.isEquals(c,i)&&("undefined"!==typeof c||u.call(t,e))||(o===t&&(o=d(t)),"Map"===p(o)?o.set(e,c):o[e]=c)}})),o},t}();e.Context=y;var l={$push:function(t,e,n){return g(e,n,"$push"),t.length?e.concat(t):e},$unshift:function(t,e,n){return g(e,n,"$unshift"),t.length?t.concat(e):e},$splice:function(t,e,n,o){return function(t,e){a(Array.isArray(t),(function(){return"Expected $splice target to be an array; got "+r(t)})),$(e.$splice)}(e,n),t.forEach((function(t){$(t),e===o&&t.length&&(e=d(o)),c.apply(e,t)})),e},$set:function(t,e,n){return function(t){a(1===Object.keys(t).length,(function(){return"Cannot have more than one key in an object with $set"}))}(n),t},$toggle:function(t,e){b(t,"$toggle");var n=t.length?d(e):e;return t.forEach((function(t){n[t]=!e[t]})),n},$unset:function(t,e,n,r){return b(t,"$unset"),t.forEach((function(t){Object.hasOwnProperty.call(e,t)&&(e===r&&(e=d(r)),delete e[t])})),e},$add:function(t,e,n,r){return m(e,"$add"),b(t,"$add"),"Map"===p(e)?t.forEach((function(t){var n=t[0],o=t[1];e===r&&e.get(n)!==o&&(e=d(r)),e.set(n,o)})):t.forEach((function(t){e!==r||e.has(t)||(e=d(r)),e.add(t)})),e},$remove:function(t,e,n,r){return m(e,"$remove"),b(t,"$remove"),t.forEach((function(t){e===r&&e.has(t)&&(e=d(r)),e.delete(t)})),e},$merge:function(t,e,n,o){var u,c;return u=e,a((c=t)&&"object"===typeof c,(function(){return"update(): $merge expects a spec of type 'object'; got "+r(c)})),a(u&&"object"===typeof u,(function(){return"update(): $merge expects a target of type 'object'; got "+r(u)})),s(t).forEach((function(n){t[n]!==e[n]&&(e===o&&(e=d(o)),e[n]=t[n])})),e},$apply:function(t,e){var n;return a("function"===typeof(n=t),(function(){return"update(): expected spec of $apply to be a function; got "+r(n)+"."})),t(e)}},h=new y;function g(t,e,n){a(Array.isArray(t),(function(){return"update(): expected target of "+r(n)+" to be an array; got "+r(t)+"."})),b(e[n],n)}function b(t,e){a(Array.isArray(t),(function(){return"update(): expected spec of "+r(e)+" to be an array; got "+r(t)+". Did you forget to wrap your parameter in an array?"}))}function $(t){a(Array.isArray(t),(function(){return"update(): expected spec of $splice to be an array of arrays; got "+r(t)+". Did you forget to wrap your parameters in an array?"}))}function m(t,e){var n=p(t);a("Map"===n||"Set"===n,(function(){return"update(): "+r(e)+" expects a target of type Set or Map; got "+r(n)}))}e.isEquals=h.update.isEquals,e.extend=h.extend,e.default=h.update,e.default.default=t.exports=f(e.default,e)}).call(this,n(81))}}]);
//# sourceMappingURL=36.1ae34557.chunk.js.map