canvas-light-react 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,35 @@
1
- (function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("mobx")):typeof define=="function"&&define.amd?define(["exports","react","mobx"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f.CanvasLightReact={},f.require$$0,f.mobx))})(this,(function(f,d,y){"use strict";var p={exports:{}},E={};var j;function W(){if(j)return E;j=1;var s=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function u(l,i,c){var _=null;if(c!==void 0&&(_=""+c),i.key!==void 0&&(_=""+i.key),"key"in i){c={};for(var h in i)h!=="key"&&(c[h]=i[h])}else c=i;return i=c.ref,{$$typeof:s,type:l,key:_,ref:i!==void 0?i:null,props:c}}return E.Fragment=t,E.jsx=u,E.jsxs=u,E}var b={};var A;function q(){return A||(A=1,process.env.NODE_ENV!=="production"&&(function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case re:return"Profiler";case ee:return"StrictMode";case ae:return"Suspense";case se:return"SuspenseList";case ue:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case K:return"Portal";case ne:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case oe:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case k:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function t(e){return""+e}function u(e){try{t(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),t(e)}}function l(e){if(e===x)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===k)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function i(){var e=w.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function _(e){if(M.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function h(e,r){function n(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function Z(){var e=s(this.type);return F[e]||(F[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function Q(e,r,n,o,T,S){var a=n.ref;return e={$$typeof:L,type:e,key:r,props:n,_owner:o},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Z}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,r,n,o,T,S){var a=r.children;if(a!==void 0)if(o)if(ce(a)){for(o=0;o<a.length;o++)Y(a[o]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(a);if(M.call(r,"key")){a=s(e);var v=Object.keys(r).filter(function(fe){return fe!=="key"});o=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",$[a+o]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(ee,fe){typeof exports=="object"&&typeof module<"u"?fe(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],fe):(ee=typeof globalThis<"u"?globalThis:ee||self,fe(ee.CanvasLight={},ee.React))})(this,(function(ee,fe){"use strict";var He={exports:{}},Me={};var Jt;function br(){if(Jt)return Me;Jt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:e,type:n,key:s,ref:i!==void 0?i:null,props:o}}return Me.Fragment=t,Me.jsx=r,Me.jsxs=r,Me}var ke={};var Zt;function gr(){return Zt||(Zt=1,process.env.NODE_ENV!=="production"&&(function(){function e(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===Oo?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case j:return"Fragment";case We:return"Profiler";case Re:return"StrictMode";case oe:return"Suspense";case gt:return"SuspenseList";case mo:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case F:return"Portal";case D:return c.displayName||"Context";case Ee:return(c._context.displayName||"Context")+".Consumer";case Q:var h=c.render;return c=c.displayName,c||(c=h.displayName||h.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case go:return h=c.displayName||null,h!==null?h:e(c.type)||"Memo";case zt:h=c._payload,c=c._init;try{return e(c(h))}catch{}}return null}function t(c){return""+c}function r(c){try{t(c);var h=!1}catch{h=!0}if(h){h=console;var O=h.error,N=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return O.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",N),t(c)}}function n(c){if(c===j)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===zt)return"<...>";try{var h=e(c);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function i(){var c=Yt.A;return c===null?null:c.getOwner()}function o(){return Error("react-stack-top-frame")}function s(c){if(fr.call(c,"key")){var h=Object.getOwnPropertyDescriptor(c,"key").get;if(h&&h.isReactWarning)return!1}return c.key!==void 0}function a(c,h){function O(){dr||(dr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",h))}O.isReactWarning=!0,Object.defineProperty(c,"key",{get:O,configurable:!0})}function u(){var c=e(this.type);return _r[c]||(_r[c]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),c=this.props.ref,c!==void 0?c:null}function f(c,h,O,N,mt,Ht){var A=O.ref;return c={$$typeof:M,type:c,key:h,props:O,_owner:N},(A!==void 0?A:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:u}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:mt}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ht}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function d(c,h,O,N,mt,Ht){var A=h.children;if(A!==void 0)if(N)if(yo(A)){for(N=0;N<A.length;N++)p(A[N]);Object.freeze&&Object.freeze(A)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(A);if(fr.call(h,"key")){A=e(c);var Ce=Object.keys(h).filter(function(Eo){return Eo!=="key"});N=0<Ce.length?"{key: someKey, "+Ce.join(": ..., ")+": ...}":"{key: someKey}",pr[A+N]||(Ce=0<Ce.length?"{"+Ce.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,o,a,v,a),$[a+o]=!0)}if(a=null,n!==void 0&&(u(n),a=""+n),_(r)&&(u(r.key),a=""+r.key),"key"in r){n={};for(var g in r)g!=="key"&&(n[g]=r[g])}else n=r;return a&&h(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),Q(e,a,n,i(),T,S)}function Y(e){D(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===k&&(e._payload.status==="fulfilled"?D(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function D(e){return typeof e=="object"&&e!==null&&e.$$typeof===L}var R=d,L=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),le=Symbol.for("react.client.reference"),w=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,ce=Array.isArray,O=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var I,F={},H=R.react_stack_bottom_frame.bind(R,c)(),U=O(l(c)),$={};b.Fragment=x,b.jsx=function(e,r,n){var o=1e4>w.recentlyCreatedOwnerStacks++;return N(e,r,n,!1,o?Error("react-stack-top-frame"):H,o?O(l(e)):U)},b.jsxs=function(e,r,n){var o=1e4>w.recentlyCreatedOwnerStacks++;return N(e,r,n,!0,o?Error("react-stack-top-frame"):H,o?O(l(e)):U)}})()),b}var P;function J(){return P||(P=1,process.env.NODE_ENV==="production"?p.exports=W():p.exports=q()),p.exports}var m=J();class V{canvas=null;constructor(){y.makeAutoObservable(this)}setCanvas(t){this.canvas=t}}class z{tool=null;constructor(){y.makeAutoObservable(this)}setTool(t){this.tool=t}}class C{canvas;ctx;drawing=!1;constructor(t){this.canvas=t,this.ctx=t.getContext("2d"),this.ctx.strokeStyle="black",this.ctx.lineWidth=2,this.mouseDownHandler=this.mouseDownHandler.bind(this),this.mouseMoveHandler=this.mouseMoveHandler.bind(this),this.mouseUpHandler=this.mouseUpHandler.bind(this),this.init()}init(){this.canvas.addEventListener("mousedown",this.mouseDownHandler),this.canvas.addEventListener("mousemove",this.mouseMoveHandler),this.canvas.addEventListener("mouseup",this.mouseUpHandler)}mouseDownHandler(t){this.drawing=!0,this.ctx.beginPath(),this.ctx.moveTo(t.offsetX,t.offsetY)}mouseMoveHandler(t){this.drawing&&(this.ctx.lineTo(t.offsetX,t.offsetY),this.ctx.stroke())}mouseUpHandler(){this.drawing=!1}}const X=({canvasStore:s,toolStore:t,width:u=800,height:l=600})=>{const i=d.useRef(null);return d.useEffect(()=>{i.current&&(s.setCanvas(i.current),t.setTool(new C(i.current)))},[i.current]),m.jsx("canvas",{ref:i,width:u,height:l,style:{border:"1px solid #000"}})},G=({canvasStore:s,toolStore:t})=>m.jsx("div",{style:{marginBottom:10},children:m.jsx("button",{onClick:()=>s.canvas&&t.setTool(new C(s.canvas)),children:"Кисть"})}),B=({width:s=800,height:t=600})=>{const u=new V,l=new z;return m.jsxs("div",{children:[m.jsx(G,{canvasStore:u,toolStore:l}),m.jsx(X,{canvasStore:u,toolStore:l,width:s,height:t})]})};f.CanvasLight=B,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,N,A,Ce,A),pr[A+N]=!0)}if(A=null,O!==void 0&&(r(O),A=""+O),s(h)&&(r(h.key),A=""+h.key),"key"in h){O={};for(var Xt in h)Xt!=="key"&&(O[Xt]=h[Xt])}else O=h;return A&&a(O,typeof c=="function"?c.displayName||c.name||"Unknown":c),f(c,A,O,i(),mt,Ht)}function p(c){g(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===zt&&(c._payload.status==="fulfilled"?g(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function g(c){return typeof c=="object"&&c!==null&&c.$$typeof===M}var E=fe,M=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),Re=Symbol.for("react.strict_mode"),We=Symbol.for("react.profiler"),Ee=Symbol.for("react.consumer"),D=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),gt=Symbol.for("react.suspense_list"),go=Symbol.for("react.memo"),zt=Symbol.for("react.lazy"),mo=Symbol.for("react.activity"),Oo=Symbol.for("react.client.reference"),Yt=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fr=Object.prototype.hasOwnProperty,yo=Array.isArray,Wt=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(c){return c()}};var dr,_r={},vr=E.react_stack_bottom_frame.bind(E,o)(),hr=Wt(n(o)),pr={};ke.Fragment=j,ke.jsx=function(c,h,O){var N=1e4>Yt.recentlyCreatedOwnerStacks++;return d(c,h,O,!1,N?Error("react-stack-top-frame"):vr,N?Wt(n(c)):hr)},ke.jsxs=function(c,h,O){var N=1e4>Yt.recentlyCreatedOwnerStacks++;return d(c,h,O,!0,N?Error("react-stack-top-frame"):vr,N?Wt(n(c)):hr)}})()),ke}var Qt;function mr(){return Qt||(Qt=1,process.env.NODE_ENV==="production"?He.exports=br():He.exports=gr()),He.exports}var Ne=mr(),Or={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},yr=process.env.NODE_ENV!=="production"?Or:{};function _(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(process.env.NODE_ENV!=="production"){var i=typeof e=="string"?e:yr[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var Er={};function Ot(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Er}var en=Object.assign,Xe=Object.getOwnPropertyDescriptor,H=Object.defineProperty,Je=Object.prototype,Ze=[];Object.freeze(Ze);var tn={};Object.freeze(tn);var Nr=typeof Proxy<"u",Ar=Object.toString();function nn(){Nr||_(process.env.NODE_ENV!=="production"?"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`":"Proxy not available")}function Le(e){process.env.NODE_ENV!=="production"&&l.verifyProxies&&_("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function K(){return++l.mobxGuid}function yt(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Ae=function(){};function y(e){return typeof e=="function"}function de(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Qe(e){return e!==null&&typeof e=="object"}function V(e){if(!Qe(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===Ar}function rn(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function et(e,t,r){H(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function on(e,t,r){H(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function _e(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Qe(n)&&n[r]===!0}}function Se(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Sr(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function te(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var sn=typeof Object.getOwnPropertySymbols<"u";function wr(e){var t=Object.keys(e);if(!sn)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Je.propertyIsEnumerable.call(e,n)})):t}var Be=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:sn?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Et(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function an(e){return e===null?null:typeof e=="object"?""+e:e}function G(e,t){return Je.hasOwnProperty.call(e,t)}var Dr=Object.getOwnPropertyDescriptors||function(t){var r={};return Be(t).forEach(function(n){r[n]=Xe(t,n)}),r};function T(e,t){return!!(e&t)}function x(e,t,r){return r?e|=t:e&=~t,e}function un(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function jr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tr(n.key),n)}}function we(e,t,r){return t&&jr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function De(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=xr(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
7
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},se.apply(null,arguments)}function cn(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Nt(e,t)}function Nt(e,t){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Nt(e,t)}function Vr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Tr(e){var t=Vr(e,"string");return typeof t=="symbol"?t:t+""}function xr(e,t){if(e){if(typeof e=="string")return un(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?un(e,t):void 0}}var ne=Symbol("mobx-stored-annotations");function X(e){function t(r,n){if(Ie(n))return e.decorate_20223_(r,n);Ue(r,n,e)}return Object.assign(t,e)}function Ue(e,t,r){if(G(e,ne)||et(e,ne,se({},e[ne])),process.env.NODE_ENV!=="production"&&it(r)&&!G(e[ne],t)){var n=e.constructor.name+".prototype."+t.toString();_("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}Pr(e,r,t),it(r)||(e[ne][t]=r)}function Pr(e,t,r){if(process.env.NODE_ENV!=="production"&&!it(t)&&G(e[ne],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[ne][r].annotationType_,o=t.annotationType_;_("Cannot apply '@"+o+"' to '"+n+"':"+(`
8
+ The field is already decorated with '@`+i+"'.")+`
9
+ Re-decorating fields is not allowed.
10
+ Use '@override' decorator for methods overridden by subclass.`)}}function Ie(e){return typeof e=="object"&&typeof e.kind=="string"}function tt(e,t){process.env.NODE_ENV!=="production"&&!t.includes(e.kind)&&_("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var v=Symbol("mobx administration"),ae=(function(){function e(r){r===void 0&&(r=process.env.NODE_ENV!=="production"?"Atom@"+K():"Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=b.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return Dn(this)},t.reportChanged=function(){B(),jn(this),U()},t.toString=function(){return this.name_},we(e,[{key:"isBeingObserved",get:function(){return T(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=x(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return T(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=x(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return T(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=x(this.flags_,e.diffValueMask_,n===1)}}])})();ae.isBeingObservedMask_=1,ae.isPendingUnobservationMask_=2,ae.diffValueMask_=4;var At=_e("Atom",ae);function ln(e,t,r){t===void 0&&(t=Ae),r===void 0&&(r=Ae);var n=new ae(e);return t!==Ae&&Ki(n,t),r!==Ae&&Mn(n,r),n}function Rr(e,t){return ir(e,t)}function Cr(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var nt={structural:Rr,default:Cr};function ve(e,t,r){return qe(e)?e:Array.isArray(e)?S.array(e,{name:r}):V(e)?S.object(e,void 0,{name:r}):Se(e)?S.map(e,{name:r}):te(e)?S.set(e,{name:r}):typeof e=="function"&&!me(e)&&!Ge(e)?rn(e)?Ve(e):Ke(r,e):e}function Mr(e,t,r){if(e==null||xe(e)||ht(e)||le(e)||Z(e))return e;if(Array.isArray(e))return S.array(e,{name:r,deep:!1});if(V(e))return S.object(e,void 0,{name:r,deep:!1});if(Se(e))return S.map(e,{name:r,deep:!1});if(te(e))return S.set(e,{name:r,deep:!1});process.env.NODE_ENV!=="production"&&_("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function rt(e){return e}function kr(e,t){return process.env.NODE_ENV!=="production"&&qe(e)&&_("observable.struct should not be used with observable values"),ir(e,t)?t:e}var Lr="override";function it(e){return e.annotationType_===Lr}function $e(e,t){return{annotationType_:e,options_:t,make_:Br,extend_:Ur,decorate_20223_:Ir}}function Br(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(me(r.value))return 1;var o=fn(e,this,t,r,!1);return H(n,t,o),2}function Ur(e,t,r,n){var i=fn(e,this,t,r);return e.defineProperty_(t,i,n)}function Ir(e,t){process.env.NODE_ENV!=="production"&&tt(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,o=this,s=function(f){var d,p,g,E;return he((d=(p=o.options_)==null?void 0:p.name)!=null?d:n.toString(),f,(g=(E=o.options_)==null?void 0:E.autoAction)!=null?g:!1)};if(r=="field")return function(u){var f,d=u;return me(d)||(d=s(d)),(f=o.options_)!=null&&f.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(r=="method"){var a;return me(e)||(e=s(e)),(a=this.options_)!=null&&a.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),e}_("Cannot apply '"+o.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
11
+ '`+o.annotationType_+"' can only be used on properties with a function value."))}function $r(e,t,r,n){var i=t.annotationType_,o=n.value;process.env.NODE_ENV!=="production"&&!y(o)&&_("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
12
+ '`+i+"' can only be used on properties with a function value."))}function fn(e,t,r,n,i){var o,s,a,u,f,d,p;i===void 0&&(i=l.safeDescriptors),$r(e,t,r,n);var g=n.value;if((o=t.options_)!=null&&o.bound){var E;g=g.bind((E=e.proxy_)!=null?E:e.target_)}return{value:he((s=(a=t.options_)==null?void 0:a.name)!=null?s:r.toString(),g,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(d=t.options_)!=null&&d.bound?(p=e.proxy_)!=null?p:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function dn(e,t){return{annotationType_:e,options_:t,make_:Fr,extend_:Kr,decorate_20223_:Gr}}function Fr(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!G(e.target_,t)||!Ge(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Ge(r.value))return 1;var o=_n(e,this,t,r,!1,!1);return H(n,t,o),2}function Kr(e,t,r,n){var i,o=_n(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,o,n)}function Gr(e,t){var r;process.env.NODE_ENV!=="production"&&tt(t,["method"]);var n=t.name,i=t.addInitializer;return Ge(e)||(e=Ve(e)),(r=this.options_)!=null&&r.bound&&i(function(){var o=this,s=o[n].bind(o);s.isMobXFlow=!0,o[n]=s}),e}function qr(e,t,r,n){var i=t.annotationType_,o=n.value;process.env.NODE_ENV!=="production"&&!y(o)&&_("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
13
+ '`+i+"' can only be used on properties with a generator function value."))}function _n(e,t,r,n,i,o){o===void 0&&(o=l.safeDescriptors),qr(e,t,r,n);var s=n.value;if(Ge(s)||(s=Ve(s)),i){var a;s=s.bind((a=e.proxy_)!=null?a:e.target_),s.isMobXFlow=!0}return{value:s,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function St(e,t){return{annotationType_:e,options_:t,make_:zr,extend_:Yr,decorate_20223_:Wr}}function zr(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Yr(e,t,r,n){return Hr(e,this,t,r),e.defineComputedProperty_(t,se({},this.options_,{get:r.get,set:r.set}),n)}function Wr(e,t){process.env.NODE_ENV!=="production"&&tt(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var o=Te(this)[v],s=se({},r.options_,{get:e,context:this});s.name||(s.name=process.env.NODE_ENV!=="production"?o.name_+"."+n.toString():"ObservableObject."+n.toString()),o.values_.set(n,new k(s))}),function(){return this[v].getObservablePropValue_(n)}}function Hr(e,t,r,n){var i=t.annotationType_,o=n.get;process.env.NODE_ENV!=="production"&&!o&&_("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
14
+ '`+i+"' can only be used on getter(+setter) properties."))}function ot(e,t){return{annotationType_:e,options_:t,make_:Xr,extend_:Jr,decorate_20223_:Zr}}function Xr(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Jr(e,t,r,n){var i,o;return Qr(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(o=this.options_)==null?void 0:o.enhancer)!=null?i:ve,n)}function Zr(e,t){if(process.env.NODE_ENV!=="production"){if(t.kind==="field")throw _("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");tt(t,["accessor"])}var r=this,n=t.kind,i=t.name,o=new WeakSet;function s(a,u){var f,d,p=Te(a)[v],g=new pe(u,(f=(d=r.options_)==null?void 0:d.enhancer)!=null?f:ve,process.env.NODE_ENV!=="production"?p.name_+"."+i.toString():"ObservableObject."+i.toString(),!1);p.values_.set(i,g),o.add(a)}if(n=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[v].getObservablePropValue_(i)},set:function(u){return o.has(this)||s(this,u),this[v].setObservablePropValue_(i,u)},init:function(u){return o.has(this)||s(this,u),u}}}function Qr(e,t,r,n){var i=t.annotationType_;process.env.NODE_ENV!=="production"&&!("value"in n)&&_("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
15
+ '`+i+"' cannot be used on getter/setter properties"))}var ei="true",ti=vn();function vn(e){return{annotationType_:ei,options_:e,make_:ni,extend_:ri,decorate_20223_:ii}}function ni(e,t,r,n){var i,o;if(r.get)return ut.make_(e,t,r,n);if(r.set){var s=me(r.set)?r.set:he(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:l.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(H(n,t,{configurable:!0,set:s}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(rn(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?Ve.bound:Ve;return f.make_(e,t,r,n)}var d=(a=this.options_)!=null&&a.autoBind?Ke.bound:Ke;return d.make_(e,t,r,n)}var p=((i=this.options_)==null?void 0:i.deep)===!1?S.ref:S;if(typeof r.value=="function"&&(o=this.options_)!=null&&o.autoBind){var g;r.value=r.value.bind((g=e.proxy_)!=null?g:e.target_)}return p.make_(e,t,r,n)}function ri(e,t,r,n){var i,o;if(r.get)return ut.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:l.safeDescriptors?e.isPlainObject_:!0,set:he(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;r.value=r.value.bind((s=e.proxy_)!=null?s:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?S.ref:S;return a.extend_(e,t,r,n)}function ii(e,t){_("'"+this.annotationType_+"' cannot be used as a decorator")}var oi="observable",si="observable.ref",ai="observable.shallow",ui="observable.struct",hn={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(hn);function st(e){return e||hn}var wt=ot(oi),ci=ot(si,{enhancer:rt}),li=ot(ai,{enhancer:Mr}),fi=ot(ui,{enhancer:kr}),pn=X(wt);function at(e){return e.deep===!0?ve:e.deep===!1?rt:_i(e.defaultDecorator)}function di(e){var t;return e?(t=e.defaultDecorator)!=null?t:vn(e):void 0}function _i(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:ve}function bn(e,t,r){if(Ie(t))return wt.decorate_20223_(e,t);if(de(t)){Ue(e,t,wt);return}return qe(e)?e:V(e)?S.object(e,t,r):Array.isArray(e)?S.array(e,t):Se(e)?S.map(e,t):te(e)?S.set(e,t):typeof e=="object"&&e!==null?e:S.box(e,t)}en(bn,pn);var vi={box:function(t,r){var n=st(r);return new pe(t,at(n),n.name,!0,n.equals)},array:function(t,r){var n=st(r);return(l.useProxies===!1||n.proxy===!1?fo:to)(t,at(n),n.name)},map:function(t,r){var n=st(r);return new Gn(t,at(n),n.name)},set:function(t,r){var n=st(r);return new zn(t,at(n),n.name)},object:function(t,r,n){return ye(function(){return Ln(l.useProxies===!1||n?.proxy===!1?Te({},n):Zi({},n),t,r)})},ref:X(ci),shallow:X(li),deep:pn,struct:X(fi)},S=en(bn,vi),gn="computed",hi="computed.struct",Dt=St(gn),pi=St(hi,{equals:nt.structural}),ut=function(t,r){if(Ie(r))return Dt.decorate_20223_(t,r);if(de(r))return Ue(t,r,Dt);if(V(t))return X(St(gn,t));process.env.NODE_ENV!=="production"&&(y(t)||_("First argument to `computed` should be an expression."),y(r)&&_("A setter as second argument is no longer supported, use `{ set: fn }` option instead"));var n=V(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new k(n)};Object.assign(ut,Dt),ut.struct=X(pi);var mn,On,ct=0,bi=1,gi=(mn=(On=Xe(function(){},"name"))==null?void 0:On.configurable)!=null?mn:!1,yn={value:"action",configurable:!0,writable:!1,enumerable:!1};function he(e,t,r,n){r===void 0&&(r=!1),process.env.NODE_ENV!=="production"&&(y(t)||_("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&_("actions should have valid names, got: '"+e+"'"));function i(){return mi(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},gi&&(yn.value=e,H(i,"name",yn)),i}function mi(e,t,r,n,i){var o=Oi(e,t,n,i);try{return r.apply(n,i)}catch(s){throw o.error_=s,s}finally{yi(o)}}function Oi(e,t,r,n){var i=process.env.NODE_ENV!=="production"&&w()&&!!e,o=0;if(process.env.NODE_ENV!=="production"&&i){o=Date.now();var s=n?Array.from(n):Ze;P({type:Mt,name:e,object:r,arguments:s})}var a=l.trackingDerivation,u=!t||!a;B();var f=l.allowStateChanges;u&&(be(),f=jt(!0));var d=Pt(!0),p={runAsAction_:u,prevDerivation_:a,prevAllowStateChanges_:f,prevAllowStateReads_:d,notifySpy_:i,startTime_:o,actionId_:bi++,parentActionId_:ct};return ct=p.actionId_,p}function yi(e){ct!==e.actionId_&&_(30),ct=e.parentActionId_,e.error_!==void 0&&(l.suppressReactionErrors=!0),Vt(e.prevAllowStateChanges_),Fe(e.prevAllowStateReads_),U(),e.runAsAction_&&re(e.prevDerivation_),process.env.NODE_ENV!=="production"&&e.notifySpy_&&R({time:Date.now()-e.startTime_}),l.suppressReactionErrors=!1}function jt(e){var t=l.allowStateChanges;return l.allowStateChanges=e,t}function Vt(e){l.allowStateChanges=e}var Ei="create",pe=(function(e){function t(n,i,o,s,a){var u;if(o===void 0&&(o=process.env.NODE_ENV!=="production"?"ObservableValue@"+K():"ObservableValue"),s===void 0&&(s=!0),a===void 0&&(a=nt.default),u=e.call(this,o)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=o,u.equals=a,u.value_=i(n,void 0,o),process.env.NODE_ENV!=="production"&&s&&w()){var f;ge({type:Ei,object:u,observableKind:"value",debugObjectName:u.name_,newValue:""+((f=u.value_)==null?void 0:f.toString())})}return u}cn(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var o=this.value_;if(i=this.prepareNewValue_(i),i!==l.UNCHANGED){var s=w();process.env.NODE_ENV!=="production"&&s&&P({type:Y,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),process.env.NODE_ENV!=="production"&&s&&R()}},r.prepareNewValue_=function(i){if(J(this),I(this)){var o=$(this,{object:this,type:Y,newValue:i});if(!o)return l.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?l.UNCHANGED:i},r.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),q(this)&&z(this,{type:Y,object:this,newValue:i,oldValue:o})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return ze(this,i)},r.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Y,newValue:this.value_,oldValue:void 0}),Ye(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return an(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t})(ae),k=(function(){function e(r){this.dependenciesState_=b.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=b.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ft(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=L.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||_(31),this.derivation=r.get,this.name_=r.name||(process.env.NODE_ENV!=="production"?"ComputedValue@"+K():"ComputedValue"),r.set&&(this.setter_=he(process.env.NODE_ENV!=="production"?this.name_+"-setter":"ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?nt.structural:nt.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){ji(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&_(32,this.name_,this.derivation),l.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Tt(this)&&(this.warnAboutUntrackedRead_(),B(),this.value_=this.computeValue_(!1),U());else if(Dn(this),Tt(this)){var n=l.trackingContext;this.keepAlive_&&!n&&(l.trackingContext=this),this.trackAndCompute()&&Di(this),l.trackingContext=n}var i=this.value_;if(dt(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&_(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else _(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===b.NOT_TRACKING_,o=this.computeValue_(!0),s=i||dt(n)||dt(o)||!this.equals_(n,o);return s&&(this.value_=o,process.env.NODE_ENV!=="production"&&w()&&ge({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:o})),s},t.computeValue_=function(n){this.isComputing=!0;var i=jt(!1),o;if(n)o=En(this,this.derivation,this.scope_);else if(l.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new ft(s)}return Vt(i),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(xt(this),this.value_=void 0,process.env.NODE_ENV!=="production"&&this.isTracing_!==L.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var o=this,s=!0,a=void 0;return Bi(function(){var u=o.get();if(!s||i){var f=be();n({observableKind:"computed",debugObjectName:o.name_,type:Y,object:o,newValue:u,oldValue:a}),re(f)}s=!1,a=u})},t.warnAboutUntrackedRead_=function(){process.env.NODE_ENV!=="production"&&(this.isTracing_!==L.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:l.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."))},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return an(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},we(e,[{key:"isComputing",get:function(){return T(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=x(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return T(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=x(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return T(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=x(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return T(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=x(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return T(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=x(this.flags_,e.diffValueMask_,n===1)}}])})();k.isComputingMask_=1,k.isRunningSetterMask_=2,k.isBeingObservedMask_=4,k.isPendingUnobservationMask_=8,k.diffValueMask_=16;var lt=_e("ComputedValue",k),b;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(b||(b={}));var L;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(L||(L={}));var ft=function(t){this.cause=void 0,this.cause=t};function dt(e){return e instanceof ft}function Tt(e){switch(e.dependenciesState_){case b.UP_TO_DATE_:return!1;case b.NOT_TRACKING_:case b.STALE_:return!0;case b.POSSIBLY_STALE_:{for(var t=Pt(!0),r=be(),n=e.observing_,i=n.length,o=0;o<i;o++){var s=n[o];if(lt(s)){if(l.disableErrorBoundaries)s.get();else try{s.get()}catch{return re(r),Fe(t),!0}if(e.dependenciesState_===b.STALE_)return re(r),Fe(t),!0}}return An(e),re(r),Fe(t),!1}}}function J(e){if(process.env.NODE_ENV!=="production"){var t=e.observers_.size>0;!l.allowStateChanges&&(t||l.enforceActions==="always")&&console.warn("[MobX] "+(l.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}}function Ni(e){process.env.NODE_ENV!=="production"&&!l.allowStateReads&&l.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function En(e,t,r){var n=Pt(!0);An(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++l.runId;var i=l.trackingDerivation;l.trackingDerivation=e,l.inBatch++;var o;if(l.disableErrorBoundaries===!0)o=t.call(r);else try{o=t.call(r)}catch(s){o=new ft(s)}return l.inBatch--,l.trackingDerivation=i,Si(e),Ai(e),Fe(n),o}function Ai(e){process.env.NODE_ENV!=="production"&&e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:l.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Si(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=b.UP_TO_DATE_,i=0,o=e.unboundDepsCount_,s=0;s<o;s++){var a=r[s];a.diffValue===0&&(a.diffValue=1,i!==s&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,o=t.length;o--;){var u=t[o];u.diffValue===0&&Sn(u,e),u.diffValue=0}for(;i--;){var f=r[i];f.diffValue===1&&(f.diffValue=0,wi(f,e))}n!==b.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function xt(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Sn(t[r],e);e.dependenciesState_=b.NOT_TRACKING_}function Nn(e){var t=be();try{return e()}finally{re(t)}}function be(){var e=l.trackingDerivation;return l.trackingDerivation=null,e}function re(e){l.trackingDerivation=e}function Pt(e){var t=l.allowStateReads;return l.allowStateReads=e,t}function Fe(e){l.allowStateReads=e}function An(e){if(e.dependenciesState_!==b.UP_TO_DATE_){e.dependenciesState_=b.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=b.UP_TO_DATE_}}var Rt=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Ct=!0,l=(function(){var e=Ot();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ct=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Rt().version&&(Ct=!1),Ct?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Rt):(setTimeout(function(){_(35)},1),new Rt)})();function wi(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Sn(e,t){e.observers_.delete(t),e.observers_.size===0&&wn(e)}function wn(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,l.pendingUnobservations.push(e))}function B(){l.inBatch++}function U(){if(--l.inBatch===0){Pn();for(var e=l.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof k&&r.suspend_())}l.pendingUnobservations=[]}}function Dn(e){Ni(e);var t=l.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&l.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&l.inBatch>0&&wn(e),!1)}function jn(e){e.lowestObserverState_!==b.STALE_&&(e.lowestObserverState_=b.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===b.UP_TO_DATE_&&(process.env.NODE_ENV!=="production"&&t.isTracing_!==L.NONE&&Vn(t,e),t.onBecomeStale_()),t.dependenciesState_=b.STALE_}))}function Di(e){e.lowestObserverState_!==b.STALE_&&(e.lowestObserverState_=b.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===b.POSSIBLY_STALE_?(t.dependenciesState_=b.STALE_,process.env.NODE_ENV!=="production"&&t.isTracing_!==L.NONE&&Vn(t,e)):t.dependenciesState_===b.UP_TO_DATE_&&(e.lowestObserverState_=b.UP_TO_DATE_)}))}function ji(e){e.lowestObserverState_===b.UP_TO_DATE_&&(e.lowestObserverState_=b.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===b.UP_TO_DATE_&&(t.dependenciesState_=b.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Vn(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===L.BREAK){var r=[];Tn(Gi(e),r,1),new Function(`debugger;
16
+ /*
17
+ Tracing '`+e.name_+`'
18
+
19
+ You are entering this break point because derivation '`+e.name_+"' is being traced and '"+t.name_+`' is now forcing it to update.
20
+ Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
21
+ The stackframe you are looking for is at least ~6-8 stack-frames up.
22
+
23
+ `+(e instanceof k?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
24
+
25
+ The dependencies for this derivation are:
26
+
27
+ `+r.join(`
28
+ `)+`
29
+ */
30
+ `)()}}function Tn(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return Tn(n,t,r+1)})}var ue=(function(){function e(r,n,i,o){r===void 0&&(r=process.env.NODE_ENV!=="production"?"Reaction@"+K():"Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=b.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=L.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,l.pendingReactions.push(this),Pn())},t.runReaction_=function(){if(!this.isDisposed){B(),this.isScheduled=!1;var n=l.trackingContext;if(l.trackingContext=this,Tt(this)){this.isTrackPending=!0;try{this.onInvalidate_(),process.env.NODE_ENV!=="production"&&this.isTrackPending&&w()&&ge({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}l.trackingContext=n,U()}},t.track=function(n){if(!this.isDisposed){B();var i=w(),o;process.env.NODE_ENV!=="production"&&i&&(o=Date.now(),P({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=l.trackingContext;l.trackingContext=this;var a=En(this,n,void 0);l.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&xt(this),dt(a)&&this.reportExceptionInDerivation_(a.cause),process.env.NODE_ENV!=="production"&&i&&R({time:Date.now()-o}),U()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(l.disableErrorBoundaries)throw n;var o=process.env.NODE_ENV!=="production"?"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'":"[mobx] uncaught error in '"+this+"'";l.suppressReactionErrors?process.env.NODE_ENV!=="production"&&console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,n),process.env.NODE_ENV!=="production"&&w()&&ge({type:"error",name:this.name_,message:o,error:""+n}),l.globalReactionErrorHandlers.forEach(function(s){return s(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(B(),xt(this),U()))},t.getDisposer_=function(n){var i=this,o=function s(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",s)};return n==null||n.addEventListener==null||n.addEventListener("abort",o),o[v]=this,"dispose"in Symbol&&typeof Symbol.dispose=="symbol"&&(o[Symbol.dispose]=o),o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),Hi(this,n)},we(e,[{key:"isDisposed",get:function(){return T(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=x(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return T(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=x(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return T(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=x(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return T(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=x(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return T(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=x(this.flags_,e.diffValueMask_,n===1)}}])})();ue.isDisposedMask_=1,ue.isScheduledMask_=2,ue.isTrackPendingMask_=4,ue.isRunningMask_=8,ue.diffValueMask_=16;var xn=100,Vi=function(t){return t()};function Pn(){l.inBatch>0||l.isRunningReactions||Vi(Ti)}function Ti(){l.isRunningReactions=!0;for(var e=l.pendingReactions,t=0;e.length>0;){++t===xn&&(console.error(process.env.NODE_ENV!=="production"?"Reaction doesn't converge to a stable state after "+xn+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0]):"[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}l.isRunningReactions=!1}var _t=_e("Reaction",ue);function w(){return process.env.NODE_ENV!=="production"&&!!l.spyListeners.length}function ge(e){if(process.env.NODE_ENV!=="production"&&l.spyListeners.length)for(var t=l.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function P(e){if(process.env.NODE_ENV!=="production"){var t=se({},e,{spyReportStart:!0});ge(t)}}var xi={type:"report-end",spyReportEnd:!0};function R(e){process.env.NODE_ENV!=="production"&&ge(e?se({},e,{type:"report-end",spyReportEnd:!0}):xi)}function Pi(e){return process.env.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(l.spyListeners.push(e),yt(function(){l.spyListeners=l.spyListeners.filter(function(t){return t!==e})}))}var Mt="action",Ri="action.bound",Rn="autoAction",Ci="autoAction.bound",Mi="<unnamed action>",kt=$e(Mt),ki=$e(Ri,{bound:!0}),Lt=$e(Rn,{autoAction:!0}),Li=$e(Ci,{autoAction:!0,bound:!0});function Cn(e){var t=function(n,i){if(y(n))return he(n.name||Mi,n,e);if(y(i))return he(n,i,e);if(Ie(i))return(e?Lt:kt).decorate_20223_(n,i);if(de(i))return Ue(n,i,e?Lt:kt);if(de(n))return X($e(e?Rn:Mt,{name:n,autoAction:e}));process.env.NODE_ENV!=="production"&&_("Invalid arguments for `action`")};return t}var je=Cn(!1);Object.assign(je,kt);var Ke=Cn(!0);Object.assign(Ke,Lt),je.bound=X(ki),Ke.bound=X(Li);function me(e){return y(e)&&e.isMobxAction===!0}function Bi(e,t){var r,n,i,o;t===void 0&&(t=tn),process.env.NODE_ENV!=="production"&&(y(e)||_("Autorun expects a function as first argument"),me(e)&&_("Autorun does not accept actions since actions are untrackable"));var s=(r=(n=t)==null?void 0:n.name)!=null?r:process.env.NODE_ENV!=="production"?e.name||"Autorun@"+K():"Autorun",a=!t.scheduler&&!t.delay,u;if(a)u=new ue(s,function(){this.track(p)},t.onError,t.requiresObservable);else{var f=Ii(t),d=!1;u=new ue(s,function(){d||(d=!0,f(function(){d=!1,u.isDisposed||u.track(p)}))},t.onError,t.requiresObservable)}function p(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((o=t)==null?void 0:o.signal)}var Ui=function(t){return t()};function Ii(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ui}var $i="onBO",Fi="onBUO";function Ki(e,t,r){return kn($i,e,t,r)}function Mn(e,t,r){return kn(Fi,e,t,r)}function kn(e,t,r,n){var i=Pe(t),o=y(n)?n:r,s=e+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var a=i[s];a&&(a.delete(o),a.size===0&&delete i[s])}}function Ln(e,t,r,n){process.env.NODE_ENV!=="production"&&(arguments.length>4&&_("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&_("'extendObservable' expects an object as first argument"),le(e)&&_("'extendObservable' should not be used on maps, use map.merge instead"),V(t)||_("'extendObservable' only accepts plain objects as second argument"),(qe(t)||qe(r))&&_("Extending an object with another observable (object) is not supported"));var i=Dr(t);return ye(function(){var o=Te(e,n)[v];Be(i).forEach(function(s){o.extend_(s,i[s],r&&s in r?r[s]:!0)})}),e}function Gi(e,t){return Bn(Pe(e,t))}function Bn(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=qi(e.observing_).map(Bn)),t}function qi(e){return Array.from(new Set(e))}var zi=0;function Un(){this.message="FLOW_CANCELLED"}Un.prototype=Object.create(Error.prototype);var Bt=dn("flow"),Yi=dn("flow.bound",{bound:!0}),Ve=Object.assign(function(t,r){if(Ie(r))return Bt.decorate_20223_(t,r);if(de(r))return Ue(t,r,Bt);process.env.NODE_ENV!=="production"&&arguments.length!==1&&_("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",o=function(){var a=this,u=arguments,f=++zi,d=je(i+" - runid: "+f+" - init",n).apply(a,u),p,g=void 0,E=new Promise(function(M,F){var j=0;p=F;function Re(D){g=void 0;var Q;try{Q=je(i+" - runid: "+f+" - yield "+j++,d.next).call(d,D)}catch(oe){return F(oe)}Ee(Q)}function We(D){g=void 0;var Q;try{Q=je(i+" - runid: "+f+" - yield "+j++,d.throw).call(d,D)}catch(oe){return F(oe)}Ee(Q)}function Ee(D){if(y(D?.then)){D.then(Ee,F);return}return D.done?M(D.value):(g=Promise.resolve(D.value),g.then(Re,We))}Re(void 0)});return E.cancel=je(i+" - runid: "+f+" - cancel",function(){try{g&&In(g);var M=d.return(void 0),F=Promise.resolve(M.value);F.then(Ae,Ae),In(F),p(new Un)}catch(j){p(j)}}),E};return o.isMobXFlow=!0,o},Bt);Ve.bound=X(Yi);function In(e){y(e.cancel)&&e.cancel()}function Ge(e){return e?.isMobXFlow===!0}function Wi(e,t){return e?xe(e)||!!e[v]||At(e)||_t(e)||lt(e):!1}function qe(e){return process.env.NODE_ENV!=="production"&&arguments.length!==1&&_("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Wi(e)}function Hi(){if(process.env.NODE_ENV!=="production"){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=Xi(r);if(!i)return _("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===L.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?L.BREAK:L.LOG}}function Xi(e){switch(e.length){case 0:return l.trackingDerivation;case 1:return Pe(e[0]);case 2:return Pe(e[0],e[1])}}function ie(e,t){t===void 0&&(t=void 0),B();try{return e.apply(t)}finally{U()}}function Oe(e){return e[v]}var Ji={has:function(t,r){return process.env.NODE_ENV!=="production"&&l.trackingDerivation&&Le("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Oe(t).has_(r)},get:function(t,r){return Oe(t).get_(r)},set:function(t,r,n){var i;return de(r)?(process.env.NODE_ENV!=="production"&&!Oe(t).values_.has(r)&&Le("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Oe(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return process.env.NODE_ENV!=="production"&&Le("delete properties from an observable object. Use 'remove' from 'mobx' instead."),de(r)?(n=Oe(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return process.env.NODE_ENV!=="production"&&Le("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Oe(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return process.env.NODE_ENV!=="production"&&l.trackingDerivation&&Le("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Oe(t).ownKeys_()},preventExtensions:function(t){_(13)}};function Zi(e,t){var r,n;return nn(),e=Te(e,t),(n=(r=e[v]).proxy_)!=null?n:r.proxy_=new Proxy(e,Ji)}function I(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function ze(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),yt(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function $(e,t){var r=be();try{for(var n=[].concat(e.interceptors_||[]),i=0,o=n.length;i<o&&(t=n[i](t),t&&!t.type&&_(14),!!t);i++);return t}finally{re(r)}}function q(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ye(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),yt(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function z(e,t){var r=be(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,o=n.length;i<o;i++)n[i](t);re(r)}}var Ut=Symbol("mobx-keys");function $n(e,t,r){return process.env.NODE_ENV!=="production"&&(!V(e)&&!V(Object.getPrototypeOf(e))&&_("'makeAutoObservable' can only be used for classes that don't have a superclass"),xe(e)&&_("makeAutoObservable can only be used on objects not already made observable")),V(e)?Ln(e,e,t,r):(ye(function(){var n=Te(e,r)[v];if(!e[Ut]){var i=Object.getPrototypeOf(e),o=new Set([].concat(Be(e),Be(i)));o.delete("constructor"),o.delete(v),et(i,Ut,o)}e[Ut].forEach(function(s){return n.make_(s,t&&s in t?t[s]:!0)})}),e)}var Fn="splice",Y="update",Qi=1e4,eo={get:function(t,r){var n=t[v];return r===v?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):G(vt,r)?vt[r]:t[r]},set:function(t,r,n){var i=t[v];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){_(15)}},It=(function(){function e(r,n,i,o){r===void 0&&(r=process.env.NODE_ENV!=="production"?"ObservableArray@"+K():"ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=o,this.atom_=new ae(r),this.enhancer_=function(s,a){return n(s,a,process.env.NODE_ENV!=="production"?r+"[..]":"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return ze(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Ye(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&_("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var o=new Array(n-i),s=0;s<n-i;s++)o[s]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&_(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&tr(n+i+1)},t.spliceWithArray_=function(n,i,o){var s=this;J(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),o===void 0&&(o=Ze),I(this)){var u=$(this,{object:this.proxy_,type:Fn,index:n,removedCount:i,added:o});if(!u)return Ze;i=u.removedCount,o=u.added}if(o=o.length===0?o:o.map(function(p){return s.enhancer_(p,void 0)}),this.legacyMode_||process.env.NODE_ENV!=="production"){var f=o.length-i;this.updateArrayLength_(a,f)}var d=this.spliceItemsIntoValues_(n,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(n,o,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(n,i,o){if(o.length<Qi){var s;return(s=this.values_).splice.apply(s,[n,i].concat(o))}else{var a=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=o.length-i;for(var f=0;f<o.length;f++)this.values_[n+f]=o[f];for(var d=0;d<u.length;d++)this.values_[n+o.length+d]=u[d];return a}},t.notifyArrayChildUpdate_=function(n,i,o){var s=!this.owned_&&w(),a=q(this),u=a||s?{observableKind:"array",object:this.proxy_,type:Y,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:o}:null;process.env.NODE_ENV!=="production"&&s&&P(u),this.atom_.reportChanged(),a&&z(this,u),process.env.NODE_ENV!=="production"&&s&&R()},t.notifyArraySplice_=function(n,i,o){var s=!this.owned_&&w(),a=q(this),u=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Fn,index:n,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;process.env.NODE_ENV!=="production"&&s&&P(u),this.atom_.reportChanged(),a&&z(this,u),process.env.NODE_ENV!=="production"&&s&&R()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn(process.env.NODE_ENV!=="production"?"[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX":"[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var o=this.values_;if(this.legacyMode_&&n>o.length&&_(17,n,o.length),n<o.length){J(this.atom_);var s=o[n];if(I(this)){var a=$(this,{type:Y,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,s);var u=i!==s;u&&(o[n]=i,this.notifyArrayChildUpdate_(n,i,s))}else{for(var f=new Array(n+1-o.length),d=0;d<f.length-1;d++)f[d]=void 0;f[f.length-1]=i,this.spliceWithArray_(o.length,0,f)}},e})();function to(e,t,r,n){return r===void 0&&(r=process.env.NODE_ENV!=="production"?"ObservableArray@"+K():"ObservableArray"),n===void 0&&(n=!1),nn(),ye(function(){var i=new It(r,t,n,!1);on(i.values_,v,i);var o=new Proxy(i.values_,eo);return i.proxy_=o,e&&e.length&&i.spliceWithArray_(0,0,e),o})}var vt={clear:function(){return this.splice(0)},replace:function(t){var r=this[v];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];var s=this[v];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,r)}return s.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[v].spliceWithArray_(t,r,n)},push:function(){for(var t=this[v],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[v].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[v],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return l.trackingDerivation&&_(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){l.trackingDerivation&&_(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[v],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};m("at",C),m("concat",C),m("flat",C),m("includes",C),m("indexOf",C),m("join",C),m("lastIndexOf",C),m("slice",C),m("toString",C),m("toLocaleString",C),m("toSorted",C),m("toSpliced",C),m("with",C),m("every",W),m("filter",W),m("find",W),m("findIndex",W),m("findLast",W),m("findLastIndex",W),m("flatMap",W),m("forEach",W),m("map",W),m("some",W),m("toReversed",W),m("reduce",Kn),m("reduceRight",Kn);function m(e,t){typeof Array.prototype[e]=="function"&&(vt[e]=t(e))}function C(e){return function(){var t=this[v];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function W(e){return function(t,r){var n=this,i=this[v];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[e](function(s,a){return t.call(r,s,a,n)})}}function Kn(e){return function(){var t=this,r=this[v];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(o,s,a){return i(o,s,a,t)},n[e].apply(n,arguments)}}var no=_e("ObservableArrayAdministration",It);function ht(e){return Qe(e)&&no(e[v])}var ro={},ce="add",pt="delete",Gn=(function(){function e(r,n,i){var o=this;n===void 0&&(n=ve),i===void 0&&(i=process.env.NODE_ENV!=="production"?"ObservableMap@"+K():"ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[v]=ro,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,y(Map)||_(18),ye(function(){o.keysAtom_=ln(process.env.NODE_ENV!=="production"?o.name_+".keys()":"ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,r&&o.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!l.trackingDerivation)return this.has_(n);var o=this.hasMap_.get(n);if(!o){var s=o=new pe(this.has_(n),rt,process.env.NODE_ENV!=="production"?this.name_+"."+Et(n)+"?":"ObservableMap.key?",!1);this.hasMap_.set(n,s),Mn(s,function(){return i.hasMap_.delete(n)})}return o.get()},t.set=function(n,i){var o=this.has_(n);if(I(this)){var s=$(this,{type:o?Y:ce,object:this,newValue:i,name:n});if(!s)return this;i=s.newValue}return o?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(J(this.keysAtom_),I(this)){var o=$(this,{type:pt,object:this,name:n});if(!o)return!1}if(this.has_(n)){var s=w(),a=q(this),u=a||s?{observableKind:"map",debugObjectName:this.name_,type:pt,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return process.env.NODE_ENV!=="production"&&s&&P(u),ie(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var d=i.data_.get(n);d.setNewValue_(void 0),i.data_.delete(n)}),a&&z(this,u),process.env.NODE_ENV!=="production"&&s&&R(),!0}return!1},t.updateValue_=function(n,i){var o=this.data_.get(n);if(i=o.prepareNewValue_(i),i!==l.UNCHANGED){var s=w(),a=q(this),u=a||s?{observableKind:"map",debugObjectName:this.name_,type:Y,object:this,oldValue:o.value_,name:n,newValue:i}:null;process.env.NODE_ENV!=="production"&&s&&P(u),o.setNewValue_(i),a&&z(this,u),process.env.NODE_ENV!=="production"&&s&&R()}},t.addValue_=function(n,i){var o=this;J(this.keysAtom_),ie(function(){var f,d=new pe(i,o.enhancer_,process.env.NODE_ENV!=="production"?o.name_+"."+Et(n):"ObservableMap.key",!1);o.data_.set(n,d),i=d.value_,(f=o.hasMap_.get(n))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=w(),a=q(this),u=a||s?{observableKind:"map",debugObjectName:this.name_,type:ce,object:this,name:n,newValue:i}:null;process.env.NODE_ENV!=="production"&&s&&P(u),a&&z(this,u),process.env.NODE_ENV!=="production"&&s&&R()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return qn({next:function(){var s=i.next(),a=s.done,u=s.value;return{done:a,value:a?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return qn({next:function(){var s=i.next(),a=s.done,u=s.value;return{done:a,value:a?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var o=De(this),s;!(s=o()).done;){var a=s.value,u=a[0],f=a[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return le(n)&&(n=new Map(n)),ie(function(){V(n)?wr(n).forEach(function(o){return i.set(o,n[o])}):Array.isArray(n)?n.forEach(function(o){var s=o[0],a=o[1];return i.set(s,a)}):Se(n)?(Sr(n)||_(19,n),n.forEach(function(o,s){return i.set(s,o)})):n!=null&&_(20,n)}),this},t.clear=function(){var n=this;ie(function(){Nn(function(){for(var i=De(n.keys()),o;!(o=i()).done;){var s=o.value;n.delete(s)}})})},t.replace=function(n){var i=this;return ie(function(){for(var o=io(n),s=new Map,a=!1,u=De(i.data_.keys()),f;!(f=u()).done;){var d=f.value;if(!o.has(d)){var p=i.delete(d);if(p)a=!0;else{var g=i.data_.get(d);s.set(d,g)}}}for(var E=De(o.entries()),M;!(M=E()).done;){var F=M.value,j=F[0],Re=F[1],We=i.data_.has(j);if(i.set(j,Re),i.data_.has(j)){var Ee=i.data_.get(j);s.set(j,Ee),We||(a=!0)}}if(!a)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var D=i.data_.keys(),Q=s.keys(),oe=D.next(),gt=Q.next();!oe.done;){if(oe.value!==gt.value){i.keysAtom_.reportChanged();break}oe=D.next(),gt=Q.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return process.env.NODE_ENV!=="production"&&i===!0&&_("`observe` doesn't support fireImmediately=true in combination with maps."),Ye(this,n)},t.intercept_=function(n){return ze(this,n)},we(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),le=_e("ObservableMap",Gn);function qn(e){return e[Symbol.toStringTag]="MapIterator",qt(e)}function io(e){if(Se(e)||le(e))return e;if(Array.isArray(e))return new Map(e);if(V(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return _(21,e)}var oo={},zn=(function(){function e(r,n,i){var o=this;n===void 0&&(n=ve),i===void 0&&(i=process.env.NODE_ENV!=="production"?"ObservableSet@"+K():"ObservableSet"),this.name_=void 0,this[v]=oo,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,y(Set)||_(22),this.enhancer_=function(s,a){return n(s,a,i)},ye(function(){o.atom_=ln(o.name_),r&&o.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;ie(function(){Nn(function(){for(var i=De(n.data_.values()),o;!(o=i()).done;){var s=o.value;n.delete(s)}})})},t.forEach=function(n,i){for(var o=De(this),s;!(s=o()).done;){var a=s.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(J(this.atom_),I(this)){var o=$(this,{type:ce,object:this,newValue:n});if(!o)return this;n=o.newValue}if(!this.has(n)){ie(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var s=process.env.NODE_ENV!=="production"&&w(),a=q(this),u=a||s?{observableKind:"set",debugObjectName:this.name_,type:ce,object:this,newValue:n}:null;s&&process.env.NODE_ENV!=="production"&&P(u),a&&z(this,u),s&&process.env.NODE_ENV!=="production"&&R()}return this},t.delete=function(n){var i=this;if(I(this)){var o=$(this,{type:pt,object:this,oldValue:n});if(!o)return!1}if(this.has(n)){var s=process.env.NODE_ENV!=="production"&&w(),a=q(this),u=a||s?{observableKind:"set",debugObjectName:this.name_,type:pt,object:this,oldValue:n}:null;return s&&process.env.NODE_ENV!=="production"&&P(u),ie(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&z(this,u),s&&process.env.NODE_ENV!=="production"&&R(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return Yn({next:function(){var o=n.next(),s=o.value,a=o.done;return a?{value:void 0,done:a}:{value:[s,s],done:a}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return Yn({next:function(){var s=i.next(),a=s.value,u=s.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(a),done:u}}})},t.intersection=function(n){if(te(n)&&!Z(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(te(n)&&!Z(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(te(n)&&!Z(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(te(n)&&!Z(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Z(n)&&(n=new Set(n)),ie(function(){Array.isArray(n)?(i.clear(),n.forEach(function(o){return i.add(o)})):te(n)?(i.clear(),n.forEach(function(o){return i.add(o)})):n!=null&&_("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return process.env.NODE_ENV!=="production"&&i===!0&&_("`observe` doesn't support fireImmediately=true in combination with sets."),Ye(this,n)},t.intercept_=function(n){return ze(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},we(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),Z=_e("ObservableSet",zn);function Yn(e){return e[Symbol.toStringTag]="SetIterator",qt(e)}var Wn=Object.create(null),Hn="remove",$t=(function(){function e(r,n,i,o){n===void 0&&(n=new Map),o===void 0&&(o=ti),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new ae(process.env.NODE_ENV!=="production"?this.name_+".keys":"ObservableObject.keys"),this.isPlainObject_=V(this.target_),process.env.NODE_ENV!=="production"&&!ar(this.defaultAnnotation_)&&_("defaultAnnotation must be valid annotation"),process.env.NODE_ENV!=="production"&&(this.appliedAnnotations_={})}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var o=this.values_.get(n);if(o instanceof k)return o.set(i),!0;if(I(this)){var s=$(this,{type:Y,object:this.proxy_||this.target_,name:n,newValue:i});if(!s)return null;i=s.newValue}if(i=o.prepareNewValue_(i),i!==l.UNCHANGED){var a=q(this),u=process.env.NODE_ENV!=="production"&&w(),f=a||u?{type:Y,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:n,newValue:i}:null;process.env.NODE_ENV!=="production"&&u&&P(f),o.setNewValue_(i),a&&z(this,f),process.env.NODE_ENV!=="production"&&u&&R()}return!0},t.get_=function(n){return l.trackingDerivation&&!G(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,o){return o===void 0&&(o=!1),G(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):o?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(n){if(!l.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new pe(n in this.target_,rt,process.env.NODE_ENV!=="production"?this.name_+"."+Et(n)+"?":"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Zn(this,i,n),!(n in this.target_)){var o;if((o=this.target_[ne])!=null&&o[n])return;_(1,i.annotationType_,this.name_+"."+n.toString())}for(var s=this.target_;s&&s!==Je;){var a=Xe(s,n);if(a){var u=i.make_(this,n,a,s);if(u===0)return;if(u===1)break}s=Object.getPrototypeOf(s)}Jn(this,i,n)}},t.extend_=function(n,i,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(n,i,s);Zn(this,o,n);var a=o.extend_(this,n,i,s);return a&&Jn(this,o,n),a},t.defineProperty_=function(n,i,o){o===void 0&&(o=!1),J(this.keysAtom_);try{B();var s=this.delete_(n);if(!s)return s;if(I(this)){var a=$(this,{object:this.proxy_||this.target_,name:n,type:ce,newValue:i.value});if(!a)return null;var u=a.newValue;i.value!==u&&(i=se({},i,{value:u}))}if(o){if(!Reflect.defineProperty(this.target_,n,i))return!1}else H(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{U()}return!0},t.defineObservableProperty_=function(n,i,o,s){s===void 0&&(s=!1),J(this.keysAtom_);try{B();var a=this.delete_(n);if(!a)return a;if(I(this)){var u=$(this,{object:this.proxy_||this.target_,name:n,type:ce,newValue:i});if(!u)return null;i=u.newValue}var f=Xn(n),d={configurable:l.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,n,d))return!1}else H(this.target_,n,d);var p=new pe(i,o,process.env.NODE_ENV!=="production"?this.name_+"."+n.toString():"ObservableObject.key",!1);this.values_.set(n,p),this.notifyPropertyAddition_(n,p.value_)}finally{U()}return!0},t.defineComputedProperty_=function(n,i,o){o===void 0&&(o=!1),J(this.keysAtom_);try{B();var s=this.delete_(n);if(!s)return s;if(I(this)){var a=$(this,{object:this.proxy_||this.target_,name:n,type:ce,newValue:void 0});if(!a)return null}i.name||(i.name=process.env.NODE_ENV!=="production"?this.name_+"."+n.toString():"ObservableObject.key"),i.context=this.proxy_||this.target_;var u=Xn(n),f={configurable:l.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(o){if(!Reflect.defineProperty(this.target_,n,f))return!1}else H(this.target_,n,f);this.values_.set(n,new k(i)),this.notifyPropertyAddition_(n,void 0)}finally{U()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),J(this.keysAtom_),!G(this.target_,n))return!0;if(I(this)){var o=$(this,{object:this.proxy_||this.target_,name:n,type:Hn});if(!o)return null}try{var s;B();var a=q(this),u=process.env.NODE_ENV!=="production"&&w(),f=this.values_.get(n),d=void 0;if(!f&&(a||u)){var p;d=(p=Xe(this.target_,n))==null?void 0:p.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(process.env.NODE_ENV!=="production"&&delete this.appliedAnnotations_[n],f&&(this.values_.delete(n),f instanceof pe&&(d=f.value_),jn(f)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(n in this.target_),a||u){var g={type:Hn,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:n};process.env.NODE_ENV!=="production"&&u&&P(g),a&&z(this,g),process.env.NODE_ENV!=="production"&&u&&R()}}finally{U()}return!0},t.observe_=function(n,i){return process.env.NODE_ENV!=="production"&&i===!0&&_("`observe` doesn't support the fire immediately property for observable objects."),Ye(this,n)},t.intercept_=function(n){return ze(this,n)},t.notifyPropertyAddition_=function(n,i){var o,s=q(this),a=process.env.NODE_ENV!=="production"&&w();if(s||a){var u=s||a?{type:ce,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;process.env.NODE_ENV!=="production"&&a&&P(u),s&&z(this,u),process.env.NODE_ENV!=="production"&&a&&R()}(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Be(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function Te(e,t){var r;if(process.env.NODE_ENV!=="production"&&t&&xe(e)&&_("Options can't be provided for already observable objects."),G(e,v))return process.env.NODE_ENV!=="production"&&!(nr(e)instanceof $t)&&_("Cannot convert '"+bt(e)+`' into observable object:
31
+ The target is already observable of different type.
32
+ Extending builtins is not supported.`),e;process.env.NODE_ENV!=="production"&&!Object.isExtensible(e)&&_("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:process.env.NODE_ENV!=="production"?(V(e)?"ObservableObject":e.constructor.name)+"@"+K():"ObservableObject",i=new $t(e,new Map,String(n),di(t));return et(e,v,i),e}var so=_e("ObservableObjectAdministration",$t);function Xn(e){return Wn[e]||(Wn[e]={get:function(){return this[v].getObservablePropValue_(e)},set:function(r){return this[v].setObservablePropValue_(e,r)}})}function xe(e){return Qe(e)?so(e[v]):!1}function Jn(e,t,r){var n;process.env.NODE_ENV!=="production"&&(e.appliedAnnotations_[r]=t),(n=e.target_[ne])==null||delete n[r]}function Zn(e,t,r){if(process.env.NODE_ENV!=="production"&&!ar(t)&&_("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),process.env.NODE_ENV!=="production"&&!it(t)&&G(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,o=t.annotationType_;_("Cannot apply '"+o+"' to '"+n+"':"+(`
33
+ The field is already annotated with '`+i+"'.")+`
34
+ Re-annotating fields is not allowed.
35
+ Use 'override' annotation for methods overridden by subclass.`)}}var ao=er(0),uo=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),Ft=0,Qn=function(){};function co(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}co(Qn,Array.prototype);var Kt=(function(e){function t(n,i,o,s){var a;return o===void 0&&(o=process.env.NODE_ENV!=="production"?"ObservableArray@"+K():"ObservableArray"),s===void 0&&(s=!1),a=e.call(this)||this,ye(function(){var u=new It(o,i,s,!0);u.proxy_=a,on(a,v,u),n&&n.length&&a.spliceWithArray(0,0,n),uo&&Object.defineProperty(a,"0",ao)}),a}cn(t,e);var r=t.prototype;return r.concat=function(){this[v].atom_.reportObserved();for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),o.map(function(a){return ht(a)?a.slice():a}))},r[Symbol.iterator]=function(){var n=this,i=0;return qt({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},we(t,[{key:"length",get:function(){return this[v].getArrayLength_()},set:function(i){this[v].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(Qn);Object.entries(vt).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&et(Kt.prototype,t,r)});function er(e){return{enumerable:!1,configurable:!0,get:function(){return this[v].get_(e)},set:function(r){this[v].set_(e,r)}}}function lo(e){H(Kt.prototype,""+e,er(e))}function tr(e){if(e>Ft){for(var t=Ft;t<e+100;t++)lo(t);Ft=e}}tr(1e3);function fo(e,t,r){return new Kt(e,t,r)}function Pe(e,t){if(typeof e=="object"&&e!==null){if(ht(e))return t!==void 0&&_(23),e[v].atom_;if(Z(e))return e.atom_;if(le(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||_(25,t,bt(e)),r}if(xe(e)){if(!t)return _(26);var n=e[v].values_.get(t);return n||_(27,t,bt(e)),n}if(At(e)||lt(e)||_t(e))return e}else if(y(e)&&_t(e[v]))return e[v];_(28)}function nr(e,t){if(e||_(29),At(e)||lt(e)||_t(e)||le(e)||Z(e))return e;if(e[v])return e[v];_(24,e)}function bt(e,t){var r;if(t!==void 0)r=Pe(e,t);else{if(me(e))return e.name;xe(e)||le(e)||Z(e)?r=nr(e):r=Pe(e)}return r.name_}function ye(e){var t=be(),r=jt(!0);B();try{return e()}finally{U(),Vt(r),re(t)}}var rr=Je.toString;function ir(e,t,r){return r===void 0&&(r=-1),Gt(e,t,r)}function Gt(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof t!="object")return!1;var s=rr.call(e);if(s!==rr.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=or(e),t=or(t);var a=s==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,f=t.constructor;if(u!==f&&!(y(u)&&u instanceof u&&y(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var d=n.length;d--;)if(n[d]===e)return i[d]===t;if(n.push(e),i.push(t),a){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!Gt(e[d],t[d],r-1,n,i))return!1}else{var p=Object.keys(e),g=p.length;if(Object.keys(t).length!==g)return!1;for(var E=0;E<g;E++){var M=p[E];if(!(G(t,M)&&Gt(e[M],t[M],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function or(e){return ht(e)?e.slice():Se(e)||le(e)||te(e)||Z(e)?Array.from(e.entries()):e}var sr,_o=((sr=Ot().Iterator)==null?void 0:sr.prototype)||{};function qt(e){return e[Symbol.iterator]=vo,Object.assign(Object.create(_o),e)}function vo(){return this}function ar(e){return e instanceof Object&&typeof e.annotationType_=="string"&&y(e.make_)&&y(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Ot();typeof t[e]>"u"&&_("MobX requires global '"+e+"' to be available or polyfilled")}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Pi,extras:{getDebugName:bt},$mobx:v});class ur{canvas=null;constructor(){$n(this)}setCanvas(t){this.canvas=t}}class cr{tool=null;constructor(){$n(this)}setTool(t){this.tool=t}}class lr{canvas;ctx;drawing=!1;constructor(t){this.canvas=t,this.ctx=t.getContext("2d"),this.ctx.strokeStyle="black",this.ctx.lineWidth=2,this.mouseDownHandler=this.mouseDownHandler.bind(this),this.mouseMoveHandler=this.mouseMoveHandler.bind(this),this.mouseUpHandler=this.mouseUpHandler.bind(this),this.init()}init(){this.canvas.addEventListener("mousedown",this.mouseDownHandler),this.canvas.addEventListener("mousemove",this.mouseMoveHandler),this.canvas.addEventListener("mouseup",this.mouseUpHandler)}mouseDownHandler(t){this.drawing=!0,this.ctx.beginPath(),this.ctx.moveTo(t.offsetX,t.offsetY)}mouseMoveHandler(t){this.drawing&&(this.ctx.lineTo(t.offsetX,t.offsetY),this.ctx.stroke())}mouseUpHandler(){this.drawing=!1}}const ho=({canvasStore:e,toolStore:t,width:r=800,height:n=600})=>{const i=fe.useRef(null);return fe.useEffect(()=>{i.current&&(e.setCanvas(i.current),t.setTool(new lr(i.current)))},[i.current]),Ne.jsx("canvas",{ref:i,width:r,height:n,style:{border:"1px solid #000"}})},po=({canvasStore:e,toolStore:t})=>Ne.jsx("div",{style:{marginBottom:10},children:Ne.jsx("button",{onClick:()=>e.canvas&&t.setTool(new lr(e.canvas)),children:"Кисть"})}),bo=({width:e=800,height:t=600})=>{const r=new ur,n=new cr;return Ne.jsxs("div",{children:[Ne.jsx(po,{canvasStore:r,toolStore:n}),Ne.jsx(ho,{canvasStore:r,toolStore:n,width:e,height:t})]})};ee.CanvasLight=bo,ee.CanvasStore=ur,ee.ToolStore=cr,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,10 @@
1
+ import { CanvasStore } from "../store/CanvasStore";
2
+ import { ToolStore } from "../store/ToolStore";
3
+ type Props = {
4
+ canvasStore: CanvasStore;
5
+ toolStore: ToolStore;
6
+ width?: number;
7
+ height?: number;
8
+ };
9
+ export declare const Canvas: ({ canvasStore, toolStore, width, height }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ import { CanvasStore } from "../store/CanvasStore";
2
+ import { ToolStore } from "../store/ToolStore";
3
+ type Props = {
4
+ canvasStore: CanvasStore;
5
+ toolStore: ToolStore;
6
+ };
7
+ export declare const Toolbar: ({ canvasStore, toolStore }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ export { CanvasLight } from "./CanvasLight";
2
+ export { CanvasStore } from "./store/CanvasStore";
3
+ export { ToolStore } from "./store/ToolStore";