9 lines
69 KiB
JavaScript
9 lines
69 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self)["ReactFlow Plugins"]={},t.React)}(this,(function(t,e){"use strict";var n,r="default"in e?e.default:e;function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(n,!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function s(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c="undefined"!=typeof Symbol?Symbol("immer-nothing"):((n={})["immer-nothing"]=!0,n),l="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-draftable"):"__$immer_draftable",f="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-state"):"__$immer_state";function h(t){return!!t&&!!t[f]}function p(t){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t))return!0;var e=Object.getPrototypeOf(t);return!e||e===Object.prototype||(!!t[l]||!!t.constructor[l])}var d=Object.assign||function(t,e){for(var n in e)w(e,n)&&(t[n]=e[n]);return t},y="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function v(t,e){if(void 0===e&&(e=!1),Array.isArray(t))return t.slice();var n=Object.create(Object.getPrototypeOf(t));return y(t).forEach((function(r){if(r!==f){var i=Object.getOwnPropertyDescriptor(t,r),o=i.value;i.get&&e&&(o=i.get.call(t)),i.enumerable?n[r]=o:e&&Object.defineProperty(n,r,{value:o,writable:!0,configurable:!0})}})),n}function g(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e(n,t[n],t);else y(t).forEach((function(n){return e(n,t[n],t)}))}function m(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!n&&n.enumerable}function w(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function b(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}var _=function(t){this.drafts=[],this.parent=t,this.canAutoFreeze=!0,this.patches=null};function x(t){t[f].revoke()}_.prototype.usePatches=function(t){t&&(this.patches=[],this.inversePatches=[],this.patchListener=t)},_.prototype.revoke=function(){this.leave(),this.drafts.forEach(x),this.drafts=null},_.prototype.leave=function(){this===_.current&&(_.current=this.parent)},_.current=null,_.enter=function(){return this.current=new _(this.current)};var E={};function O(t,e){var n=Array.isArray(t),r=N(t);g(r,(function(e){!function(t,e,n){var r=E[e];r?r.enumerable=n:E[e]=r={configurable:!0,enumerable:n,get:function(){return function(t,e){I(t);var n=k(S(t),e);if(t.finalizing)return n;if(n===k(t.base,e)&&p(n))return j(t),t.copy[e]=O(n,t);return n}(this[f],e)},set:function(t){!function(t,e,n){if(I(t),t.assigned[e]=!0,!t.modified){if(b(n,k(S(t),e)))return;P(t),j(t)}t.copy[e]=n}(this[f],e,t)}};Object.defineProperty(t,e,r)}(r,e,n||m(t,e))}));var i,o,a,u=e?e.scope:_.current;return i=r,o=f,a={scope:u,modified:!1,finalizing:!1,finalized:!1,assigned:{},parent:e,base:t,draft:r,copy:null,revoke:A,revoked:!1},Object.defineProperty(i,o,{value:a,enumerable:!1,writable:!0}),u.drafts.push(r),r}function A(){this.revoked=!0}function S(t){return t.copy||t.base}function k(t,e){var n=t[f];if(n&&!n.finalizing){n.finalizing=!0;var r=t[e];return n.finalizing=!1,r}return t[e]}function P(t){t.modified||(t.modified=!0,t.parent&&P(t.parent))}function j(t){t.copy||(t.copy=N(t.base))}function N(t){var e=t&&t[f];if(e){e.finalizing=!0;var n=v(e.draft,!0);return e.finalizing=!1,n}return v(t)}function I(t){if(!0===t.revoked)throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+JSON.stringify(S(t)))}function M(t){for(var e=t.length-1;e>=0;e--){var n=t[e][f];n.modified||(Array.isArray(n.base)?R(n)&&P(n):z(n)&&P(n))}}function z(t){for(var e=t.base,n=t.draft,r=Object.keys(n),i=r.length-1;i>=0;i--){var o=r[i],a=e[o];if(void 0===a&&!w(e,o))return!0;var u=n[o],s=u&&u[f];if(s?s.base!==a:!b(u,a))return!0}return r.length!==Object.keys(e).length}function R(t){var e=t.draft;if(e.length!==t.base.length)return!0;var n=Object.getOwnPropertyDescriptor(e,e.length-1);return!(!n||n.get)}var C=Object.freeze({willFinalize:function(t,e,n){t.drafts.forEach((function(t){t[f].finalizing=!0})),n?h(e)&&e[f].scope===t&&M(t.drafts):(t.patches&&function t(e){if(!e||"object"!=typeof e)return;var n=e[f];if(!n)return;var r=n.base;var i=n.draft;var o=n.assigned;if(Array.isArray(e)){if(R(n)){if(P(n),o.length=!0,i.length<r.length)for(var a=i.length;a<r.length;a++)o[a]=!1;else for(var u=r.length;u<i.length;u++)o[u]=!0;for(var s=0;s<i.length;s++)void 0===o[s]&&t(i[s])}}else Object.keys(i).forEach((function(e){void 0!==r[e]||w(r,e)?o[e]||t(i[e]):(o[e]=!0,P(n))})),Object.keys(r).forEach((function(t){void 0!==i[t]||w(i,t)||(o[t]=!1,P(n))}))}(t.drafts[0]),M(t.drafts))},createProxy:O});function D(t,e){var n=e?e.scope:_.current,r={scope:n,modified:!1,finalized:!1,assigned:{},parent:e,base:t,draft:null,drafts:{},copy:null,revoke:null},i=Array.isArray(t)?Proxy.revocable([r],X):Proxy.revocable(r,T),o=i.revoke,a=i.proxy;return r.draft=a,r.revoke=o,n.drafts.push(a),a}var T={get:function(t,e){if(e===f)return t;var n=t.drafts;if(!t.modified&&w(n,e))return n[e];var r=q(t)[e];if(t.finalized||!p(r))return r;if(t.modified){if(r!==V(t.base,e))return r;n=t.copy}return n[e]=D(r,t)},has:function(t,e){return e in q(t)},ownKeys:function(t){return Reflect.ownKeys(q(t))},set:function(t,e,n){if(!t.modified){var r=V(t.base,e);if(n?b(r,n)||n===t.drafts[e]:b(r,n)&&e in t.base)return!0;Y(t)}return t.assigned[e]=!0,t.copy[e]=n,!0},deleteProperty:function(t,e){(void 0!==V(t.base,e)||e in t.base)&&(t.assigned[e]=!1,Y(t));t.copy&&delete t.copy[e];return!0},getOwnPropertyDescriptor:function(t,e){var n=q(t),r=Reflect.getOwnPropertyDescriptor(n,e);r&&(r.writable=!0,r.configurable=!Array.isArray(n)||"length"!==e);return r},defineProperty:function(){throw new Error("Object.defineProperty() cannot be used on an Immer draft")},getPrototypeOf:function(t){return Object.getPrototypeOf(t.base)},setPrototypeOf:function(){throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft")}},X={};function q(t){return t.copy||t.base}function V(t,e){var n=t[f],r=Reflect.getOwnPropertyDescriptor(n?q(n):t,e);return r&&r.value}function Y(t){t.modified||(t.modified=!0,t.copy=d(v(t.base),t.drafts),t.drafts=null,t.parent&&Y(t.parent))}g(T,(function(t,e){X[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),X.deleteProperty=function(t,e){if(isNaN(parseInt(e)))throw new Error("Immer only supports deleting array indices");return T.deleteProperty.call(this,t[0],e)},X.set=function(t,e,n){if("length"!==e&&isNaN(parseInt(e)))throw new Error("Immer only supports setting array indices and the 'length' property");return T.set.call(this,t[0],e,n)};var L=Object.freeze({willFinalize:function(){},createProxy:D});function F(t,e,n,r){Array.isArray(t.base)?function(t,e,n,r){var i,o,a=t.base,u=t.copy,s=t.assigned;u.length<a.length&&(a=(i=[u,a])[0],u=i[1],n=(o=[r,n])[0],r=o[1]);var c=u.length-a.length,l=0;for(;a[l]===u[l]&&l<a.length;)++l;var f=a.length;for(;f>l&&a[f-1]===u[f+c-1];)--f;for(var h=l;h<f;++h)if(s[h]&&u[h]!==a[h]){var p=e.concat([h]);n.push({op:"replace",path:p,value:u[h]}),r.push({op:"replace",path:p,value:a[h]})}for(var d=f!=a.length,y=n.length,v=f+c-1;v>=f;--v){var g=e.concat([v]);n[y+v-f]={op:"add",path:g,value:u[v]},d&&r.push({op:"remove",path:g})}d||r.push({op:"replace",path:e.concat(["length"]),value:a.length})}(t,e,n,r):function(t,e,n,r){var i=t.base,o=t.copy;g(t.assigned,(function(t,a){var u=i[t],s=o[t],c=a?t in i?"replace":"add":"remove";if(u!==s||"replace"!==c){var l=e.concat(t);n.push("remove"===c?{op:c,path:l}:{op:c,path:l,value:s}),r.push("add"===c?{op:"remove",path:l}:"remove"===c?{op:"add",path:l,value:u}:{op:"replace",path:l,value:u})}}))}(t,e,n,r)}function H(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.path;if(0===i.length&&"replace"===r.op)t=r.value;else{for(var o=t,a=0;a<i.length-1;a++)if(!(o=o[i[a]])||"object"!=typeof o)throw new Error("Cannot apply patch, path doesn't resolve: "+i.join("/"));var u=i[i.length-1];switch(r.op){case"replace":o[u]=r.value;break;case"add":Array.isArray(o)?o.splice(u,0,r.value):o[u]=r.value;break;case"remove":Array.isArray(o)?o.splice(u,1):delete o[u];break;default:throw new Error("Unsupported patch operation: "+r.op)}}}return t}var B={useProxies:"undefined"!=typeof Proxy&&"undefined"!=typeof Reflect,autoFreeze:"undefined"!=typeof process?"production"!==process.env.NODE_ENV:"verifyMinified"===function(){}.name,onAssign:null,onDelete:null,onCopy:null},U=function(t){d(this,B,t),this.setUseProxies(this.useProxies),this.produce=this.produce.bind(this)};U.prototype.produce=function(t,e,n){var r,i=this;if("function"==typeof t&&"function"!=typeof e){var o=e;e=t;var a=this;return function(t){var n=this;void 0===t&&(t=o);for(var r=[],i=arguments.length-1;i-- >0;)r[i]=arguments[i+1];return a.produce(t,(function(t){return e.call.apply(e,[n,t].concat(r))}))}}if("function"!=typeof e)throw new Error("The first or second argument to `produce` must be a function");if(void 0!==n&&"function"!=typeof n)throw new Error("The third argument to `produce` must be a function or undefined");if(p(t)){var u=_.enter(),s=this.createProxy(t),l=!0;try{r=e(s),l=!1}finally{l?u.revoke():u.leave()}return r instanceof Promise?r.then((function(t){return u.usePatches(n),i.processResult(t,u)}),(function(t){throw u.revoke(),t})):(u.usePatches(n),this.processResult(r,u))}return void 0===(r=e(t))?t:r!==c?r:void 0},U.prototype.createDraft=function(t){if(!p(t))throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object");var e=_.enter(),n=this.createProxy(t);return n[f].isManual=!0,e.leave(),n},U.prototype.finishDraft=function(t,e){var n=t&&t[f];if(!n||!n.isManual)throw new Error("First argument to `finishDraft` must be a draft returned by `createDraft`");if(n.finalized)throw new Error("The given draft is already finalized");var r=n.scope;return r.usePatches(e),this.processResult(void 0,r)},U.prototype.setAutoFreeze=function(t){this.autoFreeze=t},U.prototype.setUseProxies=function(t){this.useProxies=t,d(this,t?L:C)},U.prototype.applyPatches=function(t,e){return h(t)?H(t,e):this.produce(t,(function(t){return H(t,e)}))},U.prototype.processResult=function(t,e){var n=e.drafts[0],r=void 0!==t&&t!==n;if(this.willFinalize(e,t,r),r){if(n[f].modified)throw e.revoke(),new Error("An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.");p(t)&&(t=this.finalize(t,null,e)),e.patches&&(e.patches.push({op:"replace",path:[],value:t}),e.inversePatches.push({op:"replace",path:[],value:n[f].base}))}else t=this.finalize(n,[],e);return e.revoke(),e.patches&&e.patchListener(e.patches,e.inversePatches),t!==c?t:void 0},U.prototype.finalize=function(t,e,n){var r=this,i=t[f];if(!i)return Object.isFrozen(t)?t:this.finalizeTree(t,null,n);if(i.scope!==n)return t;if(!i.modified)return i.base;if(!i.finalized){if(i.finalized=!0,this.finalizeTree(i.draft,e,n),this.onDelete)if(this.useProxies){var o=i.assigned;for(var a in o)o[a]||this.onDelete(i,a)}else{var u=i.base,s=i.copy;g(u,(function(t){w(s,t)||r.onDelete(i,t)}))}this.onCopy&&this.onCopy(i),this.autoFreeze&&n.canAutoFreeze&&Object.freeze(i.copy),e&&n.patches&&F(i,e,n.patches,n.inversePatches)}return i.copy},U.prototype.finalizeTree=function(t,e,n){var r=this,i=t[f];i&&(this.useProxies||(i.copy=v(i.draft,!0)),t=i.copy);var o=!!e&&!!n.patches,a=function(u,s,c){if(s===c)throw Error("Immer forbids circular references");var l=!!i&&c===t;if(h(s)){var f=l&&o&&!i.assigned[u]?e.concat(u):null;if(h(s=r.finalize(s,f,n))&&(n.canAutoFreeze=!1),Array.isArray(c)||m(c,u)?c[u]=s:Object.defineProperty(c,u,{value:s}),l&&s===i.base[u])return}else{if(l&&b(s,i.base[u]))return;p(s)&&!Object.isFrozen(s)&&g(s,a)}l&&r.onAssign&&r.onAssign(i,u,s)};return g(t,a),t};var $=new U,K=$.setAutoFreeze.bind($),Z=($.setUseProxies.bind($),$.applyPatches.bind($),$.createDraft.bind($)),W=$.finishDraft.bind($);var J=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),G=function(){return Math.random().toString(36).substring(7).split("").join(".")},Q={INIT:"@@redux/INIT"+G(),REPLACE:"@@redux/REPLACE"+G(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+G()}};function tt(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(tt)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var i=t,o=e,a=[],u=a,s=!1;function c(){u===a&&(u=a.slice())}function l(){if(s)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(s)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var e=!0;return c(),u.push(t),function(){if(e){if(s)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");e=!1,c();var n=u.indexOf(t);u.splice(n,1)}}}function h(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(s)throw new Error("Reducers may not dispatch actions.");try{s=!0,o=i(o,t)}finally{s=!1}for(var e=a=u,n=0;n<e.length;n++){(0,e[n])()}return t}return h({type:Q.INIT}),(r={dispatch:h,subscribe:f,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");i=t,h({type:Q.REPLACE})}})[J]=function(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function n(){t.next&&t.next(l())}return n(),{unsubscribe:e(n)}}})[J]=function(){return this},t},r}function et(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nt(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n}function rt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nt(n,!0).forEach((function(e){et(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(n).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function it(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function ot(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=e.map((function(t){return t(i)}));return rt({},n,{dispatch:r=it.apply(void 0,o)(n.dispatch)})}}}function at(){}function ut(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(i){return"function"==typeof i?i(n,r,t):e(i)}}}}"production"!==process.env.NODE_ENV&&"string"==typeof at.name&&"isCrushed"!==at.name&&function(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw new Error(t)}catch(t){}}('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');var st=ut();function ct(){return this.list=[],this.lastItem=void 0,this.size=0,this}st.withExtraArgument=ut,ct.prototype.get=function(t){var e;return this.lastItem&&this.isEqual(this.lastItem.key,t)?this.lastItem.val:(e=this.indexOf(t))>=0?(this.lastItem=this.list[e],this.list[e].val):void 0},ct.prototype.set=function(t,e){var n;return this.lastItem&&this.isEqual(this.lastItem.key,t)?(this.lastItem.val=e,this):(n=this.indexOf(t))>=0?(this.lastItem=this.list[n],this.list[n].val=e,this):(this.lastItem={key:t,val:e},this.list.push(this.lastItem),this.size++,this)},ct.prototype.delete=function(t){var e;if(this.lastItem&&this.isEqual(this.lastItem.key,t)&&(this.lastItem=void 0),(e=this.indexOf(t))>=0)return this.size--,this.list.splice(e,1)[0]},ct.prototype.has=function(t){var e;return!(!this.lastItem||!this.isEqual(this.lastItem.key,t))||(e=this.indexOf(t))>=0&&(this.lastItem=this.list[e],!0)},ct.prototype.forEach=function(t,e){var n;for(n=0;n<this.size;n++)t.call(e||this,this.list[n].val,this.list[n].key,this)},ct.prototype.indexOf=function(t){var e;for(e=0;e<this.size;e++)if(this.isEqual(this.list[e].key,t))return e;return-1},ct.prototype.isEqual=function(t,e){return t===e||t!=t&&e!=e};var lt=ct,ft=function(t){return"function"!=typeof Map||t?new lt:new Map},ht=function(t){var e=new ft("true"===process.env.FORCE_SIMILAR_INSTEAD_OF_MAP),n=[];return function(r){var i=function(){var o,a,u,s=e,c=arguments.length-1,l=Array(c+1),f=!0;if((i.numArgs||0===i.numArgs)&&i.numArgs!==c+1)throw new Error("Memoizerific functions should always be called with the same number of arguments");for(u=0;u<c;u++)l[u]={cacheItem:s,arg:arguments[u]},s.has(arguments[u])?s=s.get(arguments[u]):(f=!1,o=new ft("true"===process.env.FORCE_SIMILAR_INSTEAD_OF_MAP),s.set(arguments[u],o),s=o);return f&&(s.has(arguments[c])?a=s.get(arguments[c]):f=!1),f||(a=r.apply(null,arguments),s.set(arguments[c],a)),t>0&&(l[c]={cacheItem:s,arg:arguments[c]},f?pt(n,l):n.push(l),n.length>t&&dt(n.shift())),i.wasMemoized=f,i.numArgs=c+1,a};return i.limit=t,i.wasMemoized=!1,i.cache=e,i.lru=n,i}};function pt(t,e){var n,r,i,o,a,u=t.length,s=e.length;for(r=0;r<u;r++){for(n=!0,i=0;i<s;i++)if(o=t[r][i].arg,a=e[i].arg,o!==a&&(o==o||a==a)){n=!1;break}if(n)break}t.push(t.splice(r,1)[0])}function dt(t){var e,n,r=t.length,i=t[r-1];for(i.cacheItem.delete(i.arg),n=r-2;n>=0&&(!(e=(i=t[n]).cacheItem.get(i.arg))||!e.size);n--)i.cacheItem.delete(i.arg)}var yt=e.createContext(),vt="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;var gt,mt=(gt=yt,function(t){var n=e.useContext(gt),r=e.useRef(t),i=e.useRef(),o=e.useRef(!0),a=e.useRef(),u=e.useReducer((function(t){return t+1}),0)[1];if(a.current||r.current!==t||void 0===i.current)try{i.current=t(n.getState())}catch(t){var s="An error occurred trying to map state in a useStoreState hook: "+t.message+".";throw a.current&&(s+="\nThis error may be related to the following error:\n"+a.current.stack+"\n\nOriginal stack trace:"),new Error(s)}return vt((function(){r.current=t,a.current=void 0})),vt((function(){var t=function(){try{var t=r.current(n.getState());if(t===i.current)return;i.current=t}catch(t){a.current=t}o.current&&u({})},e=n.subscribe(t);return t(),function(){o.current=!1,e()}}),[]),i.current});function wt(){return(wt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var bt="🙈action🙈",_t="🙈actionOn🙈",xt="🙈computedSymbol🙈",Et="🙈reducer🙈",Ot="🙈thunkOn🙈",At="🙈thunk🙈",St=function(t){return t[bt]={},t},kt=function(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object},Pt=function(t,e){return t.reduce((function(t,e){return kt(t)?t[e]:void 0}),e)},jt=function(t,e,n){t.reduce((function(e,r,i){return i+1===t.length?e[r]=n:e[r]=e[r]||{},e[r]}),e)},Nt=function t(e,n,r){if(0===e.length)return r;var i=wt({},n),o=e[0];return 1===e.length?i[o]=r:i[o]=t(e.slice(1),i[o],r),i};function It(t){var e=t.disableImmer,n=t.initialState,r=t.injections,i=t.model,o=t.reducerEnhancer,a=t.references;function u(t,n,r){if(e){var i=Pt(t,n),o=r(i);return i!==o?Nt(t,n,o):n}var a=Z(n);return r(Pt(t,a)),W(a)}var s=n,c={},l={},f={},h={},p=[],d=[],y={},v={},g=[],m={isInReducer:!1,currentState:s};!function t(e,i){return Object.keys(e).forEach((function(o){var u=e[o],v=[].concat(i,[o]),w={parent:i,path:v},b=function(){var t=Pt(i,n);jt(v,s,t&&o in t?t[o]:u)};if("function"==typeof u)if(u[bt]||u[_t]){var _=(u[bt]?"@action":"@actionOn")+"."+v.join("."),x=u[bt]||u[_t];x.actionName=o,x.type=_,x.parent=w.parent,x.path=w.path,f[_]=u;var E=function(t){var e={type:_,payload:t};return u[_t]&&x.resolvedTargets&&(t.resolvedTargets=[].concat(x.resolvedTargets)),a.dispatch(e)};E.type=_,c[_]=E,"easyPeasyReplaceState"!==o&&(u[_t]?(g.push(u),jt(v,y,E)):jt(v,l,E))}else if(u[At]||u[Ot]){var O=(u[At]?"@thunk":"@thunkOn")+"."+v.join("."),A=u[At]||u[Ot];A.actionName=o,A.type=O,A.parent=w.parent,A.path=w.path;var S=function(t){var e={dispatch:a.dispatch,getState:function(){return Pt(i,a.getState())},getStoreActions:function(){return l},getStoreState:a.getState,injections:r,meta:w};return u[Ot]&&A.resolvedTargets&&(t.resolvedTargets=[].concat(A.resolvedTargets)),u(Pt(i,l),t,e)};jt(v,h,S);var k=O+"(start)",P=O+"(success)",j=O+"(fail)",N=function(t){var e=function(e){a.dispatch({type:j,payload:t,error:e}),a.dispatch({type:O,payload:t,error:e})},n=function(e){a.dispatch({type:P,payload:t,result:e}),a.dispatch({type:O,payload:t,result:e})};a.dispatch({type:k,payload:t});try{var r=a.dispatch((function(){return S(t)}));return"object"==typeof r&&"function"==typeof r.then?r.then((function(t){return n(t),t})).catch((function(t){throw e(t),t})):(n(r),r)}catch(t){throw e(t),t}};N.type=O,N.startType=k,N.successType=P,N.failType=j,c[O]=N,u[Ot]?(g.push(u),jt(v,y,N)):jt(v,l,N)}else if(u[xt]){var I=Pt(i,s),M=u[xt],z=ht(1)(u),R=function(t){Object.defineProperty(t,o,{configurable:!0,enumerable:!0,get:function(){var t;if(m.isInReducer)t=m.currentState;else{if(null==a.getState)return;try{t=a.getState()}catch(t){return void("production"!==process.env.NODE_ENV&&console.warn("Invalid access attempt to a computed property"))}}var e=Pt(i,t),n=M.stateResolvers.map((function(n){return n(e,t)}));return z.apply(void 0,n)}})};R(I),p.push({key:o,parentPath:i,createComputedProperty:R})}else u[Et]?d.push({key:o,parentPath:i,reducer:u}):b();else if(kt(u)){null==Pt(v,s)&&jt(v,s,{}),t(u,v)}else b()}))}(i,[]),g.forEach((function(t){var e=t[_t]||t[Ot],n=e.targetResolver(Pt(e.parent,l),l),r=(Array.isArray(n)?n:[n]).reduce((function(t,e){return"function"==typeof e&&e.type&&c[e.type]?t.push(e.type):"string"==typeof e&&t.push(e),t}),[]);e.resolvedTargets=r,r.forEach((function(t){var n=v[t]||[];n.push(c[e.type]),v[t]=n}))}));var w;return{actionCreatorDict:c,actionCreators:l,computedProperties:p,computedState:m,defaultState:s,listenerActionCreators:y,listenerActionMap:v,reducer:o((w=function(t,e){var n=f[e.type];return n?function(t,e,n,r){return u(r,t,(function(t){return n(t,e.payload)}))}(t,e,n,(n[bt]||n[_t]).parent):t},function(t,e){var n=w(t,e),r=d.length>0?function(t,e){return d.reduce((function(t,n){var r=n.parentPath,i=n.key,o=n.reducer;return u(r,t,(function(t){return t[i]=o(t[i],e),t}))}),t)}(n,e):n;return t!==r&&p.forEach((function(t){var e=t.parentPath;(0,t.createComputedProperty)(Pt(e,r))})),r}))}}K(!1);var Mt=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){
|
|
/*!
|
|
Copyright (c) 2017 Jed Watson.
|
|
Licensed under the MIT License (MIT), see
|
|
http://jedwatson.github.io/classnames
|
|
*/
|
|
!function(){var e={}.hasOwnProperty;function n(){for(var t=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)t.push(i);else if(Array.isArray(i)&&i.length){var a=n.apply(null,i);a&&t.push(a)}else if("object"===o)for(var u in i)e.call(i,u)&&i[u]&&t.push(u)}}return t.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n}()})),zt={value:function(){}};function Rt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new Ct(r)}function Ct(t){this._=t}function Dt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Tt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Xt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=zt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Ct.prototype=Rt.prototype={constructor:Ct,on:function(t,e){var n,r=this._,i=Dt(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=Xt(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Xt(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=Tt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ct(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var qt="http://www.w3.org/1999/xhtml",Vt={svg:"http://www.w3.org/2000/svg",xhtml:qt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Vt.hasOwnProperty(e)?{space:Vt[e],local:t}:t}function Lt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===qt&&e.documentElement.namespaceURI===qt?e.createElement(t):e.createElementNS(n,t)}}function Ft(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ht(t){var e=Yt(t);return(e.local?Ft:Lt)(e)}function Bt(){}function Ut(t){return null==t?Bt:function(){return this.querySelector(t)}}function $t(){return[]}function Kt(t){return null==t?$t:function(){return this.querySelectorAll(t)}}function Zt(t){return function(){return this.matches(t)}}function Wt(t){return new Array(t.length)}function Jt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Jt.prototype={constructor:Jt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Gt="$";function Qt(t,e,n,r,i,o){for(var a,u=0,s=e.length,c=o.length;u<c;++u)(a=e[u])?(a.__data__=o[u],r[u]=a):n[u]=new Jt(t,o[u]);for(;u<s;++u)(a=e[u])&&(i[u]=a)}function te(t,e,n,r,i,o,a){var u,s,c,l={},f=e.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=e[u])&&(p[u]=c=Gt+a.call(s,s.__data__,u,e),c in l?i[u]=s:l[c]=s);for(u=0;u<h;++u)(s=l[c=Gt+a.call(t,o[u],u,o)])?(r[u]=s,s.__data__=o[u],l[c]=null):n[u]=new Jt(t,o[u]);for(u=0;u<f;++u)(s=e[u])&&l[p[u]]===s&&(i[u]=s)}function ee(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ne(t){return function(){this.removeAttribute(t)}}function re(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ie(t,e){return function(){this.setAttribute(t,e)}}function oe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ae(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function ue(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function se(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ce(t){return function(){this.style.removeProperty(t)}}function le(t,e,n){return function(){this.style.setProperty(t,e,n)}}function fe(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function he(t,e){return t.style.getPropertyValue(e)||se(t).getComputedStyle(t,null).getPropertyValue(e)}function pe(t){return function(){delete this[t]}}function de(t,e){return function(){this[t]=e}}function ye(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function ve(t){return t.trim().split(/^|\s+/)}function ge(t){return t.classList||new me(t)}function me(t){this._node=t,this._names=ve(t.getAttribute("class")||"")}function we(t,e){for(var n=ge(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function be(t,e){for(var n=ge(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function _e(t){return function(){we(this,t)}}function xe(t){return function(){be(this,t)}}function Ee(t,e){return function(){(e.apply(this,arguments)?we:be)(this,t)}}function Oe(){this.textContent=""}function Ae(t){return function(){this.textContent=t}}function Se(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ke(){this.innerHTML=""}function Pe(t){return function(){this.innerHTML=t}}function je(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Ne(){this.nextSibling&&this.parentNode.appendChild(this)}function Ie(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Me(){return null}function ze(){var t=this.parentNode;t&&t.removeChild(this)}function Re(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function Ce(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}me.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var De={};"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(De={mouseenter:"mouseover",mouseleave:"mouseout"}));function Te(t,e,n){return t=Xe(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function Xe(t,e,n){return function(r){try{t.call(this,this.__data__,e,n)}finally{}}}function qe(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function Ve(t,e,n){var r=De.hasOwnProperty(t.type)?Te:Xe;return function(i,o,a){var u,s=this.__on,c=r(e,o,a);if(s)for(var l=0,f=s.length;l<f;++l)if((u=s[l]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=c,u.capture=n),void(u.value=e);this.addEventListener(t.type,c,n),u={type:t.type,name:t.name,value:e,listener:c,capture:n},s?s.push(u):this.__on=[u]}}function Ye(t,e,n){var r=se(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Le(t,e){return function(){return Ye(this,t,e)}}function Fe(t,e){return function(){return Ye(this,t,e.apply(this,arguments))}}var He=[null];function Be(t,e){this._groups=t,this._parents=e}function Ue(){return new Be([[document.documentElement]],He)}function $e(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ke(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ze(){}Be.prototype=Ue.prototype={constructor:Be,select:function(t){"function"!=typeof t&&(t=Ut(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a,u=e[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new Be(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=Kt(t));for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a,u=e[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new Be(r,i)},filter:function(t){"function"!=typeof t&&(t=Zt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new Be(r,this._parents)},data:function(t,e){if(!t)return d=new Array(this.size()),l=-1,this.each((function(t){d[++l]=t})),d;var n,r=e?te:Qt,i=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,u=new Array(a),s=new Array(a),c=new Array(a),l=0;l<a;++l){var f=i[l],h=o[l],p=h.length,d=t.call(f,f&&f.__data__,l,i),y=d.length,v=s[l]=new Array(y),g=u[l]=new Array(y);r(f,h,v,g,c[l]=new Array(p),d,e);for(var m,w,b=0,_=0;b<y;++b)if(m=v[b]){for(b>=_&&(_=b+1);!(w=g[_])&&++_<y;);m._next=w||null}}return(u=new Be(u,i))._enter=s,u._exit=c,u},enter:function(){return new Be(this._enter||this._groups.map(Wt),this._parents)},exit:function(){return new Be(this._exit||this._groups.map(Wt),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=e[u],l=n[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=e[u];return new Be(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ee);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,u=n[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(e)}return new Be(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=Yt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?re:ne:"function"==typeof e?n.local?ue:ae:n.local?oe:ie)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?ce:"function"==typeof e?fe:le)(t,e,null==n?"":n)):he(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?pe:"function"==typeof e?ye:de)(t,e)):this.node()[t]},classed:function(t,e){var n=ve(t+"");if(arguments.length<2){for(var r=ge(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?Ee:e?_e:xe)(n,e))},text:function(t){return arguments.length?this.each(null==t?Oe:("function"==typeof t?Se:Ae)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ke:("function"==typeof t?je:Pe)(t)):this.node().innerHTML},raise:function(){return this.each(Ne)},lower:function(){return this.each(Ie)},append:function(t){var e="function"==typeof t?t:Ht(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Ht(t),r=null==e?Me:"function"==typeof e?e:Ut(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(ze)},clone:function(t){return this.select(t?Ce:Re)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=e?Ve:qe,null==n&&(n=!1),r=0;r<a;++r)this.each(u(o[r],e,n));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,e){return this.each(("function"==typeof e?Fe:Le)(t,e))}};var We="\\s*([+-]?\\d+)\\s*",Je="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ge="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qe=/^#([0-9a-f]{3,8})$/,tn=new RegExp("^rgb\\("+[We,We,We]+"\\)$"),en=new RegExp("^rgb\\("+[Ge,Ge,Ge]+"\\)$"),nn=new RegExp("^rgba\\("+[We,We,We,Je]+"\\)$"),rn=new RegExp("^rgba\\("+[Ge,Ge,Ge,Je]+"\\)$"),on=new RegExp("^hsl\\("+[Je,Ge,Ge]+"\\)$"),an=new RegExp("^hsla\\("+[Je,Ge,Ge,Je]+"\\)$"),un={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function sn(){return this.rgb().formatHex()}function cn(){return this.rgb().formatRgb()}function ln(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Qe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fn(e):3===n?new dn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new dn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new dn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=tn.exec(t))?new dn(e[1],e[2],e[3],1):(e=en.exec(t))?new dn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nn.exec(t))?hn(e[1],e[2],e[3],e[4]):(e=rn.exec(t))?hn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=on.exec(t))?mn(e[1],e[2]/100,e[3]/100,1):(e=an.exec(t))?mn(e[1],e[2]/100,e[3]/100,e[4]):un.hasOwnProperty(t)?fn(un[t]):"transparent"===t?new dn(NaN,NaN,NaN,0):null}function fn(t){return new dn(t>>16&255,t>>8&255,255&t,1)}function hn(t,e,n,r){return r<=0&&(t=e=n=NaN),new dn(t,e,n,r)}function pn(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ze||(i=ln(i)),i?new dn((i=i.rgb()).r,i.g,i.b,i.opacity):new dn):new dn(t,e,n,null==r?1:r);var i}function dn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yn(){return"#"+gn(this.r)+gn(this.g)+gn(this.b)}function vn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function gn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function mn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bn(t,e,n,r)}function wn(t){if(t instanceof bn)return new bn(t.h,t.s,t.l,t.opacity);if(t instanceof Ze||(t=ln(t)),!t)return new bn;if(t instanceof bn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n<r):n===o?(r-e)/u+2:(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new bn(a,u,s,t.opacity)}function bn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function _n(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function xn(t){return function(){return t}}function En(t){return 1==(t=+t)?On:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):xn(isNaN(e)?n:e)}}function On(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):xn(isNaN(t)?e:t)}$e(Ze,ln,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:sn,formatHex:sn,formatHsl:function(){return wn(this).formatHsl()},formatRgb:cn,toString:cn}),$e(dn,pn,Ke(Ze,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yn,formatHex:yn,formatRgb:vn,toString:vn})),$e(bn,(function(t,e,n,r){return 1===arguments.length?wn(t):new bn(t,e,n,null==r?1:r)}),Ke(Ze,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new bn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new bn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new dn(_n(t>=240?t-240:t+120,i,r),_n(t,i,r),_n(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var An=function t(e){var n=En(e);function r(t,e){var r=n((t=pn(t)).r,(e=pn(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=On(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Sn(t,e){return e-=t=+t,function(n){return t+e*n}}var kn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pn=new RegExp(kn.source,"g");function jn(t,e){var n,r,i,o=kn.lastIndex=Pn.lastIndex=0,a=-1,u=[],s=[];for(t+="",e+="";(n=kn.exec(t))&&(r=Pn.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Sn(n,r)})),o=Pn.lastIndex;return o<e.length&&(i=e.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}var Nn,In,Mn,zn,Rn=180/Math.PI,Cn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Dn(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Rn,skewX:Math.atan(s)*Rn,scaleX:a,scaleY:u}}function Tn(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],s=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,e,null,n);u.push({i:s-4,x:Sn(t,i)},{i:s-2,x:Sn(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,u,s),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Sn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Sn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Sn(t,n)},{i:u-2,x:Sn(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++n<r;)u[(e=s[n]).i]=e.x(t);return u.join("")}}}var Xn,qn,Vn=Tn((function(t){return"none"===t?Cn:(Nn||(Nn=document.createElement("DIV"),In=document.documentElement,Mn=document.defaultView),Nn.style.transform=t,t=Mn.getComputedStyle(In.appendChild(Nn),null).getPropertyValue("transform"),In.removeChild(Nn),Dn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Yn=Tn((function(t){return null==t?Cn:(zn||(zn=document.createElementNS("http://www.w3.org/2000/svg","g")),zn.setAttribute("transform",t),(t=zn.transform.baseVal.consolidate())?Dn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Cn)}),", ",")",")"),Ln=0,Fn=0,Hn=0,Bn=1e3,Un=0,$n=0,Kn=0,Zn="object"==typeof performance&&performance.now?performance:Date,Wn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Jn(){return $n||(Wn(Gn),$n=Zn.now()+Kn)}function Gn(){$n=0}function Qn(){this._call=this._time=this._next=null}function tr(t,e,n){var r=new Qn;return r.restart(t,e,n),r}function er(){$n=(Un=Zn.now())+Kn,Ln=Fn=0;try{!function(){Jn(),++Ln;for(var t,e=Xn;e;)(t=$n-e._time)>=0&&e._call.call(null,t),e=e._next;--Ln}()}finally{Ln=0,function(){var t,e,n=Xn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Xn=e);qn=t,rr(r)}(),$n=0}}function nr(){var t=Zn.now(),e=t-Un;e>Bn&&(Kn-=e,Un=t)}function rr(t){Ln||(Fn&&(Fn=clearTimeout(Fn)),t-$n>24?(t<1/0&&(Fn=setTimeout(er,t-Zn.now()-Kn)),Hn&&(Hn=clearInterval(Hn))):(Hn||(Un=Zn.now(),Hn=setInterval(nr,Bn)),Ln=1,Wn(er)))}function ir(t,e,n){var r=new Qn;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r}Qn.prototype=tr.prototype={constructor:Qn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Jn():+n)+(null==e?0:+e),this._next||qn===this||(qn?qn._next=this:Xn=this,qn=this),this._call=t,this._time=n,rr()},stop:function(){this._call&&(this._call=null,this._time=1/0,rr())}};var or=Rt("start","end","cancel","interrupt"),ar=[],ur=0,sr=1,cr=2,lr=3,fr=4,hr=5,pr=6;function dr(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(s){var c,l,f,h;if(n.state!==sr)return u();for(c in i)if((h=i[c]).name===n.name){if(h.state===lr)return ir(o);h.state===fr?(h.state=pr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c<e&&(h.state=pr,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[c])}if(ir((function(){n.state===lr&&(n.state=fr,n.timer.restart(a,n.delay,n.time),a(s))})),n.state=cr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===cr){for(n.state=lr,r=new Array(f=n.tween.length),c=0,l=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++l]=h);r.length=l+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=hr,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);n.state===hr&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=pr,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=tr((function(t){n.state=sr,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:or,tween:ar,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ur})}function yr(t,e){var n=gr(t,e);if(n.state>ur)throw new Error("too late; already scheduled");return n}function vr(t,e){var n=gr(t,e);if(n.state>lr)throw new Error("too late; already running");return n}function gr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function mr(t,e){var n,r;return function(){var i=vr(this,t),o=i.tween;if(o!==n)for(var a=0,u=(r=n=o).length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}i.tween=r}}function wr(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=vr(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:e,value:n},s=0,c=i.length;s<c;++s)if(i[s].name===e){i[s]=u;break}s===c&&i.push(u)}o.tween=i}}function br(t,e,n){var r=t._id;return t.each((function(){var t=vr(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return gr(t,r).value[e]}}function _r(t,e){var n;return("number"==typeof e?Sn:e instanceof ln?An:(n=ln(e))?(e=n,An):jn)(t,e)}function xr(t){return function(){this.removeAttribute(t)}}function Er(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Or(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function Ar(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function Sr(t,e,n){var r,i,o;return function(){var a,u,s=n(this);if(null!=s)return(a=this.getAttribute(t))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,s));this.removeAttribute(t)}}function kr(t,e,n){var r,i,o;return function(){var a,u,s=n(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,s));this.removeAttributeNS(t.space,t.local)}}function Pr(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,i)),n}return i._value=e,i}function jr(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,i)),n}return i._value=e,i}function Nr(t,e){return function(){yr(this,t).delay=+e.apply(this,arguments)}}function Ir(t,e){return e=+e,function(){yr(this,t).delay=e}}function Mr(t,e){return function(){vr(this,t).duration=+e.apply(this,arguments)}}function zr(t,e){return e=+e,function(){vr(this,t).duration=e}}var Rr=Ue.prototype.constructor;function Cr(t){return function(){this.style.removeProperty(t)}}var Dr=0;function Tr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Xr(){return++Dr}var qr=Ue.prototype;Tr.prototype=function(t){return Ue().transition(t)}.prototype={constructor:Tr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Ut(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u,s,c=r[a],l=c.length,f=o[a]=new Array(l),h=0;h<l;++h)(u=c[h])&&(s=t.call(u,u.__data__,h,c))&&("__data__"in u&&(s.__data__=u.__data__),f[h]=s,dr(f[h],e,n,h,f,gr(u,n)));return new Tr(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Kt(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var s,c=r[u],l=c.length,f=0;f<l;++f)if(s=c[f]){for(var h,p=t.call(s,s.__data__,f,c),d=gr(s,n),y=0,v=p.length;y<v;++y)(h=p[y])&&dr(h,e,n,y,p,d);o.push(p),a.push(s)}return new Tr(o,a,e,n)},filter:function(t){"function"!=typeof t&&(t=Zt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new Tr(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=e[u],l=n[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=e[u];return new Tr(a,this._parents,this._name,this._id)},selection:function(){return new Rr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Xr(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,c=0;c<s;++c)if(a=u[c]){var l=gr(a,e);dr(a,t,n,c,u,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Tr(r,this._parents,t,n)},call:qr.call,nodes:qr.nodes,node:qr.node,size:qr.size,empty:qr.empty,each:qr.each,on:function(t,e){var n=this._id;return arguments.length<2?gr(this.node(),n).on.on(t):this.each(function(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?yr:vr;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=Yt(t),r="transform"===n?Yn:_r;return this.attrTween(t,"function"==typeof e?(n.local?kr:Sr)(n,r,br(this,"attr."+t,e)):null==e?(n.local?Er:xr)(n):(n.local?Ar:Or)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=Yt(t);return this.tween(n,(r.local?Pr:jr)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Vn:_r;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=he(this,t),a=(this.style.removeProperty(t),he(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Cr(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=he(this,t),u=n(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=he(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u))}}(t,r,br(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,u="end."+a;return function(){var s=vr(this,t),c=s.on,l=null==s.value[a]?o||(o=Cr(e)):void 0;c===n&&i===l||(r=(n=c).copy()).on(u,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=he(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(br(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=gr(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?mr:wr)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Nr:Ir)(e,t)):gr(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Mr:zr)(e,t)):gr(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){vr(this,t).ease=e}}(e,t)):gr(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,a){var u={value:a},s={value:function(){0==--i&&o()}};n.each((function(){var n=vr(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),n.on=e}))}))}};var Vr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Yr(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Vr.time=Jn(),Vr;return n}function Lr(t,e,n){this.k=t,this.x=e,this.y=n}Ue.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>cr&&n.state<hr,n.state=pr,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}}(this,t)}))},Ue.prototype.transition=function(t){var e,n;t instanceof Tr?(e=t._id,t=t._name):(e=Xr(),(n=Vr).time=Jn(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,c=0;c<s;++c)(a=u[c])&&dr(a,t,e,c,u,n||Yr(a,e));return new Tr(r,this._parents,t,e)},Lr.prototype={constructor:Lr,scale:function(t){return 1===t?this:new Lr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Lr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fr=new Lr(1,0,0),Hr=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n},Br={setOnConnect:St((function(t,e){t.onConnect=e})),setNodes:St((function(t,e){t.nodes=e})),setEdges:St((function(t,e){t.edges=e})),updateNodeData:St((function(t,e){var n=e.id,r=u(e,["id"]);t.nodes.forEach((function(t){t.id===n&&(t.__rg=a({},t.__rg,{},r))}))})),updateNodePos:St((function(t,e){var n=e.id,r=e.pos;t.nodes.forEach((function(t){t.id===n&&(t.__rg=a({},t.__rg,{position:r}))}))})),setSelection:St((function(t,e){t.selectionActive=e})),setNodesSelection:St((function(t,e){var n=e.isActive,r=e.selection;if(!n)return t.nodesSelectionActive=!1,void(t.selectedElements=[]);var i=Kr(t.nodes,r,t.transform),o=$r(i);t.selection=r,t.nodesSelectionActive=!0,t.selectedNodesBbox=o,t.nodesSelectionActive=!0})),setSelectedElements:St((function(t,e){var n=Array.isArray(e)?e:[e],r=!Hr(n,t.selectedElements)?n:t.selectedElements;t.selectedElements=r})),updateSelection:St((function(t,e){var n=Kr(t.nodes,e,t.transform),r=Zr(n,t.edges),i=[].concat(s(n),s(r)),o=!Hr(i,t.selectedElements);t.selection=e,t.selectedElements=o?i:t.selectedElements})),updateTransform:St((function(t,e){t.transform=[e.x,e.y,e.k]})),updateSize:St((function(t,e){t.width=e.width,t.height=e.height})),initD3:St((function(t,e){var n=e.zoom,r=e.selection;t.d3Zoom=n,t.d3Selection=r,t.d3Initialised=!0})),setConnectionPosition:St((function(t,e){t.connectionPosition=e})),setConnectionSourceId:St((function(t,e){t.connectionSourceId=e}))},Ur=function(t,e){void 0===e&&(e={});var n=e,r=n.compose,i=n.devTools,o=void 0===i||i,a=n.disableImmer,u=void 0!==a&&a,s=n.enhancers,c=void 0===s?[]:s,l=n.initialState,f=void 0===l?{}:l,h=n.injections,p=n.middleware,d=void 0===p?[]:p,y=n.mockActions,v=void 0!==y&&y,g=n.name,m=void 0===g?"EasyPeasyStore":g,w=n.reducerEnhancer,b=void 0===w?function(t){return t}:w,_=function(t){return wt({},t,{easyPeasyReplaceState:St((function(t,e){return e}))})},x=_(t),E=[],O={},A=function(t){void 0===t&&(t={}),O.internals=It({disableImmer:u,initialState:t,injections:h,model:x,reducerEnhancer:b,references:O})};A(f);var S=[function(t){return function(e){return function(n){return O.internals.computedState.currentState=t.getState(),O.internals.computedState.isInReducer=!0,e(n)}}},st].concat(d,[function(){return function(t){return function(e){var n=t(e);if(e&&O.internals.listenerActionMap[e.type]&&O.internals.listenerActionMap[e.type].length>0){var r=O.internals.actionCreatorDict[e.type];O.internals.listenerActionMap[e.type].forEach((function(t){t({type:r?r.type:e.type,payload:e.payload,error:e.error,result:e.result})}))}return n}}}]);v&&S.push((function(){return function(){return function(t){null!=t&&E.push(t)}}}));var k=r||(o&&"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:m}):it),P=tt(O.internals.reducer,O.internals.defaultState,k.apply(void 0,[ot.apply(void 0,S)].concat(c)));P.subscribe((function(){O.internals.computedState.isInReducer=!1})),O.dispatch=P.dispatch,O.getState=P.getState;var j=function(){Object.keys(P.dispatch).forEach((function(t){delete P.dispatch[t]})),Object.keys(O.internals.actionCreators).forEach((function(t){P.dispatch[t]=O.internals.actionCreators[t]}))};j();var N=function(t){var e=P.getState();t&&delete e[t],A(P.getState()),P.replaceReducer(O.internals.reducer),O.internals.actionCreatorDict["@action.easyPeasyReplaceState"](O.internals.defaultState),j()};return Object.assign(P,{addModel:function(t,e){x[t]&&"production"!==process.env.NODE_ENV&&(console.warn('easy-peasy: The store model already contains a model definition for "'+t+'"'),P.removeModel(t)),x[t]=e,N()},clearMockedActions:function(){E=[]},getActions:function(){return O.internals.actionCreators},getListeners:function(){return O.internals.listenerActionCreators},getMockedActions:function(){return[].concat(E)},reconfigure:function(t){x=_(t),N()},removeModel:function(t){x[t]?(delete x[t],N(t)):"production"!==process.env.NODE_ENV&&console.warn('easy-peasy: The store model does not contain a model definition for "'+t+'"')}})}(a({width:0,height:0,transform:[0,0,1],nodes:[],edges:[],selectedElements:[],selectedNodesBbox:{x:0,y:0,width:0,height:0},d3Zoom:null,d3Selection:null,d3Initialised:!1,nodesSelectionActive:!1,selectionActive:!1,selection:{},connectionSourceId:null,connectionPosition:{x:0,y:0},onConnect:function(){}},Br)),$r=function(t){var e=t.reduce((function(t,e){var n=e.__rg.position,r=n.x+e.__rg.width,i=n.y+e.__rg.height;return n.x<t.minX&&(t.minX=n.x),r>t.maxX&&(t.maxX=r),n.y<t.minY&&(t.minY=n.y),i>t.maxY&&(t.maxY=i),t}),{minX:Number.MAX_VALUE,minY:Number.MAX_VALUE,maxX:0,maxY:0});return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}},Kr=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,1],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.filter((function(t){var i=(e.x-n[0])*(1/n[2]),o=(e.y-n[1])*(1/n[2]),a=e.width*(1/n[2]),u=e.height*(1/n[2]),s=t.__rg,c=s.position,l=s.width,f=s.height,h=r?-l:l,p=r?0:f,d=r?l:0,y=r?f:0;return c.x+d>i&&c.x+h<i+a&&c.y+y>o&&c.y+p<o+u}))},Zr=function(t,e){var n=t.map((function(t){return t.id}));return e.filter((function(t){var e=t.source.includes("__"),r=t.target.includes("__"),i=e?t.source.split("__")[0]:t.source,o=r?t.target.split("__")[0]:t.target;return n.includes(i)||n.includes(o)}))},Wr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.padding,n=void 0===e?0:e,r=Ur.getState(),i=$r(r.nodes),o=Math.max(i.width,i.height),a=Math.min(r.width,r.height)/(o+o*n),u=i.x+i.width/2,s=i.y+i.height/2,c=[r.width/2-u*a,r.height/2-s*a],l=Fr.translate(c[0],c[1]).scale(a);r.d3Selection.call(r.d3Zoom.transform,l)},Jr=function(){var t=Ur.getState();t.d3Zoom.scaleTo(t.d3Selection,t.transform[2]+.2)},Gr=function(){var t=Ur.getState();t.d3Zoom.scaleTo(t.d3Selection,t.transform[2]-.2)},Qr={position:"absolute",zIndex:5,bottom:10,right:10,width:200},ti={position:"absolute",zIndex:5,bottom:10,left:10};t.Controls=function(t){var e=t.style,n=t.className,i=Mt("react-flow__controls",n);return r.createElement("div",{className:i,style:a({},ti,{},e)},r.createElement("div",{className:"react-flow__controls-button react-flow__controls-zoomin",onClick:Jr},r.createElement("img",{src:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M416 277.333H277.333V416h-42.666V277.333H96v-42.666h138.667V96h42.666v138.667H416v42.666z"/></svg>'})),r.createElement("div",{className:"react-flow__controls-button react-flow__controls-zoomout",onClick:Gr},r.createElement("img",{src:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M96 235h320v42H96z"/></svg>'})),r.createElement("div",{className:"react-flow__controls-button react-flow__controls-fitview",onClick:Wr},r.createElement("img",{src:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M96 124.2c0-6.9 5.2-12.2 12.2-12.2H176V64h-66.8C75.7 64 48 90.7 48 124.2V192h48v-67.8zM403.6 64H336v48h67.2c6.9 0 12.8 5.2 12.8 12.2V192h48v-67.8c0-33.5-27-60.2-60.4-60.2zM416 386.8c0 6.9-5.2 12.2-12.2 12.2H336v49h67.8c33.5 0 60.2-27.7 60.2-61.2V320h-48v66.8zM108.2 399c-6.9 0-12.2-5.2-12.2-12.2V320H48v66.8c0 33.5 27.7 61.2 61.2 61.2H176v-49h-67.8z"/></svg>'})))},t.MiniMap=function(t){var n=t.style,i=void 0===n?{}:n,o=t.className,u=t.bgColor,s=void 0===u?"#f8f8f8":u,c=t.nodeColor,l=void 0===c?"#ddd":c,f=e.useRef(null),h=mt((function(t){return{width:t.width,height:t.height,nodes:t.nodes,transform:t.transform}})),p=Mt("react-flow__minimap",o),d=h.nodes.map((function(t){return t.__rg.position})),y=i.width||Qr.width,v=h.height/(h.width||1)*y,g={x:0,y:0,width:h.width,height:h.height},m=y/h.width,w=function(t){return!!(t&&t.constructor&&t.call&&t.apply)}(l)?l:function(){return l};return e.useEffect((function(){if(f){var t=f.current.getContext("2d"),e=Kr(h.nodes,g,h.transform,!0);t.fillStyle=s,t.fillRect(0,0,y,v),e.forEach((function(e){var n=e.__rg.position,r=h.transform[0],i=h.transform[1],o=n.x*h.transform[2]+r,a=n.y*h.transform[2]+i;t.fillStyle=w(e),t.fillRect(o*m,a*m,e.__rg.width*m*h.transform[2],e.__rg.height*m*h.transform[2])}))}}),[d,h.transform,v]),r.createElement("canvas",{style:a({},Qr,{},i,{height:v}),width:y,height:v,className:p,ref:f})},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
//# sourceMappingURL=index.js.map
|