@actual-app/web 23.5.0 → 23.7.0
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.
- package/build/asset-manifest.json +14 -46
- package/build/data/migrations/1685007876842_add_category_hidden.sql +6 -0
- package/build/data/migrations/1685375406832_transaction_filters.sql +10 -0
- package/build/data/migrations/1686139660866_remove_account_type.sql +5 -0
- package/build/data-file-index.txt +3 -0
- package/build/index.html +1 -1
- package/build/kcab/kcab.worker.d3b18567995ce96e3239.js +3 -0
- package/build/kcab/kcab.worker.d3b18567995ce96e3239.js.LICENSE.txt +24 -0
- package/build/kcab/kcab.worker.d3b18567995ce96e3239.js.map +1 -0
- package/build/kcab/xfo.xfo.kcab.worker.e800a4a41b9557f2726d.js +1 -0
- package/build/sql-wasm.wasm +0 -0
- package/build/static/css/main.1037ae74.css +7 -0
- package/build/static/css/main.1037ae74.css.map +1 -0
- package/build/static/js/457.e2e3c7b2.chunk.js +2 -0
- package/build/static/js/457.e2e3c7b2.chunk.js.map +1 -0
- package/build/static/js/{969.91b242b7.chunk.js → 969.98ab5142.chunk.js} +2 -2
- package/build/static/js/{969.91b242b7.chunk.js.map → 969.98ab5142.chunk.js.map} +1 -1
- package/build/static/js/main.127f6bd4.js +3 -0
- package/build/static/js/{main.8c52ae96.js.LICENSE.txt → main.127f6bd4.js.LICENSE.txt} +69 -8
- package/build/static/js/main.127f6bd4.js.map +1 -0
- package/build/static/js/reports.51bcc145.chunk.js +2 -0
- package/build/static/js/reports.51bcc145.chunk.js.map +1 -0
- package/build/static/js/{145.f5f301ec.chunk.js → resize-observer-polyfill.a2fa22b1.chunk.js} +2 -2
- package/build/static/js/resize-observer-polyfill.a2fa22b1.chunk.js.map +1 -0
- package/package.json +21 -20
- package/build/codemirror.css +0 -341
- package/build/kcab/kcab.worker.e2ee9d65fbc7d1214a04.js +0 -32
- package/build/kcab/kcab.worker.e2ee9d65fbc7d1214a04.js.map +0 -1
- package/build/kcab/xfo.kcab.worker.e2ee9d65fbc7d1214a04.js +0 -1
- package/build/monokai.css +0 -36
- package/build/sql-wasm-debug.wasm +0 -0
- package/build/static/css/main.5456b6c5.css +0 -7
- package/build/static/css/main.5456b6c5.css.map +0 -1
- package/build/static/js/145.f5f301ec.chunk.js.map +0 -1
- package/build/static/js/main.8c52ae96.js +0 -3
- package/build/static/js/main.8c52ae96.js.map +0 -1
- package/build/static/media/Inter-Black.15ca31c0a2a68f76d2d1.woff2 +0 -0
- package/build/static/media/Inter-Black.c6938660eec019fefd68.woff +0 -0
- package/build/static/media/Inter-BlackItalic.ca1e738e4f349f27514d.woff +0 -0
- package/build/static/media/Inter-BlackItalic.cb2a7335650c690077fe.woff2 +0 -0
- package/build/static/media/Inter-Bold.93c1301bd9f486c573b3.woff +0 -0
- package/build/static/media/Inter-Bold.ec64ea577b0349e055ad.woff2 +0 -0
- package/build/static/media/Inter-BoldItalic.2d26c56a606662486796.woff2 +0 -0
- package/build/static/media/Inter-BoldItalic.b376885042f6c961a541.woff +0 -0
- package/build/static/media/Inter-ExtraBold.cbe0ae49c52c920fd563.woff2 +0 -0
- package/build/static/media/Inter-ExtraBold.d0fa3bb2b7c9063dc594.woff +0 -0
- package/build/static/media/Inter-ExtraBoldItalic.535a6cf662596b3bd6a6.woff2 +0 -0
- package/build/static/media/Inter-ExtraBoldItalic.6ab17abedc4d3f140953.woff +0 -0
- package/build/static/media/Inter-ExtraLight.72505e6a122c6acd5471.woff2 +0 -0
- package/build/static/media/Inter-ExtraLight.c4248615291a9e8f1fb7.woff +0 -0
- package/build/static/media/Inter-ExtraLightItalic.170dddfca278d3c2ad4a.woff +0 -0
- package/build/static/media/Inter-ExtraLightItalic.5c7d7d6deb1d2ec8d48c.woff2 +0 -0
- package/build/static/media/Inter-Italic.890025e726861dba417f.woff +0 -0
- package/build/static/media/Inter-Italic.cb10ffd7684cd9836a05.woff2 +0 -0
- package/build/static/media/Inter-Light.2d5198822ab091ce4305.woff2 +0 -0
- package/build/static/media/Inter-Light.994e34451cc19ede31d3.woff +0 -0
- package/build/static/media/Inter-LightItalic.ef9f65d91d2b0ba9b2e4.woff +0 -0
- package/build/static/media/Inter-LightItalic.f86952265d7b0f02c921.woff2 +0 -0
- package/build/static/media/Inter-Medium.293fd13dbca5a3e450ef.woff2 +0 -0
- package/build/static/media/Inter-Medium.9053572c46aeb4b16caa.woff +0 -0
- package/build/static/media/Inter-MediumItalic.085cb93e613ba3d40d2b.woff2 +0 -0
- package/build/static/media/Inter-MediumItalic.3d0107dd43d0101274d3.woff +0 -0
- package/build/static/media/Inter-Regular.8c206db99195777c6769.woff +0 -0
- package/build/static/media/Inter-Regular.c8ba52b05a9ef10f4758.woff2 +0 -0
- package/build/static/media/Inter-SemiBold.b5f0f109bc88052d4000.woff2 +0 -0
- package/build/static/media/Inter-SemiBold.cca62d21c8c555c392e5.woff +0 -0
- package/build/static/media/Inter-SemiBoldItalic.463bdbfb28abad0fa6df.woff +0 -0
- package/build/static/media/Inter-SemiBoldItalic.d9467ee321a8f38aefff.woff2 +0 -0
- package/build/static/media/Inter-Thin.29b9c616a95a912abf73.woff +0 -0
- package/build/static/media/Inter-Thin.fff2a096db014f6239d4.woff2 +0 -0
- package/build/static/media/Inter-ThinItalic.bae95eb2f889c797e435.woff +0 -0
- package/build/static/media/Inter-ThinItalic.bf213704dce6b437ede4.woff2 +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see main.8c52ae96.js.LICENSE.txt */
|
|
2
|
-
!function(){var e={9423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e)};var r,o=n(8087),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},5685:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"===typeof e&&n.test(e)};var n=/-webkit-|-moz-|-ms-/;e.exports=t.default},4881:function(e){function t(e,t,n){var r,o,i,a,l;function s(){var u=Date.now()-a;u<t&&u>=0?r=setTimeout(s,t-u):(r=null,n||(l=e.apply(i,o),i=o=null))}null==t&&(t=100);var u=function(){i=this,o=arguments,a=Date.now();var u=n&&!r;return r||(r=setTimeout(s,t)),u&&(l=e.apply(i,o),i=o=null),l};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(l=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},u}t.debounce=t,e.exports=t},2753:function(e){e.exports=function(){"use strict";var e=Math.pow(2,-52),t=new Uint32Array(512),n=function(e){var t=e.length>>1;if(t>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;var n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()};function r(e,t){var n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function o(e,t,n,r){var o=e-n,i=t-r;return o*o+i*i}function i(e,t,n,r,o,i){var a=(r-t)*(o-e),l=(n-e)*(i-t);return Math.abs(a-l)>=33306690738754716e-32*Math.abs(a+l)?a-l:0}function a(e,t,n,r,o,a){return(i(o,a,e,t,n,r)||i(e,t,n,r,o,a)||i(n,r,o,a,e,t))<0}function l(e,t,n,r,o,i,a,l){var s=e-a,u=t-l,c=n-a,d=r-l,f=o-a,p=i-l,h=c*c+d*d,y=f*f+p*p;return s*(d*y-h*p)-u*(c*y-h*f)+(s*s+u*u)*(c*p-d*f)<0}function s(e,t,n,r,o,i){var a=n-e,l=r-t,s=o-e,u=i-t,c=a*a+l*l,d=s*s+u*u,f=.5/(a*u-l*s),p=(u*c-l*d)*f,h=(a*d-s*c)*f;return p*p+h*h}function u(e,t,n,r,o,i){var a=n-e,l=r-t,s=o-e,u=i-t,c=a*a+l*l,d=s*s+u*u,f=.5/(a*u-l*s);return{x:e+(u*c-l*d)*f,y:t+(a*d-s*c)*f}}function c(e,t,n,r){if(r-n<=20)for(var o=n+1;o<=r;o++){for(var i=e[o],a=t[i],l=o-1;l>=n&&t[e[l]]>a;)e[l+1]=e[l--];e[l+1]=i}else{var s=n+1,u=r;d(e,n+r>>1,s),t[e[n]]>t[e[r]]&&d(e,n,r),t[e[s]]>t[e[r]]&&d(e,s,r),t[e[n]]>t[e[s]]&&d(e,n,s);for(var f=e[s],p=t[f];;){do{s++}while(t[e[s]]<p);do{u--}while(t[e[u]]>p);if(u<s)break;d(e,s,u)}e[n+1]=e[u],e[u]=f,r-s+1>=u-n?(c(e,t,s,r),c(e,t,n,u-1)):(c(e,t,n,u-1),c(e,t,s,r))}}function d(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function f(e){return e[0]}function p(e){return e[1]}return n.from=function(e,t,r){void 0===t&&(t=f),void 0===r&&(r=p);for(var o=e.length,i=new Float64Array(2*o),a=0;a<o;a++){var l=e[a];i[2*a]=t(l),i[2*a+1]=r(l)}return new n(i)},n.prototype.update=function(){for(var t=this,n=t.coords,r=t._hullPrev,i=t._hullNext,l=t._hullTri,d=t._hullHash,f=n.length>>1,p=1/0,h=1/0,y=-1/0,g=-1/0,m=0;m<f;m++){var v=n[2*m],b=n[2*m+1];v<p&&(p=v),b<h&&(h=b),v>y&&(y=v),b>g&&(g=b),this._ids[m]=m}for(var x,w,j,S=(p+y)/2,k=(h+g)/2,C=1/0,_=0;_<f;_++){var O=o(S,k,n[2*_],n[2*_+1]);O<C&&(x=_,C=O)}var E=n[2*x],T=n[2*x+1];C=1/0;for(var P=0;P<f;P++)if(P!==x){var A=o(E,T,n[2*P],n[2*P+1]);A<C&&A>0&&(w=P,C=A)}for(var M=n[2*w],D=n[2*w+1],I=1/0,R=0;R<f;R++)if(R!==x&&R!==w){var N=s(E,T,M,D,n[2*R],n[2*R+1]);N<I&&(j=R,I=N)}var L=n[2*j],F=n[2*j+1];if(I===1/0){for(var B=0;B<f;B++)this._dists[B]=n[2*B]-n[0]||n[2*B+1]-n[1];c(this._ids,this._dists,0,f-1);for(var z=new Uint32Array(f),U=0,W=0,H=-1/0;W<f;W++){var K=this._ids[W];this._dists[K]>H&&(z[U++]=K,H=this._dists[K])}return this.hull=z.subarray(0,U),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(a(E,T,M,D,L,F)){var $=w,V=M,q=D;w=j,M=L,D=F,j=$,L=V,F=q}var G=u(E,T,M,D,L,F);this._cx=G.x,this._cy=G.y;for(var Y=0;Y<f;Y++)this._dists[Y]=o(n[2*Y],n[2*Y+1],G.x,G.y);c(this._ids,this._dists,0,f-1),this._hullStart=x;var Q=3;i[x]=r[j]=w,i[w]=r[x]=j,i[j]=r[w]=x,l[x]=0,l[w]=1,l[j]=2,d.fill(-1),d[this._hashKey(E,T)]=x,d[this._hashKey(M,D)]=w,d[this._hashKey(L,F)]=j,this.trianglesLen=0,this._addTriangle(x,w,j,-1,-1,-1);for(var X=0,Z=void 0,J=void 0;X<this._ids.length;X++){var ee=this._ids[X],te=n[2*ee],ne=n[2*ee+1];if(!(X>0&&Math.abs(te-Z)<=e&&Math.abs(ne-J)<=e)&&(Z=te,J=ne,ee!==x&&ee!==w&&ee!==j)){for(var re=0,oe=0,ie=this._hashKey(te,ne);oe<this._hashSize&&(-1===(re=d[(ie+oe)%this._hashSize])||re===i[re]);oe++);for(var ae=re=r[re],le=void 0;le=i[ae],!a(te,ne,n[2*ae],n[2*ae+1],n[2*le],n[2*le+1]);)if((ae=le)===re){ae=-1;break}if(-1!==ae){var se=this._addTriangle(ae,ee,i[ae],-1,-1,l[ae]);l[ee]=this._legalize(se+2),l[ae]=se,Q++;for(var ue=i[ae];le=i[ue],a(te,ne,n[2*ue],n[2*ue+1],n[2*le],n[2*le+1]);)se=this._addTriangle(ue,ee,le,l[ee],-1,l[ue]),l[ee]=this._legalize(se+2),i[ue]=ue,Q--,ue=le;if(ae===re)for(;a(te,ne,n[2*(le=r[ae])],n[2*le+1],n[2*ae],n[2*ae+1]);)se=this._addTriangle(le,ee,ae,-1,l[ae],l[le]),this._legalize(se+2),l[le]=se,i[ae]=ae,Q--,ae=le;this._hullStart=r[ee]=ae,i[ae]=r[ue]=ee,i[ee]=ue,d[this._hashKey(te,ne)]=ee,d[this._hashKey(n[2*ae],n[2*ae+1])]=ae}}}this.hull=new Uint32Array(Q);for(var ce=0,de=this._hullStart;ce<Q;ce++)this.hull[ce]=de,de=i[de];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)},n.prototype._hashKey=function(e,t){return Math.floor(r(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize},n.prototype._legalize=function(e){for(var n=this,r=n._triangles,o=n._halfedges,i=n.coords,a=0,s=0;;){var u=o[e],c=e-e%3;if(s=c+(e+2)%3,-1!==u){var d=u-u%3,f=c+(e+1)%3,p=d+(u+2)%3,h=r[s],y=r[e],g=r[f],m=r[p];if(l(i[2*h],i[2*h+1],i[2*y],i[2*y+1],i[2*g],i[2*g+1],i[2*m],i[2*m+1])){r[e]=m,r[u]=h;var v=o[p];if(-1===v){var b=this._hullStart;do{if(this._hullTri[b]===p){this._hullTri[b]=e;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(e,v),this._link(u,o[s]),this._link(s,p);var x=d+(u+1)%3;a<t.length&&(t[a++]=x)}else{if(0===a)break;e=t[--a]}}else{if(0===a)break;e=t[--a]}}return s},n.prototype._link=function(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)},n.prototype._addTriangle=function(e,t,n,r,o,i){var a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,o),this._link(a+2,i),this.trianglesLen+=3,a},n}()},6813:function(e,t,n){"use strict";t.Z=void 0;var r,o=(r=n(2753))&&r.__esModule?r:{default:r};function i(e){return e[0]}function a(e){return e[1]}function l(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var s=function(){function e(e){var t=new o.default(e);this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=t.coords,this._init(t)}var t=e.prototype;return t._init=function(e){var t=e,n=this.points;if(t.hull&&t.hull.length>2&&function(e){for(var t=e.triangles,n=e.coords,r=0;r<t.length;r+=3){var o=2*t[r],i=2*t[r+1],a=2*t[r+2];if((n[a]-n[o])*(n[i+1]-n[o+1])-(n[i]-n[o])*(n[a+1]-n[o+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},(function(e,t){return t})).sort((function(e,t){return n[2*e]-n[2*t]||n[2*e+1]-n[2*t+1]}));for(var r=this.collinear[0],i=this.collinear[this.collinear.length-1],a=[n[2*r],n[2*r+1],n[2*i],n[2*i+1]],s=1e-8*Math.sqrt(Math.pow(a[3]-a[1],2)+Math.pow(a[2]-a[0],2)),u=0,c=n.length/2;u<c;++u){var d=l(n[2*u],n[2*u+1],s);n[2*u]=d[0],n[2*u+1]=d[1]}e=new o.default(n)}for(var f=this.halfedges=e.halfedges,p=this.hull=e.hull,h=this.triangles=e.triangles,y=this.inedges.fill(-1),g=this._hullIndex.fill(-1),m=0,v=f.length;m<v;++m){var b=h[m%3===2?m-2:m+1];-1!==f[m]&&-1!==y[b]||(y[b]=m)}for(var x=0,w=p.length;x<w;++x)g[p[x]]=x;p.length<=2&&p.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=p[0],this.triangles[1]=p[1],this.triangles[2]=p[1],y[p[0]]=1,2===p.length&&(y[p[1]]=0))},t.neighbors=function(e){var t=[],n=this.inedges,r=this.hull,o=this._hullIndex,i=this.halfedges,a=this.triangles,l=n[e];if(-1===l)return t;var s=l,u=-1;do{if(u=a[s],t.push(u),a[s=s%3===2?s-2:s+1]!==e)break;if(-1===(s=i[s])){var c=r[(o[e]+1)%r.length];c!==u&&t.push(c);break}}while(s!==l);return t},t.find=function(e,t,n){if(void 0===n&&(n=0),(e=+e)!==e||(t=+t)!==t)return-1;for(var r,o=n;(r=this._step(n,e,t))>=0&&r!==n&&r!==o;)n=r;return r},t._step=function(e,t,n){var r=this.inedges,o=this.points;if(-1===r[e]||!o.length)return(e+1)%(o.length>>1);var i=e,a=Math.pow(t-o[2*e],2)+Math.pow(n-o[2*e+1],2),l=this.neighbors(e),s=Array.isArray(l),u=0;for(l=s?l:l[Symbol.iterator]();;){var c;if(s){if(u>=l.length)break;c=l[u++]}else{if((u=l.next()).done)break;c=u.value}var d=c,f=Math.pow(t-o[2*d],2)+Math.pow(n-o[2*d+1],2);f<a&&(a=f,i=d)}return i},e}();t.Z=s,s.from=function(e,t,n,r){return void 0===t&&(t=i),void 0===n&&(n=a),new s(function(e,t,n,r){for(var o=e.length,i=new Float64Array(2*o),a=0;a<o;++a){var l=e[a];i[2*a]=t.call(r,l,a,e),i[2*a+1]=n.call(r,l,a,e)}return i}(e,t,n,r))}},6881:function(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,l=60109,s=60110,u=60112,c=60113,d=60120,f=60115,p=60116,h=60121,y=60122,g=60117,m=60129,v=60131;if("function"===typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),o=b("react.fragment"),i=b("react.strict_mode"),a=b("react.profiler"),l=b("react.provider"),s=b("react.context"),u=b("react.forward_ref"),c=b("react.suspense"),d=b("react.suspense_list"),f=b("react.memo"),p=b("react.lazy"),h=b("react.block"),y=b("react.server.block"),g=b("react.fundamental"),m=b("react.debug_trace_mode"),v=b("react.legacy_hidden")}function x(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case c:case d:return e;default:switch(e=e&&e.$$typeof){case s:case u:case p:case f:case l:return e;default:return t}}case r:return t}}}},3612:function(e,t,n){"use strict";n(6881)},7276:function(e,t,n){var r;!function(){"use strict";var o=!("undefined"===typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},6184:function(e){"use strict";var t=/-(.)/g;e.exports=function(e){return e.replace(t,(function(e,t){return t.toUpperCase()}))}},5114:function(e,t,n){"use strict";var r=n(6184),o=/^-ms-/;e.exports=function(e){return r(e.replace(o,"ms-"))}},2341:function(e){"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},6791:function(e){"use strict";var t=/([A-Z])/g;e.exports=function(e){return e.replace(t,"-$1").toLowerCase()}},6800:function(e,t,n){"use strict";var r=n(6791),o=/^ms-/;e.exports=function(e){return r(e).replace(o,"-ms-")}},1963:function(e){"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},565:function(e,t,n){"use strict";var r=n(2341);e.exports=r},1803:function(){!function(){"use strict";function e(){var e=!0,t=!1,n=null,r={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function o(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function i(e){var t=e.type,n=e.tagName;return!("INPUT"!=n||!r[t]||e.readOnly)||"TEXTAREA"==n&&!e.readOnly||!!e.isContentEditable}function a(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function s(t){o(document.activeElement)&&a(document.activeElement),e=!0}function u(t){e=!1}function c(t){o(t.target)&&(e||i(t.target))&&a(t.target)}function d(e){o(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(t=!0,window.clearTimeout(n),n=window.setTimeout((function(){t=!1,window.clearTimeout(n)}),100),l(e.target))}function f(n){"hidden"==document.visibilityState&&(t&&(e=!0),p())}function p(){document.addEventListener("mousemove",y),document.addEventListener("mousedown",y),document.addEventListener("mouseup",y),document.addEventListener("pointermove",y),document.addEventListener("pointerdown",y),document.addEventListener("pointerup",y),document.addEventListener("touchmove",y),document.addEventListener("touchstart",y),document.addEventListener("touchend",y)}function h(){document.removeEventListener("mousemove",y),document.removeEventListener("mousedown",y),document.removeEventListener("mouseup",y),document.removeEventListener("pointermove",y),document.removeEventListener("pointerdown",y),document.removeEventListener("pointerup",y),document.removeEventListener("touchmove",y),document.removeEventListener("touchstart",y),document.removeEventListener("touchend",y)}function y(t){"html"!==t.target.nodeName.toLowerCase()&&(e=!1,h())}document.addEventListener("keydown",s,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("focus",c,!0),document.addEventListener("blur",d,!0),document.addEventListener("visibilitychange",f,!0),p(),document.body.classList.add("js-focus-visible")}function t(e){var t;function n(){t||(t=!0,e())}["interactive","complete"].indexOf(document.readyState)>=0?e():(t=!1,document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1))}"undefined"!==typeof document&&t(e)}()},5607:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowStart:!0,gridRowEnd:!0,gridColumn:!0,gridColumnStart:!0,gridColumnEnd:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var r=["Webkit","ms","Moz","O"];Object.keys(n).forEach((function(e){r.forEach((function(t){n[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=n[e]}))}));var o={isUnitlessNumber:n,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};t.default=o},7135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(5607));o(n(565));function o(e){return e&&e.__esModule?e:{default:e}}var i=r.default.isUnitlessNumber;t.default=function(e,t,n){return null==t||"boolean"===typeof t||""===t?"":isNaN(t)||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"===typeof t&&(t=t.trim()),t+"px")}},373:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processStyleName=void 0,t.createMarkupForStyles=function(e,t){var n="";for(var o in e){var i=0===o.indexOf("--");if(e.hasOwnProperty(o)&&"label"!==o){var a=e[o];0,null!=a&&(i?n+=o+":"+a+";":(n+=l(o)+":",n+=(0,r.default)(o,a,t)+";"))}}return n||null};a(n(5114));var r=a(n(7135)),o=a(n(6800)),i=a(n(1963));a(n(565));function a(e){return e&&e.__esModule?e:{default:e}}var l=t.processStyleName=(0,i.default)(o.default)},578:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e){if(function(e){return null===e||void 0===e||!1===e||"object"===("undefined"===typeof e?"undefined":n(e))&&0===Object.keys(e).length}(e))return null;if("object"!==("undefined"===typeof e?"undefined":n(e)))return e;for(var t={},r=Object.keys(e),i=!1,a=0;a<r.length;a++){var l=e[r[a]],s=o(l);null!==s&&s===l||(i=!0),null!==s&&(t[r[a]]=s)}return 0===Object.keys(t).length?null:i?t:e}function o(e){return Array.isArray(e)?function(e){var t=!1,n=[];return e.forEach((function(e){var r=o(e);null!==r&&r===e||(t=!0),null!==r&&n.push(r)})),0==n.length?null:t?n:e}(e):r(e)}t.default=o},5726:function(e,t){"use strict";function n(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function r(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function o(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var i=1540483477,a=t^e.length,l=e.length,s=0;for(;l>=4;){var u=n(e,s);u=o(u,i),u=o(u^=u>>>24,i),a=o(a,i),a^=u,s+=4,l-=4}switch(l){case 3:a^=r(e,s),a=o(a^=e.charCodeAt(s+2)<<16,i);break;case 2:a=o(a^=r(e,s),i);break;case 1:a=o(a^=e.charCodeAt(s),i)}return a=o(a^=a>>>13,i),(a^=a>>>15)>>>0}},6634:function(e,t,n){"use strict";t.iv=V,t.BC=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return V(c({},"@media "+e,n))},t.bb=function(e){return Y("::before",e)};var r=u(n(5832)),o=n(6349),i=n(373),a=u(n(578)),l=n(5221),s=u(n(5726));function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=new o.StyleSheet;d.inject();var f=d.plugins=new l.PluginSet([l.prefixes,l.contentWrap,l.fallbacks]);f.media=new l.PluginSet,f.fontFace=new l.PluginSet,f.keyframes=new l.PluginSet([l.prefixes,l.fallbacks]);var p=!1,h=!1,y="undefined"!==typeof window,g=p,m=!1,v=!1;var b=p;function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.toLowerCase().replace(/[^a-z0-9]/g,t)}function w(e){var t=JSON.stringify(e),n=(0,s.default)(t).toString(36);return e.label&&e.label.length>0&&p?x(e.label.join("."),"-")+"-"+n:n}function j(e){var t=Object.keys(e).filter((function(e){return"toString"!==e}));return 1===t.length&&!!/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0])}function S(e){var t=Object.keys(e).filter((function(e){return"toString"!==e}));if(1!==t.length)throw new Error("not a rule");var n=/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0]);if(!n)throw new Error("not a rule");return n[1]}var k=/[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g;function C(e){if(-1===e.indexOf(","))return[e];for(var t,n=[],r=[],o=0;t=k.exec(e);)switch(t[0]){case"(":o++;break;case")":o--;break;case",":if(o)break;n.push(t.index)}for(t=n.length;t--;)r.unshift(e.slice(n[t]+1)),e=e.slice(0,n[t]);return r.unshift(e),r}function _(e,t){if(!e)return t.replace(/\&/g,"");if(!t)return".css-"+e+",[data-css-"+e+"]";var n=C(t).map((function(t){return t.indexOf("&")>=0?[t.replace(/\&/gm,".css-"+e),t.replace(/\&/gm,"[data-css-"+e+"]")].join(","):".css-"+e+t+",[data-css-"+e+"]"+t})).join(",");return g&&/^\&\:/.exec(t)&&!/\s/.exec(t)&&(n+=",.css-"+e+"[data-simulate-"+x(t)+"],[data-css-"+e+"][data-simulate-"+x(t)+"]"),n}function O(e){var t=e.selector,n=e.style,r=f.transform({selector:t,style:n});return r.selector+"{"+(0,i.createMarkupForStyles)(r.style)+"}"}function E(e){var t=void 0,n=void 0,r=void 0,o=void 0;return Object.keys(e).forEach((function(i){i.indexOf("&")>=0?(n=n||{})[i]=e[i]:0===i.indexOf("@media")?(r=r||{})[i]=E(e[i]):0===i.indexOf("@supports")?(o=o||{})[i]=E(e[i]):"label"===i?e.label.length>0&&((t=t||{}).label=b?e.label.join("."):""):(t=t||{})[i]=e[i]})),{plain:t,selects:n,medias:r,supports:o}}function T(e,t){var n=[],r=t.plain,o=t.selects,i=t.medias,a=t.supports;return r&&n.push(O({style:r,selector:_(e)})),o&&Object.keys(o).forEach((function(t){return n.push(O({style:o[t],selector:_(e,t)}))})),i&&Object.keys(i).forEach((function(t){return n.push(t+"{"+T(e,i[t]).join("")+"}")})),a&&Object.keys(a).forEach((function(t){return n.push(t+"{"+T(e,a[t]).join("")+"}")})),n}var P=d.inserted={};var A=d.registered={};function M(e){A[e.id]||(A[e.id]=e)}var D={};function I(e){if(M(e),function(e){if(!P[e.id]){P[e.id]=!0;var t=E(e.style),n=T(e.id,t);P[e.id]=!!y||n,n.forEach((function(e){return d.insert(e)}))}}(e),D[e.id])return D[e.id];var t=c({},"data-css-"+e.id,b&&e.label||"");return Object.defineProperty(t,"toString",{enumerable:!1,value:function(){return"css-"+e.id}}),D[e.id]=t,t}function R(e,t){var n=C(e).map((function(e){return e.indexOf("&")>=0?e:"&"+e})),r=C(t).map((function(e){return e.indexOf("&")>=0?e:"&"+e}));return r.reduce((function(e,t){return e.concat(n.map((function(e){return t.replace(/\&/g,e)})))}),[]).join(",")}function N(e,t){return e?"@supports "+e.substring(9)+" and "+t.substring(9):t}function L(e){for(var t=[],n=0;n<e.length;n++)t=Array.isArray(e[n])?t.concat(L(e[n])):t.concat(e[n]);return t}var F={"::placeholder":["::-webkit-input-placeholder","::-moz-placeholder","::-ms-input-placeholder"],":fullscreen":[":-webkit-full-screen",":-moz-full-screen",":-ms-fullscreen"]};function B(e,t){var n=t.selector,r=void 0===n?"":n,o=t.mq,i=void 0===o?"":o,l=t.supp,s=void 0===l?"":l,u=t.src,c=void 0===u?{}:u;Array.isArray(c)||(c=[c]),(c=L(c)).forEach((function(t){if(j(t)){var n=function(e){if(j(e)){var t=A[S(e)];if(null==t)throw new Error("[glamor] an unexpected rule cache miss occurred. This is probably a sign of multiple glamor instances in your app. See https://github.com/threepointone/glamor/issues/79");return t}return e}(t);if("css"!==n.type)throw new Error("cannot merge this rule");t=n.style}(t=(0,a.default)(t))&&t.composes&&B(e,{selector:r,mq:i,supp:s,src:t.composes}),Object.keys(t||{}).forEach((function(n){if(function(e){for(var t=[":",".","[",">"," "],n=!1,r=e.charAt(0),o=0;o<t.length;o++)if(r===t[o]){n=!0;break}return n||e.indexOf("&")>=0}(n))F[n]&&F[n].forEach((function(o){return B(e,{selector:R(r,o),mq:i,supp:s,src:t[n]})})),B(e,{selector:R(r,n),mq:i,supp:s,src:t[n]});else if(function(e){return 0===e.indexOf("@media")}(n))B(e,{selector:r,mq:(a=i,l=n,a?"@media "+a.substring(6)+" and "+l.substring(6):l),supp:s,src:t[n]});else if(function(e){return 0===e.indexOf("@supports")}(n))B(e,{selector:r,mq:i,supp:N(s,n),src:t[n]});else if("composes"===n);else{var o=e;s&&(o[s]=o[s]||{},o=o[s]),i&&(o[i]=o[i]||{},o=o[i]),r&&(o[r]=o[r]||{},o=o[r]),"label"===n?b&&(e.label=e.label.concat(t.label)):o[n]=t[n]}var a,l}))}))}function z(e){var t={label:[]};return B(t,{src:e}),I({id:w(t),style:t,label:b?t.label.join("."):"",type:"css"})}var U={};Object.defineProperty(U,"toString",{enumerable:!1,value:function(){return"css-nil"}});var W="undefined"!==typeof WeakMap?[U,new WeakMap,new WeakMap,new WeakMap]:[U],H=!1;var K,$="undefined"!==typeof WeakMap?(K=z,function(e){if(W[e.length]){for(var t=W[e.length],n=0;n<e.length-1;)t.has(e[n])||t.set(e[n],new WeakMap),t=t.get(e[n]),n++;if(t.has(e[e.length-1])){var r=t.get(e[n]);if(A[r.toString().substring(4)])return r}}var o=K(e);if(W[e.length]){for(var i=0,a=W[e.length];i<e.length-1;)a=a.get(e[i]),i++;try{a.set(e[i],o)}catch(s){var l;p&&!H&&(H=!0,(l=console).warn.apply(l,["failed setting the WeakMap cache for args:"].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e))),console.warn("this should NOT happen, please file a bug on the github repo."))}}return o}):z;function V(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t[0]&&t[0].length&&t[0].raw)throw new Error("you forgot to include glamor/babel in your babel plugins.");return(t=(0,a.default)(t))?$(t):U}V.insert=function(e){var t={id:w(e),css:e,type:"raw"};M(t),P[t.id]||(d.insert(t.css),P[t.id]=!!y||[t.css])};V.insert;V.global=function(e,t){if(t=(0,a.default)(t))return V.insert(O({selector:e,style:t}))};V.global;V.keyframes=function(e,t){t||(t=e,e="animation");var n={id:w({name:e,kfs:t=(0,a.default)(t)||{}}),type:"keyframes",name:e,keyframes:t};return M(n),function(e){if(!P[e.id]){var t=Object.keys(e.keyframes).map((function(t){var n=f.keyframes.transform({id:e.id,name:t,style:e.keyframes[t]});return n.name+"{"+(0,i.createMarkupForStyles)(n.style)+"}"})).join(""),n=["-webkit-","-moz-","-o-",""].map((function(n){return"@"+n+"keyframes "+e.name+"_"+e.id+"{"+t+"}"}));n.forEach((function(e){return d.insert(e)})),P[e.id]=!!y||n}}(n),e+"_"+n.id},V.fontFace=function(e){var t={id:w(e=(0,a.default)(e)),type:"font-face",font:e};return M(t),function(e){if(!P[e.id]){var t="@font-face{"+(0,i.createMarkupForStyles)(e.font)+"}";d.insert(t),P[e.id]=!!y||[t]}}(t),e.fontFamily};V.fontFace,V.keyframes;var q=V;function G(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e?V(c({},e,n)):q(n)}function Y(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return V(c({},e,n))}},5221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.PluginSet=u,t.fallbacks=function(e){if(Object.keys(e.style).map((function(t){return Array.isArray(e.style[t])})).indexOf(!0)>=0){var t=e.style,n=Object.keys(t).reduce((function(e,n){return e[n]=Array.isArray(t[n])?t[n].join("; "+(0,i.processStyleName)(n)+": "):t[n],e}),{});return(0,o.default)({},e,{style:n})}return e},t.contentWrap=function(e){if(e.style.content){var t=e.style.content;return c.indexOf(t)>=0||/^(attr|calc|counters?|url)\(/.test(t)?e:t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)?r({},e,{style:r({},e.style,{content:'"'+t+'"'})}):e}return e},t.prefixes=function(e){return(0,o.default)({},e,{style:(0,a.default)(r({},e.style))})};var o=l(n(5832)),i=n(373),a=l(n(8490));function l(e){return e&&e.__esModule?e:{default:e}}var s=!1;function u(e){this.fns=e||[]}(0,o.default)(u.prototype,{add:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach((function(t){e.fns.indexOf(t)>=0?s&&console.warn("adding the same plugin again, ignoring"):e.fns=[t].concat(e.fns)}))},remove:function(e){this.fns=this.fns.filter((function(t){return t!==e}))},clear:function(){this.fns=[]},transform:function(e){return this.fns.reduce((function(e,t){return t(e)}),e)}});var c=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit"]},8490:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t in e){var n=e[t],r=(0,i.default)(m,t,n,e,v);r&&(e[t]=r),(0,o.default)(v,t,e)}return e};var r=g(n(5699)),o=g(n(4761)),i=g(n(5485)),a=g(n(9733)),l=g(n(3425)),s=g(n(4214)),u=g(n(2518)),c=g(n(2105)),d=g(n(5441)),f=g(n(3047)),p=g(n(3920)),h=g(n(5180)),y=g(n(3886));function g(e){return e&&e.__esModule?e:{default:e}}var m=[l.default,a.default,s.default,c.default,d.default,f.default,p.default,h.default,y.default,u.default],v=r.default.prefixMap},6349:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StyleSheet=p;var r,o=n(5832),i=(r=o)&&r.__esModule?r:{default:r};function a(e){return e[e.length-1]}function l(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}var s="undefined"!==typeof window,u=!1,c=!1,d=function(){if(s){var e=document.createElement("div");return e.innerHTML="\x3c!--[if lt IE 10]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}}();function f(){var e=document.createElement("style");return e.type="text/css",e.setAttribute("data-glamor",""),e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.speedy,n=void 0===t?!u&&!c:t,r=e.maxLength,o=void 0===r?s&&d?4e3:65e3:r;this.isSpeedy=n,this.sheet=void 0,this.tags=[],this.maxLength=o,this.ctr=0}(0,i.default)(p.prototype,{getSheet:function(){return l(a(this.tags))},inject:function(){var e=this;if(this.injected)throw new Error("already injected stylesheet!");s?this.tags[0]=f():this.sheet={cssRules:[],insertRule:function(t){e.sheet.cssRules.push({cssText:t})}},this.injected=!0},speedy:function(e){if(0!==this.ctr)throw new Error("cannot change speedy mode after inserting any rule to sheet. Either call speedy("+e+") earlier in your app, or call flush() before speedy("+e+")");this.isSpeedy=!!e},_insert:function(e){try{var t=this.getSheet();t.insertRule(e,-1!==e.indexOf("@import")?0:t.cssRules.length)}catch(n){u&&console.warn("whoops, illegal rule inserted",e)}},insert:function(e){if(s)if(this.isSpeedy&&this.getSheet().insertRule)this._insert(e);else if(-1!==e.indexOf("@import")){var t=a(this.tags);t.insertBefore(document.createTextNode(e),t.firstChild)}else a(this.tags).appendChild(document.createTextNode(e));else this.sheet.insertRule(e,-1!==e.indexOf("@import")?0:this.sheet.cssRules.length);return this.ctr++,s&&this.ctr%this.maxLength===0&&this.tags.push(f()),this.ctr-1},delete:function(e){return this.replace(e,"")},flush:function(){s?(this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.sheet=null,this.ctr=0):this.sheet.cssRules=[],this.injected=!1},rules:function(){if(!s)return this.sheet.cssRules;var e=[];return this.tags.forEach((function(t){return e.splice.apply(e,[e.length,0].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Array.from(l(t).cssRules))))})),e}})},7204:function(e,t,n){"use strict";var r=n(5412),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?a:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var l=s(t),y=s(n),g=0;g<a.length;++g){var m=a[g];if(!i[m]&&(!r||!r[m])&&(!y||!y[m])&&(!l||!l[m])){var v=f(n,m);try{u(t,m,v)}catch(b){}}}}return t}},8087:function(e,t,n){"use strict";n.r(t);var r=/[A-Z]/g,o=/^ms-/,i={};function a(e){return"-"+e.toLowerCase()}t.default=function(e){if(i.hasOwnProperty(e))return i[e];var t=e.replace(r,a);return i[e]=o.test(t)?"-"+t:t}},3425:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&t.indexOf("cross-fade(")>-1)return a.map((function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-",""];e.exports=t.default},9733:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("cursor"===e&&r.hasOwnProperty(t))return n.map((function(e){return e+t}))};var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};e.exports=t.default},4214:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&t.indexOf("filter(")>-1)return a.map((function(e){return t.replace(/filter\(/g,e+"filter(")}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-",""];e.exports=t.default},2518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("display"===e&&n.hasOwnProperty(t))return n[t]};var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};e.exports=t.default},2105:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,o){"flexDirection"===e&&"string"===typeof t&&(t.indexOf("column")>-1?o.WebkitBoxOrient="vertical":o.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?o.WebkitBoxDirection="reverse":o.WebkitBoxDirection="normal");r.hasOwnProperty(e)&&(o[r[e]]=n[t]||t)};var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},r={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};e.exports=t.default},5441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&l.test(t))return a.map((function(e){return e+t}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-","-moz-",""],l=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},3047:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"===typeof t&&!(0,i.default)(t)&&t.indexOf("image-set(")>-1)return a.map((function(e){return t.replace(/image-set\(/g,e+"image-set(")}))};var r,o=n(5685),i=(r=o)&&r.__esModule?r:{default:r};var a=["-webkit-",""];e.exports=t.default},3920:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]},e.exports=t.default},5180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(r.hasOwnProperty(e)&&o.hasOwnProperty(t))return n.map((function(e){return e+t}))};var n=["-webkit-","-moz-",""],r={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},o={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},3886:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a){if("string"===typeof t&&l.hasOwnProperty(e)){var u=function(e,t){if((0,o.default)(e))return e;for(var n=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),i=0,a=n.length;i<a;++i){var l=n[i],u=[l];for(var c in t){var d=(0,r.default)(c);if(l.indexOf(d)>-1&&"order"!==d)for(var f=t[c],p=0,h=f.length;p<h;++p)u.unshift(l.replace(d,s[f[p]]+d))}n[i]=u.join(",")}return n.join(",")}(t,a),c=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-moz-|-ms-/.test(e)})).join(",");if(e.indexOf("Webkit")>-1)return c;var d=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(e){return!/-webkit-|-ms-/.test(e)})).join(",");return e.indexOf("Moz")>-1?d:(n["Webkit"+(0,i.default)(e)]=c,n["Moz"+(0,i.default)(e)]=d,u)}};var r=a(n(9423)),o=a(n(5685)),i=a(n(6059));function a(e){return e&&e.__esModule?e:{default:e}}var l={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},s={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};e.exports=t.default},5699:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["Webkit"],r=["Moz"],o=["ms"],i=["Webkit","Moz"],a=["Webkit","ms"],l=["Webkit","Moz","ms"];t.default={plugins:[],prefixMap:{appearance:i,userSelect:l,textEmphasisPosition:n,textEmphasis:n,textEmphasisStyle:n,textEmphasisColor:n,boxDecorationBreak:n,clipPath:n,maskImage:n,maskMode:n,maskRepeat:n,maskPosition:n,maskClip:n,maskOrigin:n,maskSize:n,maskComposite:n,mask:n,maskBorderSource:n,maskBorderMode:n,maskBorderSlice:n,maskBorderWidth:n,maskBorderOutset:n,maskBorderRepeat:n,maskBorder:n,maskType:n,textDecorationStyle:n,textDecorationSkip:n,textDecorationLine:n,textDecorationColor:n,filter:n,fontFeatureSettings:n,breakAfter:l,breakBefore:l,breakInside:l,columnCount:i,columnFill:i,columnGap:i,columnRule:i,columnRuleColor:i,columnRuleStyle:i,columnRuleWidth:i,columns:i,columnSpan:i,columnWidth:i,writingMode:a,flex:n,flexBasis:n,flexDirection:n,flexGrow:n,flexFlow:n,flexShrink:n,flexWrap:n,alignContent:n,alignItems:n,alignSelf:n,justifyContent:n,order:n,transform:n,transformOrigin:n,transformOriginX:n,transformOriginY:n,backfaceVisibility:n,perspective:n,perspectiveOrigin:n,transformStyle:n,transformOriginZ:n,animation:n,animationDelay:n,animationDirection:n,animationFillMode:n,animationDuration:n,animationIterationCount:n,animationName:n,animationPlayState:n,animationTimingFunction:n,backdropFilter:n,fontKerning:n,scrollSnapType:a,scrollSnapPointsX:a,scrollSnapPointsY:a,scrollSnapDestination:a,scrollSnapCoordinate:a,shapeImageThreshold:n,shapeImageMargin:n,shapeImageOutside:n,hyphens:l,flowInto:a,flowFrom:a,regionFragment:a,textAlignLast:r,tabSize:r,wrapFlow:o,wrapThrough:o,wrapMargin:o,gridTemplateColumns:o,gridTemplateRows:o,gridTemplateAreas:o,gridTemplate:o,gridAutoColumns:o,gridAutoRows:o,gridAutoFlow:o,grid:o,gridRowStart:o,gridColumnStart:o,gridRowEnd:o,gridRow:o,gridColumn:o,gridColumnEnd:o,gridColumnGap:o,gridRowGap:o,gridArea:o,gridGap:o,textSizeAdjust:a,borderImage:n,borderImageOutset:n,borderImageRepeat:n,borderImageSlice:n,borderImageSource:n,borderImageWidth:n,transitionDelay:n,transitionDuration:n,transitionProperty:n,transitionTimingFunction:n}},e.exports=t.default},6059:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},4761:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(e.hasOwnProperty(t))for(var r=e[t],o=0,a=r.length;o<a;++o)n[r[o]+(0,i.default)(t)]=n[t]};var r,o=n(6059),i=(r=o)&&r.__esModule?r:{default:r};e.exports=t.default},5485:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,o){for(var i=0,a=e.length;i<a;++i){var l=e[i](t,n,r,o);if(l)return l}},e.exports=t.default},2211:function(e,t){function n(e,t){var n=[],r=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}}(e.exports=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)}).getSerialize=n},3685:function(e,t,n){var r=n(314)(n(8645),"DataView");e.exports=r},9006:function(e,t,n){var r=n(9852),o=n(488),i=n(7671),a=n(4095),l=n(424);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=l,e.exports=s},1146:function(e,t,n){var r=n(207),o=n(7938),i=n(4786),a=n(5952),l=n(8041);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=l,e.exports=s},5103:function(e,t,n){var r=n(314)(n(8645),"Map");e.exports=r},5666:function(e,t,n){var r=n(3802),o=n(1201),i=n(9930),a=n(1076),l=n(4117);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=l,e.exports=s},6667:function(e,t,n){var r=n(314)(n(8645),"Promise");e.exports=r},1560:function(e,t,n){var r=n(314)(n(8645),"Set");e.exports=r},8193:function(e,t,n){var r=n(5666),o=n(4285),i=n(83);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,e.exports=a},6823:function(e,t,n){var r=n(1146),o=n(9035),i=n(5258),a=n(4877),l=n(6110),s=n(8408);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=l,u.prototype.set=s,e.exports=u},471:function(e,t,n){var r=n(8645).Symbol;e.exports=r},7370:function(e,t,n){var r=n(8645).Uint8Array;e.exports=r},2345:function(e,t,n){var r=n(314)(n(8645),"WeakMap");e.exports=r},292:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3146:function(e){e.exports=function(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}},9302:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},1005:function(e,t,n){var r=n(9849);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},5410:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},1366:function(e,t,n){var r=n(1240),o=n(8105),i=n(1627),a=n(7178),l=n(986),s=n(5919),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),c=!n&&o(e),d=!n&&!c&&a(e),f=!n&&!c&&!d&&s(e),p=n||c||d||f,h=p?r(e.length,String):[],y=h.length;for(var g in e)!t&&!u.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,y))||h.push(g);return h}},1624:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},6548:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},8049:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},468:function(e,t,n){var r=n(1450),o=n(6245),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},751:function(e,t,n){var r=n(6245);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},3002:function(e,t,n){var r=n(2492);e.exports=function(e,t,n,o){return r(e,(function(e,r,i){t(o,e,n(e),i)})),o}},1450:function(e,t,n){var r=n(5214);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},5775:function(e,t,n){var r=n(8193),o=n(1005),i=n(5410),a=n(1624),l=n(7651),s=n(866),u=200;e.exports=function(e,t,n,c){var d=-1,f=o,p=!0,h=e.length,y=[],g=t.length;if(!h)return y;n&&(t=a(t,l(n))),c?(f=i,p=!1):t.length>=u&&(f=s,p=!1,t=new r(t));e:for(;++d<h;){var m=e[d],v=null==n?m:n(m);if(m=c||0!==m?m:0,p&&v===v){for(var b=g;b--;)if(t[b]===v)continue e;y.push(m)}else f(t,v,c)||y.push(m)}return y}},2492:function(e,t,n){var r=n(3226),o=n(7162)(r);e.exports=o},136:function(e){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},2335:function(e,t,n){var r=n(6548),o=n(2983);e.exports=function e(t,n,i,a,l){var s=-1,u=t.length;for(i||(i=o),l||(l=[]);++s<u;){var c=t[s];n>0&&i(c)?n>1?e(c,n-1,i,a,l):r(l,c):a||(l[l.length]=c)}return l}},1611:function(e,t,n){var r=n(7311)();e.exports=r},3226:function(e,t,n){var r=n(1611),o=n(8034);e.exports=function(e,t){return e&&r(e,t,o)}},7273:function(e,t,n){var r=n(6969),o=n(9560);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},4821:function(e,t,n){var r=n(6548),o=n(1627);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},6306:function(e,t,n){var r=n(471),o=n(1953),i=n(6504),a="[object Null]",l="[object Undefined]",s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?l:a:s&&s in Object(e)?o(e):i(e)}},5249:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},9849:function(e,t,n){var r=n(136),o=n(3718),i=n(5267);e.exports=function(e,t,n){return t===t?i(e,t,n):r(e,o,n)}},3269:function(e,t,n){var r=n(3226);e.exports=function(e,t,n,o){return r(e,(function(e,r,i){t(o,n(e),r,i)})),o}},6211:function(e,t,n){var r=n(6306),o=n(5438),i="[object Arguments]";e.exports=function(e){return o(e)&&r(e)==i}},8603:function(e,t,n){var r=n(6306),o=n(5438),i="[object Date]";e.exports=function(e){return o(e)&&r(e)==i}},816:function(e,t,n){var r=n(1619),o=n(5438);e.exports=function e(t,n,i,a,l){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!==t&&n!==n:r(t,n,i,a,e,l))}},1619:function(e,t,n){var r=n(6823),o=n(1921),i=n(7840),a=n(2774),l=n(7213),s=n(1627),u=n(7178),c=n(5919),d=1,f="[object Arguments]",p="[object Array]",h="[object Object]",y=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,v){var b=s(e),x=s(t),w=b?p:l(e),j=x?p:l(t),S=(w=w==f?h:w)==h,k=(j=j==f?h:j)==h,C=w==j;if(C&&u(e)){if(!u(t))return!1;b=!0,S=!1}if(C&&!S)return v||(v=new r),b||c(e)?o(e,t,n,g,m,v):i(e,t,w,n,g,m,v);if(!(n&d)){var _=S&&y.call(e,"__wrapped__"),O=k&&y.call(t,"__wrapped__");if(_||O){var E=_?e.value():e,T=O?t.value():t;return v||(v=new r),m(E,T,n,g,v)}}return!!C&&(v||(v=new r),a(e,t,n,g,m,v))}},3724:function(e,t,n){var r=n(6823),o=n(816),i=1,a=2;e.exports=function(e,t,n,l){var s=n.length,u=s,c=!l;if(null==e)return!u;for(e=Object(e);s--;){var d=n[s];if(c&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++s<u;){var f=(d=n[s])[0],p=e[f],h=d[1];if(c&&d[2]){if(void 0===p&&!(f in e))return!1}else{var y=new r;if(l)var g=l(p,h,f,e,t,y);if(!(void 0===g?o(h,p,i|a,l,y):g))return!1}}return!0}},3718:function(e){e.exports=function(e){return e!==e}},2937:function(e,t,n){var r=n(6405),o=n(2637),i=n(3329),a=n(8980),l=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,c=s.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:l).test(a(e))}},2567:function(e,t,n){var r=n(6306),o=n(5438),i="[object RegExp]";e.exports=function(e){return o(e)&&r(e)==i}},1553:function(e,t,n){var r=n(6306),o=n(9993),i=n(5438),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},4860:function(e,t,n){var r=n(4307),o=n(5837),i=n(4008),a=n(1627),l=n(3686);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):l(e)}},1167:function(e,t,n){var r=n(1311),o=n(4843),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},9158:function(e,t,n){var r=n(3329),o=n(1311),i=n(6930),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var l in e)("constructor"!=l||!t&&a.call(e,l))&&n.push(l);return n}},8828:function(e,t,n){var r=n(2492),o=n(3709);e.exports=function(e,t){var n=-1,i=o(e)?Array(e.length):[];return r(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}},4307:function(e,t,n){var r=n(3724),o=n(4396),i=n(9669);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},5837:function(e,t,n){var r=n(816),o=n(7714),i=n(1503),a=n(5417),l=n(1259),s=n(9669),u=n(9560),c=1,d=2;e.exports=function(e,t){return a(e)&&l(t)?s(u(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?i(n,e):r(t,a,c|d)}}},300:function(e,t,n){var r=n(1624),o=n(7273),i=n(4860),a=n(8828),l=n(9054),s=n(7651),u=n(2720),c=n(4008),d=n(1627);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e})):[c];var f=-1;t=r(t,s(i));var p=a(e,(function(e,n,o){return{criteria:r(t,(function(t){return t(e)})),index:++f,value:e}}));return l(p,(function(e,t){return u(e,t,n)}))}},2636:function(e,t,n){var r=n(3472),o=n(1503);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},3472:function(e,t,n){var r=n(7273),o=n(4282),i=n(6969);e.exports=function(e,t,n){for(var a=-1,l=t.length,s={};++a<l;){var u=t[a],c=r(e,u);n(c,u)&&o(s,i(u,e),c)}return s}},1474:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},862:function(e,t,n){var r=n(7273);e.exports=function(e){return function(t){return r(t,e)}}},2334:function(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,i){for(var a=-1,l=n(t((r-e)/(o||1)),0),s=Array(l);l--;)s[i?l:++a]=e,e+=o;return s}},4241:function(e,t,n){var r=n(4008),o=n(947),i=n(2054);e.exports=function(e,t){return i(o(e,t,r),e+"")}},4282:function(e,t,n){var r=n(468),o=n(6969),i=n(986),a=n(3329),l=n(9560);e.exports=function(e,t,n,s){if(!a(e))return e;for(var u=-1,c=(t=o(t,e)).length,d=c-1,f=e;null!=f&&++u<c;){var p=l(t[u]),h=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=d){var y=f[p];void 0===(h=s?s(y,p,f):void 0)&&(h=a(y)?y:i(t[u+1])?[]:{})}r(f,p,h),f=f[p]}return e}},2531:function(e,t,n){var r=n(7074),o=n(5214),i=n(4008),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=a},1878:function(e,t,n){var r=n(2492);e.exports=function(e,t){var n;return r(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}},9054:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},4033:function(e,t,n){var r=n(6245);e.exports=function(e,t){for(var n=-1,o=e.length,i=0,a=[];++n<o;){var l=e[n],s=t?t(l):l;if(!n||!r(s,u)){var u=s;a[i++]=0===l?0:l}}return a}},1240:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},6474:function(e,t,n){var r=n(471),o=n(1624),i=n(1627),a=n(8727),l=1/0,s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(a(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},9298:function(e,t,n){var r=n(6088),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},7651:function(e){e.exports=function(e){return function(t){return e(t)}}},5386:function(e,t,n){var r=n(8193),o=n(1005),i=n(5410),a=n(866),l=n(8510),s=n(4355),u=200;e.exports=function(e,t,n){var c=-1,d=o,f=e.length,p=!0,h=[],y=h;if(n)p=!1,d=i;else if(f>=u){var g=t?null:l(e);if(g)return s(g);p=!1,d=a,y=new r}else y=t?[]:h;e:for(;++c<f;){var m=e[c],v=t?t(m):m;if(m=n||0!==m?m:0,p&&v===v){for(var b=y.length;b--;)if(y[b]===v)continue e;t&&y.push(v),h.push(m)}else d(y,v,n)||(y!==h&&y.push(v),h.push(m))}return h}},7412:function(e,t,n){var r=n(1624);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},866:function(e){e.exports=function(e,t){return e.has(t)}},6969:function(e,t,n){var r=n(1627),o=n(5417),i=n(4293),a=n(6199);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(a(e))}},5432:function(e,t,n){var r=n(8727);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,i=e===e,a=r(e),l=void 0!==t,s=null===t,u=t===t,c=r(t);if(!s&&!c&&!a&&e>t||a&&l&&u&&!s&&!c||o&&l&&u||!n&&u||!i)return 1;if(!o&&!a&&!c&&e<t||c&&n&&i&&!o&&!a||s&&n&&i||!l&&i||!u)return-1}return 0}},2720:function(e,t,n){var r=n(5432);e.exports=function(e,t,n){for(var o=-1,i=e.criteria,a=t.criteria,l=i.length,s=n.length;++o<l;){var u=r(i[o],a[o]);if(u)return o>=s?u:u*("desc"==n[o]?-1:1)}return e.index-t.index}},7485:function(e,t,n){var r=n(468),o=n(1450);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var l=-1,s=t.length;++l<s;){var u=t[l],c=i?i(n[u],e[u],u,n,e):void 0;void 0===c&&(c=e[u]),a?o(n,u,c):r(n,u,c)}return n}},6655:function(e,t,n){var r=n(8645)["__core-js_shared__"];e.exports=r},7:function(e,t,n){var r=n(3146),o=n(3002),i=n(4860),a=n(1627);e.exports=function(e,t){return function(n,l){var s=a(n)?r:o,u=t?t():{};return s(n,e,i(l,2),u)}}},9685:function(e,t,n){var r=n(4241),o=n(4890);e.exports=function(e){return r((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,l=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,l&&o(n[0],n[1],l)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))}},7162:function(e,t,n){var r=n(3709);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,a=t?i:-1,l=Object(n);(t?a--:++a<i)&&!1!==o(l[a],a,l););return n}}},7311:function(e){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}},3419:function(e,t,n){var r=n(4860),o=n(3709),i=n(8034);e.exports=function(e){return function(t,n,a){var l=Object(t);if(!o(t)){var s=r(n,3);t=i(t),n=function(e){return s(l[e],e,l)}}var u=e(t,n,a);return u>-1?l[s?t[u]:u]:void 0}}},7561:function(e,t,n){var r=n(3269);e.exports=function(e,t){return function(n,o){return r(n,e,t(o),{})}}},3866:function(e,t,n){var r=n(2334),o=n(4890),i=n(7930);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&o(t,n,a)&&(n=a=void 0),t=i(t),void 0===n?(n=t,t=0):n=i(n),a=void 0===a?t<n?1:-1:i(a),r(t,n,a,e)}}},8510:function(e,t,n){var r=n(1560),o=n(5624),i=n(4355),a=r&&1/i(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=a},5214:function(e,t,n){var r=n(314),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=o},1921:function(e,t,n){var r=n(8193),o=n(8049),i=n(866),a=1,l=2;e.exports=function(e,t,n,s,u,c){var d=n&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var h=c.get(e),y=c.get(t);if(h&&y)return h==t&&y==e;var g=-1,m=!0,v=n&l?new r:void 0;for(c.set(e,t),c.set(t,e);++g<f;){var b=e[g],x=t[g];if(s)var w=d?s(x,b,g,t,e,c):s(b,x,g,e,t,c);if(void 0!==w){if(w)continue;m=!1;break}if(v){if(!o(t,(function(e,t){if(!i(v,t)&&(b===e||u(b,e,n,s,c)))return v.push(t)}))){m=!1;break}}else if(b!==x&&!u(b,x,n,s,c)){m=!1;break}}return c.delete(e),c.delete(t),m}},7840:function(e,t,n){var r=n(471),o=n(7370),i=n(6245),a=n(1921),l=n(9482),s=n(4355),u=1,c=2,d="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Map]",y="[object Number]",g="[object RegExp]",m="[object Set]",v="[object String]",b="[object Symbol]",x="[object ArrayBuffer]",w="[object DataView]",j=r?r.prototype:void 0,S=j?j.valueOf:void 0;e.exports=function(e,t,n,r,j,k,C){switch(n){case w:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!k(new o(e),new o(t)));case d:case f:case y:return i(+e,+t);case p:return e.name==t.name&&e.message==t.message;case g:case v:return e==t+"";case h:var _=l;case m:var O=r&u;if(_||(_=s),e.size!=t.size&&!O)return!1;var E=C.get(e);if(E)return E==t;r|=c,C.set(e,t);var T=a(_(e),_(t),r,j,k,C);return C.delete(e),T;case b:if(S)return S.call(e)==S.call(t)}return!1}},2774:function(e,t,n){var r=n(4430),o=1,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,l,s){var u=n&o,c=r(e),d=c.length;if(d!=r(t).length&&!u)return!1;for(var f=d;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var h=s.get(e),y=s.get(t);if(h&&y)return h==t&&y==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=u;++f<d;){var v=e[p=c[f]],b=t[p];if(a)var x=u?a(b,v,p,t,e,s):a(v,b,p,e,t,s);if(!(void 0===x?v===b||l(v,b,n,a,s):x)){g=!1;break}m||(m="constructor"==p)}if(g&&!m){var w=e.constructor,j=t.constructor;w==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof j&&j instanceof j||(g=!1)}return s.delete(e),s.delete(t),g}},5217:function(e,t,n){var r=n(8901),o=n(947),i=n(2054);e.exports=function(e){return i(o(e,void 0,r),e+"")}},1832:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4430:function(e,t,n){var r=n(4821),o=n(4778),i=n(8034);e.exports=function(e){return r(e,i,o)}},6986:function(e,t,n){var r=n(4821),o=n(8553),i=n(2761);e.exports=function(e){return r(e,i,o)}},269:function(e,t,n){var r=n(6390);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},4396:function(e,t,n){var r=n(1259),o=n(8034);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,r(a)]}return t}},314:function(e,t,n){var r=n(2937),o=n(4074);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},9210:function(e,t,n){var r=n(5898)(Object.getPrototypeOf,Object);e.exports=r},1953:function(e,t,n){var r=n(471),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(s){}var o=a.call(e);return r&&(t?e[l]=n:delete e[l]),o}},4778:function(e,t,n){var r=n(9302),o=n(6696),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=l},8553:function(e,t,n){var r=n(6548),o=n(9210),i=n(4778),a=n(6696),l=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=l},7213:function(e,t,n){var r=n(3685),o=n(5103),i=n(6667),a=n(1560),l=n(2345),s=n(6306),u=n(8980),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",y=u(r),g=u(o),m=u(i),v=u(a),b=u(l),x=s;(r&&x(new r(new ArrayBuffer(1)))!=h||o&&x(new o)!=c||i&&x(i.resolve())!=d||a&&x(new a)!=f||l&&x(new l)!=p)&&(x=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case y:return h;case g:return c;case m:return d;case v:return f;case b:return p}return t}),e.exports=x},4074:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8905:function(e,t,n){var r=n(6969),o=n(8105),i=n(1627),a=n(986),l=n(9993),s=n(9560);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u<c;){var f=s(t[u]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++u!=c?d:!!(c=null==e?0:e.length)&&l(c)&&a(f,c)&&(i(e)||o(e))}},9852:function(e,t,n){var r=n(5806);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},488:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7671:function(e,t,n){var r=n(5806),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return n===o?void 0:n}return i.call(t,e)?t[e]:void 0}},4095:function(e,t,n){var r=n(5806),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},424:function(e,t,n){var r=n(5806),o="__lodash_hash_undefined__";e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?o:t,this}},2983:function(e,t,n){var r=n(471),o=n(8105),i=n(1627),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(a&&e&&e[a])}},986:function(e){var t=9007199254740991,n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var o=typeof e;return!!(r=null==r?t:r)&&("number"==o||"symbol"!=o&&n.test(e))&&e>-1&&e%1==0&&e<r}},4890:function(e,t,n){var r=n(6245),o=n(3709),i=n(986),a=n(3329);e.exports=function(e,t,n){if(!a(n))return!1;var l=typeof t;return!!("number"==l?o(n)&&i(t,n.length):"string"==l&&t in n)&&r(n[t],e)}},5417:function(e,t,n){var r=n(1627),o=n(8727),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(a.test(e)||!i.test(e)||null!=t&&e in Object(t))}},6390:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},2637:function(e,t,n){var r=n(6655),o=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!o&&o in e}},1311:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},1259:function(e,t,n){var r=n(3329);e.exports=function(e){return e===e&&!r(e)}},207:function(e){e.exports=function(){this.__data__=[],this.size=0}},7938:function(e,t,n){var r=n(751),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},4786:function(e,t,n){var r=n(751);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},5952:function(e,t,n){var r=n(751);e.exports=function(e){return r(this.__data__,e)>-1}},8041:function(e,t,n){var r=n(751);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3802:function(e,t,n){var r=n(9006),o=n(1146),i=n(5103);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1201:function(e,t,n){var r=n(269);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},9930:function(e,t,n){var r=n(269);e.exports=function(e){return r(this,e).get(e)}},1076:function(e,t,n){var r=n(269);e.exports=function(e){return r(this,e).has(e)}},4117:function(e,t,n){var r=n(269);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},9482:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},9669:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},4469:function(e,t,n){var r=n(8389),o=500;e.exports=function(e){var t=r(e,(function(e){return n.size===o&&n.clear(),e})),n=t.cache;return t}},5806:function(e,t,n){var r=n(314)(Object,"create");e.exports=r},4843:function(e,t,n){var r=n(5898)(Object.keys,Object);e.exports=r},6930:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},4210:function(e,t,n){e=n.nmd(e);var r=n(1832),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,l=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=l},6504:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5898:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},947:function(e,t,n){var r=n(292),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,l=o(i.length-t,0),s=Array(l);++a<l;)s[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=n(s),r(e,this,u)}}},8645:function(e,t,n){var r=n(1832),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},4285:function(e){var t="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,t),this}},83:function(e){e.exports=function(e){return this.__data__.has(e)}},4355:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2054:function(e,t,n){var r=n(2531),o=n(5860)(r);e.exports=o},5860:function(e){var t=800,n=16,r=Date.now;e.exports=function(e){var o=0,i=0;return function(){var a=r(),l=n-(a-i);if(i=a,l>0){if(++o>=t)return arguments[0]}else o=0;return e.apply(void 0,arguments)}}},9035:function(e,t,n){var r=n(1146);e.exports=function(){this.__data__=new r,this.size=0}},5258:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},4877:function(e){e.exports=function(e){return this.__data__.get(e)}},6110:function(e){e.exports=function(e){return this.__data__.has(e)}},8408:function(e,t,n){var r=n(1146),o=n(5103),i=n(5666),a=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var l=n.__data__;if(!o||l.length<a-1)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(l)}return n.set(e,t),this.size=n.size,this}},5267:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},4293:function(e,t,n){var r=n(4469),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=a},9560:function(e,t,n){var r=n(8727),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},8980:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},6088:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},6608:function(e,t,n){var r=n(468),o=n(7485),i=n(9685),a=n(3709),l=n(1311),s=n(8034),u=Object.prototype.hasOwnProperty,c=i((function(e,t){if(l(t)||a(t))o(t,s(t),e);else for(var n in t)u.call(t,n)&&r(e,n,t[n])}));e.exports=c},7074:function(e){e.exports=function(e){return function(){return e}}},8527:function(e,t,n){var r=n(3329),o=n(8755),i=n(7790),a="Expected a function",l=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,d,f,p,h,y=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError(a);function b(t){var n=u,r=c;return u=c=void 0,y=t,f=e.apply(r,n)}function x(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-y>=d}function w(){var e=o();if(x(e))return j(e);p=setTimeout(w,function(e){var n=t-(e-h);return m?s(n,d-(e-y)):n}(e))}function j(e){return p=void 0,v&&u?b(e):(u=c=void 0,f)}function S(){var e=o(),n=x(e);if(u=arguments,c=this,h=e,n){if(void 0===p)return function(e){return y=e,p=setTimeout(w,t),g?b(e):f}(h);if(m)return clearTimeout(p),p=setTimeout(w,t),b(h)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(g=!!n.leading,d=(m="maxWait"in n)?l(i(n.maxWait)||0,t):d,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==p&&clearTimeout(p),y=0,u=h=c=p=void 0},S.flush=function(){return void 0===p?f:j(o())},S}},1324:function(e,t,n){var r=n(4241),o=n(6245),i=n(4890),a=n(2761),l=Object.prototype,s=l.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n<r;)for(var c=t[n],d=a(c),f=-1,p=d.length;++f<p;){var h=d[f],y=e[h];(void 0===y||o(y,l[h])&&!s.call(e,h))&&(e[h]=c[h])}return e}));e.exports=u},9010:function(e,t,n){var r=n(5775),o=n(2335),i=n(4241),a=n(4712),l=i((function(e,t){return a(e)?r(e,o(t,1,a,!0)):[]}));e.exports=l},6245:function(e){e.exports=function(e,t){return e===t||e!==e&&t!==t}},3139:function(e,t,n){var r=n(3419)(n(2051));e.exports=r},2051:function(e,t,n){var r=n(136),o=n(4860),i=n(35),a=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var s=null==n?0:i(n);return s<0&&(s=a(l+s,0)),r(e,o(t,3),s)}},8901:function(e,t,n){var r=n(2335);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},4256:function(e){e.exports=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r}},7714:function(e,t,n){var r=n(7273);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},4564:function(e,t,n){var r=n(1450),o=n(7),i=Object.prototype.hasOwnProperty,a=o((function(e,t,n){i.call(e,n)?e[n].push(t):r(e,n,[t])}));e.exports=a},1503:function(e,t,n){var r=n(5249),o=n(8905);e.exports=function(e,t){return null!=e&&o(e,t,r)}},4008:function(e){e.exports=function(e){return e}},6366:function(e,t,n){var r=n(9849),o=n(3709),i=n(8133),a=n(35),l=n(3809),s=Math.max;e.exports=function(e,t,n,u){e=o(e)?e:l(e),n=n&&!u?a(n):0;var c=e.length;return n<0&&(n=s(c+n,0)),i(e)?n<=c&&e.indexOf(t,n)>-1:!!c&&r(e,t,n)>-1}},2783:function(e,t,n){var r=n(7074),o=n(7561),i=n(4008),a=Object.prototype.toString,l=o((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=a.call(t)),e[t]=n}),r(i));e.exports=l},8105:function(e,t,n){var r=n(6211),o=n(5438),i=Object.prototype,a=i.hasOwnProperty,l=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!l.call(e,"callee")};e.exports=s},1627:function(e){var t=Array.isArray;e.exports=t},3709:function(e,t,n){var r=n(6405),o=n(9993);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4712:function(e,t,n){var r=n(3709),o=n(5438);e.exports=function(e){return o(e)&&r(e)}},7178:function(e,t,n){e=n.nmd(e);var r=n(8645),o=n(3641),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,l=a&&a.exports===i?r.Buffer:void 0,s=(l?l.isBuffer:void 0)||o;e.exports=s},3129:function(e,t,n){var r=n(8603),o=n(7651),i=n(4210),a=i&&i.isDate,l=a?o(a):r;e.exports=l},5322:function(e,t,n){var r=n(1167),o=n(7213),i=n(8105),a=n(1627),l=n(3709),s=n(7178),u=n(1311),c=n(5919),d="[object Map]",f="[object Set]",p=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(l(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||s(e)||c(e)||i(e)))return!e.length;var t=o(e);if(t==d||t==f)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(p.call(e,n))return!1;return!0}},6568:function(e,t,n){var r=n(816);e.exports=function(e,t){return r(e,t)}},6405:function(e,t,n){var r=n(6306),o=n(3329),i="[object AsyncFunction]",a="[object Function]",l="[object GeneratorFunction]",s="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=r(e);return t==a||t==l||t==i||t==s}},9993:function(e){var t=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=t}},2185:function(e){e.exports=function(e){return null==e}},3329:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5438:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4222:function(e,t,n){var r=n(6306),o=n(9210),i=n(5438),a="[object Object]",l=Function.prototype,s=Object.prototype,u=l.toString,c=s.hasOwnProperty,d=u.call(Object);e.exports=function(e){if(!i(e)||r(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==d}},1314:function(e,t,n){var r=n(2567),o=n(7651),i=n(4210),a=i&&i.isRegExp,l=a?o(a):r;e.exports=l},8133:function(e,t,n){var r=n(6306),o=n(1627),i=n(5438),a="[object String]";e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&r(e)==a}},8727:function(e,t,n){var r=n(6306),o=n(5438),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},5919:function(e,t,n){var r=n(1553),o=n(7651),i=n(4210),a=i&&i.isTypedArray,l=a?o(a):r;e.exports=l},4154:function(e){e.exports=function(e){return void 0===e}},8034:function(e,t,n){var r=n(1366),o=n(1167),i=n(3709);e.exports=function(e){return i(e)?r(e):o(e)}},2761:function(e,t,n){var r=n(1366),o=n(9158),i=n(3709);e.exports=function(e){return i(e)?r(e,!0):o(e)}},9945:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8389:function(e,t,n){var r=n(5666),o="Expected a function";function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},4984:function(e){var t="Expected a function";e.exports=function(e){if("function"!=typeof e)throw new TypeError(t);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},5624:function(e){e.exports=function(){}},8755:function(e,t,n){var r=n(8645);e.exports=function(){return r.Date.now()}},5876:function(e,t,n){var r=n(4860),o=n(4984),i=n(9693);e.exports=function(e,t){return i(e,o(r(t)))}},8649:function(e,t,n){var r=n(300),o=n(1627);e.exports=function(e,t,n,i){return null==e?[]:(o(t)||(t=null==t?[]:[t]),o(n=i?void 0:n)||(n=null==n?[]:[n]),r(e,t,n))}},5510:function(e,t,n){var r=n(2636),o=n(5217)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},9693:function(e,t,n){var r=n(1624),o=n(4860),i=n(3472),a=n(6986);e.exports=function(e,t){if(null==e)return{};var n=r(a(e),(function(e){return[e]}));return t=o(t),i(e,n,(function(e,n){return t(e,n[0])}))}},3686:function(e,t,n){var r=n(1474),o=n(862),i=n(5417),a=n(9560);e.exports=function(e){return i(e)?r(a(e)):o(e)}},9546:function(e,t,n){var r=n(3866)();e.exports=r},4082:function(e,t,n){var r=n(8049),o=n(4860),i=n(1878),a=n(1627),l=n(4890);e.exports=function(e,t,n){var s=a(e)?r:i;return n&&l(e,t,n)&&(t=void 0),s(e,o(t,3))}},4209:function(e,t,n){var r=n(4033);e.exports=function(e){return e&&e.length?r(e):[]}},6696:function(e){e.exports=function(){return[]}},3641:function(e){e.exports=function(){return!1}},3806:function(e,t,n){var r=n(8527),o=n(3329),i="Expected a function";e.exports=function(e,t,n){var a=!0,l=!0;if("function"!=typeof e)throw new TypeError(i);return o(n)&&(a="leading"in n?!!n.leading:a,l="trailing"in n?!!n.trailing:l),r(e,t,{leading:a,maxWait:t,trailing:l})}},7930:function(e,t,n){var r=n(7790),o=1/0,i=17976931348623157e292;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*i:e===e?e:0:0===e?e:0}},35:function(e,t,n){var r=n(7930);e.exports=function(e){var t=r(e),n=t%1;return t===t?n?t-n:t:0}},7790:function(e,t,n){var r=n(9298),o=n(3329),i=n(8727),a=NaN,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):l.test(e)?a:+e}},6199:function(e,t,n){var r=n(6474);e.exports=function(e){return null==e?"":r(e)}},3978:function(e,t,n){var r=n(5386);e.exports=function(e){return e&&e.length?r(e):[]}},3172:function(e,t,n){var r=n(4860),o=n(5386);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},5603:function(e,t,n){var r=n(6199),o=0;e.exports=function(e){var t=++o;return r(e)+t}},3809:function(e,t,n){var r=n(7412),o=n(8034);e.exports=function(e){return null==e?[]:r(e,o(e))}},2853:function(e,t,n){var r=n(5775),o=n(4241),i=n(4712),a=o((function(e,t){return i(e)?r(e,t):[]}));e.exports=a},7521:function(e,t,n){"use strict";const r=n(1438),o=Symbol("max"),i=Symbol("length"),a=Symbol("lengthCalculator"),l=Symbol("allowStale"),s=Symbol("maxAge"),u=Symbol("dispose"),c=Symbol("noDisposeOnSet"),d=Symbol("lruList"),f=Symbol("cache"),p=Symbol("updateAgeOnGet"),h=()=>1;const y=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(g(e,t)){if(v(e,r),!e[l])return}else n&&(e[p]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[s])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[s]&&n>e[s]},m=e=>{if(e[i]>e[o])for(let t=e[d].tail;e[i]>e[o]&&null!==t;){const n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){const n=t.value;e[u]&&e[u](n.key,n.value),e[i]-=n.length,e[f].delete(n.key),e[d].removeNode(t)}};class b{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const x=(e,t,n,r)=>{let o=n.value;g(e,o)&&(v(e,n),e[l]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};e.exports=class{constructor(e){if("number"===typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!==typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||h;if(this[a]="function"!==typeof t?h:t,this[l]=e.stale||!1,e.maxAge&&"number"!==typeof e.maxAge)throw new TypeError("maxAge must be a number");this[s]=e.maxAge||0,this[u]=e.dispose,this[c]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,m(this)}get max(){return this[o]}set allowStale(e){this[l]=!!e}get allowStale(){return this[l]}set maxAge(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[s]=e,m(this)}get maxAge(){return this[s]}set lengthCalculator(e){"function"!==typeof e&&(e=h),e!==this[a]&&(this[a]=e,this[i]=0,this[d].forEach((e=>{e.length=this[a](e.value,e.key),this[i]+=e.length}))),m(this)}get lengthCalculator(){return this[a]}get length(){return this[i]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;x(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;x(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach((e=>this[u](e.key,e.value))),this[f]=new Map,this[d]=new r,this[i]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[s])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,l=this[a](t,e);if(this[f].has(e)){if(l>this[o])return v(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[u]&&(this[c]||this[u](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[i]+=l-a.length,a.length=l,this.get(e),m(this),!0}const p=new b(e,t,l,r,n);return p.length>this[o]?(this[u]&&this[u](e,t),!1):(this[i]+=p.length,this[d].unshift(p),this[f].set(e,this[d].head),m(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!g(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[d].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach(((e,t)=>y(this,t,!1)))}}},1288:function(e){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1438:function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"===typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,o=arguments.length;n<o;n++)t.push(arguments[n]);return t}function o(e,t,n){var r=t===e.head?new l(n,null,t,e):new l(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function i(e,t){e.tail=new l(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new l(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function l(e,t,n,r){if(!(this instanceof l))return new l(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}e.exports=r,r.Node=l,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},r.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},r.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},r.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},r.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,o=this.head;null!==o;)n.push(e.call(t,o.value,this)),o=o.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,o=this.tail;null!==o;)n.push(e.call(t,o.value,this)),o=o.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var o=0;null!==r;o++)n=e(n,r.value,o),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var o=this.length-1;null!==r;o--)n=e(n,r.value,o),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,i=this.head;null!==i&&o<e;o++)i=i.next;for(;null!==i&&o<t;o++,i=i.next)n.push(i.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,i=this.tail;null!==i&&o>t;o--)i=i.prev;for(;null!==i&&o>e;o--,i=i.prev)n.push(i.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n<e;n++)r=r.next;var i=[];for(n=0;r&&n<t;n++)i.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(n=2;n<arguments.length;n++)r=o(this,r,arguments[n]);return i},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(1288)(r)}catch(s){}},5832:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,o){for(var i,a,l=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var u in i=Object(arguments[s]))n.call(i,u)&&(l[u]=i[u]);if(t){a=t(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(l[a[c]]=i[a[c]])}}return l}},6406:function(e,t,n){var r=n(8080);e.exports=p,e.exports.parse=i,e.exports.compile=function(e,t){return l(i(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,l="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(a,p),a=p+d.length,f)l+=f[1];else{var h=e[a],y=n[2],g=n[3],m=n[4],v=n[5],b=n[6],x=n[7];l&&(r.push(l),l="");var w=null!=y&&null!=h&&h!==y,j="+"===b||"*"===b,S="?"===b||"*"===b,k=n[2]||c,C=m||v;r.push({name:g||i++,prefix:y||"",delimiter:k,optional:S,repeat:j,partial:w,asterisk:!!x,pattern:C?u(C):x?".*":"[^"+s(k)+"]+?"})}}return a<e.length&&(l+=e.substr(a)),l&&r.push(l),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"===typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",d(t)));return function(t,o){for(var i="",l=t||{},s=(o||{}).pretty?a:encodeURIComponent,u=0;u<e.length;u++){var c=e[u];if("string"!==typeof c){var d,f=l[c.name];if(null==f){if(c.optional){c.partial&&(i+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(r(f)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=s(f[p]),!n[u].test(d))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(d)+"`");i+=(0===p?c.prefix:c.delimiter)+d}}else{if(d=c.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):s(f),!n[u].test(d))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+d+'"');i+=c.prefix+d}}else i+=c}return i}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function c(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",l=0;l<e.length;l++){var u=e[l];if("string"===typeof u)a+=s(u);else{var f=s(u.prefix),p="(?:"+u.pattern+")";t.push(u),u.repeat&&(p+="(?:"+f+p+")*"),a+=p=u.optional?u.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var h=s(n.delimiter||"/"),y=a.slice(-h.length)===h;return o||(a=(y?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=i?"$":o&&y?"":"(?="+h+"|$)",c(new RegExp("^"+a,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return c(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],o=0;o<e.length;o++)r.push(p(e[o],t,n).source);return c(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(i(e,n),t,n)}(e,t,n)}},8080:function(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},8582:function(e){!function(t,n){"use strict";e.exports=function(e){var t="function"===typeof e,n=!!window.addEventListener,r=window.document,o=window.setTimeout,i=function(e,t,r,o){n?e.addEventListener(t,r,!!o):e.attachEvent("on"+t,r)},a=function(e,t,r,o){n?e.removeEventListener(t,r,!!o):e.detachEvent("on"+t,r)},l=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},s=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e,t){s(e,t)||(e.className=""===e.className?t:e.className+" "+t)},c=function(e,t){e.className=l((" "+e.className+" ").replace(" "+t+" "," "))},d=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},p=function(e){var t=e.getDay();return 0===t||6===t},h=function(e){return e%4===0&&e%100!==0||e%400===0},y=function(e,t){return[31,h(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},g=function(e){f(e)&&e.setHours(0,0,0,0)},m=function(e,t){return e.getTime()===t.getTime()},v=function(e,t,n){var r,o;for(r in t)(o=void 0!==e[r])&&"object"===typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?f(t[r])?n&&(e[r]=new Date(t[r].getTime())):d(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=v({},t[r],n):!n&&o||(e[r]=t[r]);return e},b=function(e,t,n){var o;r.createEvent?((o=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),o=v(o,n),e.dispatchEvent(o)):r.createEventObject&&(o=r.createEventObject(),o=v(o,n),e.fireEvent("on"+t,o))},x=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},w={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},j=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},S=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},k=function(e,t,n){var r=new Date(n,0,1);return'<td class="pika-week">'+Math.ceil(((new Date(n,t,e)-r)/864e5+r.getDay()+1)/7)+"</td>"},C=function(e,t,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(t?e.reverse():e).join("")+"</tr>"},_=function(e){return"<tbody>"+e.join("")+"</tbody>"},O=function(e){var t,n=[];for(e.showWeekNumber&&n.push("<th></th>"),t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+j(e,t)+'">'+j(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"},E=function(e,t,n,r,o,i){var a,l,s,u,c,f=e._o,p=n===f.minYear,h=n===f.maxYear,y='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',g=!0,m=!0;for(s=[],a=0;a<12;a++)s.push('<option value="'+(n===o?a-t:12+a-t)+'"'+(a===r?' selected="selected"':"")+(p&&a<f.minMonth||h&&a>f.maxMonth?'disabled="disabled"':"")+">"+f.i18n.months[a]+"</option>");for(u='<div class="pika-label">'+f.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+s.join("")+"</select></div>",d(f.yearRange)?(a=f.yearRange[0],l=f.yearRange[1]+1):(a=n-f.yearRange,l=1+n+f.yearRange),s=[];a<l&&a<=f.maxYear;a++)a>=f.minYear&&s.push('<option value="'+a+'"'+(a===n?' selected="selected"':"")+">"+a+"</option>");return c='<div class="pika-label">'+n+f.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+s.join("")+"</select></div>",f.showMonthAfterYear?y+=c+u:y+=u+c,p&&(0===r||f.minMonth>=r)&&(g=!1),h&&(11===r||f.maxMonth<=r)&&(m=!1),0===t&&(y+='<button class="pika-prev'+(g?"":" is-disabled")+'" type="button">'+f.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(y+='<button class="pika-next'+(m?"":" is-disabled")+'" type="button">'+f.i18n.nextMonth+"</button>"),y+"</div>"},T=function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+O(e)+_(t)+"</table>"},P=function(a){var l=this,u=l.config(a);l._onMouseDown=function(e){if(l._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(s(t,"is-disabled")||(!s(t,"pika-button")||s(t,"is-empty")||s(t.parentNode,"is-disabled")?s(t,"pika-prev")?l.prevMonth():s(t,"pika-next")&&l.nextMonth():(l.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&o((function(){l.hide(),u.blurFieldOnSelect&&u.field&&u.field.blur()}),100))),s(t,"pika-select"))l._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},l._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(s(t,"pika-select-month")?l.gotoMonth(t.value):s(t,"pika-select-year")&&l.gotoYear(t.value))},l._onKeyChange=function(e){if(e=e||window.event,l.isVisible())switch(e.keyCode){case 13:case 27:u.field&&u.field.blur();break;case 37:e.preventDefault(),l.adjustDate("subtract",1);break;case 38:l.adjustDate("subtract",7);break;case 39:l.adjustDate("add",1);break;case 40:l.adjustDate("add",7)}},l._onInputChange=function(n){var r;n.firedBy!==l&&(r=u.parse?u.parse(u.field.value,u.format):t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),f(r)&&l.setDate(r),l._v||l.show())},l._onInputFocus=function(){l.show()},l._onInputClick=function(){l.show()},l._onInputBlur=function(){var e=r.activeElement;do{if(s(e,"pika-single"))return}while(e=e.parentNode);l._c||(l._b=o((function(){l.hide()}),50)),l._c=!1},l._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&s(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",l._onChange)));do{if(s(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);l._v&&t!==u.trigger&&r!==u.trigger&&l.hide()}},l.el=r.createElement("div"),l.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(l.el,"mousedown",l._onMouseDown,!0),i(l.el,"touchend",l._onMouseDown,!0),i(l.el,"change",l._onChange),u.keyboardInput&&i(r,"keydown",l._onKeyChange),u.field&&(u.container?u.container.appendChild(l.el):u.bound?r.body.appendChild(l.el):u.field.parentNode.insertBefore(l.el,u.field.nextSibling),i(u.field,"change",l._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var c=u.defaultDate;f(c)?u.setDefaultDate?l.setDate(c,!0):l.gotoDate(c):l.gotoDate(new Date),u.bound?(this.hide(),l.el.className+=" is-bound",i(u.trigger,"click",l._onInputClick),i(u.trigger,"focus",l._onInputFocus),i(u.trigger,"blur",l._onInputBlur)):this.show()};return P.prototype={config:function(e){this._o||(this._o=v({},w,!0));var t=v(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"===typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"===typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),d(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||w.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return n=n||this._o.format,f(this._d)?this._o.toString?this._o.toString(this._d,n):t?e(this._d).format(n):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",b(this._o.field,"change",{firedBy:this})),this.draw();if("string"===typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,r=this._o.maxDate;f(n)&&e<n?e=n:f(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),g(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),b(this._o.field,"change",{firedBy:this})),t||"function"!==typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=o<n.getTime()||r.getTime()<o}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(e,t){var n,r=this.getDate()||new Date,o=24*parseInt(t)*60*60*1e3;"add"===e?n=new Date(r.valueOf()+o):"subtract"===e&&(n=new Date(r.valueOf()-o)),this.setDate(n)},adjustCalendars:function(){this.calendars[0]=x(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=x({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(g(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=w.minDate,this._o.minYear=w.minYear,this._o.minMonth=w.minMonth,this._o.startRange=w.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(g(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=w.maxDate,this._o.maxYear=w.maxYear,this._o.maxMonth=w.maxMonth,this._o.endRange=w.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,a=n.minMonth,l=n.maxMonth,s="";this._y<=r&&(this._y=r,!isNaN(a)&&this._m<a&&(this._m=a)),this._y>=i&&(this._y=i,!isNaN(l)&&this._m>l&&(this._m=l)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)s+='<div class="pika-lendar">'+E(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=s,n.bound&&"hidden"!==n.field.type&&o((function(){n.trigger.focus()}),1),"function"===typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label",n.ariaLabel)}},adjustPosition:function(){var e,t,n,o,i,a,l,s,d,f,p,h;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,o=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,a=window.innerHeight||r.documentElement.clientHeight,l=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,p=!0,h=!0,"function"===typeof e.getBoundingClientRect)s=(f=e.getBoundingClientRect()).left+window.pageXOffset,d=f.bottom+window.pageYOffset;else for(s=t.offsetLeft,d=t.offsetTop+t.offsetHeight;t=t.offsetParent;)s+=t.offsetLeft,d+=t.offsetTop;(this._o.reposition&&s+n>i||this._o.position.indexOf("right")>-1&&s-n+e.offsetWidth>0)&&(s=s-n+e.offsetWidth,p=!1),(this._o.reposition&&d+o>a+l||this._o.position.indexOf("top")>-1&&d-o-e.offsetHeight>0)&&(d=d-o-e.offsetHeight,h=!1),this.el.style.left=s+"px",this.el.style.top=d+"px",u(this.el,p?"left-aligned":"right-aligned"),u(this.el,h?"bottom-aligned":"top-aligned"),c(this.el,p?"right-aligned":"left-aligned"),c(this.el,h?"top-aligned":"bottom-aligned")}},render:function(e,t,n){var r=this._o,o=new Date,i=y(e,t),a=new Date(e,t,1).getDay(),l=[],s=[];g(o),r.firstDay>0&&(a-=r.firstDay)<0&&(a+=7);for(var u=0===t?11:t-1,c=11===t?0:t+1,d=0===t?e-1:e,h=11===t?e+1:e,v=y(d,u),b=i+a,x=b;x>7;)x-=7;b+=7-x;for(var w=!1,j=0,_=0;j<b;j++){var O=new Date(e,t,j-a+1),E=!!f(this._d)&&m(O,this._d),P=m(O,o),A=-1!==r.events.indexOf(O.toDateString()),M=j<a||j>=i+a,D=j-a+1,I=t,R=e,N=r.startRange&&m(r.startRange,O),L=r.endRange&&m(r.endRange,O),F=r.startRange&&r.endRange&&r.startRange<O&&O<r.endRange;M&&(j<a?(D=v+D,I=u,R=d):(D-=i,I=c,R=h));var B={day:D,month:I,year:R,hasEvent:A,isSelected:E,isToday:P,isDisabled:r.minDate&&O<r.minDate||r.maxDate&&O>r.maxDate||r.disableWeekends&&p(O)||r.disableDayFn&&r.disableDayFn(O),isEmpty:M,isStartRange:N,isEndRange:L,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&E&&(w=!0),s.push(S(B)),7===++_&&(r.showWeekNumber&&s.unshift(k(j-a,t,e)),l.push(C(s,r.isRTL,r.pickWholeWeek,w)),s=[],_=0,w=!1)}return T(r,l,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),c(this.el,"is-hidden"),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"===typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;!1!==e&&(this._o.bound&&a(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",u(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"===typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var e=this._o;this.hide(),a(this.el,"mousedown",this._onMouseDown,!0),a(this.el,"touchend",this._onMouseDown,!0),a(this.el,"change",this._onChange),e.keyboardInput&&a(r,"keydown",this._onKeyChange),e.field&&(a(e.field,"change",this._onInputChange),e.bound&&(a(e.trigger,"click",this._onInputClick),a(e.trigger,"focus",this._onInputFocus),a(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},P}(null)}()},1266:function(e,t,n){"use strict";var r=n(5092);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},7633:function(e,t,n){e.exports=n(1266)()},5092:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2663:function(e,t,n){"use strict";var r=n(3017),o=n(4796);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,l={};function s(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)a.add(t[e])}var c=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},h={};function y(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new y(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new y(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new y(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new y(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new y(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new y(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)}));var m=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function b(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!d.call(h,e)||!d.call(p,e)&&(f.test(e)?h[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(m,v);g[t]=new y(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(m,v);g[t]=new y(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(m,v);g[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),j=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),O=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),M=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var I=Symbol.iterator;function R(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=I&&e[I]||e["@@iterator"])?e:null}var N,L=Object.assign;function F(e){if(void 0===N)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return"\n"+N+e}var B=!1;function z(e,t){if(!e||B)return"";B=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var o=u.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(1!==a||1!==l)do{if(a--,0>--l||o[a]!==i[l]){var s="\n"+o[a].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=a&&0<=l);break}}}finally{B=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function U(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=z(e.type,!1);case 11:return e=z(e.type.render,!1);case 1:return e=z(e.type,!0);default:return""}}function W(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case S:return"Fragment";case j:return"Portal";case C:return"Profiler";case k:return"StrictMode";case T:return"Suspense";case P:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case O:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case E:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case A:return null!==(t=e.displayName||null)?t:W(e.type)||"Memo";case M:t=e._payload,e=e._init;try{return W(e(t))}catch(n){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W(t);case 8:return t===k?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function K(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function $(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function G(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=K(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function X(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function Z(e,t){X(e,t);var n=K(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,K(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&G(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+K(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(i(91));return L({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(i(92));if(te(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:K(n)}}function ie(e,t){var n=K(t.value),r=K(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,ce,de=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function ye(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=ye(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pe).forEach((function(e){he.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]}))}));var me=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(me[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(i(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(i(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(i(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xe=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var je=null,Se=null,ke=null;function Ce(e){if(e=xo(e)){if("function"!==typeof je)throw Error(i(280));var t=e.stateNode;t&&(t=jo(t),je(e.stateNode,e.type,t))}}function _e(e){Se?ke?ke.push(e):ke=[e]:Se=e}function Oe(){if(Se){var e=Se,t=ke;if(ke=Se=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function Ee(e,t){return e(t)}function Te(){}var Pe=!1;function Ae(e,t,n){if(Pe)return e(t,n);Pe=!0;try{return Ee(e,t,n)}finally{Pe=!1,(null!==Se||null!==ke)&&(Te(),Oe())}}function Me(e,t){var n=e.stateNode;if(null===n)return null;var r=jo(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(i(231,t,typeof n));return n}var De=!1;if(c)try{var Ie={};Object.defineProperty(Ie,"passive",{get:function(){De=!0}}),window.addEventListener("test",Ie,Ie),window.removeEventListener("test",Ie,Ie)}catch(ce){De=!1}function Re(e,t,n,r,o,i,a,l,s){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ne=!1,Le=null,Fe=!1,Be=null,ze={onError:function(e){Ne=!0,Le=e}};function Ue(e,t,n,r,o,i,a,l,s){Ne=!1,Le=null,Re.apply(ze,arguments)}function We(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function He(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ke(e){if(We(e)!==e)throw Error(i(188))}function $e(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=We(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return Ke(o),e;if(a===r)return Ke(o),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=o,r=a;else{for(var l=!1,s=o.child;s;){if(s===n){l=!0,n=o,r=a;break}if(s===r){l=!0,r=o,n=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===n){l=!0,n=a,r=o;break}if(s===r){l=!0,r=a,n=o;break}s=s.sibling}if(!l)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(e))?Ve(e):null}function Ve(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ve(e);if(null!==t)return t;e=e.sibling}return null}var qe=o.unstable_scheduleCallback,Ge=o.unstable_cancelCallback,Ye=o.unstable_shouldYield,Qe=o.unstable_requestPaint,Xe=o.unstable_now,Ze=o.unstable_getCurrentPriorityLevel,Je=o.unstable_ImmediatePriority,et=o.unstable_UserBlockingPriority,tt=o.unstable_NormalPriority,nt=o.unstable_LowPriority,rt=o.unstable_IdlePriority,ot=null,it=null;var at=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(lt(e)/st|0)|0},lt=Math.log,st=Math.LN2;var ut=64,ct=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var l=a&~o;0!==l?r=dt(l):0!==(i&=a)&&(r=dt(i))}else 0!==(a=n&~o)?r=dt(a):0!==i&&(r=dt(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!==(4194240&i)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-at(t)),r|=e[n],t&=~o;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ht(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function yt(){var e=ut;return 0===(4194240&(ut<<=1))&&(ut=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var bt=0;function xt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var wt,jt,St,kt,Ct,_t=!1,Ot=[],Et=null,Tt=null,Pt=null,At=new Map,Mt=new Map,Dt=[],It="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Rt(e,t){switch(e){case"focusin":case"focusout":Et=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":Pt=null;break;case"pointerover":case"pointerout":At.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mt.delete(t.pointerId)}}function Nt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=xo(t))&&jt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Lt(e){var t=bo(e.target);if(null!==t){var n=We(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=He(n)))return e.blockedOn=t,void Ct(e.priority,(function(){St(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ft(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=xo(n))&&jt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);xe=r,n.target.dispatchEvent(r),xe=null,t.shift()}return!0}function Bt(e,t,n){Ft(e)&&n.delete(t)}function zt(){_t=!1,null!==Et&&Ft(Et)&&(Et=null),null!==Tt&&Ft(Tt)&&(Tt=null),null!==Pt&&Ft(Pt)&&(Pt=null),At.forEach(Bt),Mt.forEach(Bt)}function Ut(e,t){e.blockedOn===t&&(e.blockedOn=null,_t||(_t=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,zt)))}function Wt(e){function t(t){return Ut(t,e)}if(0<Ot.length){Ut(Ot[0],e);for(var n=1;n<Ot.length;n++){var r=Ot[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&Ut(Et,e),null!==Tt&&Ut(Tt,e),null!==Pt&&Ut(Pt,e),At.forEach(t),Mt.forEach(t),n=0;n<Dt.length;n++)(r=Dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&null===(n=Dt[0]).blockedOn;)Lt(n),null===n.blockedOn&&Dt.shift()}var Ht=x.ReactCurrentBatchConfig,Kt=!0;function $t(e,t,n,r){var o=bt,i=Ht.transition;Ht.transition=null;try{bt=1,qt(e,t,n,r)}finally{bt=o,Ht.transition=i}}function Vt(e,t,n,r){var o=bt,i=Ht.transition;Ht.transition=null;try{bt=4,qt(e,t,n,r)}finally{bt=o,Ht.transition=i}}function qt(e,t,n,r){if(Kt){var o=Yt(e,t,n,r);if(null===o)Kr(e,t,r,Gt,n),Rt(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Et=Nt(Et,e,t,n,r,o),!0;case"dragenter":return Tt=Nt(Tt,e,t,n,r,o),!0;case"mouseover":return Pt=Nt(Pt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return At.set(i,Nt(At.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Mt.set(i,Nt(Mt.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Rt(e,r),4&t&&-1<It.indexOf(e)){for(;null!==o;){var i=xo(o);if(null!==i&&wt(i),null===(i=Yt(e,t,n,r))&&Kr(e,t,r,Gt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Kr(e,t,r,null,n)}}var Gt=null;function Yt(e,t,n,r){if(Gt=null,null!==(e=bo(e=we(r))))if(null===(t=We(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=He(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gt=e,null}function Qt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ze()){case Je:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Xt=null,Zt=null,Jt=null;function en(){if(Jt)return Jt;var e,t,n=Zt,r=n.length,o="value"in Xt?Xt.value:Xt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Jt=o.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var an,ln,sn,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=on(un),dn=L({},un,{view:0,detail:0}),fn=on(dn),pn=L({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sn&&(sn&&"mousemove"===e.type?(an=e.screenX-sn.screenX,ln=e.screenY-sn.screenY):ln=an=0,sn=e),an)},movementY:function(e){return"movementY"in e?e.movementY:ln}}),hn=on(pn),yn=on(L({},pn,{dataTransfer:0})),gn=on(L({},dn,{relatedTarget:0})),mn=on(L({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=L({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=on(vn),xn=on(L({},un,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function Cn(){return kn}var _n=L({},dn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?jn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),On=on(_n),En=on(L({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=on(L({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),Pn=on(L({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=L({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Mn=on(An),Dn=[9,13,27,32],In=c&&"CompositionEvent"in window,Rn=null;c&&"documentMode"in document&&(Rn=document.documentMode);var Nn=c&&"TextEvent"in window&&!Rn,Ln=c&&(!In||Rn&&8<Rn&&11>=Rn),Fn=String.fromCharCode(32),Bn=!1;function zn(e,t){switch(e){case"keyup":return-1!==Dn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Un(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var Hn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Hn[e.type]:"textarea"===t}function $n(e,t,n,r){_e(r),0<(t=Vr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vn=null,qn=null;function Gn(e){Fr(e,0)}function Yn(e){if(q(wo(e)))return e}function Qn(e,t){if("change"===e)return t}var Xn=!1;if(c){var Zn;if(c){var Jn="oninput"in document;if(!Jn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jn="function"===typeof er.oninput}Zn=Jn}else Zn=!1;Xn=Zn&&(!document.documentMode||9<document.documentMode)}function tr(){Vn&&(Vn.detachEvent("onpropertychange",nr),qn=Vn=null)}function nr(e){if("value"===e.propertyName&&Yn(qn)){var t=[];$n(t,qn,e,we(e)),Ae(Gn,t)}}function rr(e,t,n){"focusin"===e?(tr(),qn=n,(Vn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(qn)}function ir(e,t){if("click"===e)return Yn(t)}function ar(e,t){if("input"===e||"change"===e)return Yn(t)}var lr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function sr(e,t){if(lr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!d.call(t,o)||!lr(e[o],t[o]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,t){var n,r=ur(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fr(){for(var e=window,t=G();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=G((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function hr(e){var t=fr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=cr(n,i);var a=cr(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var yr=c&&"documentMode"in document&&11>=document.documentMode,gr=null,mr=null,vr=null,br=!1;function xr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==gr||gr!==G(r)||("selectionStart"in(r=gr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&sr(vr,r)||(vr=r,0<(r=Vr(mr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jr={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Sr={},kr={};function Cr(e){if(Sr[e])return Sr[e];if(!jr[e])return e;var t,n=jr[e];for(t in n)if(n.hasOwnProperty(t)&&t in kr)return Sr[e]=n[t];return e}c&&(kr=document.createElement("div").style,"AnimationEvent"in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),"TransitionEvent"in window||delete jr.transitionend.transition);var _r=Cr("animationend"),Or=Cr("animationiteration"),Er=Cr("animationstart"),Tr=Cr("transitionend"),Pr=new Map,Ar="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,t){Pr.set(e,t),s(t,[e])}for(var Dr=0;Dr<Ar.length;Dr++){var Ir=Ar[Dr];Mr(Ir.toLowerCase(),"on"+(Ir[0].toUpperCase()+Ir.slice(1)))}Mr(_r,"onAnimationEnd"),Mr(Or,"onAnimationIteration"),Mr(Er,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr(Tr,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rr));function Lr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,l,s,u){if(Ue.apply(this,arguments),Ne){if(!Ne)throw Error(i(198));var c=Le;Ne=!1,Le=null,Fe||(Fe=!0,Be=c)}}(r,t,void 0,e),e.currentTarget=null}function Fr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],s=l.instance,u=l.currentTarget;if(l=l.listener,s!==i&&o.isPropagationStopped())break e;Lr(o,l,u),i=s}else for(a=0;a<r.length;a++){if(s=(l=r[a]).instance,u=l.currentTarget,l=l.listener,s!==i&&o.isPropagationStopped())break e;Lr(o,l,u),i=s}}}if(Fe)throw e=Be,Fe=!1,Be=null,e}function Br(e,t){var n=t[go];void 0===n&&(n=t[go]=new Set);var r=e+"__bubble";n.has(r)||(Hr(t,e,2,!1),n.add(r))}function zr(e,t,n){var r=0;t&&(r|=4),Hr(n,e,r,t)}var Ur="_reactListening"+Math.random().toString(36).slice(2);function Wr(e){if(!e[Ur]){e[Ur]=!0,a.forEach((function(t){"selectionchange"!==t&&(Nr.has(t)||zr(t,!1,e),zr(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Ur]||(t[Ur]=!0,zr("selectionchange",!1,t))}}function Hr(e,t,n,r){switch(Qt(t)){case 1:var o=$t;break;case 4:o=Vt;break;default:o=qt}n=o.bind(null,t,n,e),o=void 0,!De||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Kr(e,t,n,r,o){var i=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var l=r.stateNode.containerInfo;if(l===o||8===l.nodeType&&l.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var s=a.tag;if((3===s||4===s)&&((s=a.stateNode.containerInfo)===o||8===s.nodeType&&s.parentNode===o))return;a=a.return}for(;null!==l;){if(null===(a=bo(l)))return;if(5===(s=a.tag)||6===s){r=i=a;continue e}l=l.parentNode}}r=r.return}Ae((function(){var r=i,o=we(n),a=[];e:{var l=Pr.get(e);if(void 0!==l){var s=cn,u=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":s=On;break;case"focusin":u="focus",s=gn;break;case"focusout":u="blur",s=gn;break;case"beforeblur":case"afterblur":s=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=hn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Tn;break;case _r:case Or:case Er:s=mn;break;case Tr:s=Pn;break;case"scroll":s=fn;break;case"wheel":s=Mn;break;case"copy":case"cut":case"paste":s=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=En}var c=0!==(4&t),d=!c&&"scroll"===e,f=c?null!==l?l+"Capture":null:l;c=[];for(var p,h=r;null!==h;){var y=(p=h).stateNode;if(5===p.tag&&null!==y&&(p=y,null!==f&&(null!=(y=Me(h,f))&&c.push($r(h,y,p)))),d)break;h=h.return}0<c.length&&(l=new s(l,u,null,n,o),a.push({event:l,listeners:c}))}}if(0===(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||n===xe||!(u=n.relatedTarget||n.fromElement)||!bo(u)&&!u[yo])&&(s||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(u=(u=n.relatedTarget||n.toElement)?bo(u):null)&&(u!==(d=We(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(s=null,u=r),s!==u)){if(c=hn,y="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=En,y="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==s?l:wo(s),p=null==u?l:wo(u),(l=new c(y,h+"leave",s,n,o)).target=d,l.relatedTarget=p,y=null,bo(o)===r&&((c=new c(f,h+"enter",u,n,o)).target=p,c.relatedTarget=d,y=c),d=y,s&&u)e:{for(f=u,h=0,p=c=s;p;p=qr(p))h++;for(p=0,y=f;y;y=qr(y))p++;for(;0<h-p;)c=qr(c),h--;for(;0<p-h;)f=qr(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=qr(c),f=qr(f)}c=null}else c=null;null!==s&&Gr(a,l,s,c,!1),null!==u&&null!==d&&Gr(a,d,u,c,!0)}if("select"===(s=(l=r?wo(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var g=Qn;else if(Kn(l))if(Xn)g=ar;else{g=or;var m=rr}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(g=ir);switch(g&&(g=g(e,r))?$n(a,g,n,o):(m&&m(e,l,r),"focusout"===e&&(m=l._wrapperState)&&m.controlled&&"number"===l.type&&ee(l,"number",l.value)),m=r?wo(r):window,e){case"focusin":(Kn(m)||"true"===m.contentEditable)&&(gr=m,mr=r,vr=null);break;case"focusout":vr=mr=gr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,xr(a,n,o);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":xr(a,n,o)}var v;if(In)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Wn?zn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Ln&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(v=en()):(Zt="value"in(Xt=o)?Xt.value:Xt.textContent,Wn=!0)),0<(m=Vr(r,b)).length&&(b=new xn(b,e,null,n,o),a.push({event:b,listeners:m}),v?b.data=v:null!==(v=Un(n))&&(b.data=v))),(v=Nn?function(e,t){switch(e){case"compositionend":return Un(t);case"keypress":return 32!==t.which?null:(Bn=!0,Fn);case"textInput":return(e=t.data)===Fn&&Bn?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!In&&zn(e,t)?(e=en(),Jt=Zt=Xt=null,Wn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ln&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Vr(r,"onBeforeInput")).length&&(o=new xn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=v))}Fr(a,t)}))}function $r(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Me(e,n))&&r.unshift($r(e,i,o)),null!=(i=Me(e,t))&&r.push($r(e,i,o))),e=e.return}return r}function qr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Gr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var l=n,s=l.alternate,u=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==u&&(l=u,o?null!=(s=Me(n,i))&&a.unshift($r(n,s,l)):o||null!=(s=Me(n,i))&&a.push($r(n,s,l))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Yr=/\r\n?/g,Qr=/\u0000|\uFFFD/g;function Xr(e){return("string"===typeof e?e:""+e).replace(Yr,"\n").replace(Qr,"")}function Zr(e,t,n){if(t=Xr(t),Xr(e)!==t&&n)throw Error(i(425))}function Jr(){}var eo=null,to=null;function no(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ro="function"===typeof setTimeout?setTimeout:void 0,oo="function"===typeof clearTimeout?clearTimeout:void 0,io="function"===typeof Promise?Promise:void 0,ao="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof io?function(e){return io.resolve(null).then(e).catch(lo)}:ro;function lo(e){setTimeout((function(){throw e}))}function so(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Wt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Wt(t)}function uo(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function co(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var fo=Math.random().toString(36).slice(2),po="__reactFiber$"+fo,ho="__reactProps$"+fo,yo="__reactContainer$"+fo,go="__reactEvents$"+fo,mo="__reactListeners$"+fo,vo="__reactHandles$"+fo;function bo(e){var t=e[po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yo]||n[po]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=co(e);null!==e;){if(n=e[po])return n;e=co(e)}return t}n=(e=n).parentNode}return null}function xo(e){return!(e=e[po]||e[yo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(i(33))}function jo(e){return e[ho]||null}var So=[],ko=-1;function Co(e){return{current:e}}function _o(e){0>ko||(e.current=So[ko],So[ko]=null,ko--)}function Oo(e,t){ko++,So[ko]=e.current,e.current=t}var Eo={},To=Co(Eo),Po=Co(!1),Ao=Eo;function Mo(e,t){var n=e.type.contextTypes;if(!n)return Eo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Do(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Io(){_o(Po),_o(To)}function Ro(e,t,n){if(To.current!==Eo)throw Error(i(168));Oo(To,t),Oo(Po,n)}function No(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(i(108,H(e)||"Unknown",o));return L({},n,r)}function Lo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Eo,Ao=To.current,Oo(To,e),Oo(Po,Po.current),!0}function Fo(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=No(e,t,Ao),r.__reactInternalMemoizedMergedChildContext=e,_o(Po),_o(To),Oo(To,e)):_o(Po),Oo(Po,n)}var Bo=null,zo=!1,Uo=!1;function Wo(e){null===Bo?Bo=[e]:Bo.push(e)}function Ho(){if(!Uo&&null!==Bo){Uo=!0;var e=0,t=bt;try{var n=Bo;for(bt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Bo=null,zo=!1}catch(o){throw null!==Bo&&(Bo=Bo.slice(e+1)),qe(Je,Ho),o}finally{bt=t,Uo=!1}}return null}var Ko=[],$o=0,Vo=null,qo=0,Go=[],Yo=0,Qo=null,Xo=1,Zo="";function Jo(e,t){Ko[$o++]=qo,Ko[$o++]=Vo,Vo=e,qo=t}function ei(e,t,n){Go[Yo++]=Xo,Go[Yo++]=Zo,Go[Yo++]=Qo,Qo=e;var r=Xo;e=Zo;var o=32-at(r)-1;r&=~(1<<o),n+=1;var i=32-at(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Xo=1<<32-at(t)+o|n<<o|r,Zo=i+e}else Xo=1<<i|n<<o|r,Zo=e}function ti(e){null!==e.return&&(Jo(e,1),ei(e,1,0))}function ni(e){for(;e===Vo;)Vo=Ko[--$o],Ko[$o]=null,qo=Ko[--$o],Ko[$o]=null;for(;e===Qo;)Qo=Go[--Yo],Go[Yo]=null,Zo=Go[--Yo],Go[Yo]=null,Xo=Go[--Yo],Go[Yo]=null}var ri=null,oi=null,ii=!1,ai=null;function li(e,t){var n=Mu(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function si(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ri=e,oi=uo(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ri=e,oi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Qo?{id:Xo,overflow:Zo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Mu(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ri=e,oi=null,!0);default:return!1}}function ui(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function ci(e){if(ii){var t=oi;if(t){var n=t;if(!si(e,t)){if(ui(e))throw Error(i(418));t=uo(n.nextSibling);var r=ri;t&&si(e,t)?li(r,n):(e.flags=-4097&e.flags|2,ii=!1,ri=e)}}else{if(ui(e))throw Error(i(418));e.flags=-4097&e.flags|2,ii=!1,ri=e}}}function di(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ri=e}function fi(e){if(e!==ri)return!1;if(!ii)return di(e),ii=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!no(e.type,e.memoizedProps)),t&&(t=oi)){if(ui(e))throw pi(),Error(i(418));for(;t;)li(e,t),t=uo(t.nextSibling)}if(di(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){oi=uo(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}oi=null}}else oi=ri?uo(e.stateNode.nextSibling):null;return!0}function pi(){for(var e=oi;e;)e=uo(e.nextSibling)}function hi(){oi=ri=null,ii=!1}function yi(e){null===ai?ai=[e]:ai.push(e)}var gi=x.ReactCurrentBatchConfig;function mi(e,t){if(e&&e.defaultProps){for(var n in t=L({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var vi=Co(null),bi=null,xi=null,wi=null;function ji(){wi=xi=bi=null}function Si(e){var t=vi.current;_o(vi),e._currentValue=t}function ki(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ci(e,t){bi=e,wi=xi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(xl=!0),e.firstContext=null)}function _i(e){var t=e._currentValue;if(wi!==e)if(e={context:e,memoizedValue:t,next:null},null===xi){if(null===bi)throw Error(i(308));xi=e,bi.dependencies={lanes:0,firstContext:e}}else xi=xi.next=e;return t}var Oi=null;function Ei(e){null===Oi?Oi=[e]:Oi.push(e)}function Ti(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Ei(t)):(n.next=o.next,o.next=n),t.interleaved=n,Pi(e,r)}function Pi(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ai=!1;function Mi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Di(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ii(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ri(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&Ts)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Pi(e,n)}return null===(o=r.interleaved)?(t.next=t,Ei(r)):(t.next=o.next,o.next=t),r.interleaved=t,Pi(e,n)}function Ni(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}function Li(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Fi(e,t,n,r){var o=e.updateQueue;Ai=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var s=l,u=s.next;s.next=null,null===a?i=u:a.next=u,a=s;var c=e.alternate;null!==c&&((l=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=s))}if(null!==i){var d=o.baseState;for(a=0,c=u=s=null,l=i;;){var f=l.lane,p=l.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var h=e,y=l;switch(f=t,p=n,y.tag){case 1:if("function"===typeof(h=y.payload)){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null===(f="function"===typeof(h=y.payload)?h.call(p,d,f):h)||void 0===f)break e;d=L({},d,f);break e;case 2:Ai=!0}}null!==l.callback&&0!==l.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=p,s=d):c=c.next=p,a|=f;if(null===(l=l.next)){if(null===(l=o.shared.pending))break;l=(f=l).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===c&&(s=d),o.baseState=s,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Ls|=a,e.lanes=a,e.memoizedState=d}}function Bi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!==typeof o)throw Error(i(191,o));o.call(r)}}}var zi=(new r.Component).refs;function Ui(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:L({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Wi={isMounted:function(e){return!!(e=e._reactInternals)&&We(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tu(),o=nu(e),i=Ii(r,o);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=Ri(e,i,o))&&(ru(t,e,o,r),Ni(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tu(),o=nu(e),i=Ii(r,o);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),null!==(t=Ri(e,i,o))&&(ru(t,e,o,r),Ni(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tu(),r=nu(e),o=Ii(n,r);o.tag=2,void 0!==t&&null!==t&&(o.callback=t),null!==(t=Ri(e,o,r))&&(ru(t,e,r,n),Ni(t,e,r))}};function Hi(e,t,n,r,o,i,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!sr(n,r)||!sr(o,i))}function Ki(e,t,n){var r=!1,o=Eo,i=t.contextType;return"object"===typeof i&&null!==i?i=_i(i):(o=Do(t)?Ao:To.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?Mo(e,o):Eo),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Wi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function $i(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Wi.enqueueReplaceState(t,t.state,null)}function Vi(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=zi,Mi(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=_i(i):(i=Do(t)?Ao:To.current,o.context=Mo(e,i)),o.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(Ui(e,t,i,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&Wi.enqueueReplaceState(o,o.state,null),Fi(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.flags|=4194308)}function qi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var o=r,a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;t===zi&&(t=o.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!==typeof e)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function Gi(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yi(e){return(0,e._init)(e._payload)}function Qi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Iu(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function l(t){return e&&null===t.alternate&&(t.flags|=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Fu(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function u(e,t,n,r){var i=n.type;return i===S?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"===typeof i&&null!==i&&i.$$typeof===M&&Yi(i)===t.type)?((r=o(t,n.props)).ref=qi(e,t,n),r.return=e,r):((r=Ru(n.type,n.key,n.props,null,e.mode,r)).ref=qi(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Bu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Nu(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Fu(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Ru(t.type,t.key,t.props,null,e.mode,n)).ref=qi(e,null,t),n.return=e,n;case j:return(t=Bu(t,e.mode,n)).return=e,t;case M:return f(e,(0,t._init)(t._payload),n)}if(te(t)||R(t))return(t=Nu(t,e.mode,n,null)).return=e,t;Gi(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==o?null:s(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===o?u(e,t,n,r):null;case j:return n.key===o?c(e,t,n,r):null;case M:return p(e,t,(o=n._init)(n._payload),r)}if(te(n)||R(n))return null!==o?null:d(e,t,n,r,null);Gi(e,n)}return null}function h(e,t,n,r,o){if("string"===typeof r&&""!==r||"number"===typeof r)return s(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case w:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case j:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case M:return h(e,t,n,(0,r._init)(r._payload),o)}if(te(r)||R(r))return d(t,e=e.get(n)||null,r,o,null);Gi(t,r)}return null}function y(o,i,l,s){for(var u=null,c=null,d=i,y=i=0,g=null;null!==d&&y<l.length;y++){d.index>y?(g=d,d=null):g=d.sibling;var m=p(o,d,l[y],s);if(null===m){null===d&&(d=g);break}e&&d&&null===m.alternate&&t(o,d),i=a(m,i,y),null===c?u=m:c.sibling=m,c=m,d=g}if(y===l.length)return n(o,d),ii&&Jo(o,y),u;if(null===d){for(;y<l.length;y++)null!==(d=f(o,l[y],s))&&(i=a(d,i,y),null===c?u=d:c.sibling=d,c=d);return ii&&Jo(o,y),u}for(d=r(o,d);y<l.length;y++)null!==(g=h(d,o,y,l[y],s))&&(e&&null!==g.alternate&&d.delete(null===g.key?y:g.key),i=a(g,i,y),null===c?u=g:c.sibling=g,c=g);return e&&d.forEach((function(e){return t(o,e)})),ii&&Jo(o,y),u}function g(o,l,s,u){var c=R(s);if("function"!==typeof c)throw Error(i(150));if(null==(s=c.call(s)))throw Error(i(151));for(var d=c=null,y=l,g=l=0,m=null,v=s.next();null!==y&&!v.done;g++,v=s.next()){y.index>g?(m=y,y=null):m=y.sibling;var b=p(o,y,v.value,u);if(null===b){null===y&&(y=m);break}e&&y&&null===b.alternate&&t(o,y),l=a(b,l,g),null===d?c=b:d.sibling=b,d=b,y=m}if(v.done)return n(o,y),ii&&Jo(o,g),c;if(null===y){for(;!v.done;g++,v=s.next())null!==(v=f(o,v.value,u))&&(l=a(v,l,g),null===d?c=v:d.sibling=v,d=v);return ii&&Jo(o,g),c}for(y=r(o,y);!v.done;g++,v=s.next())null!==(v=h(y,o,g,v.value,u))&&(e&&null!==v.alternate&&y.delete(null===v.key?g:v.key),l=a(v,l,g),null===d?c=v:d.sibling=v,d=v);return e&&y.forEach((function(e){return t(o,e)})),ii&&Jo(o,g),c}return function e(r,i,a,s){if("object"===typeof a&&null!==a&&a.type===S&&null===a.key&&(a=a.props.children),"object"===typeof a&&null!==a){switch(a.$$typeof){case w:e:{for(var u=a.key,c=i;null!==c;){if(c.key===u){if((u=a.type)===S){if(7===c.tag){n(r,c.sibling),(i=o(c,a.props.children)).return=r,r=i;break e}}else if(c.elementType===u||"object"===typeof u&&null!==u&&u.$$typeof===M&&Yi(u)===c.type){n(r,c.sibling),(i=o(c,a.props)).ref=qi(r,c,a),i.return=r,r=i;break e}n(r,c);break}t(r,c),c=c.sibling}a.type===S?((i=Nu(a.props.children,r.mode,s,a.key)).return=r,r=i):((s=Ru(a.type,a.key,a.props,null,r.mode,s)).ref=qi(r,i,a),s.return=r,r=s)}return l(r);case j:e:{for(c=a.key;null!==i;){if(i.key===c){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=Bu(a,r.mode,s)).return=r,r=i}return l(r);case M:return e(r,i,(c=a._init)(a._payload),s)}if(te(a))return y(r,i,a,s);if(R(a))return g(r,i,a,s);Gi(r,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=Fu(a,r.mode,s)).return=r,r=i),l(r)):n(r,i)}}var Xi=Qi(!0),Zi=Qi(!1),Ji={},ea=Co(Ji),ta=Co(Ji),na=Co(Ji);function ra(e){if(e===Ji)throw Error(i(174));return e}function oa(e,t){switch(Oo(na,t),Oo(ta,e),Oo(ea,Ji),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:se(null,"");break;default:t=se(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_o(ea),Oo(ea,t)}function ia(){_o(ea),_o(ta),_o(na)}function aa(e){ra(na.current);var t=ra(ea.current),n=se(t,e.type);t!==n&&(Oo(ta,e),Oo(ea,n))}function la(e){ta.current===e&&(_o(ea),_o(ta))}var sa=Co(0);function ua(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ca=[];function da(){for(var e=0;e<ca.length;e++)ca[e]._workInProgressVersionPrimary=null;ca.length=0}var fa=x.ReactCurrentDispatcher,pa=x.ReactCurrentBatchConfig,ha=0,ya=null,ga=null,ma=null,va=!1,ba=!1,xa=0,wa=0;function ja(){throw Error(i(321))}function Sa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function ka(e,t,n,r,o,a){if(ha=a,ya=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fa.current=null===e||null===e.memoizedState?ll:sl,e=n(r,o),ba){a=0;do{if(ba=!1,xa=0,25<=a)throw Error(i(301));a+=1,ma=ga=null,t.updateQueue=null,fa.current=ul,e=n(r,o)}while(ba)}if(fa.current=al,t=null!==ga&&null!==ga.next,ha=0,ma=ga=ya=null,va=!1,t)throw Error(i(300));return e}function Ca(){var e=0!==xa;return xa=0,e}function _a(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ma?ya.memoizedState=ma=e:ma=ma.next=e,ma}function Oa(){if(null===ga){var e=ya.alternate;e=null!==e?e.memoizedState:null}else e=ga.next;var t=null===ma?ya.memoizedState:ma.next;if(null!==t)ma=t,ga=e;else{if(null===e)throw Error(i(310));e={memoizedState:(ga=e).memoizedState,baseState:ga.baseState,baseQueue:ga.baseQueue,queue:ga.queue,next:null},null===ma?ya.memoizedState=ma=e:ma=ma.next=e}return ma}function Ea(e,t){return"function"===typeof t?t(e):t}function Ta(e){var t=Oa(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=ga,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var l=o.next;o.next=a.next,a.next=l}r.baseQueue=o=a,n.pending=null}if(null!==o){a=o.next,r=r.baseState;var s=l=null,u=null,c=a;do{var d=c.lane;if((ha&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(s=u=f,l=r):u=u.next=f,ya.lanes|=d,Ls|=d}c=c.next}while(null!==c&&c!==a);null===u?l=r:u.next=s,lr(r,t.memoizedState)||(xl=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{a=o.lane,ya.lanes|=a,Ls|=a,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Pa(e){var t=Oa(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var l=o=o.next;do{a=e(a,l.action),l=l.next}while(l!==o);lr(a,t.memoizedState)||(xl=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Aa(){}function Ma(e,t){var n=ya,r=Oa(),o=t(),a=!lr(r.memoizedState,o);if(a&&(r.memoizedState=o,xl=!0),r=r.queue,Ka(Ra.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||null!==ma&&1&ma.memoizedState.tag){if(n.flags|=2048,Ba(9,Ia.bind(null,n,r,o,t),void 0,null),null===Ps)throw Error(i(349));0!==(30&ha)||Da(n,t,o)}return o}function Da(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ya.updateQueue)?(t={lastEffect:null,stores:null},ya.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ia(e,t,n,r){t.value=n,t.getSnapshot=r,Na(t)&&La(e)}function Ra(e,t,n){return n((function(){Na(t)&&La(e)}))}function Na(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lr(e,n)}catch(r){return!0}}function La(e){var t=Pi(e,1);null!==t&&ru(t,e,1,-1)}function Fa(e){var t=_a();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:e},t.queue=e,e=e.dispatch=nl.bind(null,ya,e),[t.memoizedState,e]}function Ba(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ya.updateQueue)?(t={lastEffect:null,stores:null},ya.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function za(){return Oa().memoizedState}function Ua(e,t,n,r){var o=_a();ya.flags|=e,o.memoizedState=Ba(1|t,n,void 0,void 0===r?null:r)}function Wa(e,t,n,r){var o=Oa();r=void 0===r?null:r;var i=void 0;if(null!==ga){var a=ga.memoizedState;if(i=a.destroy,null!==r&&Sa(r,a.deps))return void(o.memoizedState=Ba(t,n,i,r))}ya.flags|=e,o.memoizedState=Ba(1|t,n,i,r)}function Ha(e,t){return Ua(8390656,8,e,t)}function Ka(e,t){return Wa(2048,8,e,t)}function $a(e,t){return Wa(4,2,e,t)}function Va(e,t){return Wa(4,4,e,t)}function qa(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ga(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Wa(4,4,qa.bind(null,t,e),n)}function Ya(){}function Qa(e,t){var n=Oa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Sa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xa(e,t){var n=Oa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Sa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Za(e,t,n){return 0===(21&ha)?(e.baseState&&(e.baseState=!1,xl=!0),e.memoizedState=n):(lr(n,t)||(n=yt(),ya.lanes|=n,Ls|=n,e.baseState=!0),t)}function Ja(e,t){var n=bt;bt=0!==n&&4>n?n:4,e(!0);var r=pa.transition;pa.transition={};try{e(!1),t()}finally{bt=n,pa.transition=r}}function el(){return Oa().memoizedState}function tl(e,t,n){var r=nu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rl(e))ol(t,n);else if(null!==(n=Ti(e,t,n,r))){ru(n,e,r,tu()),il(n,t,r)}}function nl(e,t,n){var r=nu(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rl(e))ol(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,lr(l,a)){var s=t.interleaved;return null===s?(o.next=o,Ei(t)):(o.next=s.next,s.next=o),void(t.interleaved=o)}}catch(u){}null!==(n=Ti(e,t,o,r))&&(ru(n,e,r,o=tu()),il(n,t,r))}}function rl(e){var t=e.alternate;return e===ya||null!==t&&t===ya}function ol(e,t){ba=va=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function il(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,vt(e,n)}}var al={readContext:_i,useCallback:ja,useContext:ja,useEffect:ja,useImperativeHandle:ja,useInsertionEffect:ja,useLayoutEffect:ja,useMemo:ja,useReducer:ja,useRef:ja,useState:ja,useDebugValue:ja,useDeferredValue:ja,useTransition:ja,useMutableSource:ja,useSyncExternalStore:ja,useId:ja,unstable_isNewReconciler:!1},ll={readContext:_i,useCallback:function(e,t){return _a().memoizedState=[e,void 0===t?null:t],e},useContext:_i,useEffect:Ha,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Ua(4194308,4,qa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ua(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ua(4,2,e,t)},useMemo:function(e,t){var n=_a();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_a();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=tl.bind(null,ya,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},_a().memoizedState=e},useState:Fa,useDebugValue:Ya,useDeferredValue:function(e){return _a().memoizedState=e},useTransition:function(){var e=Fa(!1),t=e[0];return e=Ja.bind(null,e[1]),_a().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ya,o=_a();if(ii){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===Ps)throw Error(i(349));0!==(30&ha)||Da(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,Ha(Ra.bind(null,r,a,e),[e]),r.flags|=2048,Ba(9,Ia.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=_a(),t=Ps.identifierPrefix;if(ii){var n=Zo;t=":"+t+"R"+(n=(Xo&~(1<<32-at(Xo)-1)).toString(32)+n),0<(n=xa++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=wa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sl={readContext:_i,useCallback:Qa,useContext:_i,useEffect:Ka,useImperativeHandle:Ga,useInsertionEffect:$a,useLayoutEffect:Va,useMemo:Xa,useReducer:Ta,useRef:za,useState:function(){return Ta(Ea)},useDebugValue:Ya,useDeferredValue:function(e){return Za(Oa(),ga.memoizedState,e)},useTransition:function(){return[Ta(Ea)[0],Oa().memoizedState]},useMutableSource:Aa,useSyncExternalStore:Ma,useId:el,unstable_isNewReconciler:!1},ul={readContext:_i,useCallback:Qa,useContext:_i,useEffect:Ka,useImperativeHandle:Ga,useInsertionEffect:$a,useLayoutEffect:Va,useMemo:Xa,useReducer:Pa,useRef:za,useState:function(){return Pa(Ea)},useDebugValue:Ya,useDeferredValue:function(e){var t=Oa();return null===ga?t.memoizedState=e:Za(t,ga.memoizedState,e)},useTransition:function(){return[Pa(Ea)[0],Oa().memoizedState]},useMutableSource:Aa,useSyncExternalStore:Ma,useId:el,unstable_isNewReconciler:!1};function cl(e,t){try{var n="",r=t;do{n+=U(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o,digest:null}}function dl(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function fl(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var pl="function"===typeof WeakMap?WeakMap:Map;function hl(e,t,n){(n=Ii(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$s||($s=!0,Vs=r),fl(0,t)},n}function yl(e,t,n){(n=Ii(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){fl(0,t)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){fl(0,t),"function"!==typeof r&&(null===qs?qs=new Set([this]):qs.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function gl(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new pl;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=_u.bind(null,e,t,n),t.then(e,e))}function ml(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vl(e,t,n,r,o){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ii(-1,1)).tag=2,Ri(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var bl=x.ReactCurrentOwner,xl=!1;function wl(e,t,n,r){t.child=null===e?Zi(t,null,n,r):Xi(t,e.child,n,r)}function jl(e,t,n,r,o){n=n.render;var i=t.ref;return Ci(t,o),r=ka(e,t,n,r,i,o),n=Ca(),null===e||xl?(ii&&n&&ti(t),t.flags|=1,wl(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,$l(e,t,o))}function Sl(e,t,n,r,o){if(null===e){var i=n.type;return"function"!==typeof i||Du(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ru(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,kl(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:sr)(a,r)&&e.ref===t.ref)return $l(e,t,o)}return t.flags|=1,(e=Iu(i,r)).ref=t.ref,e.return=t,t.child=e}function kl(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(sr(i,r)&&e.ref===t.ref){if(xl=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,$l(e,t,o);0!==(131072&e.flags)&&(xl=!0)}}return Ol(e,t,n,r,o)}function Cl(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Oo(Is,Ds),Ds|=n;else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Oo(Is,Ds),Ds|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,Oo(Is,Ds),Ds|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,Oo(Is,Ds),Ds|=r;return wl(e,t,o,n),t.child}function _l(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ol(e,t,n,r,o){var i=Do(n)?Ao:To.current;return i=Mo(t,i),Ci(t,o),n=ka(e,t,n,r,i,o),r=Ca(),null===e||xl?(ii&&r&&ti(t),t.flags|=1,wl(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,$l(e,t,o))}function El(e,t,n,r,o){if(Do(n)){var i=!0;Lo(t)}else i=!1;if(Ci(t,o),null===t.stateNode)Kl(e,t),Ki(t,n,r),Vi(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,l=t.memoizedProps;a.props=l;var s=a.context,u=n.contextType;"object"===typeof u&&null!==u?u=_i(u):u=Mo(t,u=Do(n)?Ao:To.current);var c=n.getDerivedStateFromProps,d="function"===typeof c||"function"===typeof a.getSnapshotBeforeUpdate;d||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(l!==r||s!==u)&&$i(t,a,r,u),Ai=!1;var f=t.memoizedState;a.state=f,Fi(t,r,a,o),s=t.memoizedState,l!==r||f!==s||Po.current||Ai?("function"===typeof c&&(Ui(t,n,c,r),s=t.memoizedState),(l=Ai||Hi(t,n,l,r,f,s,u))?(d||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),a.props=r,a.state=s,a.context=u,r=l):("function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Di(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:mi(t.type,l),a.props=u,d=t.pendingProps,f=a.context,"object"===typeof(s=n.contextType)&&null!==s?s=_i(s):s=Mo(t,s=Do(n)?Ao:To.current);var p=n.getDerivedStateFromProps;(c="function"===typeof p||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(l!==d||f!==s)&&$i(t,a,r,s),Ai=!1,f=t.memoizedState,a.state=f,Fi(t,r,a,o);var h=t.memoizedState;l!==d||f!==h||Po.current||Ai?("function"===typeof p&&(Ui(t,n,p,r),h=t.memoizedState),(u=Ai||Hi(t,n,u,r,f,h,s)||!1)?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,s),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,s)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=s,r=u):("function"!==typeof a.componentDidUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Tl(e,t,n,r,i,o)}function Tl(e,t,n,r,o,i){_l(e,t);var a=0!==(128&t.flags);if(!r&&!a)return o&&Fo(t,n,!1),$l(e,t,i);r=t.stateNode,bl.current=t;var l=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Xi(t,e.child,null,i),t.child=Xi(t,null,l,i)):wl(e,t,l,i),t.memoizedState=r.state,o&&Fo(t,n,!0),t.child}function Pl(e){var t=e.stateNode;t.pendingContext?Ro(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ro(0,t.context,!1),oa(e,t.containerInfo)}function Al(e,t,n,r,o){return hi(),yi(o),t.flags|=256,wl(e,t,n,r),t.child}var Ml,Dl,Il,Rl,Nl={dehydrated:null,treeContext:null,retryLane:0};function Ll(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fl(e,t,n){var r,o=t.pendingProps,a=sa.current,l=!1,s=0!==(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&0!==(2&a)),r?(l=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Oo(sa,1&a),null===e)return ci(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(s=o.children,e=o.fallback,l?(o=t.mode,l=t.child,s={mode:"hidden",children:s},0===(1&o)&&null!==l?(l.childLanes=0,l.pendingProps=s):l=Lu(s,o,0,null),e=Nu(e,o,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Ll(n),t.memoizedState=Nl,e):Bl(t,s));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,l){if(n)return 256&t.flags?(t.flags&=-257,zl(e,t,l,r=dl(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=Lu({mode:"visible",children:r.children},o,0,null),(a=Nu(a,o,l,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!==(1&t.mode)&&Xi(t,e.child,null,l),t.child.memoizedState=Ll(l),t.memoizedState=Nl,a);if(0===(1&t.mode))return zl(e,t,l,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var s=r.dgst;return r=s,zl(e,t,l,r=dl(a=Error(i(419)),r,void 0))}if(s=0!==(l&e.childLanes),xl||s){if(null!==(r=Ps)){switch(l&-l){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(r.suspendedLanes|l))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Pi(e,o),ru(r,e,o,-1))}return gu(),zl(e,t,l,r=dl(Error(i(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Eu.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,oi=uo(o.nextSibling),ri=t,ii=!0,ai=null,null!==e&&(Go[Yo++]=Xo,Go[Yo++]=Zo,Go[Yo++]=Qo,Xo=e.id,Zo=e.overflow,Qo=t),t=Bl(t,r.children),t.flags|=4096,t)}(e,t,s,o,r,a,n);if(l){l=o.fallback,s=t.mode,r=(a=e.child).sibling;var u={mode:"hidden",children:o.children};return 0===(1&s)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=u,t.deletions=null):(o=Iu(a,u)).subtreeFlags=14680064&a.subtreeFlags,null!==r?l=Iu(r,l):(l=Nu(l,s,n,null)).flags|=2,l.return=t,o.return=t,o.sibling=l,t.child=o,o=l,l=t.child,s=null===(s=e.child.memoizedState)?Ll(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},l.memoizedState=s,l.childLanes=e.childLanes&~n,t.memoizedState=Nl,o}return e=(l=e.child).sibling,o=Iu(l,{mode:"visible",children:o.children}),0===(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Bl(e,t){return(t=Lu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function zl(e,t,n,r){return null!==r&&yi(r),Xi(t,e.child,null,n),(e=Bl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ul(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ki(e.return,t,n)}function Wl(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Hl(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(wl(e,t,r.children,n),0!==(2&(r=sa.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ul(e,n,t);else if(19===e.tag)Ul(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Oo(sa,r),0===(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ua(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Wl(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ua(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Wl(t,!0,n,null,i);break;case"together":Wl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Kl(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function $l(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ls|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Iu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Iu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Vl(e,t){if(!ii)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ql(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gl(e,t,n){var r=t.pendingProps;switch(ni(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ql(t),null;case 1:case 17:return Do(t.type)&&Io(),ql(t),null;case 3:return r=t.stateNode,ia(),_o(Po),_o(To),da(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(fi(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ai&&(lu(ai),ai=null))),Dl(e,t),ql(t),null;case 5:la(t);var o=ra(na.current);if(n=t.type,null!==e&&null!=t.stateNode)Il(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return ql(t),null}if(e=ra(ea.current),fi(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[po]=t,r[ho]=a,e=0!==(1&t.mode),n){case"dialog":Br("cancel",r),Br("close",r);break;case"iframe":case"object":case"embed":Br("load",r);break;case"video":case"audio":for(o=0;o<Rr.length;o++)Br(Rr[o],r);break;case"source":Br("error",r);break;case"img":case"image":case"link":Br("error",r),Br("load",r);break;case"details":Br("toggle",r);break;case"input":Q(r,a),Br("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Br("invalid",r);break;case"textarea":oe(r,a),Br("invalid",r)}for(var s in ve(n,a),o=null,a)if(a.hasOwnProperty(s)){var u=a[s];"children"===s?"string"===typeof u?r.textContent!==u&&(!0!==a.suppressHydrationWarning&&Zr(r.textContent,u,e),o=["children",u]):"number"===typeof u&&r.textContent!==""+u&&(!0!==a.suppressHydrationWarning&&Zr(r.textContent,u,e),o=["children",""+u]):l.hasOwnProperty(s)&&null!=u&&"onScroll"===s&&Br("scroll",r)}switch(n){case"input":V(r),J(r,a,!0);break;case"textarea":V(r),ae(r);break;case"select":case"option":break;default:"function"===typeof a.onClick&&(r.onclick=Jr)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{s=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=le(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),"select"===n&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[po]=t,e[ho]=r,Ml(e,t,!1,!1),t.stateNode=e;e:{switch(s=be(n,r),n){case"dialog":Br("cancel",e),Br("close",e),o=r;break;case"iframe":case"object":case"embed":Br("load",e),o=r;break;case"video":case"audio":for(o=0;o<Rr.length;o++)Br(Rr[o],e);o=r;break;case"source":Br("error",e),o=r;break;case"img":case"image":case"link":Br("error",e),Br("load",e),o=r;break;case"details":Br("toggle",e),o=r;break;case"input":Q(e,r),o=Y(e,r),Br("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=L({},r,{value:void 0}),Br("invalid",e);break;case"textarea":oe(e,r),o=re(e,r),Br("invalid",e)}for(a in ve(n,o),u=o)if(u.hasOwnProperty(a)){var c=u[a];"style"===a?ge(e,c):"dangerouslySetInnerHTML"===a?null!=(c=c?c.__html:void 0)&&de(e,c):"children"===a?"string"===typeof c?("textarea"!==n||""!==c)&&fe(e,c):"number"===typeof c&&fe(e,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(l.hasOwnProperty(a)?null!=c&&"onScroll"===a&&Br("scroll",e):null!=c&&b(e,a,c,s))}switch(n){case"input":V(e),J(e,r,!1);break;case"textarea":V(e),ae(e);break;case"option":null!=r.value&&e.setAttribute("value",""+K(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?ne(e,!!r.multiple,a,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof o.onClick&&(e.onclick=Jr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return ql(t),null;case 6:if(e&&null!=t.stateNode)Rl(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(i(166));if(n=ra(na.current),ra(ea.current),fi(t)){if(r=t.stateNode,n=t.memoizedProps,r[po]=t,(a=r.nodeValue!==n)&&null!==(e=ri))switch(e.tag){case 3:Zr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zr(r.nodeValue,n,0!==(1&e.mode))}a&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[po]=t,t.stateNode=r}return ql(t),null;case 13:if(_o(sa),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ii&&null!==oi&&0!==(1&t.mode)&&0===(128&t.flags))pi(),hi(),t.flags|=98560,a=!1;else if(a=fi(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[po]=t}else hi(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ql(t),a=!1}else null!==ai&&(lu(ai),ai=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&sa.current)?0===Rs&&(Rs=3):gu())),null!==t.updateQueue&&(t.flags|=4),ql(t),null);case 4:return ia(),Dl(e,t),null===e&&Wr(t.stateNode.containerInfo),ql(t),null;case 10:return Si(t.type._context),ql(t),null;case 19:if(_o(sa),null===(a=t.memoizedState))return ql(t),null;if(r=0!==(128&t.flags),null===(s=a.rendering))if(r)Vl(a,!1);else{if(0!==Rs||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(s=ua(e))){for(t.flags|=128,Vl(a,!1),null!==(r=s.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=14680066,null===(s=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Oo(sa,1&sa.current|2),t.child}e=e.sibling}null!==a.tail&&Xe()>Hs&&(t.flags|=128,r=!0,Vl(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ua(s))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Vl(a,!0),null===a.tail&&"hidden"===a.tailMode&&!s.alternate&&!ii)return ql(t),null}else 2*Xe()-a.renderingStartTime>Hs&&1073741824!==n&&(t.flags|=128,r=!0,Vl(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=a.last)?n.sibling=s:t.child=s,a.last=s)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Xe(),t.sibling=null,n=sa.current,Oo(sa,r?1&n|2:1&n),t):(ql(t),null);case 22:case 23:return fu(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Ds)&&(ql(t),6&t.subtreeFlags&&(t.flags|=8192)):ql(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function Yl(e,t){switch(ni(t),t.tag){case 1:return Do(t.type)&&Io(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ia(),_o(Po),_o(To),da(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return la(t),null;case 13:if(_o(sa),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));hi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _o(sa),null;case 4:return ia(),null;case 10:return Si(t.type._context),null;case 22:case 23:return fu(),null;default:return null}}Ml=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Dl=function(){},Il=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ra(ea.current);var i,a=null;switch(n){case"input":o=Y(e,o),r=Y(e,r),a=[];break;case"select":o=L({},o,{value:void 0}),r=L({},r,{value:void 0}),a=[];break;case"textarea":o=re(e,o),r=re(e,r),a=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(e.onclick=Jr)}for(c in ve(n,r),n=null,o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&null!=o[c])if("style"===c){var s=o[c];for(i in s)s.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(l.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in r){var u=r[c];if(s=null!=o?o[c]:void 0,r.hasOwnProperty(c)&&u!==s&&(null!=u||null!=s))if("style"===c)if(s){for(i in s)!s.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&s[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(a||(a=[]),a.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,s=s?s.__html:void 0,null!=u&&s!==u&&(a=a||[]).push(c,u)):"children"===c?"string"!==typeof u&&"number"!==typeof u||(a=a||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(l.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Br("scroll",e),a||s===u||(a=[])):(a=a||[]).push(c,u))}n&&(a=a||[]).push("style",n);var c=a;(t.updateQueue=c)&&(t.flags|=4)}},Rl=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ql=!1,Xl=!1,Zl="function"===typeof WeakSet?WeakSet:Set,Jl=null;function es(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){Cu(e,t,r)}else n.current=null}function ts(e,t,n){try{n()}catch(r){Cu(e,t,r)}}var ns=!1;function rs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&ts(t,n,i)}o=o.next}while(o!==r)}}function os(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function is(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function as(e){var t=e.alternate;null!==t&&(e.alternate=null,as(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[po],delete t[ho],delete t[go],delete t[mo],delete t[vo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ls(e){return 5===e.tag||3===e.tag||4===e.tag}function ss(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ls(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function us(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Jr));else if(4!==r&&null!==(e=e.child))for(us(e,t,n),e=e.sibling;null!==e;)us(e,t,n),e=e.sibling}function cs(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(cs(e,t,n),e=e.sibling;null!==e;)cs(e,t,n),e=e.sibling}var ds=null,fs=!1;function ps(e,t,n){for(n=n.child;null!==n;)hs(e,t,n),n=n.sibling}function hs(e,t,n){if(it&&"function"===typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(ot,n)}catch(l){}switch(n.tag){case 5:Xl||es(n,t);case 6:var r=ds,o=fs;ds=null,ps(e,t,n),fs=o,null!==(ds=r)&&(fs?(e=ds,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ds.removeChild(n.stateNode));break;case 18:null!==ds&&(fs?(e=ds,n=n.stateNode,8===e.nodeType?so(e.parentNode,n):1===e.nodeType&&so(e,n),Wt(e)):so(ds,n.stateNode));break;case 4:r=ds,o=fs,ds=n.stateNode.containerInfo,fs=!0,ps(e,t,n),ds=r,fs=o;break;case 0:case 11:case 14:case 15:if(!Xl&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!==(2&i)||0!==(4&i))&&ts(n,t,a),o=o.next}while(o!==r)}ps(e,t,n);break;case 1:if(!Xl&&(es(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Cu(n,t,l)}ps(e,t,n);break;case 21:ps(e,t,n);break;case 22:1&n.mode?(Xl=(r=Xl)||null!==n.memoizedState,ps(e,t,n),Xl=r):ps(e,t,n);break;default:ps(e,t,n)}}function ys(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Zl),t.forEach((function(t){var r=Tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function gs(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var a=e,l=t,s=l;e:for(;null!==s;){switch(s.tag){case 5:ds=s.stateNode,fs=!1;break e;case 3:case 4:ds=s.stateNode.containerInfo,fs=!0;break e}s=s.return}if(null===ds)throw Error(i(160));hs(a,l,o),ds=null,fs=!1;var u=o.alternate;null!==u&&(u.return=null),o.return=null}catch(c){Cu(o,t,c)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ms(t,e),t=t.sibling}function ms(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gs(t,e),vs(e),4&r){try{rs(3,e,e.return),os(3,e)}catch(g){Cu(e,e.return,g)}try{rs(5,e,e.return)}catch(g){Cu(e,e.return,g)}}break;case 1:gs(t,e),vs(e),512&r&&null!==n&&es(n,n.return);break;case 5:if(gs(t,e),vs(e),512&r&&null!==n&&es(n,n.return),32&e.flags){var o=e.stateNode;try{fe(o,"")}catch(g){Cu(e,e.return,g)}}if(4&r&&null!=(o=e.stateNode)){var a=e.memoizedProps,l=null!==n?n.memoizedProps:a,s=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===s&&"radio"===a.type&&null!=a.name&&X(o,a),be(s,l);var c=be(s,a);for(l=0;l<u.length;l+=2){var d=u[l],f=u[l+1];"style"===d?ge(o,f):"dangerouslySetInnerHTML"===d?de(o,f):"children"===d?fe(o,f):b(o,d,f,c)}switch(s){case"input":Z(o,a);break;case"textarea":ie(o,a);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var h=a.value;null!=h?ne(o,!!a.multiple,h,!1):p!==!!a.multiple&&(null!=a.defaultValue?ne(o,!!a.multiple,a.defaultValue,!0):ne(o,!!a.multiple,a.multiple?[]:"",!1))}o[ho]=a}catch(g){Cu(e,e.return,g)}}break;case 6:if(gs(t,e),vs(e),4&r){if(null===e.stateNode)throw Error(i(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(g){Cu(e,e.return,g)}}break;case 3:if(gs(t,e),vs(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Wt(t.containerInfo)}catch(g){Cu(e,e.return,g)}break;case 4:default:gs(t,e),vs(e);break;case 13:gs(t,e),vs(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Ws=Xe())),4&r&&ys(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Xl=(c=Xl)||d,gs(t,e),Xl=c):gs(t,e),vs(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&0!==(1&e.mode))for(Jl=e,d=e.child;null!==d;){for(f=Jl=d;null!==Jl;){switch(h=(p=Jl).child,p.tag){case 0:case 11:case 14:case 15:rs(4,p,p.return);break;case 1:es(p,p.return);var y=p.stateNode;if("function"===typeof y.componentWillUnmount){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){Cu(r,n,g)}}break;case 5:es(p,p.return);break;case 22:if(null!==p.memoizedState){js(f);continue}}null!==h?(h.return=p,Jl=h):js(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{o=f.stateNode,c?"function"===typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(s=f.stateNode,l=void 0!==(u=f.memoizedProps.style)&&null!==u&&u.hasOwnProperty("display")?u.display:null,s.style.display=ye("display",l))}catch(g){Cu(e,e.return,g)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Cu(e,e.return,g)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:gs(t,e),vs(e),4&r&&ys(e);case 21:}}function vs(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(ls(n)){var r=n;break e}n=n.return}throw Error(i(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(fe(o,""),r.flags&=-33),cs(e,ss(e),o);break;case 3:case 4:var a=r.stateNode.containerInfo;us(e,ss(e),a);break;default:throw Error(i(161))}}catch(l){Cu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bs(e,t,n){Jl=e,xs(e,t,n)}function xs(e,t,n){for(var r=0!==(1&e.mode);null!==Jl;){var o=Jl,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Ql;if(!a){var l=o.alternate,s=null!==l&&null!==l.memoizedState||Xl;l=Ql;var u=Xl;if(Ql=a,(Xl=s)&&!u)for(Jl=o;null!==Jl;)s=(a=Jl).child,22===a.tag&&null!==a.memoizedState?Ss(o):null!==s?(s.return=a,Jl=s):Ss(o);for(;null!==i;)Jl=i,xs(i,t,n),i=i.sibling;Jl=o,Ql=l,Xl=u}ws(e)}else 0!==(8772&o.subtreeFlags)&&null!==i?(i.return=o,Jl=i):ws(e)}}function ws(e){for(;null!==Jl;){var t=Jl;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Xl||os(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Xl)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:mi(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Bi(t,a,r);break;case 3:var l=t.updateQueue;if(null!==l){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Bi(t,l,n)}break;case 5:var s=t.stateNode;if(null===n&&4&t.flags){n=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Wt(f)}}}break;default:throw Error(i(163))}Xl||512&t.flags&&is(t)}catch(p){Cu(t,t.return,p)}}if(t===e){Jl=null;break}if(null!==(n=t.sibling)){n.return=t.return,Jl=n;break}Jl=t.return}}function js(e){for(;null!==Jl;){var t=Jl;if(t===e){Jl=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Jl=n;break}Jl=t.return}}function Ss(e){for(;null!==Jl;){var t=Jl;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{os(4,t)}catch(s){Cu(t,n,s)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(s){Cu(t,o,s)}}var i=t.return;try{is(t)}catch(s){Cu(t,i,s)}break;case 5:var a=t.return;try{is(t)}catch(s){Cu(t,a,s)}}}catch(s){Cu(t,t.return,s)}if(t===e){Jl=null;break}var l=t.sibling;if(null!==l){l.return=t.return,Jl=l;break}Jl=t.return}}var ks,Cs=Math.ceil,_s=x.ReactCurrentDispatcher,Os=x.ReactCurrentOwner,Es=x.ReactCurrentBatchConfig,Ts=0,Ps=null,As=null,Ms=0,Ds=0,Is=Co(0),Rs=0,Ns=null,Ls=0,Fs=0,Bs=0,zs=null,Us=null,Ws=0,Hs=1/0,Ks=null,$s=!1,Vs=null,qs=null,Gs=!1,Ys=null,Qs=0,Xs=0,Zs=null,Js=-1,eu=0;function tu(){return 0!==(6&Ts)?Xe():-1!==Js?Js:Js=Xe()}function nu(e){return 0===(1&e.mode)?1:0!==(2&Ts)&&0!==Ms?Ms&-Ms:null!==gi.transition?(0===eu&&(eu=yt()),eu):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Qt(e.type)}function ru(e,t,n,r){if(50<Xs)throw Xs=0,Zs=null,Error(i(185));mt(e,n,r),0!==(2&Ts)&&e===Ps||(e===Ps&&(0===(2&Ts)&&(Fs|=n),4===Rs&&su(e,Ms)),ou(e,r),1===n&&0===Ts&&0===(1&t.mode)&&(Hs=Xe()+500,zo&&Ho()))}function ou(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-at(i),l=1<<a,s=o[a];-1===s?0!==(l&n)&&0===(l&r)||(o[a]=pt(l,t)):s<=t&&(e.expiredLanes|=l),i&=~l}}(e,t);var r=ft(e,e===Ps?Ms:0);if(0===r)null!==n&&Ge(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ge(n),1===t)0===e.tag?function(e){zo=!0,Wo(e)}(uu.bind(null,e)):Wo(uu.bind(null,e)),ao((function(){0===(6&Ts)&&Ho()})),n=null;else{switch(xt(r)){case 1:n=Je;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Pu(n,iu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function iu(e,t){if(Js=-1,eu=0,0!==(6&Ts))throw Error(i(327));var n=e.callbackNode;if(Su()&&e.callbackNode!==n)return null;var r=ft(e,e===Ps?Ms:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=mu(e,r);else{t=r;var o=Ts;Ts|=2;var a=yu();for(Ps===e&&Ms===t||(Ks=null,Hs=Xe()+500,pu(e,t));;)try{bu();break}catch(s){hu(e,s)}ji(),_s.current=a,Ts=o,null!==As?t=0:(Ps=null,Ms=0,t=Rs)}if(0!==t){if(2===t&&(0!==(o=ht(e))&&(r=o,t=au(e,o))),1===t)throw n=Ns,pu(e,0),su(e,r),ou(e,Xe()),n;if(6===t)su(e,r);else{if(o=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!lr(i(),o))return!1}catch(l){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)&&(2===(t=mu(e,r))&&(0!==(a=ht(e))&&(r=a,t=au(e,a))),1===t))throw n=Ns,pu(e,0),su(e,r),ou(e,Xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(i(345));case 2:case 5:ju(e,Us,Ks);break;case 3:if(su(e,r),(130023424&r)===r&&10<(t=Ws+500-Xe())){if(0!==ft(e,0))break;if(((o=e.suspendedLanes)&r)!==r){tu(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ro(ju.bind(null,e,Us,Ks),t);break}ju(e,Us,Ks);break;case 4:if(su(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-at(r);a=1<<l,(l=t[l])>o&&(o=l),r&=~a}if(r=o,10<(r=(120>(r=Xe()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Cs(r/1960))-r)){e.timeoutHandle=ro(ju.bind(null,e,Us,Ks),r);break}ju(e,Us,Ks);break;default:throw Error(i(329))}}}return ou(e,Xe()),e.callbackNode===n?iu.bind(null,e):null}function au(e,t){var n=zs;return e.current.memoizedState.isDehydrated&&(pu(e,t).flags|=256),2!==(e=mu(e,t))&&(t=Us,Us=n,null!==t&&lu(t)),e}function lu(e){null===Us?Us=e:Us.push.apply(Us,e)}function su(e,t){for(t&=~Bs,t&=~Fs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function uu(e){if(0!==(6&Ts))throw Error(i(327));Su();var t=ft(e,0);if(0===(1&t))return ou(e,Xe()),null;var n=mu(e,t);if(0!==e.tag&&2===n){var r=ht(e);0!==r&&(t=r,n=au(e,r))}if(1===n)throw n=Ns,pu(e,0),su(e,t),ou(e,Xe()),n;if(6===n)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ju(e,Us,Ks),ou(e,Xe()),null}function cu(e,t){var n=Ts;Ts|=1;try{return e(t)}finally{0===(Ts=n)&&(Hs=Xe()+500,zo&&Ho())}}function du(e){null!==Ys&&0===Ys.tag&&0===(6&Ts)&&Su();var t=Ts;Ts|=1;var n=Es.transition,r=bt;try{if(Es.transition=null,bt=1,e)return e()}finally{bt=r,Es.transition=n,0===(6&(Ts=t))&&Ho()}}function fu(){Ds=Is.current,_o(Is)}function pu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oo(n)),null!==As)for(n=As.return;null!==n;){var r=n;switch(ni(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Io();break;case 3:ia(),_o(Po),_o(To),da();break;case 5:la(r);break;case 4:ia();break;case 13:case 19:_o(sa);break;case 10:Si(r.type._context);break;case 22:case 23:fu()}n=n.return}if(Ps=e,As=e=Iu(e.current,null),Ms=Ds=t,Rs=0,Ns=null,Bs=Fs=Ls=0,Us=zs=null,null!==Oi){for(t=0;t<Oi.length;t++)if(null!==(r=(n=Oi[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Oi=null}return e}function hu(e,t){for(;;){var n=As;try{if(ji(),fa.current=al,va){for(var r=ya.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}va=!1}if(ha=0,ma=ga=ya=null,ba=!1,xa=0,Os.current=null,null===n||null===n.return){Rs=1,Ns=t,As=null;break}e:{var a=e,l=n.return,s=n,u=t;if(t=Ms,s.flags|=32768,null!==u&&"object"===typeof u&&"function"===typeof u.then){var c=u,d=s,f=d.tag;if(0===(1&d.mode)&&(0===f||11===f||15===f)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=ml(l);if(null!==h){h.flags&=-257,vl(h,l,s,0,t),1&h.mode&&gl(a,c,t),u=c;var y=(t=h).updateQueue;if(null===y){var g=new Set;g.add(u),t.updateQueue=g}else y.add(u);break e}if(0===(1&t)){gl(a,c,t),gu();break e}u=Error(i(426))}else if(ii&&1&s.mode){var m=ml(l);if(null!==m){0===(65536&m.flags)&&(m.flags|=256),vl(m,l,s,0,t),yi(cl(u,s));break e}}a=u=cl(u,s),4!==Rs&&(Rs=2),null===zs?zs=[a]:zs.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Li(a,hl(0,u,t));break e;case 1:s=u;var v=a.type,b=a.stateNode;if(0===(128&a.flags)&&("function"===typeof v.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===qs||!qs.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Li(a,yl(a,s,t));break e}}a=a.return}while(null!==a)}wu(n)}catch(x){t=x,As===n&&null!==n&&(As=n=n.return);continue}break}}function yu(){var e=_s.current;return _s.current=al,null===e?al:e}function gu(){0!==Rs&&3!==Rs&&2!==Rs||(Rs=4),null===Ps||0===(268435455&Ls)&&0===(268435455&Fs)||su(Ps,Ms)}function mu(e,t){var n=Ts;Ts|=2;var r=yu();for(Ps===e&&Ms===t||(Ks=null,pu(e,t));;)try{vu();break}catch(o){hu(e,o)}if(ji(),Ts=n,_s.current=r,null!==As)throw Error(i(261));return Ps=null,Ms=0,Rs}function vu(){for(;null!==As;)xu(As)}function bu(){for(;null!==As&&!Ye();)xu(As)}function xu(e){var t=ks(e.alternate,e,Ds);e.memoizedProps=e.pendingProps,null===t?wu(e):As=t,Os.current=null}function wu(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=Gl(n,t,Ds)))return void(As=n)}else{if(null!==(n=Yl(n,t)))return n.flags&=32767,void(As=n);if(null===e)return Rs=6,void(As=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(As=t);As=t=e}while(null!==t);0===Rs&&(Rs=5)}function ju(e,t,n){var r=bt,o=Es.transition;try{Es.transition=null,bt=1,function(e,t,n,r){do{Su()}while(null!==Ys);if(0!==(6&Ts))throw Error(i(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-at(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Ps&&(As=Ps=null,Ms=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||Gs||(Gs=!0,Pu(tt,(function(){return Su(),null}))),a=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||a){a=Es.transition,Es.transition=null;var l=bt;bt=1;var s=Ts;Ts|=4,Os.current=null,function(e,t){if(eo=Kt,pr(e=fr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(w){n=null;break e}var l=0,s=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||0!==o&&3!==f.nodeType||(s=l+o),f!==a||0!==r&&3!==f.nodeType||(u=l+r),3===f.nodeType&&(l+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(s=l),p===a&&++d===r&&(u=l),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}n=-1===s||-1===u?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(to={focusedElem:e,selectionRange:n},Kt=!1,Jl=t;null!==Jl;)if(e=(t=Jl).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Jl=e;else for(;null!==Jl;){t=Jl;try{var y=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==y){var g=y.memoizedProps,m=y.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:mi(t.type,g),m);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(i(163))}}catch(w){Cu(t,t.return,w)}if(null!==(e=t.sibling)){e.return=t.return,Jl=e;break}Jl=t.return}y=ns,ns=!1}(e,n),ms(n,e),hr(to),Kt=!!eo,to=eo=null,e.current=n,bs(n,e,o),Qe(),Ts=s,bt=l,Es.transition=a}else e.current=n;if(Gs&&(Gs=!1,Ys=e,Qs=o),a=e.pendingLanes,0===a&&(qs=null),function(e){if(it&&"function"===typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(ot,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),ou(e,Xe()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if($s)throw $s=!1,e=Vs,Vs=null,e;0!==(1&Qs)&&0!==e.tag&&Su(),a=e.pendingLanes,0!==(1&a)?e===Zs?Xs++:(Xs=0,Zs=e):Xs=0,Ho()}(e,t,n,r)}finally{Es.transition=o,bt=r}return null}function Su(){if(null!==Ys){var e=xt(Qs),t=Es.transition,n=bt;try{if(Es.transition=null,bt=16>e?16:e,null===Ys)var r=!1;else{if(e=Ys,Ys=null,Qs=0,0!==(6&Ts))throw Error(i(331));var o=Ts;for(Ts|=4,Jl=e.current;null!==Jl;){var a=Jl,l=a.child;if(0!==(16&Jl.flags)){var s=a.deletions;if(null!==s){for(var u=0;u<s.length;u++){var c=s[u];for(Jl=c;null!==Jl;){var d=Jl;switch(d.tag){case 0:case 11:case 15:rs(8,d,a)}var f=d.child;if(null!==f)f.return=d,Jl=f;else for(;null!==Jl;){var p=(d=Jl).sibling,h=d.return;if(as(d),d===c){Jl=null;break}if(null!==p){p.return=h,Jl=p;break}Jl=h}}}var y=a.alternate;if(null!==y){var g=y.child;if(null!==g){y.child=null;do{var m=g.sibling;g.sibling=null,g=m}while(null!==g)}}Jl=a}}if(0!==(2064&a.subtreeFlags)&&null!==l)l.return=a,Jl=l;else e:for(;null!==Jl;){if(0!==(2048&(a=Jl).flags))switch(a.tag){case 0:case 11:case 15:rs(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,Jl=v;break e}Jl=a.return}}var b=e.current;for(Jl=b;null!==Jl;){var x=(l=Jl).child;if(0!==(2064&l.subtreeFlags)&&null!==x)x.return=l,Jl=x;else e:for(l=b;null!==Jl;){if(0!==(2048&(s=Jl).flags))try{switch(s.tag){case 0:case 11:case 15:os(9,s)}}catch(j){Cu(s,s.return,j)}if(s===l){Jl=null;break e}var w=s.sibling;if(null!==w){w.return=s.return,Jl=w;break e}Jl=s.return}}if(Ts=o,Ho(),it&&"function"===typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(ot,e)}catch(j){}r=!0}return r}finally{bt=n,Es.transition=t}}return!1}function ku(e,t,n){e=Ri(e,t=hl(0,t=cl(n,t),1),1),t=tu(),null!==e&&(mt(e,1,t),ou(e,t))}function Cu(e,t,n){if(3===e.tag)ku(e,e,n);else for(;null!==t;){if(3===t.tag){ku(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===qs||!qs.has(r))){t=Ri(t,e=yl(t,e=cl(n,e),1),1),e=tu(),null!==t&&(mt(t,1,e),ou(t,e));break}}t=t.return}}function _u(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=tu(),e.pingedLanes|=e.suspendedLanes&n,Ps===e&&(Ms&n)===n&&(4===Rs||3===Rs&&(130023424&Ms)===Ms&&500>Xe()-Ws?pu(e,0):Bs|=n),ou(e,t)}function Ou(e,t){0===t&&(0===(1&e.mode)?t=1:(t=ct,0===(130023424&(ct<<=1))&&(ct=4194304)));var n=tu();null!==(e=Pi(e,t))&&(mt(e,t,n),ou(e,n))}function Eu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Ou(e,n)}function Tu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),Ou(e,n)}function Pu(e,t){return qe(e,t)}function Au(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mu(e,t,n,r){return new Au(e,t,n,r)}function Du(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Iu(e,t){var n=e.alternate;return null===n?((n=Mu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ru(e,t,n,r,o,a){var l=2;if(r=e,"function"===typeof e)Du(e)&&(l=1);else if("string"===typeof e)l=5;else e:switch(e){case S:return Nu(n.children,o,a,t);case k:l=8,o|=8;break;case C:return(e=Mu(12,n,t,2|o)).elementType=C,e.lanes=a,e;case T:return(e=Mu(13,n,t,o)).elementType=T,e.lanes=a,e;case P:return(e=Mu(19,n,t,o)).elementType=P,e.lanes=a,e;case D:return Lu(n,o,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case _:l=10;break e;case O:l=9;break e;case E:l=11;break e;case A:l=14;break e;case M:l=16,r=null;break e}throw Error(i(130,null==e?e:typeof e,""))}return(t=Mu(l,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function Nu(e,t,n,r){return(e=Mu(7,e,r,t)).lanes=n,e}function Lu(e,t,n,r){return(e=Mu(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={isHidden:!1},e}function Fu(e,t,n){return(e=Mu(6,e,null,t)).lanes=n,e}function Bu(e,t,n){return(t=Mu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zu(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Uu(e,t,n,r,o,i,a,l,s){return e=new zu(e,t,n,l,s),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Mu(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mi(i),e}function Wu(e){if(!e)return Eo;e:{if(We(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Do(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(Do(n))return No(e,n,t)}return t}function Hu(e,t,n,r,o,i,a,l,s){return(e=Uu(n,r,!0,e,0,i,0,l,s)).context=Wu(null),n=e.current,(i=Ii(r=tu(),o=nu(n))).callback=void 0!==t&&null!==t?t:null,Ri(n,i,o),e.current.lanes=o,mt(e,o,r),ou(e,r),e}function Ku(e,t,n,r){var o=t.current,i=tu(),a=nu(o);return n=Wu(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ii(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ri(o,t,a))&&(ru(e,o,a,i),Ni(e,o,a)),a}function $u(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function qu(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}ks=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Po.current)xl=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return xl=!1,function(e,t,n){switch(t.tag){case 3:Pl(t),hi();break;case 5:aa(t);break;case 1:Do(t.type)&&Lo(t);break;case 4:oa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Oo(vi,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Oo(sa,1&sa.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Fl(e,t,n):(Oo(sa,1&sa.current),null!==(e=$l(e,t,n))?e.sibling:null);Oo(sa,1&sa.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return Hl(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),Oo(sa,sa.current),r)break;return null;case 22:case 23:return t.lanes=0,Cl(e,t,n)}return $l(e,t,n)}(e,t,n);xl=0!==(131072&e.flags)}else xl=!1,ii&&0!==(1048576&t.flags)&&ei(t,qo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Kl(e,t),e=t.pendingProps;var o=Mo(t,To.current);Ci(t,n),o=ka(null,t,r,e,o,n);var a=Ca();return t.flags|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Do(r)?(a=!0,Lo(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,Mi(t),o.updater=Wi,t.stateNode=o,o._reactInternals=t,Vi(t,r,e,n),t=Tl(null,t,r,!0,a,n)):(t.tag=0,ii&&a&&ti(t),wl(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Kl(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"===typeof e)return Du(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===E)return 11;if(e===A)return 14}return 2}(r),e=mi(r,e),o){case 0:t=Ol(null,t,r,e,n);break e;case 1:t=El(null,t,r,e,n);break e;case 11:t=jl(null,t,r,e,n);break e;case 14:t=Sl(null,t,r,mi(r.type,e),n);break e}throw Error(i(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,Ol(e,t,r,o=t.elementType===r?o:mi(r,o),n);case 1:return r=t.type,o=t.pendingProps,El(e,t,r,o=t.elementType===r?o:mi(r,o),n);case 3:e:{if(Pl(t),null===e)throw Error(i(387));r=t.pendingProps,o=(a=t.memoizedState).element,Di(e,t),Fi(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Al(e,t,r,n,o=cl(Error(i(423)),t));break e}if(r!==o){t=Al(e,t,r,n,o=cl(Error(i(424)),t));break e}for(oi=uo(t.stateNode.containerInfo.firstChild),ri=t,ii=!0,ai=null,n=Zi(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(hi(),r===o){t=$l(e,t,n);break e}wl(e,t,r,n)}t=t.child}return t;case 5:return aa(t),null===e&&ci(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,l=o.children,no(r,o)?l=null:null!==a&&no(r,a)&&(t.flags|=32),_l(e,t),wl(e,t,l,n),t.child;case 6:return null===e&&ci(t),null;case 13:return Fl(e,t,n);case 4:return oa(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Xi(t,null,r,n):wl(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,jl(e,t,r,o=t.elementType===r?o:mi(r,o),n);case 7:return wl(e,t,t.pendingProps,n),t.child;case 8:case 12:return wl(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,a=t.memoizedProps,l=o.value,Oo(vi,r._currentValue),r._currentValue=l,null!==a)if(lr(a.value,l)){if(a.children===o.children&&!Po.current){t=$l(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var s=a.dependencies;if(null!==s){l=a.child;for(var u=s.firstContext;null!==u;){if(u.context===r){if(1===a.tag){(u=Ii(-1,n&-n)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=n,null!==(u=a.alternate)&&(u.lanes|=n),ki(a.return,n,t),s.lanes|=n;break}u=u.next}}else if(10===a.tag)l=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(l=a.return))throw Error(i(341));l.lanes|=n,null!==(s=l.alternate)&&(s.lanes|=n),ki(l,n,t),l=a.sibling}else l=a.child;if(null!==l)l.return=a;else for(l=a;null!==l;){if(l===t){l=null;break}if(null!==(a=l.sibling)){a.return=l.return,l=a;break}l=l.return}a=l}wl(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ci(t,n),r=r(o=_i(o)),t.flags|=1,wl(e,t,r,n),t.child;case 14:return o=mi(r=t.type,t.pendingProps),Sl(e,t,r,o=mi(r.type,o),n);case 15:return kl(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:mi(r,o),Kl(e,t),t.tag=1,Do(r)?(e=!0,Lo(t)):e=!1,Ci(t,n),Ki(t,r,o),Vi(t,r,o,n),Tl(null,t,r,!0,e,n);case 19:return Hl(e,t,n);case 22:return Cl(e,t,n)}throw Error(i(156,t.tag))};var Gu="function"===typeof reportError?reportError:function(e){console.error(e)};function Yu(e){this._internalRoot=e}function Qu(e){this._internalRoot=e}function Xu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Ju(){}function ec(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"===typeof o){var l=o;o=function(){var e=$u(a);l.call(e)}}Ku(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"===typeof r){var i=r;r=function(){var e=$u(a);i.call(e)}}var a=Hu(t,r,e,0,null,!1,0,"",Ju);return e._reactRootContainer=a,e[yo]=a.current,Wr(8===e.nodeType?e.parentNode:e),du(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"===typeof r){var l=r;r=function(){var e=$u(s);l.call(e)}}var s=Uu(e,0,!1,null,0,!1,0,"",Ju);return e._reactRootContainer=s,e[yo]=s.current,Wr(8===e.nodeType?e.parentNode:e),du((function(){Ku(t,s,n,r)})),s}(n,t,e,o,r);return $u(a)}Qu.prototype.render=Yu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Ku(e,t,null,null)},Qu.prototype.unmount=Yu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;du((function(){Ku(null,e,null,null)})),t[yo]=null}},Qu.prototype.unstable_scheduleHydration=function(e){if(e){var t=kt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&0!==t&&t<Dt[n].priority;n++);Dt.splice(n,0,e),0===n&&Lt(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(vt(t,1|n),ou(t,Xe()),0===(6&Ts)&&(Hs=Xe()+500,Ho()))}break;case 13:du((function(){var t=Pi(e,1);if(null!==t){var n=tu();ru(t,e,1,n)}})),qu(e,1)}},jt=function(e){if(13===e.tag){var t=Pi(e,134217728);if(null!==t)ru(t,e,134217728,tu());qu(e,134217728)}},St=function(e){if(13===e.tag){var t=nu(e),n=Pi(e,t);if(null!==n)ru(n,e,t,tu());qu(e,t)}},kt=function(){return bt},Ct=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}},je=function(e,t,n){switch(t){case"input":if(Z(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=jo(r);if(!o)throw Error(i(90));q(r),Z(r,o)}}}break;case"textarea":ie(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ee=cu,Te=du;var tc={usingClientEntryPoint:!1,Events:[xo,wo,jo,_e,Oe,cu]},nc={findFiberByHostInstance:bo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},rc={bundleType:nc.bundleType,version:nc.version,rendererPackageName:nc.rendererPackageName,rendererConfig:nc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$e(e))?null:e.stateNode},findFiberByHostInstance:nc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{ot=oc.inject(rc),it=oc}catch(ce){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xu(t))throw Error(i(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:j,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Xu(e))throw Error(i(299));var n=!1,r="",o=Gu;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Uu(e,1,!1,null,0,n,0,r,o),e[yo]=t.current,Wr(8===e.nodeType?e.parentNode:e),new Yu(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=null===(e=$e(t))?null:e.stateNode},t.flushSync=function(e){return du(e)},t.hydrate=function(e,t,n){if(!Zu(t))throw Error(i(200));return ec(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Xu(e))throw Error(i(405));var r=null!=n&&n.hydratedSources||null,o=!1,a="",l=Gu;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(l=n.onRecoverableError)),t=Hu(t,null,e,1,null!=n?n:null,o,0,a,l),e[yo]=t.current,Wr(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Qu(t)},t.render=function(e,t,n){if(!Zu(t))throw Error(i(200));return ec(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(i(40));return!!e._reactRootContainer&&(du((function(){ec(null,null,e,!1,(function(){e._reactRootContainer=null,e[yo]=null}))})),!0)},t.unstable_batchedUpdates=cu,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zu(n))throw Error(i(200));if(null==e||void 0===e._reactInternals)throw Error(i(38));return ec(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},7282:function(e,t,n){"use strict";var r=n(6214);t.s=r.createRoot,r.hydrateRoot},6214:function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(2663)},1320:function(e){var t="undefined"!==typeof Element,n="function"===typeof Map,r="function"===typeof Set,o="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var l,s,u,c;if(Array.isArray(e)){if((l=e.length)!=a.length)return!1;for(s=l;0!==s--;)if(!i(e[s],a[s]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(c=e.entries();!(s=c.next()).done;)if(!a.has(s.value[0]))return!1;for(c=e.entries();!(s=c.next()).done;)if(!i(s.value[1],a.get(s.value[0])))return!1;return!0}if(r&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(c=e.entries();!(s=c.next()).done;)if(!a.has(s.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((l=e.length)!=a.length)return!1;for(s=l;0!==s--;)if(e[s]!==a[s])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===a.toString();if((l=(u=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(s=l;0!==s--;)if(!Object.prototype.hasOwnProperty.call(a,u[s]))return!1;if(t&&e instanceof Element)return!1;for(s=l;0!==s--;)if(("_owner"!==u[s]&&"__v"!==u[s]&&"__o"!==u[s]||!e.$$typeof)&&!i(e[u[s]],a[u[s]]))return!1;return!0}return e!==e&&a!==a}e.exports=function(e,t){try{return i(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},4740:function(e,t){"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,m=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case u:case f:case g:case y:case s:return e;default:return t}}case o:return t}}}function j(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Lazy=g,t.Memo=y,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return j(e)||w(e)===c},t.isConcurrentMode=j,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===f},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===y},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===d||e===l||e===a||e===p||e===h||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===y||e.$$typeof===s||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===b||e.$$typeof===x||e.$$typeof===m)},t.typeOf=w},5412:function(e,t,n){"use strict";e.exports=n(4740)},4370:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof e.getDerivedStateFromProps&&"function"!==typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"===typeof t.componentWillMount?n="componentWillMount":"function"===typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof t.componentWillUpdate?l="componentWillUpdate":"function"===typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var s=e.displayName||e.name,u="function"===typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+u+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"===typeof t.getSnapshotBeforeUpdate){if("function"!==typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return a}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},5818:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(3017),a=h(i),l=h(n(6214)),s=h(n(7633)),u=h(n(8108)),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(631)),d=n(7328),f=h(d),p=n(4370);function h(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}var g=t.portalClassName="ReactModalPortal",m=t.bodyOpenClassName="ReactModal__Body--open",v=d.canUseDOM&&void 0!==l.default.createPortal,b=function(e){return document.createElement(e)},x=function(){return v?l.default.createPortal:l.default.unstable_renderSubtreeIntoContainer};function w(e){return e()}var j=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,s=Array(i),c=0;c<i;c++)s[c]=arguments[c];return n=o=y(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),o.removePortal=function(){!v&&l.default.unmountComponentAtNode(o.node);var e=w(o.props.parentSelector);e&&e.contains(o.node)?e.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(e){o.portal=e},o.renderPortal=function(e){var n=x()(o,a.default.createElement(u.default,r({defaultStyles:t.defaultStyles},e)),o.node);o.portalRef(n)},y(o,n)}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){d.canUseDOM&&(v||(this.node=b("div")),this.node.className=this.props.portalClassName,w(this.props.parentSelector).appendChild(this.node),!v&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:w(e.parentSelector),nextParent:w(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(d.canUseDOM){var r=this.props,o=r.isOpen,i=r.portalClassName;e.portalClassName!==i&&(this.node.className=i);var a=n.prevParent,l=n.nextParent;l!==a&&(a.removeChild(this.node),l.appendChild(this.node)),(e.isOpen||o)&&!v&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(d.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return d.canUseDOM&&v?(!this.node&&v&&(this.node=b("div")),x()(a.default.createElement(u.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){c.setElement(e)}}]),t}(i.Component);j.propTypes={isOpen:s.default.bool.isRequired,style:s.default.shape({content:s.default.object,overlay:s.default.object}),portalClassName:s.default.string,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,className:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),overlayClassName:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),appElement:s.default.oneOfType([s.default.instanceOf(f.default),s.default.instanceOf(d.SafeHTMLCollection),s.default.instanceOf(d.SafeNodeList),s.default.arrayOf(s.default.instanceOf(f.default))]),onAfterOpen:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,ariaHideApp:s.default.bool,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,parentSelector:s.default.func,aria:s.default.object,data:s.default.object,role:s.default.string,contentLabel:s.default.string,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func},j.defaultProps={isOpen:!1,portalClassName:g,bodyOpenClassName:m,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return a.default.createElement("div",e,t)},contentElement:function(e,t){return a.default.createElement("div",e,t)}},j.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,p.polyfill)(j),t.default=j},8108:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3017),l=g(n(7633)),s=y(n(6276)),u=g(n(576)),c=y(n(631)),d=y(n(8066)),f=n(7328),p=g(f),h=g(n(7127));function y(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function g(e){return e&&e.__esModule?e:{default:e}}n(2201);var m={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},v=function(e){return"Tab"===e.code||9===e.keyCode},b=function(e){return"Escape"===e.code||27===e.keyCode},x=0,w=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,o=e.htmlOpenClassName,i=e.bodyOpenClassName,a=e.parentSelector,l=a&&a().ownerDocument||document;i&&d.remove(l.body,i),o&&d.remove(l.getElementsByTagName("html")[0],o),r&&x>0&&0===(x-=1)&&c.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(s.returnFocus(n.props.preventScroll),s.teardownScopedFocus()):s.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),h.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(s.setupScopedFocus(n.node),s.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){v(e)&&(0,u.default)(n.content,e),n.props.shouldCloseOnEsc&&b(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===("undefined"===typeof t?"undefined":o(t))?t:{base:m[e],afterOpen:m[e]+"--after-open",beforeClose:m[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"===typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,r){return n[e+"-"+r]=t[r],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName,i=e.parentSelector,a=i&&i().ownerDocument||document;o&&d.add(a.body,o),r&&d.add(a.getElementsByTagName("html")[0],r),n&&(x+=1,c.hide(t)),h.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,l=n?{}:i.content,s=o?{}:i.overlay;if(this.shouldBeClosed())return null;var u={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},s,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},c=r({id:t,ref:this.setContentRef,style:r({},l,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(c,a);return this.props.overlayElement(u,d)}}]),t}(a.Component);w.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},w.propTypes={isOpen:l.default.bool.isRequired,defaultStyles:l.default.shape({content:l.default.object,overlay:l.default.object}),style:l.default.shape({content:l.default.object,overlay:l.default.object}),className:l.default.oneOfType([l.default.string,l.default.object]),overlayClassName:l.default.oneOfType([l.default.string,l.default.object]),parentSelector:l.default.func,bodyOpenClassName:l.default.string,htmlOpenClassName:l.default.string,ariaHideApp:l.default.bool,appElement:l.default.oneOfType([l.default.instanceOf(p.default),l.default.instanceOf(f.SafeHTMLCollection),l.default.instanceOf(f.SafeNodeList),l.default.arrayOf(l.default.instanceOf(p.default))]),onAfterOpen:l.default.func,onAfterClose:l.default.func,onRequestClose:l.default.func,closeTimeoutMS:l.default.number,shouldFocusAfterRender:l.default.bool,shouldCloseOnOverlayClick:l.default.bool,shouldReturnFocusAfterClose:l.default.bool,preventScroll:l.default.bool,role:l.default.string,contentLabel:l.default.string,aria:l.default.object,data:l.default.object,children:l.default.node,shouldCloseOnEsc:l.default.bool,overlayRef:l.default.func,contentRef:l.default.func,id:l.default.string,overlayElement:l.default.func,contentElement:l.default.func,testId:l.default.string},t.default=w,e.exports=t.default},631:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){l&&(l.removeAttribute?l.removeAttribute("aria-hidden"):null!=l.length?l.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(l).forEach((function(e){return e.removeAttribute("aria-hidden")})));l=null},t.log=function(){0},t.assertNodeList=s,t.setElement=function(e){var t=e;if("string"===typeof t&&a.canUseDOM){var n=document.querySelectorAll(t);s(n,t),t=n}return l=t||l},t.validateElement=u,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){l=null};var r,o=n(8136),i=(r=o)&&r.__esModule?r:{default:r},a=n(7328);var l=null;function s(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function u(e){var t=e||l;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,i.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},2201:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[a,l],t=0;t<e.length;t++){var n=e[t];n&&(n.parentNode&&n.parentNode.removeChild(n))}a=l=null,s=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(s.length);for(var e=[a,l],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var r,o=n(7127),i=(r=o)&&r.__esModule?r:{default:r};var a=void 0,l=void 0,s=[];function u(){0!==s.length&&s[s.length-1].focusContent()}i.default.subscribe((function(e,t){a||l||((a=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),a.style.position="absolute",a.style.opacity="0",a.setAttribute("tabindex","0"),a.addEventListener("focus",u),(l=a.cloneNode()).addEventListener("focus",u)),(s=t).length>0?(document.body.firstChild!==a&&document.body.insertBefore(a,document.body.firstChild),document.body.lastChild!==l&&document.body.appendChild(l)):(a.parentElement&&a.parentElement.removeChild(a),l.parentElement&&l.parentElement.removeChild(l))}))},8066:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){0};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)}));var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)}));var o,i}},6276:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a=[]},t.log=function(){0},t.handleBlur=u,t.handleFocus=c,t.markForFocusLater=function(){a.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==a.length&&(t=a.pop()).focus({preventScroll:e}))}catch(n){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){a.length>0&&a.pop()},t.setupScopedFocus=function(e){l=e,window.addEventListener?(window.addEventListener("blur",u,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",u),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){l=null,window.addEventListener?(window.removeEventListener("blur",u),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",u),document.detachEvent("onFocus",c))};var r,o=n(4926),i=(r=o)&&r.__esModule?r:{default:r};var a=[],l=null,s=!1;function u(){s=!0}function c(){if(s){if(s=!1,!l)return;setTimeout((function(){l.contains(document.activeElement)||((0,i.default)(l)[0]||l).focus()}),0)}}},7127:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},7328:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=n(7276);var i=((r=o)&&r.__esModule?r:{default:r}).default,a=i.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=i.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=i.canUseDOM?window.NodeList:{},t.canUseDOM=i.canUseDOM;t.default=a},576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,i.default)(e);if(!n.length)return void t.preventDefault();var r=void 0,o=t.shiftKey,l=n[0],s=n[n.length-1],u=a();if(e===u){if(!o)return;r=s}s!==u||o||(r=l);l===u&&o&&(r=s);if(r)return t.preventDefault(),void r.focus();var c=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null==c||"Chrome"==c[1]||null!=/\biPod\b|\biPad\b/g.exec(navigator.userAgent))return;var d=n.indexOf(u);d>-1&&(d+=o?-1:1);if("undefined"===typeof(r=n[d]))return t.preventDefault(),void(r=o?s:l).focus();t.preventDefault(),r.focus()};var r,o=n(4926),i=(r=o)&&r.__esModule?r:{default:r};function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?a(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},4926:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]);return n.filter(l)};var n="none",r="contents",o=/input|select|textarea|button|object|iframe/;function i(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var o=window.getComputedStyle(e),i=o.getPropertyValue("display");return t?i!==r&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,o):i===n}catch(a){return console.warn("Failed to inspect element style"),!1}}function a(e,t){var n=e.nodeName.toLowerCase();return(o.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),i(t))return!1;t=t.parentNode}return!0}(e)}function l(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&a(e,!n)}e.exports=t.default},2942:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5818),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default,e.exports=t.default},2786:function(e,t,n){"use strict";var r=n(3017),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,i={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:u,ref:c,props:i,_owner:l.current}}t.Fragment=i,t.jsx=u,t.jsxs=u},6519:function(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,g={};function m(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||h}function v(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var x=b.prototype=new v;x.constructor=b,y(x,m.prototype),x.isPureReactComponent=!0;var w=Array.isArray,j=Object.prototype.hasOwnProperty,S={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var o,i={},a=null,l=null;if(null!=t)for(o in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(a=""+t.key),t)j.call(t,o)&&!k.hasOwnProperty(o)&&(i[o]=t[o]);var s=arguments.length-2;if(1===s)i.children=r;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===i[o]&&(i[o]=s[o]);return{$$typeof:n,type:e,key:a,ref:l,props:i,_owner:S.current}}function _(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var O=/\/+/g;function E(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(e,t,o,i,a){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s=!1;if(null===e)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case n:case r:s=!0}}if(s)return a=a(s=e),e=""===i?"."+E(s,0):i,w(a)?(o="",null!=e&&(o=e.replace(O,"$&/")+"/"),T(a,t,o,"",(function(e){return e}))):null!=a&&(_(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+e)),t.push(a)),1;if(s=0,i=""===i?".":i+":",w(e))for(var u=0;u<e.length;u++){var c=i+E(l=e[u],u);s+=T(l,t,o,c,a)}else if(c=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof c)for(e=c.call(e),u=0;!(l=e.next()).done;)s+=T(l=l.value,t,o,c=i+E(l,u++),a);else if("object"===l)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function P(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var M={current:null},D={transition:null},I={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:D,ReactCurrentOwner:S};t.Children={map:P,forEach:function(e,t,n){P(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=o,t.Profiler=a,t.PureComponent=b,t.StrictMode=i,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=y({},e.props),i=e.key,a=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,l=S.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)j.call(t,u)&&!k.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==s?s[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){s=Array(u);for(var c=0;c<u;c++)s[c]=arguments[c+2];o.children=s}return{$$typeof:n,type:e.type,key:i,ref:a,props:o,_owner:l}},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:l,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=_,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=D.transition;D.transition={};try{e()}finally{D.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return M.current.useCallback(e,t)},t.useContext=function(e){return M.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return M.current.useDeferredValue(e)},t.useEffect=function(e,t){return M.current.useEffect(e,t)},t.useId=function(){return M.current.useId()},t.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return M.current.useMemo(e,t)},t.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},t.useRef=function(e){return M.current.useRef(e)},t.useState=function(e){return M.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return M.current.useTransition()},t.version="18.2.0"},3017:function(e,t,n){"use strict";e.exports=n(6519)},8993:function(e,t,n){"use strict";e.exports=n(2786)},2383:function(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],u=l+1,c=e[u];if(0>i(s,n))u<o&&0>i(c,s)?(e[r]=c,e[u]=n,r=u):(e[r]=s,e[l]=n,r=l);else{if(!(u<o&&0>i(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var l=Date,s=l.now();t.unstable_now=function(){return l.now()-s}}var u=[],c=[],d=1,f=null,p=3,h=!1,y=!1,g=!1,m="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=r(c);null!==t;){if(null===t.callback)o(c);else{if(!(t.startTime<=e))break;o(c),t.sortIndex=t.expirationTime,n(u,t)}t=r(c)}}function w(e){if(g=!1,x(e),!y)if(null!==r(u))y=!0,D(j);else{var t=r(c);null!==t&&I(w,t.startTime-e)}}function j(e,n){y=!1,g&&(g=!1,v(_),_=-1),h=!0;var i=p;try{for(x(n),f=r(u);null!==f&&(!(f.expirationTime>n)||e&&!T());){var a=f.callback;if("function"===typeof a){f.callback=null,p=f.priorityLevel;var l=a(f.expirationTime<=n);n=t.unstable_now(),"function"===typeof l?f.callback=l:f===r(u)&&o(u),x(n)}else o(u);f=r(u)}if(null!==f)var s=!0;else{var d=r(c);null!==d&&I(w,d.startTime-n),s=!1}return s}finally{f=null,p=i,h=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,k=!1,C=null,_=-1,O=5,E=-1;function T(){return!(t.unstable_now()-E<O)}function P(){if(null!==C){var e=t.unstable_now();E=e;var n=!0;try{n=C(!0,e)}finally{n?S():(k=!1,C=null)}}else k=!1}if("function"===typeof b)S=function(){b(P)};else if("undefined"!==typeof MessageChannel){var A=new MessageChannel,M=A.port2;A.port1.onmessage=P,S=function(){M.postMessage(null)}}else S=function(){m(P,0)};function D(e){C=e,k||(k=!0,S())}function I(e,n){_=m((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){y||h||(y=!0,D(j))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,o,i){var a=t.unstable_now();switch("object"===typeof i&&null!==i?i="number"===typeof(i=i.delay)&&0<i?a+i:a:i=a,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:d++,callback:o,priorityLevel:e,startTime:i,expirationTime:l=i+l,sortIndex:-1},i>a?(e.sortIndex=i,n(c,e),null===r(u)&&e===r(c)&&(g?(v(_),_=-1):g=!0,I(w,i-a))):(e.sortIndex=l,n(u,e),y||h||(y=!0,D(j))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},4796:function(e,t,n){"use strict";e.exports=n(2383)},264:function(e){var t=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],n=t.join(","),r="undefined"===typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function o(e,t){t=t||{};var o,a,l,c=[],d=[],f=e.querySelectorAll(n);for(t.includeContainer&&r.call(e,n)&&(f=Array.prototype.slice.apply(f)).unshift(e),o=0;o<f.length;o++)i(a=f[o])&&(0===(l=s(a))?c.push(a):d.push({documentOrder:o,tabIndex:l,node:a}));return d.sort(u).map((function(e){return e.node})).concat(c)}function i(e){return!(!a(e)||function(e){return function(e){return c(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'),n=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(t);return!n||n===e}(e)}(e)||s(e)<0)}function a(e){return!(e.disabled||function(e){return c(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}o.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==r.call(e,n)&&i(e)},o.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==r.call(e,l)&&a(e)};var l=t.concat("iframe").join(",");function s(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function u(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function c(e){return"INPUT"===e.tagName}e.exports=o},337:function(e){e.exports=function(e,t){var n,r,o,i,a=0;return function(){n=this,r=arguments;var e=new Date-a;return i||(e>=t?l():i=setTimeout(l,t-e)),o};function l(){i=0,a=+new Date,o=e.apply(n,r),n=null,r=null}}},9707:function(e,t,n){var r=n(2227),o=n(5015),i=o;i.v1=r,i.v4=o,e.exports=i},3304:function(e){for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,o=t;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},8593:function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},2227:function(e,t,n){var r,o,i=n(8593),a=n(3304),l=0,s=0;e.exports=function(e,t,n){var u=t&&n||0,c=t||[],d=(e=e||{}).node||r,f=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==f){var p=i();null==d&&(d=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==f&&(f=o=16383&(p[6]<<8|p[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:s+1,g=h-l+(y-s)/1e4;if(g<0&&void 0===e.clockseq&&(f=f+1&16383),(g<0||h>l)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=h,s=y,o=f;var m=(1e4*(268435455&(h+=122192928e5))+y)%4294967296;c[u++]=m>>>24&255,c[u++]=m>>>16&255,c[u++]=m>>>8&255,c[u++]=255&m;var v=h/4294967296*1e4&268435455;c[u++]=v>>>8&255,c[u++]=255&v,c[u++]=v>>>24&15|16,c[u++]=v>>>16&255,c[u++]=f>>>8|128,c[u++]=255&f;for(var b=0;b<6;++b)c[u+b]=d[b];return t||a(c)}},5015:function(e,t,n){var r=n(8593),o=n(3304);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var l=0;l<16;++l)t[i+l]=a[l];return t||o(a)}},8136:function(e){"use strict";var t=function(){};e.exports=t},6104:function(e,t,n){"use strict";e.exports=n.p+"static/media/browser-server.14ed34b8682d7b10163f.js"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=e,n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"===typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"===typeof r.then)return r}var i=Object.create(null);n.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var l=2&o&&r;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((function(e){a[e]=function(){return r[e]}}));return a.default=function(){return r},n.d(i,a),i}}(),n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))},n.u=function(e){return"static/js/"+e+"."+{145:"f5f301ec",969:"91b242b7"}[e]+".chunk.js"},n.miniCssF=function(e){},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="@actual-app/web:";n.l=function(r,o,i,a){if(e[r])e[r].push(o);else{var l,s;if(void 0!==i)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var d=u[c];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+i){l=d;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+i),l.src=r),e[r]=[o];var f=function(t,n){l.onerror=l.onload=null,clearTimeout(p);var o=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),s&&document.head.appendChild(l)}}}(),n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n.p="/",function(){n.b=document.baseURI||self.location.href;var e={179:0};n.f.j=function(t,r){var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise((function(n,r){o=e[t]=[n,r]}));r.push(o[2]=i);var a=n.p+n.u(t),l=new Error;n.l(a,(function(r){if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+t,t)}};var t=function(t,r){var o,i,a=r[0],l=r[1],s=r[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)s(n)}for(t&&t(r);u<a.length;u++)i=a[u],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=self.webpackChunk_actual_app_web=self.webpackChunk_actual_app_web||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),function(){"use strict";var e={};n.r(e),n.d(e,{addGenericErrorNotification:function(){return Ht},addNotification:function(){return Wt},applyBudgetAction:function(){return $t},closeAccount:function(){return un},closeAndDownloadBudget:function(){return er},closeBudget:function(){return Gn},closeBudgetUI:function(){return Yn},closeModal:function(){return Ut},connectAccounts:function(){return kn},connectNordigenAccounts:function(){return Cn},createAccount:function(){return ln},createBudget:function(){return Xn},createCategory:function(){return qt},createGroup:function(){return Zt},createPayee:function(){return rn},debugCell:function(){return Mn},deleteBudget:function(){return Qn},deleteCategory:function(){return Gt},deleteGroup:function(){return en},downloadBudget:function(){return tr},focused:function(){return Wn},forceCloseAccount:function(){return dn},getAccounts:function(){return on},getCategories:function(){return Vt},getPayees:function(){return tn},getUserData:function(){return lr},hideModals:function(){return Ft},importBudget:function(){return Zn},importTransactions:function(){return Tn},initiallyLoadPayees:function(){return nn},linkAccount:function(){return Sn},loadAllFiles:function(){return Vn},loadBackup:function(){return nr},loadBudget:function(){return qn},loadBudgets:function(){return Kn},loadGlobalPrefs:function(){return Rn},loadPrefs:function(){return Dn},loadRemoteFiles:function(){return $n},loggedIn:function(){return sr},makeBackup:function(){return rr},markAccountFailed:function(){return bn},markAccountRead:function(){return An},markAccountSuccess:function(){return xn},moveCategory:function(){return Qt},moveCategoryGroup:function(){return Xt},openAccountCloseModal:function(){return sn},parseTransactions:function(){return En},popModal:function(){return zt},pushModal:function(){return Nt},redo:function(){return mn},removeNotification:function(){return Kt},reopenAccount:function(){return cn},replaceModal:function(){return Lt},resetSync:function(){return or},saveGlobalPrefs:function(){return Nn},savePrefs:function(){return In},setAccountsSyncing:function(){return vn},setAppState:function(){return Fn},setFailedAccounts:function(){return wn},setLastTransaction:function(){return On},setLastUndoState:function(){return zn},setUndoEnabled:function(){return yn},showModals:function(){return Bt},signOut:function(){return ur},sync:function(){return ir},syncAccounts:function(){return _n},syncAndDownload:function(){return ar},undo:function(){return gn},unlinkAccount:function(){return jn},updateAccount:function(){return an},updateApp:function(){return Bn},updateCategory:function(){return Yt},updateGroup:function(){return Jt},updateNewTransactions:function(){return Pn},updateStatusText:function(){return Hn},uploadBudget:function(){return Jn},uploadFile:function(){return Un}});var t={};n.r(t),n.d(t,{FILE:function(){return Kc},TEXT:function(){return Vc},URL:function(){return $c}});var r={};n.r(r),n.d(r,{BudgetSummary:function(){return QM},BudgetTotalsMonth:function(){return ZM},CategoryMonth:function(){return nD},ExpenseCategoryMonth:function(){return oD},ExpenseGroupMonth:function(){return rD},GroupMonth:function(){return eD},IncomeCategoryMonth:function(){return aD},IncomeGroupMonth:function(){return iD},IncomeHeaderMonth:function(){return JM}});var o={};n.r(o),n.d(o,{BudgetSummary:function(){return mD},BudgetTotalsMonth:function(){return wD},ExpenseCategoryMonth:function(){return kD},ExpenseGroupMonth:function(){return SD},IncomeCategoryMonth:function(){return _D},IncomeGroupMonth:function(){return CD},IncomeHeaderMonth:function(){return jD}});var i={};n.r(i),n.d(i,{scaleBand:function(){return SB},scaleDiverging:function(){return gK},scaleDivergingLog:function(){return mK},scaleDivergingPow:function(){return bK},scaleDivergingSqrt:function(){return xK},scaleDivergingSymlog:function(){return vK},scaleIdentity:function(){return cU},scaleImplicit:function(){return wB},scaleLinear:function(){return uU},scaleLog:function(){return bU},scaleOrdinal:function(){return jB},scalePoint:function(){return CB},scalePow:function(){return EU},scaleQuantile:function(){return zU},scaleQuantize:function(){return UU},scaleRadial:function(){return AU},scaleSequential:function(){return uK},scaleSequentialLog:function(){return cK},scaleSequentialPow:function(){return fK},scaleSequentialQuantile:function(){return hK},scaleSequentialSqrt:function(){return pK},scaleSequentialSymlog:function(){return dK},scaleSqrt:function(){return TU},scaleSymlog:function(){return SU},scaleThreshold:function(){return WU},scaleTime:function(){return iK},scaleUtc:function(){return aK},tickFormat:function(){return lU}});var a={};n.r(a),n.d(a,{easeBack:function(){return eQ},easeBackIn:function(){return ZY},easeBackInOut:function(){return eQ},easeBackOut:function(){return JY},easeBounce:function(){return YY},easeBounceIn:function(){return GY},easeBounceInOut:function(){return QY},easeBounceOut:function(){return YY},easeCircle:function(){return LY},easeCircleIn:function(){return RY},easeCircleInOut:function(){return LY},easeCircleOut:function(){return NY},easeCubic:function(){return jY},easeCubicIn:function(){return xY},easeCubicInOut:function(){return jY},easeCubicOut:function(){return wY},easeElastic:function(){return rQ},easeElasticIn:function(){return nQ},easeElasticInOut:function(){return oQ},easeElasticOut:function(){return rQ},easeExp:function(){return IY},easeExpIn:function(){return MY},easeExpInOut:function(){return IY},easeExpOut:function(){return DY},easeLinear:function(){return gY},easePoly:function(){return CY},easePolyIn:function(){return SY},easePolyInOut:function(){return CY},easePolyOut:function(){return kY},easeQuad:function(){return bY},easeQuadIn:function(){return mY},easeQuadInOut:function(){return bY},easeQuadOut:function(){return vY},easeSin:function(){return PY},easeSinIn:function(){return EY},easeSinInOut:function(){return PY},easeSinOut:function(){return TY}});var l={};function s(e){return(t,n,r)=>{if("undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope)throw new Error("`startWorkerFromMain` should only be called from the main thread");if("undefined"===typeof Worker)throw new Error("Web workers not available. sqlite3 requires web workers to work.");e().then((e=>{let{default:o}=e,i=new o;i.postMessage({type:"init",buffers:[t,n]}),i.addEventListener("message",(e=>{r.postMessage(e.data)}))}))}}n.r(l),n.d(l,{arc:function(){return LJ},area:function(){return S0},areaRadial:function(){return M0},curveBasis:function(){return j1},curveBasisClosed:function(){return k1},curveBasisOpen:function(){return _1},curveBumpX:function(){return N0},curveBumpY:function(){return L0},curveBundle:function(){return E1},curveCardinal:function(){return A1},curveCardinalClosed:function(){return D1},curveCardinalOpen:function(){return R1},curveCatmullRom:function(){return F1},curveCatmullRomClosed:function(){return z1},curveCatmullRomOpen:function(){return W1},curveLinear:function(){return b0},curveLinearClosed:function(){return K1},curveMonotoneX:function(){return Z1},curveMonotoneY:function(){return J1},curveNatural:function(){return n5},curveStep:function(){return o5},curveStepAfter:function(){return a5},curveStepBefore:function(){return i5},line:function(){return j0},lineRadial:function(){return A0},link:function(){return U0},linkHorizontal:function(){return W0},linkRadial:function(){return K0},linkVertical:function(){return H0},pie:function(){return _0},pointRadial:function(){return D0},radialArea:function(){return M0},radialLine:function(){return A0},stack:function(){return d5},stackOffsetDiverging:function(){return p5},stackOffsetExpand:function(){return f5},stackOffsetNone:function(){return l5},stackOffsetSilhouette:function(){return h5},stackOffsetWiggle:function(){return y5},stackOrderAppearance:function(){return g5},stackOrderAscending:function(){return v5},stackOrderDescending:function(){return x5},stackOrderInsideOut:function(){return w5},stackOrderNone:function(){return s5},stackOrderReverse:function(){return j5},symbol:function(){return v1},symbolAsterisk:function(){return V0},symbolCircle:function(){return q0},symbolCross:function(){return G0},symbolDiamond:function(){return X0},symbolDiamond2:function(){return Z0},symbolPlus:function(){return J0},symbolSquare:function(){return e1},symbolSquare2:function(){return t1},symbolStar:function(){return i1},symbolTimes:function(){return y1},symbolTriangle:function(){return l1},symbolTriangle2:function(){return u1},symbolWye:function(){return h1},symbolX:function(){return y1},symbols:function(){return g1},symbolsFill:function(){return g1},symbolsStroke:function(){return m1}});const u=function(e,t){const n=s(t);return t=>{t.addEventListener("message",(r=>{if(r.data.type===e)n(r.data.argBuffer,r.data.resultBuffer,t)}))}}("__absurd:spawn-idb-worker",(()=>n.e(969).then(n.bind(n,2575)))),c=new URL(n(6104),n.b);let d,f=!1,p="23.5.0";d=new Worker(c),u(d),window.SharedArrayBuffer&&localStorage.removeItem("SharedArrayBufferOverride"),d.postMessage({type:"init",version:p,isDev:f,publicUrl:"",hash:"e2ee9d65fbc7d1214a04",isSharedArrayBufferOverrideEnabled:localStorage.getItem("SharedArrayBufferOverride")}),n.g.Actual={IS_DEV:f,ACTUAL_VERSION:p,IS_FAKE_WEB:!0,IS_BETA:!1,logToTerminal:function(){console.log(...arguments)},relaunch:()=>{window.location.reload()},openFileDialog:async e=>{let{filters:t=[],properties:n}=e;return new Promise((e=>{let n=document.createElement("input");n.type="file";let r=t.find((e=>e.extensions));r&&(n.accept=r.extensions.map((e=>"."+e)).join(",")),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),n.addEventListener("change",(t=>{let n=t.target.files[0],r=n.name.replace(/.*(\.[^.]*)/,"file$1");if(n){var o=new FileReader;o.readAsArrayBuffer(n),o.onload=async function(t){let n=`/uploads/${r}`;window.__actionsForMenu.uploadFile(r,t.target.result).then((()=>e([n])))},o.onerror=function(e){alert("Error reading file")}}}))}))},saveFile:(e,t,n)=>{const r=document.createElement("a");r.style="display: none",r.download=t,r.rel="noopener";const o=new Blob([e]);r.href=URL.createObjectURL(o),r.dispatchEvent(new MouseEvent("click"))},openURLInBrowser:e=>{window.open(e,"_blank")},onEventFromMain:(e,t)=>{},applyAppUpdate:()=>{},updateAppMenu:e=>{},ipcConnect:()=>{},getServerSocket:async()=>d},document.addEventListener("keydown",(e=>{if(e.metaKey||e.ctrlKey)if("o"===e.key)e.preventDefault(),window.__actionsForMenu.closeBudget();else if("z"===e.key.toLowerCase()){if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;e.preventDefault(),e.shiftKey?window.__actionsForMenu.redo():window.__actionsForMenu.undo()}}));var h=n(3017),y=n.t(h,2),g=h.createContext(null);var m=function(e){e()},v=function(){return m},b={notify:function(){}};var x=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=b,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=function(){var e=v(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=b)},e}();var w=function(e){var t=e.store,n=e.context,r=e.children,o=(0,h.useMemo)((function(){var e=new x(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),i=(0,h.useMemo)((function(){return t.getState()}),[t]);(0,h.useEffect)((function(){var e=o.subscription;return e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,i]);var a=n||g;return h.createElement(a.Provider,{value:o},r)};function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}function S(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var k=n(7204),C=n.n(k),_=n(5412),O="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?h.useLayoutEffect:h.useEffect,E=[],T=[null,null];function P(e,t){var n=e[1];return[t.payload,n+1]}function A(e,t,n){O((function(){return e.apply(void 0,t)}),n)}function M(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function D(e,t,n,r,o,i,a,l,s,u){if(e){var c=!1,d=null,f=function(){if(!c){var e,n,f=t.getState();try{e=r(f,o.current)}catch(Fa){n=Fa,d=Fa}n||(d=null),e===i.current?a.current||s():(i.current=e,l.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=f,n.trySubscribe(),f();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var I=function(){return[null,0]};function R(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,a=void 0===i?"connectAdvanced":i,l=n.renderCountProp,s=void 0===l?void 0:l,u=n.shouldHandleStateChanges,c=void 0===u||u,d=n.storeKey,f=void 0===d?"store":d,p=(n.withRef,n.forwardRef),y=void 0!==p&&p,m=n.context,v=void 0===m?g:m,b=S(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),w=v;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=j({},b,{getDisplayName:o,methodName:a,renderCountProp:s,shouldHandleStateChanges:c,storeKey:f,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=b.pure;var u=l?h.useMemo:function(e){return e()};function d(n){var r=(0,h.useMemo)((function(){var e=n.reactReduxForwardedRef,t=S(n,["reactReduxForwardedRef"]);return[n.context,e,t]}),[n]),o=r[0],a=r[1],l=r[2],s=(0,h.useMemo)((function(){return o&&o.Consumer&&(0,_.isContextConsumer)(h.createElement(o.Consumer,null))?o:w}),[o,w]),d=(0,h.useContext)(s),f=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var p=f?n.store:d.store,y=(0,h.useMemo)((function(){return function(t){return e(t.dispatch,i)}(p)}),[p]),g=(0,h.useMemo)((function(){if(!c)return T;var e=new x(p,f?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,f,d]),m=g[0],v=g[1],b=(0,h.useMemo)((function(){return f?d:j({},d,{subscription:m})}),[f,d,m]),k=(0,h.useReducer)(P,E,I),C=k[0][0],O=k[1];if(C&&C.error)throw C.error;var R=(0,h.useRef)(),N=(0,h.useRef)(l),L=(0,h.useRef)(),F=(0,h.useRef)(!1),B=u((function(){return L.current&&l===N.current?L.current:y(p.getState(),l)}),[p,C,l]);A(M,[N,R,F,l,B,L,v]),A(D,[c,p,m,y,N,R,F,L,v,O],[p,m,y]);var z=(0,h.useMemo)((function(){return h.createElement(t,j({},B,{ref:a}))}),[a,t,B]);return(0,h.useMemo)((function(){return c?h.createElement(s.Provider,{value:b},z):z}),[s,z,b])}var p=l?h.memo(d):d;if(p.WrappedComponent=t,p.displayName=r,y){var g=h.forwardRef((function(e,t){return h.createElement(p,j({},e,{reactReduxForwardedRef:t}))}));return g.displayName=r,g.WrappedComponent=t,C()(g,t)}return C()(p,t)}}function N(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function L(e,t){if(N(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!N(e[n[o]],t[n[o]]))return!1;return!0}function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function B(e){var t=function(e,t){if("object"!==F(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===F(t)?t:String(t)}function z(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function H(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var K="function"===typeof Symbol&&Symbol.observable||"@@observable",$=function(){return Math.random().toString(36).substring(7).split("").join(".")},V={INIT:"@@redux/INIT"+$(),REPLACE:"@@redux/REPLACE"+$(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+$()}};function q(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function G(e,t,n){var r;if("function"===typeof t&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error(H(0));if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error(H(1));return n(G)(e,t)}if("function"!==typeof e)throw new Error(H(2));var o=e,i=t,a=[],l=a,s=!1;function u(){l===a&&(l=a.slice())}function c(){if(s)throw new Error(H(3));return i}function d(e){if("function"!==typeof e)throw new Error(H(4));if(s)throw new Error(H(5));var t=!0;return u(),l.push(e),function(){if(t){if(s)throw new Error(H(6));t=!1,u();var n=l.indexOf(e);l.splice(n,1),a=null}}}function f(e){if(!q(e))throw new Error(H(7));if("undefined"===typeof e.type)throw new Error(H(8));if(s)throw new Error(H(9));try{s=!0,i=o(i,e)}finally{s=!1}for(var t=a=l,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:V.INIT}),(r={dispatch:f,subscribe:d,getState:c,replaceReducer:function(e){if("function"!==typeof e)throw new Error(H(10));o=e,f({type:V.REPLACE})}})[K]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!==typeof e||null===e)throw new Error(H(11));function n(){e.next&&e.next(c())}return n(),{unsubscribe:t(n)}}})[K]=function(){return this},e},r}function Y(e,t){return function(){return t(e.apply(this,arguments))}}function Q(e,t){if("function"===typeof e)return Y(e,t);if("object"!==typeof e||null===e)throw new Error(H(16));var n={};for(var r in e){var o=e[r];"function"===typeof o&&(n[r]=Y(o,t))}return n}function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Z(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function J(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function ee(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=J(e);var o=r(t,n);return"function"===typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=J(o),o=r(t,n)),o},r}}var te=[function(e){return"function"===typeof e?ee(e):void 0},function(e){return e?void 0:Z((function(e){return{dispatch:e}}))},function(e){return e&&"object"===typeof e?Z((function(t){return Q(e,t)})):void 0}];var ne=[function(e){return"function"===typeof e?ee(e):void 0},function(e){return e?void 0:Z((function(){return{}}))}];function re(e,t,n){return j({},n,{},e,{},t)}var oe=[function(e){return"function"===typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,l){var s=e(t,n,l);return a?o&&i(s,r)||(r=s):(a=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return re}}];function ie(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function ae(e,t,n,r,o){var i,a,l,s,u,c=o.areStatesEqual,d=o.areOwnPropsEqual,f=o.areStatePropsEqual,p=!1;function h(o,p){var h=!d(p,a),y=!c(o,i);return i=o,a=p,h&&y?(l=e(i,a),t.dependsOnOwnProps&&(s=t(r,a)),u=n(l,s,a)):h?(e.dependsOnOwnProps&&(l=e(i,a)),t.dependsOnOwnProps&&(s=t(r,a)),u=n(l,s,a)):y?function(){var t=e(i,a),r=!f(t,l);return l=t,r&&(u=n(l,s,a)),u}():u}return function(o,c){return p?h(o,c):(l=e(i=o,a=c),s=t(r,a),u=n(l,s,a),p=!0,u)}}function le(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=S(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),a=n(e,i),l=r(e,i),s=o(e,i);return(i.pure?ae:ie)(a,l,s,e,i)}function se(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function ue(e,t){return e===t}function ce(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?R:n,o=t.mapStateToPropsFactories,i=void 0===o?ne:o,a=t.mapDispatchToPropsFactories,l=void 0===a?te:a,s=t.mergePropsFactories,u=void 0===s?oe:s,c=t.selectorFactory,d=void 0===c?le:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,s=a.pure,c=void 0===s||s,f=a.areStatesEqual,p=void 0===f?ue:f,h=a.areOwnPropsEqual,y=void 0===h?L:h,g=a.areStatePropsEqual,m=void 0===g?L:g,v=a.areMergedPropsEqual,b=void 0===v?L:v,x=S(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),w=se(e,i,"mapStateToProps"),k=se(t,l,"mapDispatchToProps"),C=se(n,u,"mergeProps");return r(d,j({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:w,initMapDispatchToProps:k,initMergeProps:C,pure:c,areStatesEqual:p,areOwnPropsEqual:y,areStatePropsEqual:m,areMergedPropsEqual:b},x))}}var de=ce();function fe(){return(0,h.useContext)(g)}function pe(e){void 0===e&&(e=g);var t=e===g?fe:function(){return(0,h.useContext)(e)};return function(){return t().store}}var he=pe();function ye(e){void 0===e&&(e=g);var t=e===g?he:pe(e);return function(){return t().dispatch}}var ge=ye(),me=function(e,t){return e===t};function ve(e){void 0===e&&(e=g);var t=e===g?fe:function(){return(0,h.useContext)(e)};return function(e,n){void 0===n&&(n=me);var r=t(),o=function(e,t,n,r){var o,i=(0,h.useReducer)((function(e){return e+1}),0),a=i[1],l=(0,h.useMemo)((function(){return new x(n,r)}),[n,r]),s=(0,h.useRef)(),u=(0,h.useRef)(),c=(0,h.useRef)(),d=(0,h.useRef)(),f=n.getState();try{o=e!==u.current||f!==c.current||s.current?e(f):d.current}catch(p){throw s.current&&(p.message+="\nThe error may be correlated with this previous error:\n"+s.current.stack+"\n\n"),p}return O((function(){u.current=e,c.current=f,d.current=o,s.current=void 0})),O((function(){function e(){try{var e=u.current(n.getState());if(t(e,d.current))return;d.current=e}catch(p){s.current=p}a()}return l.onStateChange=e,l.trySubscribe(),e(),function(){return l.tryUnsubscribe()}}),[n,l]),o}(e,n,r.store,r.subscription);return(0,h.useDebugValue)(o),o}}var be,xe=ve(),we=n(6214);be=we.unstable_batchedUpdates,m=be;var je=n(7282);function Se(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var ke=Se();ke.withExtraArgument=Se;var Ce=ke,_e=n(337),Oe=n.n(_e);const Ee=function(e){console.log("[Exception]",e)},Te=function(e){};var Pe=n(9707),Ae=n.n(Pe);const Me=function(){return Promise.resolve(Ae().v4())},De=function(){return Ae().v4()};let Ie=[],Re={url:null,openModal:null,selectedItems:null};const Ne=function(e,t){Re[e]=t,Re.id=De()},Le=function(e){return Re[e]},Fe=function(e){return Ie.find((t=>t.id===e))},Be=function(){let e={...Re,id:De()};return Ie.unshift(e),Ie=Ie.slice(0,40),e.id},ze=function(e){Ie=Ie.filter((t=>t.id!==e))};let Ue=new Map,We=new Map,He=[],Ke=null;class $e extends Error{constructor(e,t,n,r,o){super(e),this.url=void 0,this.line=void 0,this.column=void 0,this.name=this.constructor.name,this.message=e,Object.defineProperty(this,"stack",{get:function(){return"extended "+this._stack},set:function(e){this._stack=e}}),this.stack=t,this.url=n,this.line=r,this.column=o}}function Ve(e,t,n){Ke=e,e.onmessage=r=>{let o=r.data;"connect"===o.type?(He.length>0&&(He.forEach((t=>e.postMessage(t))),He=null),t()):"app-init-failure"===o.type?n(o):"capture-exception"===o.type?(Ee(o.stack?new $e(o.message,o.stack,o.url,o.line,o.column):o.exc),o.message&&o.message.includes("indexeddb-quota-error")&&alert("We hit a limit on the local storage available. Edits may not be saved. Please get in touch https://actualbudget.github.io/docs/Contact/ so we can help debug this.")):"capture-breadcrumb"===o.type?Te(o.data):function(e){if("error"===e.type){const{id:t}=e;Ue.delete(t)}else if("reply"===e.type){const{id:t,result:n,mutated:r,undoTag:o}=e,i=Ue.get(t);i&&(Ue.delete(t),r||ze(o),i.resolve(n))}else if("push"===e.type){const{name:t,args:n}=e,r=We.get(t);if(r)for(let e=0;e<r.length&&!0!==r[e](n);e++);}else if(!e.type.startsWith("__"))throw new Error("Unknown message type: "+JSON.stringify(e))}(o)},e instanceof MessagePort&&e.start()}const qe=function(e,t){let{catchErrors:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((r,o)=>{Me().then((i=>{Ue.set(i,{resolve:r,reject:o});let a={id:i,name:e,args:t,undoTag:Be(),catchErrors:n};He?He.push(a):Ke.postMessage(a)}))}))},Ge=function(e,t){return qe(e,t,{catchErrors:!0})},Ye=function(e,t){return We.get(e)||We.set(e,[]),We.get(e).push(t),()=>{let n=We.get(e);We.set(e,n.filter((e=>e!==t)))}},Qe=function(e){We.set(e,[])},Xe="SET_NEW_TRANSACTIONS",Ze="UPDATE_NEW_TRANSACTIONS",Je="SET_LAST_TRANSACTION",et="MARK_ACCOUNT_READ",tt="LOAD_ACCOUNTS",nt="UPDATE_ACCOUNT",rt="LOAD_CATEGORIES",ot="ADD_CATEGORY",it="DELETE_CATEGORY",at="LOAD_PAYEES",lt="LOAD_BANKS",st="SET_PROFILE",ut="SET_PREFS",ct="MERGE_LOCAL_PREFS",dt="MERGE_GLOBAL_PREFS",ft="SET_BUDGETS",pt="SET_REMOTE_FILES",ht="SET_ALL_FILES",yt="SET_AVAILABLE_IMPORTS",gt="CLOSE_BUDGET",mt="SET_APP_STATE",vt="DEBUG_CELL",bt="PUSH_MODAL",xt="REPLACE_MODAL",wt="HIDE_MODALS",jt="SHOW_MODALS",St="CLOSE_MODAL",kt="POP_MODAL",Ct="ADD_NOTIFICATION",_t="REMOVE_NOTIFICATION",Ot="GET_USER_DATA",Et="SET_LAST_UNDO_STATE",Tt="SET_LAST_SPLIT_STATE",Pt="SET_ACCOUNTS_SYNCING",At="ACCOUNT_SYNC_STATUS",Mt="ACCOUNT_SYNC_FAILURES",Dt="SIGN_OUT",It="SET_TUTORIAL_STAGE",Rt="DEACTIVATE_TUTORIAL";function Nt(e,t){return{type:bt,name:e,options:t}}function Lt(e,t){return{type:xt,name:e,options:t}}function Ft(){return{type:wt}}function Bt(){return{type:jt}}function zt(){return{type:kt}}function Ut(){return{type:St}}function Wt(e){return{type:Ct,notification:{...e,id:e.id||De()}}}function Ht(){return Wt({type:"error",message:"Something internally went wrong. You may want to restart the app if anything looks wrong. We have been notified of the issue and will try to fix it soon."})}function Kt(e){return{type:_t,id:e}}function $t(e,t,n){return async function(r){switch(t){case"budget-amount":await qe("budget/budget-amount",{month:e,category:n.category,amount:n.amount});break;case"copy-last":await qe("budget/copy-previous-month",{month:e});break;case"set-zero":await qe("budget/set-zero",{month:e});break;case"set-3-avg":await qe("budget/set-3month-avg",{month:e});break;case"apply-goal-template":r(Wt(await qe("budget/apply-goal-template",{month:e})));break;case"overwrite-goal-template":r(Wt(await qe("budget/overwrite-goal-template",{month:e})));break;case"hold":await qe("budget/hold-for-next-month",{month:e,amount:n.amount});break;case"reset-hold":await qe("budget/reset-hold",{month:e});break;case"cover":await qe("budget/cover-overspending",{month:e,to:n.to,from:n.from});break;case"transfer-available":await qe("budget/transfer-available",{month:e,amount:n.amount,category:n.category});break;case"transfer-category":await qe("budget/transfer-category",{month:e,amount:n.amount,from:n.from,to:n.to});break;case"carryover":await qe("budget/set-carryover",{startMonth:e,category:n.category,flag:n.flag})}}}function Vt(){return async function(e){const t=await qe("get-categories");return e({type:rt,categories:t}),t}}function qt(e,t,n){return async function(r){let o=await qe("category-create",{name:e,groupId:t,isIncome:n});return r(Vt()),o}}function Gt(e,t){return async function(n,r){let{error:o}=await qe("category-delete",{id:e,transferId:t});if(o){if("category-type"===o)n(Wt({type:"error",message:"A category must be transferred to another of the same type (expense or income)"}));else n(Ht());throw new Error(o)}n(Vt()),n(tn())}}function Yt(e){return async t=>{await qe("category-update",e),t(Vt())}}function Qt(e,t,n){return async(r,o)=>{await qe("category-move",{id:e,groupId:t,targetId:n}),await r(Vt())}}function Xt(e,t){return async n=>{await qe("category-group-move",{id:e,targetId:t}),await n(Vt())}}function Zt(e){return async t=>{let n=await qe("category-group-create",{name:e});return t(Vt()),n}}function Jt(e){const{categories:t,...n}=e;return async e=>{await qe("category-group-update",n),await e(Vt())}}function en(e,t){return async function(n,r){await qe("category-group-delete",{id:e,transferId:t}),await n(Vt()),await n(tn())}}function tn(){return async function(e){let t=await qe("payees-get");return e({type:at,payees:t}),t}}function nn(){return async function(e,t){if(0===t().queries.payees.length)return e(tn())}}function rn(e){return async t=>qe("payee-create",{name:e.trim()})}function on(){return async function(e){const t=await qe("accounts-get");return e({type:tt,accounts:t}),t}}function an(e){return async function(t){t({type:nt,account:e}),await qe("account-update",e)}}function ln(e,t,n,r){return async function(o){let i=await qe("account-create",{name:e,type:t,balance:n,offBudget:r});return await o(on()),await o(tn()),i}}function sn(e){return async function(t,n){const{balance:r,numTransactions:o}=await qe("account-properties",{id:e});t(Nt("close-account",{account:n().queries.accounts.find((t=>t.id===e)),balance:r,canDelete:0===o}))}}function un(e,t,n,r){return async function(o){await qe("account-close",{id:e,transferAccountId:t,categoryId:n,forced:r}),o(on())}}function cn(e){return async function(t){await qe("account-reopen",{id:e}),t(on())}}function dn(e){return un(e,null,null,!0)}let fn=Oe()((()=>qe("undo")),100),pn=Oe()((()=>qe("redo")),100),hn=!0;function yn(e){hn=e}function gn(){return async()=>{hn&&fn()}}function mn(){return async()=>{hn&&pn()}}function vn(e){return{type:Pt,name:e}}function bn(e,t,n){return{type:"ACCOUNT_SYNC_STATUS",id:e,failed:!0,errorType:t,errorCode:n}}function xn(e){return{type:"ACCOUNT_SYNC_STATUS",id:e,failed:!1}}function wn(e){return{type:"ACCOUNT_SYNC_FAILURES",syncErrors:e}}function jn(e){return async t=>{await qe("account-unlink",{id:e}),t(xn(e)),t(on())}}function Sn(e,t,n){return async r=>{await qe("nordigen-accounts-link",{requisitionId:e,account:t,upgradingId:n}),await r(tn()),await r(on())}}function kn(e,t,n,r){return async o=>{let i=await qe("accounts-connect",{institution:e,publicToken:t,accountIds:n,offbudgetIds:r});return await o(tn()),await o(on()),i}}function Cn(e,t,n,r){return async o=>{let i=await qe("nordigen-accounts-connect",{institution:e,publicToken:t,accountIds:n,offbudgetIds:r});return await o(tn()),await o(on()),i}}function _n(e){return async(t,n)=>{if(n().account.accountsSyncing)return!1;if(e){let r=n().queries.accounts.find((t=>t.id===e));t(vn(r.name))}else t(vn("__all"));const{errors:r,newTransactions:o,matchedTransactions:i,updatedAccounts:a}=await qe("nordigen-accounts-sync",{id:e});if(t(vn(null)),e){let n=r.find((t=>t.accountId===e));n?"SyncError"===n.type&&t(bn(e,n.category,n.code)):t(xn(e))}else t(wn(r.filter((e=>"SyncError"===e.type)).map((e=>({id:e.accountId,type:e.category,code:e.code})))));return r.forEach((e=>{"SyncError"===e.type?t(Wt({type:"error",message:e.message})):t(Wt({type:"error",message:e.message,internal:e.internal}))})),t({type:Xe,newTransactions:o,matchedTransactions:i,updatedAccounts:a}),o.length>0||i.length>0}}function On(e){return{type:Je,transaction:e}}function En(e,t){return async n=>await qe("transactions-parse-file",{filepath:e,options:t})}function Tn(e,t){return async n=>{let{errors:r=[],added:o,updated:i}=await qe("transactions-import",{accountId:e,transactions:t});return r.forEach((e=>{n(Wt({type:"error",message:e.message,internal:e.internal}))})),n({type:Xe,newTransactions:o,matchedTransactions:i,updatedAccounts:o.length>0?[e]:[]}),o.length>0||i.length>0}}function Pn(e){return{type:Ze,changedId:e}}function An(e){return{type:et,accountId:e}}function Mn(e,t){return{type:vt,sheet:e,name:t}}function Dn(){return async(e,t)=>{let n=await qe("load-prefs"),r=t().prefs.local;return n&&n.id&&!r&&e(Ut()),e({type:ut,prefs:n,globalPrefs:await qe("load-global-prefs")}),n}}function In(e){return async t=>{await qe("save-prefs",e),t({type:ct,prefs:e})}}function Rn(){return async(e,t)=>{let n=await qe("load-global-prefs");return e({type:ut,prefs:t().prefs.local,globalPrefs:n}),n}}function Nn(e){return async t=>{await qe("save-global-prefs",e),t({type:dt,globalPrefs:e})}}function Ln(e){let{reason:t,meta:n}=e;switch(t){case"unauthorized":return"You are not logged in.";case"encrypt-failure":return n.isMissingKey?"Encrypting your file failed because you are missing your encryption key. Create your key in the next step.":"Encrypting the file failed. You have the correct key so this is an internal bug. To fix this, generate a new key in the next step.";case"file-has-reset":return"Something went wrong while resetting your file. Please try again.";case"file-has-new-key":return"Unable to encrypt your data because you are missing the key. Create the latest key in the next step.";case"network":return"Uploading the file failed. Check your network connection.";case"beta-version":return"You cannot perform this action in the beta version (resetting sync, deleting a file, etc).";default:return`An internal error occurred, sorry! Contact help@actualbudget.com for support. (ref: ${t})`}}function Fn(e){return{type:mt,state:e}}function Bn(){return async e=>{n.g.Actual.applyAppUpdate(),e(Fn({updateInfo:null}))}}function zn(e){return{type:Et,undoState:e}}function Un(e,t){return n=>qe("upload-file-web",{filename:e,contents:t})}function Wn(){return e=>qe("app-focused")}function Hn(e){return(t,n)=>{const{loadingText:r}=n().app;null!=r&&t(Fn({loadingText:e}))}}function Kn(){return async e=>{const t=await qe("get-budgets");e({type:ft,budgets:t})}}function $n(){return async e=>{const t=await qe("get-remote-files");e({type:pt,files:t})}}function Vn(){return async(e,t)=>{const n=await qe("get-budgets"),r=await qe("get-remote-files");return e({type:ht,budgets:n,remoteFiles:r}),t().budgets.allFiles}}function qn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return async(r,o)=>{r(Fn({loadingText:t}));let{error:i}=await qe("load-budget",{id:e,...n});if(i){let t=function(e,t){return"out-of-sync-migrations"===e||"out-of-sync-data"===e?"This budget cannot be loaded with this version of the app.":"budget-not-found"===e?`Budget \u201c${t}\u201d not found. Check the id of your budget in the Advanced section of the settings page.`:`We had an unknown problem opening \u201c${t}\u201d.`}(i,e);if("out-of-sync-migrations"===i||"out-of-sync-data"===i)if("undefined"!==typeof window.confirm){window.confirm(t+" Make sure the app is up-to-date. Do you want to load a backup?")&&r(Nt("load-backup",{budgetId:e}))}else alert(t+" Make sure the app is up-to-date.");else alert(t);return void r(Fn({loadingText:null}))}r(Ut()),await r(Dn());const a=o().prefs.local;r(Fn({loadingText:null})),r(Fn({maxMonths:a.maxMonths}))}}function Gn(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&(e({type:gt}),e(Fn({loadingText:"Closing..."})),await qe("close-budget"),e(Fn({loadingText:null})),localStorage.getItem("SharedArrayBufferOverride")&&window.location.reload())}}function Yn(){return async(e,t)=>{let n=t().prefs.local;n&&n.id&&e({type:gt})}}function Qn(e,t){return async n=>{await qe("delete-budget",{id:e,cloudFileId:t}),await n(Vn())}}function Xn(){let{testMode:e=!1,demoMode:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(n,r)=>{n(Fn({loadingText:e||t?"Making demo...":""})),t?await qe("create-demo-budget"):await qe("create-budget",{testMode:e}),n(Ut()),await n(Vn()),await n(Dn()),n(Fn({loadingText:null}))}}function Zn(e,t){return async(n,r)=>{const{error:o}=await qe("import-budget",{filepath:e,type:t});if(o)throw new Error(o);n(Ut()),await n(Dn()),window.__history.push("/budget")}}function Jn(e){return async t=>{let{error:n}=await qe("upload-budget",{id:e});return n?{error:n}:(await t(Vn()),{})}}function er(e){return async t=>{t(Fn({loadingText:"Downloading..."})),await t(Gn()),t(tr(e,{replace:!0}))}}function tr(e){let{replace:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{n(Fn({loadingText:"Downloading..."}));let{id:r,error:o}=await qe("download-budget",{fileId:e,replace:t});if(o){if("decrypt-failure"===o.reason){let r={hasExistingKey:o.meta&&o.meta.isMissingKey,cloudFileId:e,onSuccess:()=>{n(tr(e,{replace:t}))}};n(Nt("fix-encryption-key",r)),n(Fn({loadingText:null}))}else{if("file-exists"===o.reason)return alert(`A file with id \u201c${o.meta.id}\u201d already exists with the name \u201c${o.meta.name}.\u201d This file will be replaced. This probably happened because files were manually moved around outside of Actual.`),n(tr(e,{replace:!0}));n(Fn({loadingText:null})),alert(function(e){let{reason:t,meta:n,fileName:r}=e;switch(t){case"network":case"download-failure":return"Downloading the file failed. Check your network connection.";case"not-zip-file":case"invalid-zip-file":case"invalid-meta-file":return"Downloaded file is invalid, sorry! Contact help@actualbudget.com for support.";case"decrypt-failure":return"Unable to decrypt file "+(r||"(unknown)")+". To change your key, first download this file with the proper password.";case"out-of-sync-migrations":return"This budget cannot be loaded with this version of the app. Make sure the app is up-to-date.";default:return"Something went wrong trying to download that file, sorry! Contact help@actualbudget.com for support. "+(n&&n.fileId?`(fileId: ${n.fileId})`:"")}}(o))}return null}return await Promise.all([n(Rn()),n(Vn()),n(qn(r))]),n(Fn({loadingText:null})),r}}function nr(e,t){return async(n,r)=>{const o=r().prefs.local;o&&o.id&&await n(Gn()),await qe("backup-load",{id:e,backupId:t}),n(qn(e))}}function rr(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&await qe("backup-make",{id:n.id})}}function or(){return async(e,t)=>{let{error:n}=await qe("sync-reset");n?(alert(Ln(n)),"encrypt-failure"===n.reason&&n.meta.isMissingKey||"file-has-new-key"===n.reason?e(Nt("fix-encryption-key",{onSuccess:()=>{e(or())}})):"encrypt-failure"===n.reason&&e(Nt("create-encryption-key",{recreate:!0}))):(await e(ir()),await e(Dn()))}}function ir(){return async(e,t)=>{const n=t().prefs.local;if(n&&n.id){let{error:e}=await qe("sync");return{error:e}}}}function ar(e){return async(t,n)=>{let r=await t(ir());if(r.error)return{error:r.error};let o=await t(_n(e));if(o){let e=await t(ir());return!e.error||{error:e.error}}return{hasUpdated:o||r.updated}}}function lr(){return async e=>{const t=await qe("subscribe-get-user");return e({type:Ot,data:t}),t}}function sr(){return async e=>{await e(lr()),e(Vn())}}function ur(){return async e=>{await qe("subscribe-sign-out"),e(lr()),e(Rn()),e(Gn()),e({type:Dt})}}class cr{constructor(e){this.state=void 0,this.state={filterExpressions:e.filterExpressions||[],selectExpressions:e.selectExpressions||[],groupExpressions:e.groupExpressions||[],orderExpressions:e.orderExpressions||[],calculation:!1,rawMode:!1,withDead:!1,validateRefs:!0,limit:null,offset:null,...e}}filter(e){return new cr({...this.state,filterExpressions:[...this.state.filterExpressions,e]})}unfilter(e){let t=new Set(e);return new cr({...this.state,filterExpressions:this.state.filterExpressions.filter((e=>!t.has(Object.keys(e)[0])))})}select(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Array.isArray(e)||(e=[e]);let t=new cr({...this.state,selectExpressions:e});return t.state.calculation=!1,t}calculate(e){let t=this.select({result:e});return t.state.calculation=!0,t}groupBy(e){return Array.isArray(e)||(e=[e]),new cr({...this.state,groupExpressions:[...this.state.groupExpressions,...e]})}orderBy(e){return Array.isArray(e)||(e=[e]),new cr({...this.state,orderExpressions:[...this.state.orderExpressions,...e]})}limit(e){return new cr({...this.state,limit:e})}offset(e){return new cr({...this.state,offset:e})}raw(){return new cr({...this.state,rawMode:!0})}withDead(){return new cr({...this.state,withDead:!0})}withoutValidatedRefs(){return new cr({...this.state,validateRefs:!1})}options(e){return new cr({...this.state,tableOptions:e})}serialize(){return this.state}}function dr(e){return new cr({table:e})}var fr=dr;async function pr(e){return qe("query",e.serialize())}function hr(e,t,n){let r=new gr(e,t,n);return r.run(),r}function yr(e,t,n){let r=new mr(e,t,n);return r.run(),r}class gr{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._unsubscribe=void 0,this.data=void 0,this.dependencies=void 0,this.error=void 0,this.listeners=void 0,this.mappedData=void 0,this.mapper=void 0,this.onlySync=void 0,this.query=void 0,this.inflight=void 0,this.inflightRequestId=void 0,this.restart=void 0,this.onData=(e,t)=>{for(let n=0;n<this.listeners.length;n++)this.listeners[n](e,t)},this.onUpdate=e=>{(null==this.dependencies||e.find((e=>this.dependencies.has(e))))&&this.run()},this.run=()=>(this.subscribe(),this._fetchData((()=>pr(this.query)))),this._fetchData=async e=>{let t=Math.random();this.inflightRequestId=t;let{data:n,dependencies:r}=await e();if(null==this.dependencies&&(this.dependencies=new Set(r)),this.inflightRequestId===t&&this._unsubscribe){let e=this.mappedData;this.data=n,this.mappedData=this.mapData(n),this.onData(this.mappedData,e),this.inflightRequestId=null}},this.subscribe=()=>{null==this._unsubscribe&&(this._unsubscribe=Ye("sync-event",(e=>{let{type:t,tables:n}=e;-1!==(this.onlySync?["success"]:["applied","success"]).indexOf(t)&&this.onUpdate(n)})))},this.unsubscribe=()=>{this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)},this.mapData=e=>this.mapper?this.mapper(e):e,this.getQuery=()=>this.query,this.getData=()=>this.mappedData,this.getNumListeners=()=>this.listeners.length,this.isRunning=()=>null!=this._unsubscribe,this._optimisticUpdate=(e,t)=>{this.data=e(this.data),this.mappedData=t(this.mappedData)},this.optimisticUpdate=(e,t)=>{let n=this.mappedData;this._optimisticUpdate(e,t),this.onData(this.mappedData,n)},this.error=new Error,this.query=e,this.data=null,this.mappedData=null,this.dependencies=null,this.mapper=n.mapper,this.onlySync=n.onlySync,this.listeners=[],this.inflight=!1,this.restart=!1,t&&this.addListener(t)}addListener(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter((t=>t!==e))}}}class mr extends gr{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(e,t,n),this.done=void 0,this.onPageData=void 0,this.pageCount=void 0,this.runPromise=void 0,this.totalCount=void 0,this._fetchCount=()=>pr(this.query.calculate({$count:"*"})).then((e=>{let{data:t}=e;this.totalCount=t})),this.run=()=>(this.subscribe(),this.runPromise=this._fetchData((async()=>(this.done=!1,this._fetchCount(),pr(this.query.limit(null==this.data?this.pageCount:Math.max(this.data.length,this.pageCount)))))),this.runPromise),this.refetchUpToRow=async(e,t)=>(this.runPromise=this._fetchData((async()=>{this.done=!1,this._fetchCount();let n=function(e,t){let n=e.serialize().orderExpressions;if(0===n.length)return t?{order:"asc",...t}:null;let r=n[0];if("string"===typeof r)return{field:r,order:"asc"};let[o]=Object.keys(r);return{field:o,order:r[o]}}(this.query,t);if(null==n)throw new Error("refetchUpToRow requires a query with orderBy");let{field:r,order:o}=n,i=await pr(this.query.filter({id:e}).select(r));if(0===i.data.length)return;let a=i.data[0];i=await pr(this.query.filter({[r]:{["asc"===o?"$lte":"$gte"]:a[r]}}));let l=i.data;return i=await pr(this.query.filter({[r]:{["asc"===o?"$gt":"$lt"]:a[r]}}).limit(this.pageCount)),{data:l.concat(i.data),dependencies:i.dependencies}})),this.runPromise),this._fetchNext=async()=>{for(;this.inflightRequestId;)await this.runPromise;let e=this.data;if(!this.done){let{data:t}=await pr(this.query.limit(this.pageCount).offset(e.length));if(this.inflightRequestId||e!==this.data)return this._fetchNext();if(0===t.length)this.done=!0;else{this.done=t.length<this.pageCount,this.data=this.data.concat(t);let e=this.mappedData,n=this.mapData(t);this.mappedData=this.mappedData.concat(n),this.onPageData(n),this.onData(this.mappedData,e)}}},this.fetchNext=function(e){let t=null;return function(){return t||(t=e(...arguments).finally((()=>{t=null})),t)}}(this._fetchNext),this.isFinished=()=>this.done,this.getTotalCount=()=>this.totalCount,this.optimisticUpdate=(e,t)=>{let n=this.data,r=this.mappedData;this._optimisticUpdate(e,t),this.totalCount+=this.data.length-n.length,this.onData(this.mappedData,r)},this.totalCount=null,this.pageCount=n.pageCount||500,this.runPromise=null,this.done=!1,this.onPageData=n.onPageData||(()=>{})}}const vr={banks:[],failedAccounts:new Map,accountsSyncing:null};const br={loadingText:null,updateInfo:null,showUpdateNotification:!0,managerHasInitialized:!1,lastUndoState:{current:null},lastSplitState:{current:null}};function xr(e,t){let n=new Set,r=e.map((e=>{if(e.cloudFileId){if(null==t)return{...e,state:"unknown"};let r=t.find((t=>e.cloudFileId===t.fileId));return r?(n.add(r.fileId),r.groupId===e.groupId?{...e,name:r.name,deleted:r.deleted,encryptKeyId:r.encryptKeyId,hasKey:r.hasKey,state:"synced"}:{...e,name:r.name,deleted:r.deleted,encryptKeyId:r.encryptKeyId,hasKey:r.hasKey,state:"detached"}):{...e,state:"broken"}}return{...e,state:"local"}})),o=(i=r.concat((t||[]).filter((e=>!n.has(e.fileId))).map((e=>({cloudFileId:e.fileId,groupId:e.groupId,name:e.name,deleted:e.deleted,encryptKeyId:e.encryptKeyId,hasKey:e.hasKey,state:"remote"})))).filter((e=>!e.deleted)),i.sort(((e,t)=>{let n=e.name.toLowerCase(),r=t.name.toLowerCase(),o=n<r?-1:n>r?1:0;return 0===o&&(o=e.id<t.id?-1:e.id>t.id?1:0),o})),i);var i;return o.filter((e=>"broken"!==e.state)).concat(o.filter((e=>"broken"===e.state)))}const wr={budgets:[],availableImports:[],remoteFiles:null,allFiles:null};const jr={selectedCell:null};var Sr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jr,t=arguments.length>1?arguments[1]:void 0;return t.type===vt?{...e,selectedCell:t.sheet?{sheet:t.sheet,name:t.name}:null}:e};const kr={modalStack:[],isHidden:!1};var Cr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case bt:return{...e,modalStack:[...e.modalStack,{name:t.name,options:t.options}]};case xt:return{...e,modalStack:[{name:t.name,options:t.options}]};case kt:return{...e,modalStack:e.modalStack.slice(0,-1)};case St:return{...e,modalStack:[]};case wt:return{...e,isHidden:!0};case jt:return{...e,isHidden:!1};case mt:if("loadingText"in t.state)return{...e,isHidden:null!=t.state.loadingText};break;case Dt:return kr}return e};const _r={notifications:[]};function Or(e,t){const n=e.id?{id:e.id}:{},r=Object.keys(t);let o=!1;for(let i=0;i<r.length;i++){let a=r[i];e[a]!==t[a]&&(n[a]=t[a],o=!0)}return o?n:null}function Er(e,t){return t=[...t],e.added&&e.added.forEach((e=>{t.push(e)})),e.updated&&e.updated.forEach((e=>{let{id:n,...r}=e;const o=t.findIndex((e=>e.id===n));t[o]={...t[o],...r}})),e.deleted&&e.deleted.forEach((e=>{const n=t.findIndex((t=>e.id===t.id));-1!==n&&t.splice(n,1)})),t}function Tr(e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];t.set(r.id,r)}return t}function Pr(e,t){let n=Tr(e),r=Tr(t),o=[],i=[],a=e.filter((e=>!r.has(e.id))).map((e=>({id:e.id})));return t.forEach((e=>{let t=n.get(e.id);if(t){const n=Or(t,e);n&&i.push(n)}else o.push(e)})),{added:o,updated:i,deleted:a}}function Ar(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[r.id]=r}return t}function Mr(e){return e[0].toUpperCase()+e.slice(1)}let Dr=[{value:"comma-dot",label:"1,000.33",labelNoFraction:"1,000"},{value:"dot-comma",label:"1.000,33",labelNoFraction:"1.000"},{value:"space-comma",label:"1 000,33",labelNoFraction:"1 000"}],Ir={value:null,formatter:null,regex:null};function Rr(e){let t,n,r,{format:o,hideFraction:i}=e;switch(o){case"space-comma":t="en-ZA",n=/[^-0-9,]/g,r=",";break;case"dot-comma":t="de-DE",n=/[^-0-9,]/g,r=",";break;default:t="en-US",n=/[^-0-9.]/g,r="."}Ir={value:o,separator:r,formatter:new Intl.NumberFormat(t,{minimumFractionDigits:i?0:2,maximumFractionDigits:i?0:2}),regex:n}}function Nr(){return Ir}Rr({format:"comma-dot",hideFraction:!1});const Lr=2**51-1,Fr=-Lr;function Br(e){if(!Number.isInteger(e))throw new Error("safeNumber: number is not an integer: "+JSON.stringify(e));if(e>Lr||e<Fr)throw new Error("safeNumber: can\u2019t safely perform arithmetic with number: "+e);return e}function zr(e){return Ir.formatter.format(Br(e)/100)}function Ur(e){return Ir.formatter.format(e)}function Wr(e){let t=parseFloat(e.replace(Ir.regex,"").replace(Ir.separator,"."));return isNaN(t)?null:t}function Hr(e){let t=Wr(e);return null==t?null:$r(t)}function Kr(e){let t=parseInt(e.replace(/[^-0-9.,]/g,""));return isNaN(t)?null:t}function $r(e){return Math.round(100*e)}function Vr(e){return parseFloat((Br(e)/100).toFixed(2))}const qr={local:null,global:null};const Gr={};var Yr=function(e,t){return e===t};var Qr=function(e,t){var n;void 0===t&&(t=Yr);var r,o=[],i=!1,a=function(e,n){return t(e,o[n],n)};return function(){for(var t=arguments.length,l=new Array(t),s=0;s<t;s++)l[s]=arguments[s];return i&&n===this&&l.length===o.length&&l.every(a)||(r=e.apply(this,l),i=!0,n=this,o=l),r}};const Xr={newTransactions:[],matchedTransactions:[],lastTransaction:null,updatedAccounts:[],accounts:[],categories:{grouped:[],list:[]},payees:[],earliestTransaction:null};const Zr=Qr((e=>Ar(e))),Jr=Qr((e=>Ar(e))),eo=Qr((e=>{let t={};return e.forEach((e=>{e.categories.forEach((e=>{t[e.id]=e}))})),t})),to=Qr(((e,t)=>{let n=Zr(t);return e.filter((e=>{if(e.transfer_acct){let t=n[e.transfer_acct];return null!=t&&!t.closed}return!0}))})),no={stage:null,fromYNAB:!1};const ro={data:null};const oo={app:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:br,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case mt:return{...e,...t.state};case Et:return e.lastUndoState.current=t.undoState,e;case Tt:return e.lastSplitState.current=t.splitState,e}return e},queries:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Xe:return{...e,newTransactions:t.newTransactions||[],matchedTransactions:t.matchedTransactions||[],updatedAccounts:t.updatedAccounts||[]};case Ze:return{...e,newTransactions:e.newTransactions.filter((e=>e!==t.changedId)),matchedTransactions:e.matchedTransactions.filter((e=>e!==t.changedId))};case Je:return{...e,lastTransaction:t.transaction};case et:return{...e,updatedAccounts:e.updatedAccounts.filter((e=>e!==t.accountId))};case tt:return{...e,accounts:t.accounts};case nt:return{...e,accounts:e.accounts.map((e=>e.id===t.account.id?{...e,...t.account}:e))};case rt:return{...e,categories:t.categories};case at:return{...e,payees:t.payees};case ot:{let n={id:"temp",name:t.name};return{...e,categories:{grouped:e.categories.grouped.map((e=>e.id===t.groupId?{...e,categories:[n,...e.categories]}:e)),list:[n,...e.categories.list]}}}case it:return{...e,categories:{grouped:e.categories.grouped.map((e=>({...e,categories:e.categories.filter((e=>e.id!==t.id))}))),list:e.categories.list.filter((e=>e.id!==t.id))}}}return e},account:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case lt:return{...e,banks:t.banks};case Pt:return{...e,accountsSyncing:t.name};case At:{let n=new Map(e.failedAccounts);return t.failed?n.set(t.id,{type:t.errorType,code:t.errorCode}):n.delete(t.id),{...e,failedAccounts:n}}case Mt:{let n=new Map;return t.syncErrors.forEach((e=>{n.set(e.id,{type:e.type,code:e.code})})),{...e,failedAccounts:n}}}return e},debug:Sr,profile:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gr,t=arguments.length>1?arguments[1]:void 0;return t.type===st?{...e,...t.profile}:e},prefs:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ut:return t.prefs&&Rr({format:t.prefs.numberFormat||"comma-dot",hideFraction:t.prefs.hideFraction}),{local:t.prefs,global:t.globalPrefs};case ct:return(t.prefs.numberFormat||null!=t.prefs.hideFraction)&&Rr({format:t.prefs.numberFormat||e.local.numberFormat,hideFraction:null!=t.prefs.hideFraction?t.prefs.hideFraction:e.local.hideFraction}),{...e,local:{...e.local,...t.prefs}};case dt:return{...e,global:{...e.global,...t.globalPrefs}}}return e},modals:Cr,notifications:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_r,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ct:return e.notifications.find((e=>e.id===t.notification.id))?e:{...e,notifications:[...e.notifications,t.notification]};case _t:return{...e,notifications:e.notifications.filter((e=>e.id!==t.id))}}return e},budgets:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ft:return{...e,budgets:t.budgets,allFiles:xr(t.budgets,e.remoteFiles)};case pt:return{...e,remoteFiles:t.files,allFiles:xr(e.budgets,t.files)};case ht:return{...e,budgets:t.budgetes,remoteFiles:t.remoteFiles,allFiles:xr(t.budgets,t.remoteFiles)};case yt:return{...e,availableImports:t.imports};case Dt:return{...e,allFiles:null}}return e},tutorial:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:no,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case It:return{...e,deactivated:!1,stage:t.stage,fromYNAB:"fromYNAB"in t?t.fromYNAB:e.fromYNAB};case Rt:return{...e,stage:null}}return e},user:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ro,t=arguments.length>1?arguments[1]:void 0;return t.type===Ot?{...e,data:t.data}:e}};var io,ao=oo,lo=n(6634);async function so(){if("ResizeObserver"in window===!1){const e=await n.e(145).then(n.bind(n,9145));window.ResizeObserver=e.ResizeObserver}}const uo=navigator.platform&&"win32"===navigator.platform.toLowerCase(),co=navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0,fo=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent),uo?"windows":co?"mac":"linux"),po="web",ho=!(null===(io=window.Actual)||void 0===io||!io.IS_FAKE_WEB);var yo={breakpoint_xs:"350px",breakpoint_narrow:"512px",breakpoint_medium:"768px",breakpoint_wide:"1024px"};const go={y1:"#733309",y2:"#87540d",y3:"#B88115",y4:"#D4A31C",y5:"#E6BB20",y6:"#F2D047",y7:"#F5E35D",y8:"#FCF088",y9:"#FFF7C4",y10:"#FFFBEA",y11:"#FFFEFA",r1:"#610316",r2:"#8A041A",r3:"#AB091E",r4:"#CF1124",r5:"#E12D39",r6:"#EF4E4E",r7:"#F86A6A",r8:"#FF9B9B",r9:"#FFBDBD",r10:"#FFE3E3",r11:"#FFF1F1",b1:"#034388",b2:"#0B5FA3",b3:"#1271BF",b4:"#1980D4",b5:"#2B8FED",b6:"#40A5F7",b7:"#66B5FA",b8:"#8BCAFD",b9:"#B3D9FF",b10:"#E3F0FF",b11:"#F5FCFF",n1:"#102A43",n2:"#243B53",n3:"#334E68",n4:"#486581",n5:"#627D98",n6:"#829AB1",n7:"#9FB3C8",n8:"#BCCCDC",n9:"#D9E2EC",n10:"#E8ECF0",n11:"#F7FAFC",g1:"#014D40",g2:"#0C6B58",g3:"#147D64",g4:"#199473",g5:"#27AB83",g6:"#3EBD93",g7:"#65D6AD",g8:"#8EEDC7",g9:"#C6F7E2",g10:"#EFFCF6",g11:"#FAFFFD",p1:"#44056E",p2:"#580A94",p3:"#690CB0",p4:"#7A0ECC",p5:"#8719E0",p6:"#9446ED",p7:"#A368FC",p8:"#B990FF",p9:"#DAC4FF",p10:"#F2EBFE",p11:"#F9F6FE"};go.border=go.n10,go.hover="#fafafa",go.selected=go.b9,go.resolve=(e,t)=>{if("border"===e)return go["n"+(8+t)];throw new Error("Unknown color name: "+e)};const mo={veryLargeText:{fontSize:30,fontWeight:600},largeText:{fontSize:20,fontWeight:700,letterSpacing:.5},mediumText:{fontSize:15,fontWeight:500},smallText:{fontSize:13,[`@media (min-width: ${yo.breakpoint_medium})`]:{}},verySmallText:{fontSize:13},page:{paddingTop:8,flex:1,[`@media (min-width: ${yo.breakpoint_xs})`]:{minWidth:360,paddingTop:36},[`@media (min-width: ${yo.breakpoint_medium})`]:{minWidth:500}},pageHeader:{fontSize:25,borderBottomWidth:5,borderColor:go.purple2,borderStyle:"solid",display:"inline",flex:0,color:go.grey4,marginTop:40,marginBottom:20,paddingBottom:5},pageContent:{paddingLeft:2,paddingRight:2,[`@media (min-width: ${yo.breakpoint_medium})`]:{paddingLeft:20,paddingRight:20}},settingsPageContent:{padding:20,[`@media (min-width: ${yo.breakpoint_medium})`]:{padding:"inherit"}},staticText:{cursor:"default",userSelect:"none"},shadow:{boxShadow:"0 2px 4px 0 rgba(0,0,0,0.1)"},shadowLarge:{boxShadow:"0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)"},tnum:{fontFeatureSettings:'"tnum"'},notFixed:{fontFeatureSettings:""},header:{headerStyle:{backgroundColor:"white",borderBottomWidth:1,borderBottomColor:go.n9,elevation:0},headerTintColor:go.n1,headerTitleStyle:{color:go.n1,fontSize:15,fontWeight:600},headerBackTitle:null},text:{fontSize:16},textColor:go.n1};let vo=!1;function bo(){mo.lightScrollbar=!vo&&{"& ::-webkit-scrollbar":{width:11,backgroundColor:"rgba(200, 200, 200, .2)"},"& ::-webkit-scrollbar-thumb":{width:7,borderRadius:30,backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"#d0d0d0"}},mo.darkScrollbar=!vo&&{"& ::-webkit-scrollbar":{width:7,backgroundColor:"rgba(0, 0, 0, 0)"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"rgba(200, 200, 200, .5)"}},mo.scrollbarWidth=vo?0:13}if("web"===po){function j6(){let e=document.createElement("div");e.innerHTML='<div style="width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px;"/>',document.body.appendChild(e);let t=e.childNodes[0];return t.offsetWidth===t.clientWidth}vo=j6(),bo(),window.addEventListener("focus",(()=>{vo=j6(),bo()}))}const xo=()=>vo;var wo=n(8993);var jo=e=>{let{color:t="#fff"}=e,[n]=(0,h.useState)("gradient-"+Math.random());return(0,wo.jsxs)("svg",{...e,viewBox:"0 0 38 38",style:{...e.style},children:[(0,wo.jsx)("defs",{children:(0,wo.jsxs)("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:n,children:[(0,wo.jsx)("stop",{stopColor:t,stopOpacity:0,offset:"0%"}),(0,wo.jsx)("stop",{stopColor:t,stopOpacity:.631,offset:"63.146%"}),(0,wo.jsx)("stop",{stopColor:t,offset:"100%"})]})}),(0,wo.jsxs)("g",{transform:"translate(1 2)",fill:"none",fillRule:"evenodd",children:[(0,wo.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",stroke:"url(#"+n+")",strokeWidth:2,fill:"none"}),(0,wo.jsx)("circle",{fill:t,cx:36,cy:18,r:1})]})]})};const So=lo.iv.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(666deg)"}});var ko=function(e){return(0,wo.jsx)("span",{...(0,lo.iv)({animationName:So,animationDuration:"1.6s",animationTimingFunction:"cubic-bezier(0.17, 0.67, 0.83, 0.67)",animationIterationCount:"infinite",lineHeight:0}),children:(0,wo.jsx)(jo,{...e})})};var Co=n.p+"static/media/bg.42987350d58d04897ed83a3ce50df2d5.svg";var _o=function(e){let{selected:t}=e;return(0,wo.jsx)("div",{...(0,lo.iv)({position:"absolute",top:0,bottom:0,left:0,right:0,background:`url(${Co}) no-repeat center center fixed`,backgroundSize:"100% 100%"})})};function Oo(e,t){return Oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oo(e,t)}function Eo(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Oo(e,t)}function To(e){return"/"===e.charAt(0)}function Po(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}var Ao=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&To(e),a=t&&To(t),l=i||a;if(e&&To(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var s=o[o.length-1];n="."===s||".."===s||""===s}else n=!1;for(var u=0,c=o.length;c>=0;c--){var d=o[c];"."===d?Po(o,c):".."===d?(Po(o,c),u++):u&&(Po(o,c),u--)}if(!l)for(;u--;u)o.unshift("..");!l||""===o[0]||o[0]&&To(o[0])||o.unshift("");var f=o.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};function Mo(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var Do=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=Mo(t),o=Mo(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},Io=!0,Ro="Invariant failed";function No(e,t){if(!e){if(Io)throw new Error(Ro);var n="function"===typeof t?t():t;throw new Error(n?Ro+": "+n:Ro)}}function Lo(e){return"/"===e.charAt(0)?e:"/"+e}function Fo(e){return"/"===e.charAt(0)?e.substr(1):e}function Bo(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function zo(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function Uo(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function Wo(e,t,n,r){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=j({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(Fa){throw Fa instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):Fa}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=Ao(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function Ho(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"===typeof e?e(t,n):e;"string"===typeof i?"function"===typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var Ko=!("undefined"===typeof window||!window.document||!window.document.createElement);function $o(e,t){t(window.confirm(e))}var Vo="popstate",qo="hashchange";function Go(){try{return window.history.state||{}}catch(Fa){return{}}}function Yo(e){void 0===e&&(e={}),Ko||No(!1);var t=window.history,n=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history}(),r=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,a=void 0!==i&&i,l=o.getUserConfirmation,s=void 0===l?$o:l,u=o.keyLength,c=void 0===u?6:u,d=e.basename?zo(Lo(e.basename)):"";function f(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return d&&(i=Bo(i,d)),Wo(i,r,n)}function p(){return Math.random().toString(36).substr(2,c)}var h=Ho();function y(e){j(E,e),E.length=t.length,h.notifyListeners(E.location,E.action)}function g(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||b(f(e.state))}function m(){b(f(Go()))}var v=!1;function b(e){if(v)v=!1,y();else{h.confirmTransitionTo(e,"POP",s,(function(t){t?y({action:"POP",location:e}):function(e){var t=E.location,n=w.indexOf(t.key);-1===n&&(n=0);var r=w.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(v=!0,k(o))}(e)}))}}var x=f(Go()),w=[x.key];function S(e){return d+Uo(e)}function k(e){t.go(e)}var C=0;function _(e){1===(C+=e)&&1===e?(window.addEventListener(Vo,g),r&&window.addEventListener(qo,m)):0===C&&(window.removeEventListener(Vo,g),r&&window.removeEventListener(qo,m))}var O=!1;var E={length:t.length,action:"POP",location:x,createHref:S,push:function(e,r){var o="PUSH",i=Wo(e,r,p(),E.location);h.confirmTransitionTo(i,o,s,(function(e){if(e){var r=S(i),l=i.key,s=i.state;if(n)if(t.pushState({key:l,state:s},null,r),a)window.location.href=r;else{var u=w.indexOf(E.location.key),c=w.slice(0,u+1);c.push(i.key),w=c,y({action:o,location:i})}else window.location.href=r}}))},replace:function(e,r){var o="REPLACE",i=Wo(e,r,p(),E.location);h.confirmTransitionTo(i,o,s,(function(e){if(e){var r=S(i),l=i.key,s=i.state;if(n)if(t.replaceState({key:l,state:s},null,r),a)window.location.replace(r);else{var u=w.indexOf(E.location.key);-1!==u&&(w[u]=i.key),y({action:o,location:i})}else window.location.replace(r)}}))},go:k,goBack:function(){k(-1)},goForward:function(){k(1)},block:function(e){void 0===e&&(e=!1);var t=h.setPrompt(e);return O||(_(1),O=!0),function(){return O&&(O=!1,_(-1)),t()}},listen:function(e){var t=h.appendListener(e);return _(1),function(){_(-1),t()}}};return E}var Qo="hashchange",Xo={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+Fo(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:Fo,decodePath:Lo},slash:{encodePath:Lo,decodePath:Lo}};function Zo(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function Jo(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function ei(e){window.location.replace(Zo(window.location.href)+"#"+e)}function ti(e){void 0===e&&{},Ko||No(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,o=void 0===r?$o:r,i=n.hashType,a=void 0===i?"slash":i,l=e.basename?zo(Lo(e.basename)):"",s=Xo[a],u=s.encodePath,c=s.decodePath;function d(){var e=c(Jo());return l&&Bo(e,l),Wo(e)}var f=Ho();function p(e){j(_,e),_.length=t.length,f.notifyListeners(_.location,_.action)}var h=!1,y=null;function g(){var e=Jo(),t=u(e);if(e!==t)ei(t);else{var n=d(),r=_.location;if(!h&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(r,n))return;if(y===Uo(n))return;null,function(e){if(h)!1,p();else{var t="POP";f.confirmTransitionTo(e,t,o,(function(n){n?p({action:t,location:e}):function(e){var t=_.location,n=x.lastIndexOf(Uo(t));-1===n&&0;var r=x.lastIndexOf(Uo(e));-1===r&&0;var o=n-r;o&&(!0,w(o))}(e)}))}}(n)}}var m=Jo(),v=u(m);m!==v&&ei(v);var b=d(),x=[Uo(b)];function w(e){t.go(e)}var S=0;function k(e){1===(S+=e)&&1===e?window.addEventListener(Qo,g):0===S&&window.removeEventListener(Qo,g)}var C=!1;var _={length:t.length,action:"POP",location:b,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&Zo(window.location.href),n+"#"+u(l+Uo(e))},push:function(e,t){var n="PUSH",r=Wo(e,void 0,void 0,_.location);f.confirmTransitionTo(r,n,o,(function(e){if(e){var t=Uo(r),o=u(l+t);if(Jo()!==o){t,function(e){window.location.hash=e}(o);var i=x.lastIndexOf(Uo(_.location)),a=x.slice(0,i+1);a.push(t),a,p({action:n,location:r})}else p()}}))},replace:function(e,t){var n="REPLACE",r=Wo(e,void 0,void 0,_.location);f.confirmTransitionTo(r,n,o,(function(e){if(e){var t=Uo(r),o=u(l+t);Jo()!==o&&(t,ei(o));var i=x.indexOf(Uo(_.location));-1!==i&&(x[i]=t),p({action:n,location:r})}}))},go:w,goBack:function(){w(-1)},goForward:function(){w(1)},block:function(e){void 0===e&&!1;var t=f.setPrompt(e);return C||(k(1),!0),function(){return C&&(!1,k(-1)),t()}},listen:function(e){var t=f.appendListener(e);return k(1),function(){k(-1),t()}}};return _}function ni(e,t,n){return Math.min(Math.max(e,t),n)}var ri=n(7633),oi=n.n(ri),ii=1073741823,ai="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:{};var li=h.createContext||function(e,t){var n,r,o="__create-react-context-"+function(){var e="__global_unique_id__";return ai[e]=(ai[e]||0)+1}()+"__",i=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=function(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}(t.props.value),t}Eo(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i===1/a:i!==i&&a!==a)?n=0:(n="function"===typeof t?t(r,o):ii,0!==(n|=0)&&this.emitter.set(e.value,n))}var i,a},r.render=function(){return this.props.children},n}(h.Component);i.childContextTypes=((n={})[o]=oi().object.isRequired,n);var a=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!==((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}Eo(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?ii:t},r.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?ii:e},r.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},r.getValue=function(){return this.context[o]?this.context[o].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(h.Component);return a.contextTypes=((r={})[o]=oi().object,r),{Provider:i,Consumer:a}},si=li,ui=n(6406),ci=n.n(ui),di=function(e){var t=si();return t.displayName=e,t},fi=di("Router-History"),pi=function(e){var t=si();return t.displayName=e,t},hi=pi("Router"),yi=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Eo(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return h.createElement(hi.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},h.createElement(fi.Provider,{children:this.props.children||null,value:this.props.history}))},t}(h.Component);h.Component;var gi=function(e){function t(){return e.apply(this,arguments)||this}Eo(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(h.Component);var mi={},vi=1e4,bi=0;function xi(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(mi[e])return mi[e];var t=ci().compile(e);return bi<vi&&(mi[e]=t,bi++),t}(e)(t,{pretty:!0})}function wi(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return h.createElement(hi.Consumer,null,(function(e){e||No(!1);var r=e.history,i=e.staticContext,a=o?r.push:r.replace,l=Wo(t?"string"===typeof n?xi(n,t.params):j({},n,{pathname:xi(n.pathname,t.params)}):n);return i?(a(l),null):h.createElement(gi,{onMount:function(){a(l)},onUpdate:function(e,t){var n=Wo(t.to);(function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&Do(e.state,t.state)})(n,j({},l,{key:n.key}))||a(l)},to:n})}))}var ji={},Si=1e4,ki=0;function Ci(e,t){void 0===t&&(t={}),("string"===typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,l=void 0!==a&&a,s=n.sensitive,u=void 0!==s&&s;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=ji[n]||(ji[n]={});if(r[e])return r[e];var o=[],i={regexp:ci()(e,o,t),keys:o};return ki<Si&&(r[e]=i,ki++),i}(n,{end:i,strict:l,sensitive:u}),o=r.regexp,a=r.keys,s=o.exec(e);if(!s)return null;var c=s[0],d=s.slice(1),f=e===c;return i&&!f?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:f,params:a.reduce((function(e,t,n){return e[t.name]=d[n],e}),{})}}),null)}var _i=function(e){function t(){return e.apply(this,arguments)||this}return Eo(t,e),t.prototype.render=function(){var e=this;return h.createElement(hi.Consumer,null,(function(t){t||No(!1);var n=e.props.location||t.location,r=j({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Ci(n.pathname,e.props):t.match}),o=e.props,i=o.children,a=o.component,l=o.render;return Array.isArray(i)&&0===i.length&&(i=null),h.createElement(hi.Provider,{value:r},r.match?i?"function"===typeof i?i(r):i:a?h.createElement(a,r):l?l(r):null:"function"===typeof i?i(r):null)}))},t}(h.Component);function Oi(e){return"/"===e.charAt(0)?e:"/"+e}function Ei(e,t){if(!e)return t;var n=Oi(e);return 0!==t.pathname.indexOf(n)?t:j({},t,{pathname:t.pathname.substr(n.length)})}function Ti(e){return"string"===typeof e?e:Uo(e)}function Pi(e){return function(){No(!1)}}function Ai(){}h.Component;var Mi=function(e){function t(){return e.apply(this,arguments)||this}return Eo(t,e),t.prototype.render=function(){var e=this;return h.createElement(hi.Consumer,null,(function(t){t||No(!1);var n,r,o=e.props.location||t.location;return h.Children.forEach(e.props.children,(function(e){if(null==r&&h.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?Ci(o.pathname,j({},e.props,{path:i})):t.match}})),r?h.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(h.Component);function Di(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=S(t,["wrappedComponentRef"]);return h.createElement(hi.Consumer,null,(function(t){return t||No(!1),h.createElement(e,j({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,C()(n,e)}var Ii=h.useContext;function Ri(){return Ii(fi)}function Ni(){return Ii(hi).location}function Li(){var e=Ii(hi).match;return e?e.params:{}}h.Component;h.Component;var Fi=function(e,t){return"function"===typeof e?e(t):e},Bi=function(e,t){return"string"===typeof e?Wo(e,null,null,t):e},zi=function(e){return e},Ui=h.forwardRef;"undefined"===typeof Ui&&(Ui=zi);var Wi=Ui((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=S(e,["innerRef","navigate","onClick"]),a=i.target,l=j({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return l.ref=zi!==Ui&&t||n,h.createElement("a",l)}));var Hi=Ui((function(e,t){var n=e.component,r=void 0===n?Wi:n,o=e.replace,i=e.to,a=e.innerRef,l=S(e,["component","replace","to","innerRef"]);return h.createElement(hi.Consumer,null,(function(e){e||No(!1);var n=e.history,s=Bi(Fi(i,e.location),e.location),u=s?n.createHref(s):"",c=j({},l,{href:u,navigate:function(){var t=Fi(i,e.location);(o?n.replace:n.push)(t)}});return zi!==Ui?c.ref=t||a:c.innerRef=a,h.createElement(r,c)}))})),Ki=function(e){return e},$i=h.forwardRef;"undefined"===typeof $i&&($i=Ki);var Vi=$i((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,a=e.activeStyle,l=e.className,s=e.exact,u=e.isActive,c=e.location,d=e.sensitive,f=e.strict,p=e.style,y=e.to,g=e.innerRef,m=S(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return h.createElement(hi.Consumer,null,(function(e){e||No(!1);var n=c||e.location,o=Bi(Fi(y,n),n),v=o.pathname,b=v&&v.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),x=b?Ci(n.pathname,{path:b,exact:s,sensitive:d,strict:f}):null,w=!!(u?u(x,n):x),S=w?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(l,i):l,k=w?j({},p,{},a):p,C=j({"aria-current":w&&r||null,className:S,style:k,to:o},m);return Ki!==$i?C.ref=t||g:C.innerRef=g,h.createElement(Hi,C)}))})),qi=(n(8136),Gi()?h.useLayoutEffect:h.useEffect);"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math&&self;function Gi(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}function Yi(e,t){var n=(0,h.createContext)(t);return n.displayName=e,n}function Qi(e){return h.forwardRef(e)}function Xi(e,t){return h.memo(e,t)}function Zi(e){return e&&e.ownerDocument?e.ownerDocument:Gi()?document:null}function Ji(e){return"boolean"===typeof e}function ea(e){return!(!e||"[object Function]"!={}.toString.call(e))}function ta(e){return"which"in e?3===e.which:"button"in e&&2===e.button}function na(e){return"string"===typeof e}function ra(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return null!=e})).join("--")}function oa(){}var ia=oa;var aa=oa;function la(e){var t=h.useRef();return t.current||(t.current={v:e()}),t.current.v}function sa(){var e=(0,h.useState)(Object.create(null))[1];return(0,h.useCallback)((function(){e(Object.create(null))}),[])}function ua(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,h.useMemo)((function(){return t.every((function(e){return null==e}))?null:function(e){t.forEach((function(t){!function(e,t){if(null!=e)if(ea(e))e(t);else try{e.current=t}catch(n){throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}(t,e)}))}}),[].concat(t))}function ca(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}}var da=!1,fa=0,pa=function(){return++fa};var ha,ya=function(e){var t=e.children,n=e.type,r=void 0===n?"reach-portal":n,o=(0,h.useRef)(null),i=(0,h.useRef)(null),a=sa();return qi((function(){if(o.current){var e=o.current.ownerDocument;return i.current=null===e||void 0===e?void 0:e.createElement(r),e.body.appendChild(i.current),a(),function(){i.current&&i.current.ownerDocument&&i.current.ownerDocument.body.removeChild(i.current)}}}),[r,a]),i.current?(0,we.createPortal)(t,i.current):h.createElement("span",{ref:o})},ga=["bottom","height","left","right","top","width"],ma=new Map,va=function e(){var t=[];ma.forEach((function(e,n){var r=n.getBoundingClientRect();(function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),ga.some((function(n){return e[n]!==t[n]}))})(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),ha=window.requestAnimationFrame(e)};var ba=function(e,t){return{observe:function(){var n=0===ma.size;ma.has(e)?ma.get(e).callbacks.push(t):ma.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&va()},unobserve:function(){var n=ma.get(e);if(n){var r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||ma.delete(e),ma.size||cancelAnimationFrame(ha)}}}};function xa(e,t,n){void 0===t&&(t=!0);var r=(0,h.useState)(e.current),o=r[0],i=r[1],a=(0,h.useRef)(!1),l=(0,h.useRef)(!1),s=(0,h.useState)(null),u=s[0],c=s[1],d=(0,h.useRef)();return qi((function(){d.current=n,e.current!==o&&i(e.current)})),qi((function(){o&&!a.current&&(a.current=!0,c(o.getBoundingClientRect()))}),[o]),qi((function(){var n,r=o;return l.current||(l.current=!0,r=e.current),r?(n=ba(r,(function(e){d.current&&d.current(e),c(e)})),t&&n.observe(),i):i;function i(){n&&n.unobserve()}}),[t,o]),u}var wa=n(264),ja=n.n(wa);function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sa.apply(this,arguments)}var ka=(0,h.forwardRef)((function(e,t){return h.createElement(ya,null,h.createElement(Ca,Object.assign({ref:t},e)))}));var Ca=(0,h.forwardRef)((function(e,t){var n=e.targetRef,r=e.position,o=void 0===r?Ea:r,i=e.unstable_observableRefs,a=void 0===i?[]:i,l=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["targetRef","position","unstable_observableRefs"]),s=(0,h.useRef)(null),u=xa(s,!l.hidden),c=xa(n,!l.hidden),d=ua(s,t);return function(e,t){var n=Zi(e.current);function r(e){"Tab"===e.key&&t.current&&0===ja()(t.current).length||("Tab"===e.key&&e.shiftKey?u(e)?c(e):d(e)?f(e):y(e)&&m():"Tab"===e.key&&(i()?a(e):l()?s(e):p(e)&&m()))}function o(){var r=n&&ja()(n),o=r&&e.current?r.indexOf(e.current):-1,i=r&&r[o+1];return(!t.current||!t.current.contains(i||null))&&i}function i(){return!(!e.current||!n)&&e.current===n.activeElement}function a(e){var n=t.current&&ja()(t.current);n&&n[0]&&(e.preventDefault(),n[0].focus())}function l(){if(!(!t.current||!n)&&t.current.contains(n.activeElement||null)){var e=t.current&&ja()(t.current);return Boolean(e&&n&&e[e.length-1]===n.activeElement)}return!1}function s(e){var t=o();t&&(e.preventDefault(),t.focus())}function u(e){if(e.shiftKey){var t=o();return e.target===t}}function c(e){var n=t.current&&ja()(t.current),r=n&&n[n.length-1];r&&(e.preventDefault(),r.focus())}function d(e){var n=t.current&&ja()(t.current);return!!n&&(0!==n.length&&e.target===n[0])}function f(t){var n;t.preventDefault(),null===(n=e.current)||void 0===n||n.focus()}function p(e){var r=n&&t.current?ja()(n).filter((function(e){return!t.current.contains(e)})):null;return!!r&&e.target===r[r.length-1]}function y(e){return!!n&&e.target===ja()(n)[0]}(0,h.useEffect)((function(){if(n)return n.addEventListener("keydown",r),function(){n.removeEventListener("keydown",r)}}),[]);var g=[];function m(){var e=t.current&&ja()(t.current);e&&(e.forEach((function(e){g.push([e,e.tabIndex]),e.tabIndex=-1})),n&&n.addEventListener("focusin",v))}function v(){n&&n.removeEventListener("focusin",v),g.forEach((function(e){var t=e[0],n=e[1];t.tabIndex=n}))}}(n,s),h.createElement("div",Object.assign({"data-reach-popover":"",ref:d},l,{style:Sa({position:"absolute"},_a.apply(void 0,[o,c,u].concat(a)),l.style)}))}));function _a(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return n?e.apply(void 0,[t,n].concat(o.map((function(e){return e.current})))):{visibility:"hidden"}}function Oa(e,t){return{top:Pa(e,t).directionUp?e.top-t.height+window.pageYOffset+"px":e.top+e.height+window.pageYOffset+"px"}}var Ea=function(e,t){return e&&t?Sa({left:Pa(e,t).directionRight?e.right-t.width+window.pageXOffset+"px":e.left+window.pageXOffset+"px"},Oa(e,t)):{}},Ta=function(e,t){return e&&t?Sa({width:e.width,left:e.left},Oa(e,t)):{}};function Pa(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var o={top:e.top-t.height<0,right:window.innerWidth<e.left+t.width-n,bottom:window.innerHeight<e.bottom+t.height-r,left:e.left+e.width-t.width<0};return{directionRight:o.right&&!o.left,directionLeft:o.left&&!o.right,directionUp:o.bottom&&!o.top,directionDown:o.top&&!o.bottom}}var Aa,Ma=ka;function Da(){return Da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Da.apply(this,arguments)}function Ia(e,t){void 0===t&&(t={});return Yi(e,Da({descendants:[],registerDescendant:oa,unregisterDescendant:oa},t))}function Ra(e,t,n){var r=sa(),o=(0,h.useContext)(t),i=o.registerDescendant,a=o.unregisterDescendant,l=o.descendants,s=null!==n&&void 0!==n?n:l.findIndex((function(t){return t.element===e.element})),u=function(e){var t=(0,h.useRef)(null);return(0,h.useEffect)((function(){t.current=e}),[e]),t.current}(l),c=l.some((function(e,t){var n;return e.element!==(null===u||void 0===u||null===(n=u[t])||void 0===n?void 0:n.element)}));return qi((function(){return e.element||r(),i(Da({},e,{index:s})),function(){return a(e.element)}}),[r,s,i,c,a].concat(Object.values(e))),s}function Na(e){var t=e.context,n=e.children,r=e.items,o=e.set,i=(0,h.useCallback)((function(e){var t=e.element,n=e.index,r=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["element","index"]);t&&o((function(e){var o;if(null!=n)o=[].concat(e,[Da({},r,{element:t,index:n})]);else if(0===e.length)o=[].concat(e,[Da({},r,{element:t,index:0})]);else if(e.find((function(e){return e.element===t})))o=e;else{var i=e.findIndex((function(e){return!(!e.element||!t)&&Boolean(e.element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)})),a=Da({},r,{element:t,index:i});o=-1===i?[].concat(e,[a]):[].concat(e.slice(0,i),[a],e.slice(i))}return o.map((function(e,t){return Da({},e,{index:t})}))}))}),[]),a=(0,h.useCallback)((function(e){e&&o((function(t){return t.filter((function(t){return e!==t.element}))}))}),[]);return h.createElement(t.Provider,{value:(0,h.useMemo)((function(){return{descendants:r,registerDescendant:i,unregisterDescendant:a}}),[r,i,a])},n)}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Aa||(Aa={}));var La={type:"xstate.init"};function Fa(e){return void 0===e?[]:[].concat(e)}function Ba(e){return{type:"xstate.assign",assignment:e}}function za(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function Ua(e){return function(t){return e===t}}function Wa(e){return"string"==typeof e?{type:e}:e}function Ha(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Ua(e)}}var Ka=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function $a(){return $a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$a.apply(this,arguments)}var Va,qa,Ga,Ya=function(e){var t;return e.subscribe((function(e){t=e})).unsubscribe(),t};function Qa(e,t,n){var r=(0,h.useRef)(e),o=la((function(){return function(e){var t=e.initialState,n=Aa.NotStarted,r=new Set,o={_machine:e,send:function(o){n===Aa.Running&&(t=e.transition(t,o),Ka(t,Wa(o)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(){return n=Aa.Running,Ka(t,La),o},stop:function(){return n=Aa.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}(r.current).start()})),i=(0,h.useRef)(null),a=(0,h.useState)((function(){return Ya(o)})),l=a[0],s=a[1],u=(0,h.useCallback)((function(e){var n=na(e)?{type:e}:e,r=function(e){return Object.entries(e).reduce((function(e,t){var n=t[0],r=t[1];return e[n]=r.current,e}),{})}(t);o.send($a({},n,{lastEventType:i.current,refs:r})),i.current=n.type}),[n]);(0,h.useEffect)((function(){return o.subscribe((function(e){e.changed&&s(e)})),function(){o.stop()}}),[o]),(0,h.useEffect)((function(){0}),[n,l]);var c=(0,h.useMemo)((function(){return $a({},l,{matches:function(e){return e===l.value}})}),[l.changed,l.context,l.value]);return[c,u,o]}function Xa(e,t){return la((function(){return function(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:Fa(e.states[e.initial].entry).map((function(e){return za(e,t.actions)})),context:e.context,matches:Ua(e.initial)},transition:function(t,r){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,l=a.value,s=a.context,u=Wa(r),c=e.states[l];if(c.on){var d=Fa(c.on[u.type]),f=function(t){if(void 0===t)return{value:Ha(l,s)};var r="string"==typeof t?{target:t}:t,o=r.target,i=void 0===o?l:o,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=s;if((void 0===f?function(){return!0}:f)(s,u)){var h=e.states[i],y=!1,g=[].concat(c.exit,d,h.entry).filter((function(e){return e})).map((function(e){return za(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){y=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,u):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,u):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:i,context:p,actions:g,changed:i!==l||g.length>0||y,matches:Ua(i)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var y=f(h.value);if("object"==typeof y)return y.value}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}return Ha(l,s)}};return n}(e,t)}))}function Za(){return Za=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Za.apply(this,arguments)}function Ja(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}!function(e){e.Idle="IDLE",e.Open="OPEN",e.Navigating="NAVIGATING",e.Dragging="DRAGGING",e.Interacting="INTERACTING"}(qa||(qa={})),function(e){e.ButtonMouseDown="BUTTON_MOUSE_DOWN",e.ButtonMouseUp="BUTTON_MOUSE_UP",e.Blur="BLUR",e.ClearNavSelection="CLEAR_NAV_SELECTION",e.ClearTypeahead="CLEAR_TYPEAHEAD",e.GetDerivedData="GET_DERIVED_DATA",e.KeyDownEscape="KEY_DOWN_ESCAPE",e.KeyDownEnter="KEY_DOWN_ENTER",e.KeyDownSpace="KEY_DOWN_SPACE",e.KeyDownNavigate="KEY_DOWN_NAVIGATE",e.KeyDownSearch="KEY_DOWN_SEARCH",e.KeyDownTab="KEY_DOWN_TAB",e.KeyDownShiftTab="KEY_DOWN_SHIFT_TAB",e.OptionTouchStart="OPTION_TOUCH_START",e.OptionMouseMove="OPTION_MOUSE_MOVE",e.OptionMouseEnter="OPTION_MOUSE_ENTER",e.OutsideMouseDown="OUTSIDE_MOUSE_DOWN",e.OutsideMouseUp="OUTSIDE_MOUSE_UP",e.ValueChange="VALUE_CHANGE",e.OptionMouseDown="OPTION_MOUSE_DOWN",e.OptionMouseUp="OPTION_MOUSE_UP",e.PopoverPointerDown="POPOVER_POINTER_DOWN",e.PopoverPointerUp="POPOVER_POINTER_UP",e.UpdateAfterTypeahead="UPDATE_AFTER_TYPEAHEAD"}(Ga||(Ga={}));var el=Ba({navigationValue:null}),tl=Ba({typeaheadQuery:null}),nl=Ba({value:function(e,t){return t.value}}),rl=Ba({navigationValue:function(e,t){return t.value}}),ol=Ba({navigationValue:function(e){var t,n=function(e,t){return e?t.find((function(t){return t.value===e})):void 0}(e.value,e.options);return n&&!n.disabled?e.value:(null===(t=e.options.find((function(e){return!e.disabled})))||void 0===t?void 0:t.value)||null}});function il(e,t){if(t.type===Ga.Blur){var n=t.refs,r=n.list,o=n.popover,i=t.relatedTarget,a=o&&Zi(o)||document;return!(a.activeElement===r||!o||o.contains(i||a.activeElement))}return!1}function al(e,t){if(t.type===Ga.OutsideMouseDown||t.type===Ga.OutsideMouseUp){var n=t.refs,r=n.button,o=n.popover,i=t.relatedTarget;return!(i===r||!r||r.contains(i)||!o||o.contains(i))}return!1}function ll(e,t){return!!e.options.find((function(t){return t.value===e.navigationValue}))}function sl(e,t){var n=t.refs,r=n.popover,o=n.list,i=t.relatedTarget;return!(r&&i&&r.contains(i)&&i!==o)&&ll(e)}function ul(e,t){requestAnimationFrame((function(){t.refs.list&&t.refs.list.focus()}))}function cl(e,t){t.refs.button&&t.refs.button.focus()}function dl(e,t){return!t.disabled}function fl(e,t){return t.type!==Ga.OptionTouchStart||!t||!t.disabled}function pl(e,t){return(!t||!t.disabled)&&null!=e.navigationValue}function hl(e,t){t.callback&&t.callback(t.value)}function yl(e,t){if(t.type===Ga.KeyDownEnter){var n=t.refs.hiddenInput;if(n&&n.form){var r=n.form.querySelector("button,[type='submit']");r&&r.click()}}}var gl=Ba({typeaheadQuery:function(e,t){return(e.typeaheadQuery||"")+t.query}}),ml=Ba({value:function(e,t){if(t.type===Ga.UpdateAfterTypeahead&&t.query){var n=xl(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}}),vl=Ba({navigationValue:function(e,t){if(t.type===Ga.UpdateAfterTypeahead&&t.query){var n=xl(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}}),bl=((Va={})[Ga.GetDerivedData]={actions:Ba((function(e,t){return Za({},e,t.data)}))},Va[Ga.ValueChange]={actions:[nl,hl]},Va);function xl(e,t){return void 0===t&&(t=""),t&&e.find((function(e){return!e.disabled&&e.label&&e.label.toLowerCase().startsWith(t.toLowerCase())}))||null}var wl=Ia("ListboxDescendantContext"),jl=Yi("ListboxContext",{}),Sl=(0,h.forwardRef)((function(e,t){var n=e["aria-labelledby"],r=e["aria-label"],o=e.children,i=e.defaultValue,a=e.disabled,l=void 0!==a&&a,s=e.form,u=e.name,c=e.onChange,d=e.required,f=e.value,p=e._componentName,y=void 0===p?"ListboxInput":p,g=Ja(e,["aria-labelledby","aria-label","children","defaultValue","disabled","form","name","onChange","required","value","_componentName"]),m=(0,h.useRef)(null!=f),v=(0,h.useState)([]),b=v[0],x=v[1],w=function(e){var t=(0,h.useRef)(e);return(0,h.useEffect)((function(){t.current=e})),(0,h.useCallback)((function(){return t.current&&t.current.apply(t,arguments)}),[])}(c),j=(0,h.useRef)(null),S=(0,h.useRef)(null),k=(0,h.useRef)(null),C=(0,h.useRef)(null),_=(0,h.useRef)(null),O=(0,h.useRef)(null),E=(0,h.useRef)(null),T=Xa(function(e){var t,n,r,o,i,a,l=e.value;return{id:"listbox",initial:qa.Idle,context:{value:l,options:[],navigationValue:null,typeaheadQuery:null},states:(a={},a[qa.Idle]={on:Za({},bl,(t={},t[Ga.ButtonMouseDown]={target:qa.Open,actions:[ol],cond:dl},t[Ga.KeyDownSpace]={target:qa.Navigating,actions:[ol,ul],cond:dl},t[Ga.KeyDownSearch]={target:qa.Idle,actions:gl,cond:dl},t[Ga.UpdateAfterTypeahead]={target:qa.Idle,actions:[ml],cond:dl},t[Ga.ClearTypeahead]={target:qa.Idle,actions:tl},t[Ga.KeyDownNavigate]={target:qa.Navigating,actions:[ol,tl,ul],cond:dl},t[Ga.KeyDownEnter]={actions:[yl],cond:dl},t))},a[qa.Interacting]={entry:[el],on:Za({},bl,(n={},n[Ga.ClearNavSelection]={actions:[el,ul]},n[Ga.KeyDownEnter]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},n[Ga.KeyDownSpace]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},n[Ga.ButtonMouseDown]={target:qa.Idle,actions:[cl]},n[Ga.KeyDownEscape]={target:qa.Idle,actions:[cl]},n[Ga.OptionMouseDown]={target:qa.Dragging},n[Ga.OutsideMouseDown]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Dragging,actions:tl,cond:ll}],n[Ga.OutsideMouseUp]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Navigating,cond:ll},{target:qa.Interacting,actions:tl}],n[Ga.KeyDownEnter]=qa.Interacting,n[Ga.Blur]=[{target:qa.Idle,cond:il,actions:tl},{target:qa.Navigating,cond:sl},{target:qa.Interacting,actions:tl}],n[Ga.OptionTouchStart]={target:qa.Navigating,actions:[rl,tl],cond:fl},n[Ga.OptionMouseEnter]={target:qa.Navigating,actions:[rl,tl],cond:fl},n[Ga.KeyDownNavigate]={target:qa.Navigating,actions:[rl,tl,ul]},n))},a[qa.Open]={on:Za({},bl,(r={},r[Ga.ClearNavSelection]={actions:[el]},r[Ga.KeyDownEnter]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},r[Ga.KeyDownSpace]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},r[Ga.ButtonMouseDown]={target:qa.Idle,actions:[cl]},r[Ga.KeyDownEscape]={target:qa.Idle,actions:[cl]},r[Ga.OptionMouseDown]={target:qa.Dragging},r[Ga.OutsideMouseDown]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Dragging,cond:ll},{target:qa.Interacting,actions:tl}],r[Ga.OutsideMouseUp]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Navigating,cond:ll},{target:qa.Interacting,actions:tl}],r[Ga.Blur]=[{target:qa.Idle,cond:il,actions:tl},{target:qa.Navigating,cond:sl},{target:qa.Interacting,actions:tl}],r[Ga.ButtonMouseUp]={target:qa.Navigating,actions:[ol,ul]},r[Ga.OptionTouchStart]={target:qa.Navigating,actions:[rl,tl],cond:fl},r[Ga.KeyDownNavigate]={target:qa.Navigating,actions:[rl,tl,ul]},r[Ga.KeyDownSearch]={target:qa.Navigating,actions:gl},r[Ga.UpdateAfterTypeahead]={actions:[vl]},r[Ga.ClearTypeahead]={actions:tl},r[Ga.OptionMouseMove]=[{target:qa.Dragging,actions:[rl],cond:fl},{target:qa.Dragging}],r))},a[qa.Dragging]={on:Za({},bl,(o={},o[Ga.ClearNavSelection]={actions:[el]},o[Ga.KeyDownEnter]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},o[Ga.KeyDownSpace]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},o[Ga.ButtonMouseDown]={target:qa.Idle,actions:[cl]},o[Ga.KeyDownEscape]={target:qa.Idle,actions:[cl]},o[Ga.OptionMouseDown]={target:qa.Dragging},o[Ga.OutsideMouseDown]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Navigating,cond:ll},{target:qa.Interacting,actions:tl}],o[Ga.OutsideMouseUp]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Navigating,cond:ll,actions:ul},{target:qa.Interacting,actions:[tl,ul]}],o[Ga.Blur]=[{target:qa.Idle,cond:il,actions:tl},{target:qa.Navigating,cond:sl},{target:qa.Interacting,actions:tl}],o[Ga.ButtonMouseUp]={target:qa.Navigating,actions:[ol,ul]},o[Ga.OptionTouchStart]={target:qa.Navigating,actions:[rl,tl],cond:fl},o[Ga.OptionMouseEnter]={target:qa.Dragging,actions:[rl,tl],cond:fl},o[Ga.KeyDownNavigate]={target:qa.Navigating,actions:[rl,tl,ul]},o[Ga.KeyDownSearch]={target:qa.Navigating,actions:gl},o[Ga.UpdateAfterTypeahead]={actions:[vl]},o[Ga.ClearTypeahead]={actions:tl},o[Ga.OptionMouseMove]=[{target:qa.Navigating,actions:[rl],cond:fl},{target:qa.Navigating}],o[Ga.OptionMouseUp]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},o))},a[qa.Navigating]={on:Za({},bl,(i={},i[Ga.ClearNavSelection]={actions:[el,ul]},i[Ga.KeyDownEnter]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},i[Ga.KeyDownSpace]={target:qa.Idle,actions:[nl,tl,cl,hl],cond:pl},i[Ga.ButtonMouseDown]={target:qa.Idle,actions:[cl]},i[Ga.KeyDownEscape]={target:qa.Idle,actions:[cl]},i[Ga.OptionMouseDown]={target:qa.Dragging},i[Ga.OutsideMouseDown]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Navigating,cond:ll},{target:qa.Interacting,actions:tl}],i[Ga.OutsideMouseUp]=[{target:qa.Idle,cond:al,actions:tl},{target:qa.Navigating,cond:ll},{target:qa.Interacting,actions:tl}],i[Ga.Blur]=[{target:qa.Idle,cond:il,actions:tl},{target:qa.Navigating,cond:sl},{target:qa.Interacting,actions:tl}],i[Ga.ButtonMouseUp]={target:qa.Navigating,actions:[ol,ul]},i[Ga.OptionTouchStart]={target:qa.Navigating,actions:[rl,tl],cond:fl},i[Ga.OptionMouseEnter]={target:qa.Navigating,actions:[rl,tl],cond:fl},i[Ga.KeyDownNavigate]={target:qa.Navigating,actions:[rl,tl,ul]},i[Ga.KeyDownSearch]={target:qa.Navigating,actions:gl},i[Ga.UpdateAfterTypeahead]={actions:[vl]},i[Ga.ClearTypeahead]={actions:tl},i[Ga.OptionMouseMove]=[{target:qa.Navigating,actions:[rl],cond:fl},{target:qa.Navigating}],i))},a)}}({value:(m.current?f:i)||null})),P=Qa(T,{button:j,hiddenInput:S,highlightedOption:k,input:C,list:_,popover:O,selectedOption:E},false),A=P[0],M=P[1],D=function(e){var t=e||(da?pa():null),n=(0,h.useState)(t),r=n[0],o=n[1];return qi((function(){null===r&&o(pa())}),[]),(0,h.useEffect)((function(){!1===da&&(da=!0)}),[]),null!=r?String(r):void 0}(g.id),I=g.id||ra("listbox-input",D),R=ua(C,t),N=(0,h.useMemo)((function(){var e=b.find((function(e){return e.value===A.context.value}));return e?e.label:null}),[b,A.context.value]),L=Ml(A.value),F=(0,h.useMemo)((function(){return{ariaLabel:r,ariaLabelledBy:n,disabled:l,isExpanded:L,listboxId:I,listboxValueLabel:N,onValueChange:w,buttonRef:j,listRef:_,popoverRef:O,selectedOptionRef:E,highlightedOptionRef:k,send:M,state:A.value,stateData:A.context}}),[r,n,A.value,A.context,l,I,L,w,M,N]),B=(0,h.useRef)(!1);if(!m.current&&null==i&&!B.current&&b.length){B.current=!0;var z=b.find((function(e){return!e.disabled}));z&&z.value&&M({type:Ga.ValueChange,value:z.value})}return ia(f,"value",y),function(e,t,n){var r=(0,h.useRef)(null!=e).current;r&&e!==t&&n()}(f,A.context.value,(function(){M({type:Ga.ValueChange,value:f})})),qi((function(){M({type:Ga.GetDerivedData,data:{options:b}})}),[b,M]),(0,h.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Rl(t,O.current)||M({type:Ga.OutsideMouseDown,relatedTarget:n||t})}return L&&window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}),[M,L]),(0,h.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Rl(t,O.current)||M({type:Ga.OutsideMouseUp,relatedTarget:n||t})}return L&&window.addEventListener("mouseup",e),function(){window.removeEventListener("mouseup",e)}}),[M,L]),aa("listbox"),h.createElement(Na,{context:wl,items:b,set:x},h.createElement(jl.Provider,{value:F},h.createElement("div",Object.assign({},g,{ref:R,"data-reach-listbox-input":"","data-state":L?"expanded":"closed","data-value":A.context.value,id:I}),ea(o)?o({id:I,isExpanded:L,value:A.context.value,selectedOptionRef:E,highlightedOptionRef:k,valueLabel:N,expanded:L}):o),(s||u||d)&&h.createElement("input",{ref:S,"data-reach-listbox-hidden-input":"",disabled:l,form:s,name:u,readOnly:!0,required:d,tabIndex:-1,type:"hidden",value:A.context.value||""})))}));var kl=Qi((function(e,t){var n=e["aria-label"],r=e.arrow,o=void 0!==r&&r,i=e.as,a=void 0===i?"span":i,l=e.children,s=e.onKeyDown,u=e.onMouseDown,c=e.onMouseUp,d=Ja(e,["aria-label","arrow","as","children","onKeyDown","onMouseDown","onMouseUp"]),f=(0,h.useContext)(jl),p=f.ariaLabelledBy,y=f.buttonRef,g=f.disabled,m=f.isExpanded,v=f.listboxId,b=f.stateData,x=f.send,w=f.listboxValueLabel,j=b.value,S=ua(y,t),k=Dl();var C=ra("button",v),_=(0,h.useMemo)((function(){return l?ea(l)?l({isExpanded:m,label:w,value:j,expanded:m}):l:w}),[l,w,m,j]);return h.createElement(a,Object.assign({"aria-disabled":g||void 0,"aria-expanded":m||void 0,"aria-haspopup":"listbox","aria-labelledby":n?void 0:[p,C].filter(Boolean).join(" "),"aria-label":n,role:"button",tabIndex:g?-1:0},d,{ref:S,"data-reach-listbox-button":"",id:C,onKeyDown:ca(s,k),onMouseDown:ca(u,(function(e){ta(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),x({type:Ga.ButtonMouseDown,disabled:g}))})),onMouseUp:ca(c,(function(e){ta(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),x({type:Ga.ButtonMouseUp}))}))}),_,o&&h.createElement(Ol,null,Ji(o)?null:o))}));var Cl=Xi(kl),_l=(0,h.forwardRef)((function(e,t){var n=e.children,r=Ja(e,["children"]),o=(0,h.useContext)(jl).isExpanded;return h.createElement("span",Object.assign({"aria-hidden":!0},r,{ref:t,"data-reach-listbox-arrow":"","data-expanded":o?"":void 0}),ea(n)?n({isExpanded:o,expanded:o}):n||"\u25bc")}));var Ol=(0,h.memo)(_l),El=(0,h.forwardRef)((function(e,t){var n=e.position,r=void 0===n?Ta:n,o=e.onBlur,i=e.onKeyDown,a=e.portal,l=void 0===a||a,s=e.unstable_observableRefs,u=Ja(e,["position","onBlur","onKeyDown","portal","unstable_observableRefs"]),c=(0,h.useContext)(jl),d=c.buttonRef,f=c.popoverRef,p=c.send,y=c.isExpanded,g=ua(f,t),m=Dl(),v=Za({hidden:!y,tabIndex:-1},u,{ref:g,"data-reach-listbox-popover":"",onBlur:ca(o,(function(e){var t=e.nativeEvent;requestAnimationFrame((function(){p({type:Ga.Blur,relatedTarget:t.relatedTarget||t.target})}))})),onKeyDown:ca(i,m)});return l?h.createElement(Ma,Object.assign({},v,{targetRef:d,position:r,unstable_observableRefs:s})):h.createElement("div",Object.assign({},v))}));var Tl=(0,h.memo)(El),Pl=Qi((function(e,t){var n=e.as,r=void 0===n?"ul":n,o=Ja(e,["as"]),i=(0,h.useContext)(jl),a=i.ariaLabel,l=i.ariaLabelledBy,s=i.isExpanded,u=i.listboxId,c=i.listRef,d=i.stateData,f=d.value,p=d.navigationValue,y=ua(t,c);return h.createElement(r,Object.assign({"aria-activedescendant":Il(s?p:f),"aria-labelledby":a?void 0:l,"aria-label":a,role:"listbox",tabIndex:-1},o,{ref:y,"data-reach-listbox-list":"",id:ra("listbox",u)}))}));var Al=Qi((function(e,t){var n=e.as,r=void 0===n?"li":n,o=e.children,i=e.disabled,a=e.onMouseDown,l=e.onMouseEnter,s=e.onMouseLeave,u=e.onMouseMove,c=e.onMouseUp,d=e.onTouchStart,f=e.value,p=e.label,y=Ja(e,["as","children","disabled","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onTouchStart","value","label"]);var g=(0,h.useContext)(jl),m=g.highlightedOptionRef,v=g.isExpanded,b=g.onValueChange,x=g.selectedOptionRef,w=g.send,j=g.state,S=g.stateData,k=S.value,C=S.navigationValue,_=(0,h.useState)(p),O=_[0],E=_[1],T=p||O||"",P=(0,h.useRef)(null);Ra({element:P.current,value:f,label:T,disabled:!!i},wl);var A=(0,h.useCallback)((function(e){!p&&e&&E((function(t){return e.textContent&&t!==e.textContent?e.textContent:t||""}))}),[p]),M=!!C&&C===f,D=k===f,I=ua(A,t,P,D?x:null,M?m:null);return h.createElement(r,Object.assign({"aria-selected":(v?M:D)||void 0,"aria-disabled":i||void 0,role:"option"},y,{ref:I,id:Il(f),"data-reach-listbox-option":"","data-current":D?"":void 0,"data-label":T,"data-value":f,onMouseDown:ca(a,(function(e){ta(e.nativeEvent)||(e.preventDefault(),w({type:Ga.OptionMouseDown}))})),onMouseEnter:ca(l,(function(){w({type:Ga.OptionMouseEnter,value:f,disabled:!!i})})),onMouseLeave:ca(s,(function(){w({type:Ga.ClearNavSelection})})),onMouseMove:ca(u,(function(){j!==qa.Open&&C===f||w({type:Ga.OptionMouseMove,value:f,disabled:!!i})})),onMouseUp:ca(c,(function(e){ta(e.nativeEvent)||w({type:Ga.OptionMouseUp,value:f,callback:b,disabled:!!i})})),onTouchStart:ca(d,(function(){w({type:Ga.OptionTouchStart,value:f,disabled:!!i})}))}),o)}));function Ml(e){return[qa.Navigating,qa.Open,qa.Dragging,qa.Interacting].includes(e)}function Dl(){var e,t=(0,h.useContext)(jl),n=t.disabled,r=t.onValueChange,o=t.stateData,i=o.navigationValue,a=o.typeaheadQuery,l=t.state,s=t.send,u=(e=wl,(0,h.useContext)(e).descendants);(0,h.useEffect)((function(){a&&s({type:Ga.UpdateAfterTypeahead,query:a,callback:r});var e=window.setTimeout((function(){null!=a&&s({type:Ga.ClearTypeahead})}),1e3);return function(){window.clearTimeout(e)}}),[r,s,a]);var c=u.findIndex((function(e){return e.value===i})),d=ca((function(e){var t=e.key,o=na(t)&&1===t.length,a=u.find((function(e){return e.value===i}));switch(t){case"Enter":return void s({type:Ga.KeyDownEnter,value:i,callback:r,disabled:!(!(null===a||void 0===a?void 0:a.disabled)&&!n)});case" ":return e.preventDefault(),void s({type:Ga.KeyDownSpace,value:i,callback:r,disabled:!(!(null===a||void 0===a?void 0:a.disabled)&&!n)});case"Escape":return Ml(l)&&e.stopPropagation(),void s({type:Ga.KeyDownEscape});case"Tab":var c=e.shiftKey?Ga.KeyDownShiftTab:Ga.KeyDownTab;return void s({type:c});default:return void(o&&s({type:Ga.KeyDownSearch,query:t,disabled:n}))}}),function(e,t){var n=(0,h.useContext)(e).descendants,r=t.callback,o=t.currentIndex,i=t.filter,a=t.key,l=void 0===a?"index":a,s=t.orientation,u=void 0===s?"vertical":s,c=t.rotate,d=void 0===c||c,f=t.rtl,p=void 0!==f&&f,y=null!==o&&void 0!==o?o:-1;return function(e){if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(e.key)){var t=i?n.filter(i):n;if(i&&(y=t.findIndex((function(e){return e.index===o}))),t.length)switch(e.key){case"ArrowDown":if("vertical"===u||"both"===u){e.preventDefault();var a=b();r("option"===l?a:a[l])}break;case"ArrowUp":if("vertical"===u||"both"===u){e.preventDefault();var s=x();r("option"===l?s:s[l])}break;case"ArrowLeft":if("horizontal"===u||"both"===u){e.preventDefault();var c=(p?b:x)();r("option"===l?c:c[l])}break;case"ArrowRight":if("horizontal"===u||"both"===u){e.preventDefault();var f=(p?x:b)();r("option"===l?f:f[l])}break;case"PageUp":e.preventDefault();var h=(e.ctrlKey?x:w)();r("option"===l?h:h[l]);break;case"Home":e.preventDefault();var g=w();r("option"===l?g:g[l]);break;case"PageDown":e.preventDefault();var m=(e.ctrlKey?b:j)();r("option"===l?m:m[l]);break;case"End":e.preventDefault();var v=j();r("option"===l?v:v[l])}}function b(){return y===t.length-1?d?w():t[y]:t[(y+1)%t.length]}function x(){return 0===y?d?j():t[y]:t[(y-1+t.length)%t.length]}function w(){return t[0]}function j(){return t[t.length-1]}}}(wl,{currentIndex:c,orientation:"vertical",key:"index",rotate:!0,filter:function(e){return!e.disabled},callback:function(e){s({type:Ga.KeyDownNavigate,value:u[e].value,disabled:n})}}));return d}function Il(e){var t=(0,h.useContext)(jl).listboxId;return e?ra("option-"+e,t):void 0}function Rl(e,t){return!(e!==t&&!(null===t||void 0===t?void 0:t.contains(e)))}var Nl=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 15",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{fill:"currentColor",d:"M24.483.576c-.309-.327-.674-.49-1.097-.49H1.56C1.137.086.771.25.463.576A1.635 1.635 0 0 0 0 1.737c0 .448.154.834.463 1.161l10.913 11.558c.31.327.675.49 1.097.49.422 0 .788-.163 1.096-.49L24.483 2.898c.308-.327.463-.713.463-1.16 0-.448-.155-.835-.463-1.162Z"})});var Ll=e=>{const{style:t,nativeStyle:n,innerRef:r,...o}=e;return(0,wo.jsx)("div",{...o,ref:r,style:n,className:`view ${(0,lo.iv)([e.className,e.style])}`})};const Fl=h.forwardRef(((e,t)=>{let{children:n,pressed:r,primary:o,hover:i,bare:a,style:l,disabled:s,hoveredStyle:u,activeStyle:c,bounce:d=!0,as:f="button",...p}=e;u=[a?{backgroundColor:"rgba(100, 100, 100, .15)"}:{...mo.shadow},u],c=[a?{backgroundColor:"rgba(100, 100, 100, .25)"}:{transform:d&&"translateY(1px)",boxShadow:!a&&(o?"0 1px 4px 0 rgba(0,0,0,0.3)":"0 1px 4px 0 rgba(0,0,0,0.2)"),transition:"none"},c];let h=f,y=[{alignItems:"center",justifyContent:"center",flexShrink:0,padding:a?"5px":"5px 10px",margin:0,overflow:"hidden",display:"flex",borderRadius:4,backgroundColor:a?"transparent":o?s?go.n7:go.p5:"white",border:a?"none":"1px solid "+(o?s?go.n7:go.p5:go.n9),color:o?"white":s?go.n6:go.n1,transition:"box-shadow .25s",...mo.smallText},{":hover":!s&&u},{":active":!s&&c},i&&u,r&&c,l];return(0,wo.jsx)(h,{ref:t,..."string"===typeof f?(0,lo.iv)(y):{style:y},disabled:s,...p,children:n})})),Bl=h.forwardRef(((e,t)=>{let{loading:n,children:r,...o}=e;return(0,wo.jsxs)(Fl,{...o,style:[{position:"relative"},o.style],children:[n&&(0,wo.jsx)(Ll,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},children:(0,wo.jsx)(ko,{color:"currentColor",style:{width:20,height:20,color:"currentColor"}})}),(0,wo.jsx)(Ll,{style:{opacity:n?0:1,flexDirection:"row",alignItems:"center"},children:r})]})}));var zl=Fl;var Ul=function(e){return function(t){e.forEach((function(e){"function"===typeof e?e(t):null!=e&&(e.current=t)}))}};let Wl=h.createContext(null);function Hl(e){let{children:t}=e,n=(0,h.useRef)(null),r=(0,h.useMemo)((()=>({keyRef:n,onKeyChange:e=>{n.current=e}})),[n]);return(0,wo.jsx)(Wl.Provider,{value:r,children:t})}function Kl(e,t){let n=(0,h.useContext)(Wl),r=(0,h.useRef)(null);(0,h.useLayoutEffect)((()=>{let o=r.current,i=e.current;if(i&&t&&(null===o||!1===o)){let e="input,button,div[tabindex]",r=i.matches(e)?i:i.querySelector(e);t&&r&&function(e,t){if(t){let n=function(e){let t=e;for(let n=0;n<10&&t;n++){let e=t.dataset&&t.dataset.focusKey;if(e)return e;t=t.parentNode}return null}(e);e.focus({preventScroll:n&&n===t.keyRef.current}),t.onKeyChange(n)}else e.focus();"INPUT"===e.tagName&&e.setSelectionRange(0,1e4)}(r,n)}r.current=t}),[t])}const $l={outline:0,backgroundColor:"white",margin:0,padding:5,borderRadius:4,border:"1px solid #d0d0d0"};var Vl=e=>{let{style:t,inputRef:n,onEnter:r,onUpdate:o,focused:i,...a}=e,l=(0,h.useRef)();return Kl(l,i),(0,wo.jsx)("input",{ref:n?Ul([n,l]):l,...(0,lo.iv)($l,{":focus":{border:"1px solid "+go.b5,boxShadow:"0 1px 1px "+go.b7},"::placeholder":{color:go.n7}},mo.smallText,t),...a,onKeyDown:e=>{"Enter"===e.key&&r&&r(e),a.onKeyDown&&a.onKeyDown(e)},onChange:e=>{o&&o(e.target.value),a.onChange&&a.onChange(e)}})};var ql=e=>{const{style:t,innerRef:n,...r}=e;return(0,wo.jsx)("span",{...r,ref:n,className:String((0,lo.iv)([e.className,e.style]))})},Gl=n(2942),Yl=n.n(Gl),Ql="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0,Xl=navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0;function Zl(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function Jl(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++){let t=n[r].toLowerCase();"mod"===t&&(t=Xl?"cmd":"ctrl"),n[r]=e[t]}return n}function es(e){"string"!==typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var ts={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,"\u21ea":20,",":188,".":190,"/":191,"`":192,"-":Ql?173:189,"=":Ql?61:187,";":Ql?59:186,"'":222,"[":219,"]":221,"\\":220},ns={"\u21e7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},rs={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},os={16:!1,18:!1,17:!1,91:!1},is={},as=1;as<20;as++)ts["f".concat(as)]=111+as;var ls=[],ss="all",us=[],cs=function(e){return"mod"===e&&(e=Xl?"cmd":"ctrl"),ts[e.toLowerCase()]||ns[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function ds(e){ss=e||"all"}function fs(){return ss||"all"}var ps=function(e){var t=e.key,n=e.scope,r=e.method,o=e.splitKey,i=void 0===o?"+":o;es(t).forEach((function(e){var t=e.split(i),o=t.length,a=t[o-1],l="*"===a?"*":cs(a);if(is[l]){n||(n=fs());var s=o>1?Jl(ns,t):[];is[l]=is[l].map((function(e){return(!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,i=0;i<n.length;i++)-1===r.indexOf(n[i])&&(o=!1);return o}(e.mods,s)?{}:e}))}}))};function hs(e,t,n){var r;if(t.scope===n||"all"===t.scope){for(var o in r=t.mods.length>0,os)Object.prototype.hasOwnProperty.call(os,o)&&(!os[o]&&t.mods.indexOf(+o)>-1||os[o]&&-1===t.mods.indexOf(+o))&&(r=!1);(0!==t.mods.length||os[16]||os[18]||os[17]||os[91])&&!r&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function ys(e){var t=is["*"],n=e.keyCode||e.which||e.charCode;if(gs.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===ls.indexOf(n)&&229!==n&&ls.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=rs[t];e[t]&&-1===ls.indexOf(n)?ls.push(n):!e[t]&&ls.indexOf(n)>-1?ls.splice(ls.indexOf(n),1):"metaKey"===t&&e[t]&&3===ls.length&&(e.ctrlKey||e.shiftKey||e.altKey||(ls=ls.slice(ls.indexOf(n))))})),n in os){for(var r in os[n]=!0,ns)ns[r]===n&&(gs[r]=!0);if(!t)return}for(var o in os)Object.prototype.hasOwnProperty.call(os,o)&&(os[o]=e[rs[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===ls.indexOf(17)&&ls.push(17),-1===ls.indexOf(18)&&ls.push(18),os[17]=!0,os[18]=!0);var i=fs();if(t)for(var a=0;a<t.length;a++)t[a].scope===i&&("keydown"===e.type&&t[a].keydown||"keyup"===e.type&&t[a].keyup)&&hs(e,t[a],i);if(n in is)for(var l=0;l<is[n].length;l++)if(("keydown"===e.type&&is[n][l].keydown||"keyup"===e.type&&is[n][l].keyup)&&is[n][l].key){for(var s=is[n][l],u=s.splitKey,c=s.key.split(u),d=[],f=0;f<c.length;f++)d.push(cs(c[f]));d.sort().join("")===ls.sort().join("")&&hs(e,s,i)}}}function gs(e,t,n){ls=[];var r=es(e),o=[],i="all",a=document,l=0,s=!1,u=!0,c="+";for(void 0===n&&"function"===typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(i=t.scope),t.element&&(a=t.element),t.keyup&&(s=t.keyup),void 0!==t.keydown&&(u=t.keydown),"string"===typeof t.splitKey&&(c=t.splitKey)),"string"===typeof t&&(i=t);l<r.length;l++)o=[],(e=r[l].split(c)).length>1&&(o=Jl(ns,e)),(e="*"===(e=e[e.length-1])?"*":cs(e))in is||(is[e]=[]),is[e].push({keyup:s,keydown:u,scope:i,mods:o,shortcut:r[l],method:n,key:r[l],splitKey:c});"undefined"!==typeof a&&!function(e){return us.indexOf(e)>-1}(a)&&window&&(us.push(a),Zl(a,"keydown",(function(e){ys(e)})),Zl(window,"focus",(function(){ls=[]})),Zl(a,"keyup",(function(e){ys(e),function(e){var t=e.keyCode||e.which||e.charCode,n=ls.indexOf(t);if(n>=0&&ls.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&ls.splice(0,ls.length),93!==t&&224!==t||(t=91),t in os)for(var r in os[t]=!1,ns)ns[r]===t&&(gs[r]=!1)}(e)})))}var ms={setScope:ds,getScope:fs,deleteScope:function(e,t){var n,r;for(var o in e||(e=fs()),is)if(Object.prototype.hasOwnProperty.call(is,o))for(n=is[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;fs()===e&&ds(t||"all")},getPressedKeyCodes:function(){return ls.slice(0)},isPressed:function(e){return"string"===typeof e&&(e=cs(e)),-1!==ls.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(r=!1),r},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&ps(e)}));else if("object"===typeof e)e.key&&ps(e);else if("string"===typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],i=n[1];"function"===typeof o&&(i=o,o=""),ps({key:e,scope:o,method:i,splitKey:"+"})}}else Object.keys(is).forEach((function(e){return delete is[e]}))}};for(var vs in ms)Object.prototype.hasOwnProperty.call(ms,vs)&&(gs[vs]=ms[vs]);if("undefined"!==typeof window){var bs=window.hotkeys;gs.noConflict=function(e){return e&&window.hotkeys===gs&&(window.hotkeys=bs),gs},window.hotkeys=gs}var xs=gs;var ws=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:4,strokeLinecap:"round",strokeMiterlimit:10,d:"m2 2 20 20M22 2 2 22"})});const js=e=>{let{style:t,size:n,noAnimation:r,isCurrent:o,stackIndex:i,children:a}=e,l=(0,h.useRef)(null),s=(0,h.useRef)(!1),u=(0,h.useRef)(10*Math.random()-5);return(0,h.useLayoutEffect)((()=>{function e(){o?(l.current.style.transform="translateY(0px) scale(1)",l.current.style.pointerEvents="auto"):(l.current.style.transform=`translateY(-40px) scale(.95) rotate(${u.current}deg)`,l.current.style.pointerEvents="none")}null!=l.current&&(s.current?e():r?(l.current.style.opacity=1,l.current.style.transform="translateY(0px) scale(1)",setTimeout((()=>{l.current&&(l.current.style.transition="opacity .1s, transform .1s cubic-bezier(.42, 0, .58, 1)")}),0)):(l.current.style.opacity=0,l.current.style.transform="translateY(10px) scale(1)",setTimeout((()=>{l.current&&(s.current=!0,l.current.style.transition="opacity .1s, transform .1s cubic-bezier(.42, 0, .58, 1)",l.current.style.opacity=1,e())}),0)))}),[r,o,i]),(0,wo.jsx)(Ll,{innerRef:l,style:[t,n&&{width:n.width,height:n.height},r&&!o&&{display:"none"}],children:a})},Ss=e=>{let{style:t,leftContent:n,focusButton:r=!1,children:o}=e,i=(0,h.useRef)(null);return(0,h.useEffect)((()=>{if(r&&i.current){let e=i.current.querySelector("button:not([data-hidden])");e&&e.focus()}}),[r]),(0,wo.jsxs)(Ll,{innerRef:i,style:[{flexDirection:"row",marginTop:30},t],children:[n,(0,wo.jsx)(Ll,{style:{flex:1}}),o]})};var ks=e=>{let{title:t,isCurrent:r,isHidden:o,size:i,padding:a=20,showHeader:l=!0,showTitle:s=!0,showClose:u=!0,showOverlay:c=!0,loading:d=!1,noAnimation:f=!1,focusAfterClose:p=!0,stackIndex:y,parent:g,style:m,contentStyle:v,overlayStyle:b,children:x,onClose:w}=e;return(0,h.useEffect)((()=>{let e=xs.getScope();return xs.setScope("modal"),()=>xs.setScope(e)}),[]),(0,wo.jsx)(Yl(),{isOpen:!0,onRequestClose:w,shouldCloseOnOverlayClick:!1,shouldFocusAfterRender:!n.g.IS_DESIGN_MODE,shouldReturnFocusAfterClose:p,appElement:document.querySelector("#root"),parentSelector:g&&(()=>g),style:{content:{top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",overflow:"visible",border:0,fontSize:14,backgroundColor:"transparent",padding:0,pointerEvents:"auto",...v},overlay:{zIndex:3e3,backgroundColor:c&&0===y?"rgba(0, 0, 0, .1)":"none",pointerEvents:c?"auto":"none",...b,...g?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}}},children:(0,wo.jsxs)(js,{noAnimation:f,isCurrent:r,size:i,style:[{willChange:"opacity, transform",minWidth:"100%",minHeight:0,borderRadius:4,backgroundColor:"white",opacity:o?0:1,[`@media (min-width: ${yo.breakpoint_narrow})`]:{minWidth:yo.breakpoint_narrow}},mo.shadowLarge,m,mo.lightScrollbar],children:[l&&(0,wo.jsxs)(Ll,{style:{padding:20,position:"relative",flexShrink:0},children:[s&&(0,wo.jsx)(Ll,{style:{color:go.n2,flex:1,alignSelf:"center",textAlign:"center",width:"calc(100% - 40px)"},children:(0,wo.jsx)(ql,{style:{fontSize:25,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})}),(0,wo.jsx)(Ll,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",alignItems:"center"},children:(0,wo.jsx)(Ll,{style:{flexDirection:"row",marginRight:15},children:u&&(0,wo.jsx)(zl,{bare:!0,onClick:w,style:{padding:"10px 10px"},"aria-label":"Close",children:(0,wo.jsx)(ws,{width:10})})})})]}),(0,wo.jsx)(Ll,{style:{padding:a,paddingTop:0,flex:1},children:"function"===typeof x?x():x}),d&&(0,wo.jsx)(Ll,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, .6)",alignItems:"center",justifyContent:"center",zIndex:1e3},children:(0,wo.jsx)(ko,{style:{width:20,height:20},color:go.n1})})]})})};function Cs(e,t){return h.Children.toArray(t).reduce(((t,n)=>n?n.type===h.Fragment?t.concat(Cs(n.key,n.props.children)):(t.push({key:e+n.key,child:n}),t):t),[])}const _s=h.forwardRef(((e,t)=>{let{direction:n="column",align:r,justify:o,spacing:i=3,children:a,debug:l,style:s,...u}=e;const c=n.endsWith("reverse"),d=n.startsWith("row"),f=Cs("",a);return(0,wo.jsx)(Ll,{style:[{flexDirection:n,alignItems:r,justifyContent:o},s],innerRef:t,...u,children:f.map(((e,t)=>{let n,{key:r,child:o}=e,a=f.length===t+1;return n=d?c?"marginLeft":"marginRight":c?"marginTop":"marginBottom",h.cloneElement("string"===typeof o?(0,wo.jsx)(ql,{children:o}):o,{key:r,style:[l&&{borderWidth:1,borderColor:"red"},a?null:{[n]:5*i},o.props?o.props.style:null]})}))})}));var Os=_s;const Es=h.createContext();function Ts(){let[e,t]=(0,h.useState)(!1);return{getOpenEvents:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{onClick:n=>{n.stopPropagation(),e.onClick&&e.onClick(n),t(!0)}}},isOpen:e,close:()=>t(!1)}}class Ps extends h.Component{constructor(e){super(e),this.state={position:null},this.position=e.position||"bottom-right",this.contentRef=h.createRef()}setup(){this.layout();let e=e=>{let t=e.target;for(;t&&t!==document.documentElement&&"tooltip"!==t.dataset.testid&&null==t.dataset.reachPopover;)t=t.parentNode;t===document.documentElement&&this.props.onClose&&this.props.onClose()};window.document.addEventListener("mousedown",e,!1),this.contentRef.current.addEventListener("keydown",(e=>{"Escape"===e.key&&this.props.onClose&&this.props.onClose()}),!1),this.cleanup=()=>{window.document.removeEventListener("mousedown",e)}}componentDidMount(){this.getContainer()?this.setup():this.forceUpdate((()=>{this.getContainer()?this.setup():console.log("Warning: could not mount tooltip, container missing")}))}componentDidUpdate(e){(e.targetRect!==this.props.targetRect||e.forceTop!==this.props.forceTop||this.props.forceLayout)&&this.layout()}getContainer(){let{ignoreBoundary:e=!1}=this.props;return!e&&this.context?this.context.current:document.body}getBoundsContainer(){let e=this.getContainer();return e.parentNode&&"auto"===e.parentNode.style.overflow?e.parentNode:e}layout(){let{targetRect:e,offset:t=0}=this.props,n=this.contentRef.current;if(!n)return;let r=n.getBoundingClientRect(),o=this.target.parentNode,i=e||o.getBoundingClientRect();i={top:i.top,left:i.left,width:i.width,height:i.height};let a=this.getBoundsContainer();if(!a)return;let l=a.getBoundingClientRect();if(i.left-=l.left,i.top-=l.top,this.props.forceTop)i.top=this.props.forceTop;else{let e=r.height+t,n=i.top-e,o=i.top+i.height+e;(-1!==this.position.indexOf("top")&&n<l.top||-1!==this.position.indexOf("bottom")&&o>l.height&&n>0)&&(this.position=this.getOppositePosition(this.position)),i.top+=a.scrollTop}const s=this.getStyleForPosition(this.position,r,i,this.getContainer().getBoundingClientRect(),t);n.style.top=s.top,n.style.bottom=s.bottom,n.style.left=s.left,n.style.right=s.right,n.style.width=s.width}componentWillUnmount(){this.cleanup&&this.cleanup()}getOppositePosition(e){switch(e){case"top":case"top-left":return"bottom";case"top-right":return"bottom-right";case"bottom":case"bottom-left":return"top";case"bottom-right":return"top-right";case"bottom-stretch":return"top-stretch";case"top-stretch":return"bottom-stretch";case"bottom-center":return"top-center";case"top-center":return"bottom-center";case"right":return"right"}}getStyleForPosition(e,t,n,r,o){const i={top:"inherit",bottom:"inherit",left:"inherit",right:"inherit"};if("top"===e||"top-right"===e||"top-left"===e)i.top=n.top-t.height-o+"px",i.left="top-right"===e?n.left+(n.width-t.width)+"px":n.left+"px";else if("bottom"===e||"bottom-right"===e||"bottom-left"===e)i.top=n.top+n.height+o+"px",i.left="bottom-right"===e?n.left+(n.width-t.width)+"px":n.left+"px";else if("bottom-center"===e)i.top=n.top+n.height+o+"px",i.left=n.left-(t.width-n.width)/2+"px";else if("top-center"===e)i.top=n.top-t.height-o+"px",i.left=n.left-(t.width-n.width)/2+"px";else if("left-center"===e)i.top=n.top-(t.height-n.height)/2+"px",i.left=n.left-t.width+"px";else if("top-stretch"===e)i.bottom=r.height-n.top+o+"px",i.left=n.left+"px",i.width=n.width+"px";else if("bottom-stretch"===e)i.top=n.top+n.height+o+"px",i.left=n.left+"px",i.width=n.width+"px";else{if("right"!==e)throw new Error("Invalid position for Tooltip: "+e);i.top=n.top+"px",i.left=n.left+n.width+o+"px"}return i}render(){const{children:e,width:t,style:n}=this.props,r={position:"absolute",zIndex:3e3,padding:5,width:t,...mo.shadowLarge,borderRadius:4,backgroundColor:"white"};return this.getContainer()?(0,wo.jsx)("div",{ref:e=>this.target=e,children:we.createPortal((0,wo.jsx)("div",{...(0,lo.iv)(r,n,mo.darkScrollbar),ref:this.contentRef,"data-testid":"tooltip",onClick:e=>{e.stopPropagation()},children:e}),this.getContainer())}):null}}function As(e){let{children:t,...n}=e;return(0,wo.jsx)(ql,{...n,style:[n.style,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}],children:t})}Ps.contextType=Es;function Ms(e){const{style:t,innerRef:n,...r}=e;return(0,wo.jsx)("div",{...r,ref:n,className:`${e.className||""} ${(0,lo.iv)(e.style)}`})}const Ds=h.forwardRef(((e,t)=>{let{children:n,...r}=e;return(0,wo.jsx)(Ll,{...r,ref:t,style:[{marginTop:15,marginLeft:5,marginRight:5,borderRadius:6,backgroundColor:"white",borderColor:go.p3,boxShadow:"0 1px 2px #9594A8"},r.style],children:(0,wo.jsx)(Ll,{style:{borderRadius:6,overflow:"hidden"},children:n})})}));function Is(e){let{style:t,children:n,...r}=e;return(0,wo.jsx)(zl,{...(0,lo.iv)({textDecoration:"none",color:mo.textColor,backgroundColor:"transparent",border:0,cursor:"pointer",padding:0,font:"inherit",":hover":{textDecoration:"underline"}},mo.smallText,t),...r,children:n})}function Rs(e){let{to:t,exact:n,style:r,activeStyle:o,children:i}=e,a=function(e){var t=Ni(),n=Ii(hi).match;return e?Ci(t.pathname,e):n}({path:t,exact:!0});return(0,wo.jsx)(Vi,{to:t,exact:n,...(0,lo.iv)([mo.smallText,r,a?o:null]),children:i})}const Ns=h.forwardRef(((e,t)=>{let{asAnchor:n,children:r,...o}=e;function i(e){e.preventDefault(),window.Actual.openURLInBrowser(o.href)}return n?(0,wo.jsx)("a",{ref:t,...o,onClick:i,children:r}):(0,wo.jsx)(zl,{ref:t,bare:!0,...o,onClick:i,children:r})}));const Ls=Di((function(e){let{history:t,staticContext:n,to:r,style:o,activeStyle:i,match:a,location:l,...s}=e;return(0,wo.jsx)(_i,{path:r,children:e=>{let{match:n}=e;return(0,wo.jsx)(zl,{style:[o,n?i:null],...s,onClick:e=>{s.onClick&&s.onClick(e),t.push(r)}})}})}));function Fs(e){let{leftContent:t,rightContent:n,inputStyle:r,style:o,getStyle:i,...a}=e,[l,s]=(0,h.useState)(!1);return(0,wo.jsxs)(Ll,{style:[$l,{padding:0,flex:1,flexDirection:"row",alignItems:"center"},l&&{border:"1px solid "+go.b5,boxShadow:"0 1px 1px "+go.b7},o,i&&i(l)],children:[t,(0,wo.jsx)(Vl,{...a,style:[r,{flex:1,"&, &:focus, &:hover":{border:0,backgroundColor:"transparent",boxShadow:"none",color:"inherit"}}],onFocus:e=>{s(!0),a.onFocus&&a.onFocus(e)},onBlur:e=>{s(!1),a.onBlur&&a.onBlur(e)}}),n]})}function Bs(e){let{inputRef:t,value:n,onChange:r,placeholder:o,isInModal:i,width:a=350}=e;return(0,wo.jsx)(Vl,{inputRef:t,placeholder:o,value:n,onChange:e=>r(e.target.value),style:{width:a,borderColor:i?null:"transparent",backgroundColor:i?null:go.n11,":focus":i?null:{backgroundColor:"white","::placeholder":{color:go.n8}}}})}const zs=h.forwardRef(((e,t)=>{let{style:n,children:r,...o}=e;return(0,wo.jsx)("select",{ref:t,...(0,lo.iv)({backgroundColor:"transparent",height:28,fontSize:14,flex:1,border:"1px solid #d0d0d0",borderRadius:4,color:go.n1,":focus":{border:"1px solid "+go.b5,boxShadow:"0 1px 1px "+go.b7,outline:"none"}},n),...o,children:r})}));function Us(e){let{options:t,value:n,onChange:r,style:o,disabledKeys:i=[]}=e;return(0,wo.jsxs)(Sl,{value:n,onChange:r,style:{lineHeight:"1em"},children:[(0,wo.jsx)(Cl,{...(0,lo.iv)([{borderWidth:0,padding:5,borderRadius:4},o]),arrow:(0,wo.jsx)(Nl,{style:{width:7,height:7,paddingTop:3}})}),(0,wo.jsx)(Tl,{style:{zIndex:1e4,outline:0,borderRadius:4},children:(0,wo.jsx)(Pl,{children:t.map((e=>{let[t,n]=e;return(0,wo.jsx)(Al,{value:t,disabled:i.includes(t),children:n},t)}))})})]})}function Ws(e){let{keyName:t}=e;return(0,wo.jsx)(ql,{style:{fontSize:10,color:go.n6},children:t})}function Hs(e){let{header:t,footer:n,items:r,onMenuSelect:o}=e,i=(0,h.useRef)(null),a=r.filter((e=>e)),[l,s]=(0,h.useState)(null);return(0,h.useEffect)((()=>{const e=i.current;e.focus();let t=e=>{let t=a.filter((e=>e&&e!==Hs.line&&e.type!==Hs.label)),n=t.indexOf(a[l]),r=e=>a.indexOf(t[e]);switch(e.key){case"ArrowUp":e.preventDefault(),s(null===l?0:r(Math.max(n-1,0)));break;case"ArrowDown":e.preventDefault(),s(null===l?0:r(Math.min(n+1,t.length-1)));break;case"Enter":e.preventDefault(),null!==l&&o&&o(a[l].name)}};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[l]),(0,wo.jsxs)(Ll,{style:{outline:"none",borderRadius:4,overflow:"hidden"},tabIndex:1,innerRef:i,children:[t,a.map(((e,t)=>{if(e===Hs.line)return(0,wo.jsx)(Ll,{style:{margin:"3px 0px"},children:(0,wo.jsx)(Ll,{style:{borderTop:"1px solid "+go.n10}})},t);if(e.type===Hs.label)return(0,wo.jsx)(ql,{style:{color:go.n6,fontSize:11,lineHeight:"1em",textTransform:"uppercase",margin:"3px 9px"},children:e.name},e.name);let n=a[t-1];return(0,wo.jsxs)(Ll,{role:"button",style:[{cursor:"default",padding:"9px 10px",marginTop:0===t||n===Hs.line||n.type===Hs.label?0:-3,flexDirection:"row",alignItems:"center"},e.disabled&&{color:go.n7},!e.disabled&&l===t&&{backgroundColor:go.n10}],onMouseEnter:()=>s(t),onMouseLeave:()=>s(null),onClick:t=>!e.disabled&&o&&o(e.name),children:[(0,wo.jsx)(ql,{style:{lineHeight:0},children:e.icon&&h.createElement(e.icon,{width:e.iconSize||10,height:e.iconSize||10,style:{marginRight:7,width:10}})}),(0,wo.jsx)(ql,{children:e.text}),(0,wo.jsx)(Ll,{style:{flex:1}}),e.key&&(0,wo.jsx)(Ws,{keyName:e.key})]},e.name)})),n]})}function Ks(e){let{left:t,right:n,style:r,leftStyle:o,rightStyle:i,truncate:a="left",...l}=e;const s={textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"};return(0,wo.jsxs)(Ll,{style:[{flexDirection:"row",alignItems:"center"},r],...l,children:[(0,wo.jsx)(Ms,{style:[{marginRight:10},"left"===a&&s,o],children:t}),(0,wo.jsx)(Ms,{style:[{flex:1,textAlign:"right"},"right"===a&&s,i],children:n})]})}function $s(e){let{style:t,isLast:n,children:r,...o}=e;return(0,wo.jsx)("div",{...o,...(0,lo.iv)(!n&&{marginBottom:15},t,{lineHeight:"1.5em"}),children:r})}function Vs(e){let{label:t,labelWidth:n,children:r,width:o,style:i}=e;return(0,wo.jsxs)("label",{...(0,lo.iv)({display:"flex",flexDirection:"row",alignItems:"center",margin:"7px 0",width:o},i),children:[(0,wo.jsxs)("div",{style:{width:n||75,textAlign:"right",paddingRight:10},children:[t,":"]}),r]})}function qs(e){let{style:t,children:n}=e;return(0,wo.jsx)(Ll,{style:[{color:"red",fontSize:13},t],children:n})}function Gs(e){let{children:t}=e,r=(0,h.useRef)(null);return(0,h.useEffect)((()=>{r.current&&!n.g.IS_DESIGN_MODE&&setTimeout((()=>{r.current&&(r.current.focus(),r.current.setSelectionRange(0,1e4))}),0)}),[]),"function"===typeof t?t(r):h.cloneElement(t,{inputRef:r})}function Ys(e){let{style:t,contentStyle:n,children:r,renderContent:o,disabled:i}=e,[a,l]=(0,h.useState)(!1);const s=(0,h.useCallback)((()=>{i||l(!0)}),[i]),u=(0,h.useCallback)((()=>{i||l(!1)}),[i]);return(0,h.useEffect)((()=>{i&&a&&l(!1)}),[i,a]),(0,wo.jsxs)(Ll,{style:t,children:[(0,wo.jsx)(Ll,{onMouseEnter:s,onMouseLeave:u,style:n,children:r}),a&&o()]})}function Qs(e){let{title:t,style:n}=e;return(0,wo.jsx)(ql,{style:[mo.text,{color:go.n2,textAlign:"right",fontSize:12,marginBottom:2},n],children:t})}Hs.line=Symbol("menu-line"),Hs.label=Symbol("menu-label");var Xs=function(e){let{initializing:t,loadingText:n}=e;return(0,wo.jsxs)(h.Fragment,{children:[(0,wo.jsx)(_o,{}),(null!=n||t)&&(0,wo.jsxs)(Ll,{...(0,lo.iv)({position:"absolute",top:0,left:0,right:0,padding:50,paddingTop:200,color:go.n1,alignItems:"center"}),children:[(0,wo.jsx)(Ms,{style:{marginBottom:20,fontSize:18},children:n}),(0,wo.jsx)(ko,{width:25,color:go.n1})]})]})};const Zs=e=>{let{title:t,style:n}=e;return(0,wo.jsx)(Ll,{style:[{fontWeight:500,textTransform:"uppercase",color:go.b3,marginBottom:5,lineHeight:"1em"},n],children:t})},Js=e=>{let{style:t,title:n,id:r,htmlFor:o}=e;return(0,wo.jsx)(ql,{style:[{fontSize:13,marginBottom:3,color:go.n3},t],children:(0,wo.jsx)("label",{htmlFor:o,id:r,children:n})})},eu=e=>{let{style:t,children:n}=e;return(0,wo.jsx)(Ll,{style:t,children:n})},tu=e=>(0,wo.jsx)("input",{type:"checkbox",...e,...(0,lo.iv)([{position:"relative",margin:0,marginRight:6,width:15,height:15,appearance:"none",outline:0,border:"1px solid #d0d0d0",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",color:"white",backgroundColor:"white",":checked":{border:"1px solid "+go.b6,backgroundColor:go.b6,"::after":{display:"block",background:go.b6+' url(\'data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="white" d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>\') 9px 9px',width:9,height:9,content:" "}},"&.focus-visible:focus":{"::before":{position:"absolute",top:-5,bottom:-5,left:-5,right:-5,border:"2px solid "+go.b5,borderRadius:6,content:" "}}}],e.style)});class nu extends h.Component{constructor(){super(...arguments),this.state={showError:!1}}renderSimple(e){let t;return t=e.IDBFailure?(0,wo.jsx)(ql,{children:"Your browser doesn\u2019t support IndexedDB in this environment, a feature that Actual requires to run. This might happen if you are in private browsing mode. Please try a different browser or turn off private browsing."}):e.SharedArrayBufferMissing?(0,wo.jsxs)(ql,{children:["Actual requires access to ",(0,wo.jsx)("code",{children:"SharedArrayBuffer"})," in order to function properly. If you\u2019re seeing this error, either your browser does not support ",(0,wo.jsx)("code",{children:"SharedArrayBuffer"}),", or your server is not sending the appropriate headers, or you are not using HTTPS. See"," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Troubleshooting/SharedArrayBuffer",children:"our troubleshooting documentation"})," ","to learn more. ",(0,wo.jsx)(ou,{})]}):(0,wo.jsxs)(ql,{children:["There was a problem loading the app in this browser version. If this continues to be a problem, you can"," ",(0,wo.jsx)("a",{href:"https://github.com/actualbudget/releases",children:"download the desktop app"}),"."]}),(0,wo.jsx)(Ll,{style:{alignItems:"center",justifyContent:"center",height:"100%"},children:(0,wo.jsxs)(Os,{style:{paddingBottom:100,maxWidth:500,color:go.r4,lineHeight:"1.5em",fontSize:15,"& a":{color:go.r4}},children:[(0,wo.jsx)(ql,{children:t}),(0,wo.jsxs)(ql,{children:["Please get"," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Contact",children:"in touch"})," ","for support"]})]})})}render(){const{buttonText:e,error:t}=this.props,{showError:n}=this.state;return"app-init-failure"===t.type?this.renderSimple(t):(0,wo.jsx)(ks,{isCurrent:!0,showClose:!1,title:"Fatal Error",children:()=>(0,wo.jsxs)(Ll,{style:{maxWidth:500},children:[(0,wo.jsx)($s,{children:"There was an unrecoverable error in the UI. Sorry!"}),(0,wo.jsxs)($s,{children:["If this error persists, please get"," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Contact",style:{color:go.p4},children:"in touch"})," ","so it can be investigated."]}),(0,wo.jsx)($s,{children:(0,wo.jsx)(zl,{onClick:()=>window.Actual.relaunch(),children:e})}),(0,wo.jsxs)($s,{isLast:!0,style:{fontSize:11},children:[(0,wo.jsx)(Is,{onClick:()=>this.setState({showError:!0}),style:{color:go.p4},children:"Show Error"}),n&&(0,wo.jsx)(Ms,{style:{marginTop:5,height:100,overflow:"auto"},children:t.stack})]})]})})}}var ru=nu;function ou(){let[e,t]=(0,h.useState)(!1),[n,r]=(0,h.useState)(!1);return e?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)($s,{style:{marginTop:10},children:["Actual uses ",(0,wo.jsx)("code",{children:"SharedArrayBuffer"})," to allow usage from multiple tabs at once and to ensure correct behavior when switching files. While it can run without access to ",(0,wo.jsx)("code",{children:"SharedArrayBuffer"}),", you may encounter data loss or notice multiple budget files being merged with each other."]}),(0,wo.jsxs)("label",{style:{display:"flex",alignItems:"center",marginBottom:10},children:[(0,wo.jsx)(tu,{checked:n,onChange:r})," I understand the risks, run Actual in the unsupported fallback mode"]}),(0,wo.jsx)(zl,{disabled:!n,onClick:()=>{window.localStorage.setItem("SharedArrayBufferOverride","true"),window.location.reload()},children:"Open Actual"})]}):(0,wo.jsx)(Is,{onClick:()=>t(!0),style:{color:"inherit !important",marginLeft:5,border:"none !important",background:"none !important",padding:"0 !important",textDecoration:"underline !important",boxShadow:"none !important",display:"inline !important",font:"inherit !important"},children:"Advanced options"})}var iu="dnd-core/INIT_COORDS",au="dnd-core/BEGIN_DRAG",lu="dnd-core/PUBLISH_DRAG_SOURCE",su="dnd-core/HOVER",uu="dnd-core/DROP",cu="dnd-core/END_DRAG",du=function(e,t){return e===t};function fu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hu={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function yu(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hu,r=arguments.length>1?arguments[1]:void 0,o=r.payload;switch(r.type){case iu:case au:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case su:return e=n.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?n:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(n),!0).forEach((function(t){pu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{clientOffset:o.clientOffset});case cu:case uu:return hu;default:return n}}var gu="dnd-core/ADD_SOURCE",mu="dnd-core/ADD_TARGET",vu="dnd-core/REMOVE_SOURCE",bu="dnd-core/REMOVE_TARGET";function xu(e){return xu="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xu(e)}function wu(e,t,n){return t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:n||null}),e)}function ju(e){return"object"===xu(e)}function Su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ku(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Su(Object(n),!0).forEach((function(t){Cu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Su(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ou(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_u,r=arguments.length>1?arguments[1]:void 0,o=r.payload;switch(r.type){case au:return ku({},n,{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case lu:return ku({},n,{isSourcePublic:!0});case su:return ku({},n,{targetIds:o.targetIds});case bu:return-1===n.targetIds.indexOf(o.targetId)?n:ku({},n,{targetIds:(e=n.targetIds,t=o.targetId,e.filter((function(e){return e!==t})))});case uu:return ku({},n,{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case cu:return ku({},n,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Eu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case gu:case mu:return e+1;case vu:case bu:return e-1;default:return e}}var Tu=[],Pu=[];function Au(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case su:break;case gu:case mu:case bu:case vu:return Tu;default:return Pu}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var n=new Map,r=function(e){return n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var o=[];return n.forEach((function(e,t){1===e&&o.push(t)})),o}(r,i),l=a.length>0||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:du;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(r,i);if(!l)return Tu;var s=i[i.length-1],u=r[r.length-1];return s!==u&&(s&&a.push(s),u&&a.push(u)),a}function Mu(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function Du(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(n),!0).forEach((function(t){Ru(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ru(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Au(e.dirtyHandlerIds,{type:t.type,payload:Iu({},t.payload,{prevTargetIds:wu(e,"dragOperation.targetIds",[])})}),dragOffset:yu(e.dragOffset,t),refCount:Eu(e.refCount,t),dragOperation:Ou(e.dragOperation,t),stateId:Mu(e.stateId)}}function Lu(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return r[a++]})))).name="Invariant Violation"}throw i.framesToPop=1,i}}function Fu(e,t){return{type:iu,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}Tu.__IS_NONE__=!0,Pu.__IS_ALL__=!0;var Bu={type:iu,payload:{clientOffset:null,sourceClientOffset:null}};function zu(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,o=void 0===r||r,i=n.clientOffset,a=n.getSourceClientOffset,l=e.getMonitor(),s=e.getRegistry();e.dispatch(Fu(i)),function(e,t,n){Lu(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){Lu(n.getSource(e),"Expected sourceIds to be registered.")}))}(t,l,s);var u=function(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,l);if(null!==u){var c=null;i&&(!function(e){Lu("function"===typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),c=a(u)),e.dispatch(Fu(i,c));var d=s.getSource(u).beginDrag(l,u);!function(e){Lu(ju(e),"Item must be an object.")}(d),s.pinSource(u);var f=s.getSourceType(u);return{type:au,payload:{itemType:f,item:d,sourceId:u,clientOffset:i||null,sourceClientOffset:c||null,isSourcePublic:!!o}}}e.dispatch(Bu)}}function Uu(e){return function(){if(e.getMonitor().isDragging())return{type:lu}}}function Wu(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function Hu(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){Lu(Array.isArray(e),"Expected targetIds to be an array.")}(t);var r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){Lu(t.isDragging(),"Cannot call hover while not dragging."),Lu(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var o=e[r];Lu(e.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array."),Lu(n.getTarget(o),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){for(var r=e.length-1;r>=0;r--){var o=e[r];Wu(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){e.forEach((function(e){n.getTarget(e).hover(t,e)}))}(r,o,i),{type:su,payload:{targetIds:r,clientOffset:n||null}}}}function Ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ku(Object(n),!0).forEach((function(t){Vu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qu(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();!function(e){Lu(e.isDragging(),"Cannot call drop while not dragging."),Lu(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach((function(o,i){var a=function(e,t,n,r){var o=n.getTarget(e),i=o?o.drop(r,e):void 0;(function(e){Lu("undefined"===typeof e||ju(e),"Drop result must either be an object or undefined.")})(i),"undefined"===typeof i&&(i=0===t?{}:r.getDropResult());return i}(o,i,r,n),l={type:uu,payload:{dropResult:$u({},t,{},a)}};e.dispatch(l)}))}}function Gu(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){Lu(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();return n.getSource(r,!0).endDrag(t,r),n.unpinSource(),{type:cu}}}function Yu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Xu,Zu=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.registry=n}var t,n,r;return t=e,n=[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;Lu("function"===typeof e,"listener must be a function."),Lu("undefined"===typeof n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe((function(){var o=t.store.getState(),i=o.stateId;try{var a=i===r||i===r+1&&!function(e,t){if(e===Tu)return!1;if(e===Pu||"undefined"===typeof t)return!0;var n,r=(n=e,t.filter((function(e){return n.indexOf(e)>-1})));return r.length>0}(o.dirtyHandlerIds,n);a||e()}finally{r=i}}))}},{key:"subscribeToOffsetChange",value:function(e){var t=this;Lu("function"===typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return Lu(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return Lu(t,"Expected to find a valid target."),!(!this.isDragging()||this.didDrop())&&Wu(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return Lu(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(r&&!Wu(n,r))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return function(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?Yu(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null}(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return function(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?Yu(t,n):null}(this.store.getState().dragOffset)}}],n&&Qu(t.prototype,n),r&&Qu(t,r),e}(),Ju=0;function ec(e){return ec="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ec(e)}function tc(e,t){t&&Array.isArray(e)?e.forEach((function(e){return tc(e,!1)})):Lu("string"===typeof e||"symbol"===ec(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function nc(e){oc.length||(rc(),!0),oc[oc.length]=e}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(Xu||(Xu={}));var rc,oc=[],ic=0,ac=1024;function lc(){for(;ic<oc.length;){var e=ic;if(ic+=1,oc[e].call(),ic>ac){for(var t=0,n=oc.length-ic;t<n;t++)oc[t]=oc[t+ic];oc.length-=ic,ic=0}}oc.length=0,ic=0,!1}var sc="undefined"!==typeof n.g?n.g:self,uc=sc.MutationObserver||sc.WebKitMutationObserver;function cc(e){return function(){var t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}rc="function"===typeof uc?function(e){var t=1,n=new uc(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}(lc):cc(lc),nc.requestFlush=rc,nc.makeRequestCallFromTimer=cc;var dc=[],fc=[],pc=nc.makeRequestCallFromTimer((function(){if(fc.length)throw fc.shift()}));function hc(e){var t;(t=dc.length?dc.pop():new yc).task=e,nc(t)}var yc=function(){function e(){}return e.prototype.call=function(){try{this.task.call()}catch(e){hc.onerror?hc.onerror(e):(fc.push(e),pc())}finally{this.task=null,dc[dc.length]=this}},e}();function gc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function vc(e){var t=(Ju++).toString();switch(e){case Xu.SOURCE:return"S".concat(t);case Xu.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function bc(e){switch(e[0]){case"S":return Xu.SOURCE;case"T":return Xu.TARGET;default:Lu(!1,"Cannot parse handler ID: ".concat(e))}}function xc(e,t){var n=e.entries(),r=!1;do{var o=n.next(),i=o.done;if(mc(o.value,2)[1]===t)return!0;r=!!i}while(!r);return!1}var wc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}var t,n,r;return t=e,n=[{key:"addSource",value:function(e,t){tc(e),function(e){Lu("function"===typeof e.canDrag,"Expected canDrag to be a function."),Lu("function"===typeof e.beginDrag,"Expected beginDrag to be a function."),Lu("function"===typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(Xu.SOURCE,e,t);return this.store.dispatch(function(e){return{type:gu,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){tc(e,!0),function(e){Lu("function"===typeof e.canDrop,"Expected canDrop to be a function."),Lu("function"===typeof e.hover,"Expected hover to be a function."),Lu("function"===typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(Xu.TARGET,e,t);return this.store.dispatch(function(e){return{type:mu,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return xc(this.dragSources,e)||xc(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Lu(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return Lu(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return Lu(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return Lu(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return bc(e)===Xu.SOURCE}},{key:"isTargetId",value:function(e){return bc(e)===Xu.TARGET}},{key:"removeSource",value:function(e){var t=this;Lu(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:vu,payload:{sourceId:e}}}(e)),hc((function(){t.dragSources.delete(e),t.types.delete(e)}))}},{key:"removeTarget",value:function(e){Lu(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:bu,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);Lu(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){Lu(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=vc(e);return this.types.set(r,t),e===Xu.SOURCE?this.dragSources.set(r,n):e===Xu.TARGET&&this.dropTargets.set(r,n),r}}],n&&gc(t.prototype,n),r&&gc(t,r),e}();function jc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Sc=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isSetUp=!1,this.handleRefCountChange=function(){var e=t.store.getState().refCount>0;t.backend&&(e&&!t.isSetUp?(t.backend.setup(),t.isSetUp=!0):!e&&t.isSetUp&&(t.backend.teardown(),t.isSetUp=!1))};var r=function(e){var t="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return G(Nu,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(n);this.store=r,this.monitor=new Zu(r,new wc(r)),r.subscribe(this.handleRefCountChange)}var t,n,r;return t=e,n=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,n=function(e){return{beginDrag:zu(e),publishDragSource:Uu(e),hover:Hu(e),drop:qu(e),endDrag:Gu(e)}}(this);return Object.keys(n).reduce((function(r,o){var i,a=n[o];return r[o]=(i=a,function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=i.apply(e,r);"undefined"!==typeof a&&t(a)}),r}),{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],n&&jc(t.prototype,n),r&&jc(t,r),e}();function kc(e,t,n,r){var o=new Sc(r),i=e(o,t,n);return o.receiveBackend(i),o}var Cc=h.createContext({dragDropManager:void 0});function _c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Oc(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Ec=0,Tc=(0,h.memo)((function(e){var t=e.children,n=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t;o[Pc]||(o[Pc]=function(e,t,n,r){return{dragDropManager:kc(e,t,n,r)}}(e,t,n,r));return o[Pc]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(Oc(e,["children"])),r=_c(n,2),o=r[0],i=r[1];return h.useEffect((function(){return i&&Ec++,function(){i&&(0===--Ec&&(Ac()[Pc]=null))}}),[]),h.createElement(Cc.Provider,{value:o},t)}));Tc.displayName="DndProvider";var Pc=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");function Ac(){return"undefined"!==typeof n.g?n.g:window}function Mc(e){var t=null;return function(){return null==t&&(t=e()),t}}function Dc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ic=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.entered=[],this.isNodeInDocument=t}var t,n,r;return t=e,n=[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var o=[];return n.forEach((function(e){return o.push(e)})),o}(this.entered.filter((function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))})),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter((function(e){return e!==n}))),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],n&&Dc(t.prototype,n),r&&Dc(t,r),e}(),Rc=Mc((function(){return/firefox/i.test(navigator.userAgent)})),Nc=Mc((function(){return Boolean(window.safari)}));function Lc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Fc=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=t.length,o=[],i=0;i<r;i++)o.push(i);o.sort((function(e,n){return t[e]<t[n]?-1:1}));for(var a,l,s=[],u=[],c=[],d=0;d<r-1;d++)a=t[d+1]-t[d],l=n[d+1]-n[d],u.push(a),s.push(l),c.push(l/a);for(var f=[c[0]],p=0;p<u.length-1;p++){var h=c[p],y=c[p+1];if(h*y<=0)f.push(0);else{a=u[p];var g=u[p+1],m=a+g;f.push(3*m/((m+g)/h+(m+a)/y))}}f.push(c[c.length-1]);for(var v,b=[],x=[],w=0;w<f.length-1;w++){v=c[w];var j=f[w],S=1/u[w],k=j+f[w+1]-v-v;b.push((v-j-k)*S),x.push(k*S*S)}this.xs=t,this.ys=n,this.c1s=f,this.c2s=b,this.c3s=x}var t,n,r;return t=e,n=[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return n[a];for(var l,s=0,u=i.length-1;s<=u;){var c=t[l=Math.floor(.5*(s+u))];if(c<e)s=l+1;else{if(!(c>e))return n[l];u=l-1}}var d=e-t[a=Math.max(0,u)],f=d*d;return n[a]+r[a]*d+o[a]*f+i[a]*d*f}}],n&&Lc(t.prototype,n),r&&Lc(t,r),e}(),Bc=1;function zc(e){var t=e.nodeType===Bc?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function Uc(e){return{x:e.clientX,y:e.clientY}}function Wc(e,t,n,r,o){var i,a="IMG"===(i=t).nodeName&&(Rc()||!document.documentElement.contains(i)),l=zc(a?e:t),s={x:n.x-l.x,y:n.y-l.y},u=e.offsetWidth,c=e.offsetHeight,d=r.anchorX,f=r.anchorY,p=function(e,t,n,r){var o=e?t.width:n,i=e?t.height:r;return Nc()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(a,t,u,c),h=p.dragPreviewWidth,y=p.dragPreviewHeight,g=o.offsetX,m=o.offsetY,v=0===m||m;return{x:0===g||g?g:new Fc([0,.5,1],[s.x,s.x/u*h,s.x+h-u]).interpolate(d),y:v?m:function(){var e=new Fc([0,.5,1],[s.y,s.y/c*y,s.y+y-c]).interpolate(f);return Nc()&&a&&(e+=(window.devicePixelRatio-1)*y),e}()}}var Hc,Kc="__NATIVE_FILE__",$c="__NATIVE_URL__",Vc="__NATIVE_TEXT__";function qc(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),"");return null!=r?r:n}function Gc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yc=(Gc(Hc={},Kc,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items}},matchesTypes:["Files"]}),Gc(Hc,$c,{exposeProperties:{urls:function(e,t){return qc(e,t,"").split("\n")}},matchesTypes:["Url","text/uri-list"]}),Gc(Hc,Vc,{exposeProperties:{text:function(e,t){return qc(e,t,"")}},matchesTypes:["Text","text/plain"]}),Hc);function Qc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Xc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.item={},this.initializeExposedProperties()}var t,n,r;return t=e,n=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach((function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})}))}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach((function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}})),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}],n&&Qc(t.prototype,n),r&&Qc(t,r),e}();function Zc(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Yc).filter((function(e){return Yc[e].matchesTypes.some((function(e){return t.indexOf(e)>-1}))}))[0]||null}function Jc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ed=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.globalContext=t}var t,n,r;return t=e,(n=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!==typeof window?window:void 0}},{key:"document",get:function(){if(this.window)return this.window.document}}])&&Jc(t.prototype,n),r&&Jc(t,r),e}();function td(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?td(Object(n),!0).forEach((function(t){rd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):td(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function od(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var id,ad=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.getSourceClientOffset=function(e){return zc(r.sourceNodes.get(e))},this.endDragNativeItem=function(){r.isDraggingNativeItem()&&(r.actions.endDrag(),r.registry.removeSource(r.currentNativeHandle),r.currentNativeHandle=null,r.currentNativeSource=null)},this.isNodeInDocument=function(e){return r.document&&r.document.body&&document.body.contains(e)},this.endDragIfSourceWasRemovedFromDOM=function(){var e=r.currentDragSourceNode;r.isNodeInDocument(e)||r.clearCurrentDragSourceNode()&&r.actions.endDrag()},this.handleTopDragStartCapture=function(){r.clearCurrentDragSourceNode(),r.dragStartSourceIds=[]},this.handleTopDragStart=function(e){if(!e.defaultPrevented){var t=r.dragStartSourceIds;r.dragStartSourceIds=null;var n=Uc(e);r.monitor.isDragging()&&r.actions.endDrag(),r.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:r.getSourceClientOffset,clientOffset:n});var o=e.dataTransfer,i=Zc(o);if(r.monitor.isDragging()){if(o&&"function"===typeof o.setDragImage){var a=r.monitor.getSourceId(),l=r.sourceNodes.get(a),s=r.sourcePreviewNodes.get(a)||l;if(s){var u=r.getCurrentSourcePreviewNodeOptions(),c=Wc(l,s,n,{anchorX:u.anchorX,anchorY:u.anchorY},{offsetX:u.offsetX,offsetY:u.offsetY});o.setDragImage(s,c.x,c.y)}}try{o.setData("application/json",{})}catch(d){}r.setCurrentDragSourceNode(e.target),r.getCurrentSourcePreviewNodeOptions().captureDraggingState?r.actions.publishDragSource():setTimeout((function(){return r.actions.publishDragSource()}),0)}else if(i)r.beginDragNativeItem(i);else{if(o&&!o.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}},this.handleTopDragEndCapture=function(){r.clearCurrentDragSourceNode()&&r.actions.endDrag()},this.handleTopDragEnterCapture=function(e){if(r.dragEnterTargetIds=[],r.enterLeaveCounter.enter(e.target)&&!r.monitor.isDragging()){var t=e.dataTransfer,n=Zc(t);n&&r.beginDragNativeItem(n,t)}},this.handleTopDragEnter=function(e){var t=r.dragEnterTargetIds;(r.dragEnterTargetIds=[],r.monitor.isDragging())&&(r.altKeyPressed=e.altKey,Rc()||r.actions.hover(t,{clientOffset:Uc(e)}),t.some((function(e){return r.monitor.canDropOnTarget(e)}))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=r.getCurrentDropEffect())))},this.handleTopDragOverCapture=function(){r.dragOverTargetIds=[]},this.handleTopDragOver=function(e){var t=r.dragOverTargetIds;if(r.dragOverTargetIds=[],!r.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));r.altKeyPressed=e.altKey,r.actions.hover(t||[],{clientOffset:Uc(e)}),(t||[]).some((function(e){return r.monitor.canDropOnTarget(e)}))||r.isDraggingNativeItem(),e.preventDefault()},this.handleTopDragLeaveCapture=function(e){r.isDraggingNativeItem()&&e.preventDefault(),r.enterLeaveCounter.leave(e.target)&&r.isDraggingNativeItem()&&r.endDragNativeItem()},this.handleTopDropCapture=function(e){r.dropTargetIds=[],e.preventDefault(),r.isDraggingNativeItem()&&r.currentNativeSource.loadDataTransfer(e.dataTransfer),r.enterLeaveCounter.reset()},this.handleTopDrop=function(e){var t=r.dropTargetIds;r.dropTargetIds=[],r.actions.hover(t,{clientOffset:Uc(e)}),r.actions.drop({dropEffect:r.getCurrentDropEffect()}),r.isDraggingNativeItem()?r.endDragNativeItem():r.endDragIfSourceWasRemovedFromDOM()},this.handleSelectStart=function(e){var t=e.target;"function"===typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new ed(n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Ic(this.isNodeInDocument)}var n,r,o;return n=e,r=[{key:"setup",value:function(){if(void 0!==this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function(){void 0!==this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&this.window.cancelAnimationFrame(this.asyncEndDragFrameId))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var o=function(t){return r.handleDragStart(t,e)},i=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},i=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return nd({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return nd({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(t).some((function(n){return t[n]===e}))}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new Xc(Yc[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((function(){return t.window&&t.window.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}},{key:"clearCurrentDragSourceNode",value:function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.window&&(this.window.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}}],r&&od(n.prototype,r),o&&od(n,o),e}(),ld=function(e,t){return new ad(e,t)};function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sd.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(id||(id={}));function ud(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var cd;function dd(e,t,n){void 0===n&&(n="/");let r=Sd(("string"===typeof t?ud(t):t).pathname||"/",n);if(null==r)return null;let o=fd(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let i=null;for(let a=0;null==i&&a<o.length;++a)i=wd(o[a],r);return i}function fd(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,o)=>{let i={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(kd(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(r.length));let a=Od([r,i.relativePath]),l=n.concat(i);e.children&&e.children.length>0&&(kd(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+a+'".'),fd(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:xd(a,e.index),routesMeta:l})})),t}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(cd||(cd={}));const pd=/^:\w+$/,hd=3,yd=2,gd=1,md=10,vd=-2,bd=e=>"*"===e;function xd(e,t){let n=e.split("/"),r=n.length;return n.some(bd)&&(r+=vd),t&&(r+=yd),n.filter((e=>!bd(e))).reduce(((e,t)=>e+(pd.test(t)?hd:""===t?gd:md)),r)}function wd(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a<n.length;++a){let e=n[a],l=a===n.length-1,s="/"===o?t:t.slice(o.length)||"/",u=jd({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},s);if(!u)return null;Object.assign(r,u.params);let c=e.route;i.push({params:r,pathname:Od([o,u.pathname]),pathnameBase:Ed(Od([o,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(o=Od([o,u.pathnameBase]))}return i}function jd(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);Cd("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(r.push(t),"([^\\/]+)")));e.endsWith("*")?(r.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):o+=n?"\\/*$":"(?:(?=[@.~-]|%[0-9A-F]{2})|\\b|\\/|$)";let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1),s=r.reduce(((e,t,n)=>{if("*"===t){let e=l[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return Cd(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(l[n]||"",t),e}),{});return{params:s,pathname:i,pathnameBase:a,pattern:e}}function Sd(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function kd(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function Cd(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(Fa){}}}function _d(e,t,n,r){void 0===r&&(r=!1);let o,i="string"===typeof e?ud(e):sd({},e),a=""===e||""===i.pathname,l=a?"/":i.pathname;if(r||null==l)o=n;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"===typeof e?ud(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:Td(r),hash:Pd(o)}}(i,o),u=l&&"/"!==l&&l.endsWith("/"),c=(a||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!u&&!c||(s.pathname+="/"),s}const Od=e=>e.join("/").replace(/\/\/+/g,"/"),Ed=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Td=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Pd=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class Ad extends Error{}class Md{constructor(e,t,n){this.status=e,this.statusText=t||"",this.data=n}}function Dd(e){return e instanceof Md}function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Id.apply(this,arguments)}const Rd="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},{useState:Nd,useEffect:Ld,useLayoutEffect:Fd,useDebugValue:Bd}=y;function zd(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!Rd(n,e)}catch(r){return!0}}"undefined"===typeof window||"undefined"===typeof window.document||window.document.createElement,y.useSyncExternalStore;const Ud=h.createContext(null);const Wd=h.createContext(null);const Hd=h.createContext(null);const Kd=h.createContext(null);const $d=h.createContext(null);const Vd=h.createContext({outlet:null,matches:[]});const qd=h.createContext(null);function Gd(){return null!=h.useContext($d)}function Yd(){return Gd()||kd(!1),h.useContext($d).location}function Qd(e){return e.filter(((t,n)=>0===n||!t.route.index&&t.pathnameBase!==e[n-1].pathnameBase))}function Xd(){Gd()||kd(!1);let{basename:e,navigator:t}=h.useContext(Kd),{matches:n}=h.useContext(Vd),{pathname:r}=Yd(),o=JSON.stringify(Qd(n).map((e=>e.pathnameBase))),i=h.useRef(!1);h.useEffect((()=>{i.current=!0}));let a=h.useCallback((function(n,a){if(void 0===a&&(a={}),!i.current)return;if("number"===typeof n)return void t.go(n);let l=_d(n,JSON.parse(o),r,"path"===a.relative);"/"!==e&&(l.pathname="/"===l.pathname?e:Od([e,l.pathname])),(a.replace?t.replace:t.push)(l,a.state,a)}),[e,t,o,r]);return a}function Zd(){let e=function(){var e;let t=h.useContext(qd),n=rf(nf.UseRouteError),r=h.useContext(Vd),o=r.matches[r.matches.length-1];if(t)return t;return r||kd(!1),!o.route.id&&kd(!1),null==(e=n.errors)?void 0:e[o.route.id]}(),t=Dd(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unhandled Thrown Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:o},n):null,h.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own\xa0",h.createElement("code",{style:i},"errorElement")," props on\xa0",h.createElement("code",{style:i},"<Route>")))}class Jd extends h.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?h.createElement(qd.Provider,{value:this.state.error,children:this.props.component}):this.props.children}}function ef(e){let{routeContext:t,match:n,children:r}=e,o=h.useContext(Ud);return o&&n.route.errorElement&&(o._deepestRenderedBoundaryId=n.route.id),h.createElement(Vd.Provider,{value:t},r)}function tf(e,t,n){if(void 0===t&&(t=[]),null==e){if(null==n||!n.errors)return null;e=n.matches}let r=e,o=null==n?void 0:n.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&(null==o?void 0:o[e.route.id])));e>=0||kd(!1),r=r.slice(0,Math.min(r.length,e+1))}return r.reduceRight(((e,i,a)=>{let l=i.route.id?null==o?void 0:o[i.route.id]:null,s=n?i.route.errorElement||h.createElement(Zd,null):null,u=()=>h.createElement(ef,{match:i,routeContext:{outlet:e,matches:t.concat(r.slice(0,a+1))}},l?s:void 0!==i.route.element?i.route.element:e);return n&&(i.route.errorElement||0===a)?h.createElement(Jd,{location:n.location,component:s,error:l,children:u()}):u()}),null)}var nf;function rf(e){let t=h.useContext(Hd);return t||kd(!1),t}!function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(nf||(nf={}));function of(e){kd(!1)}function af(e){let{basename:t="/",children:n=null,location:r,navigationType:o=id.Pop,navigator:i,static:a=!1}=e;Gd()&&kd(!1);let l=t.replace(/^\/*/,"/"),s=h.useMemo((()=>({basename:l,navigator:i,static:a})),[l,i,a]);"string"===typeof r&&(r=ud(r));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:p="default"}=r,y=h.useMemo((()=>{let e=Sd(u,l);return null==e?null:{pathname:e,search:c,hash:d,state:f,key:p}}),[l,u,c,d,f,p]);return null==y?null:h.createElement(Kd.Provider,{value:s},h.createElement($d.Provider,{children:n,value:{location:y,navigationType:o}}))}function lf(e){let{children:t,location:n}=e,r=h.useContext(Wd);return function(e,t){Gd()||kd(!1);let n=h.useContext(Hd),{matches:r}=h.useContext(Vd),o=r[r.length-1],i=o?o.params:{},a=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let l,s=Yd();if(t){var u;let e="string"===typeof t?ud(t):t;"/"===a||(null==(u=e.pathname)?void 0:u.startsWith(a))||kd(!1),l=e}else l=s;let c=l.pathname||"/",d=dd(e,{pathname:"/"===a?c:c.slice(a.length)||"/"}),f=tf(d&&d.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:Od([a,e.pathname]),pathnameBase:"/"===e.pathnameBase?a:Od([a,e.pathnameBase])}))),r,n||void 0);return t?h.createElement($d.Provider,{value:{location:Id({pathname:"/",search:"",hash:"",state:null,key:"default"},l),navigationType:id.Pop}},f):f}(r&&!t?r.router.routes:cf(t),n)}var sf;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(sf||(sf={}));new Promise((()=>{}));class uf extends h.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,r=null,o=sf.pending;if(n instanceof Promise)if(this.state.error){sf.error;let e=this.state.error;Promise.reject().catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_error",{get:()=>e})}else n._tracked?(n,void 0!==r._error?sf.error:void 0!==r._data?sf.success:sf.pending):(sf.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else sf.success,Promise.resolve(),Object.defineProperty(r,"_tracked",{get:()=>!0}),Object.defineProperty(r,"_data",{get:()=>n});if(o===sf.error&&r._error instanceof AbortedDeferredError)throw neverSettledPromise;if(o===sf.error&&!t)throw r._error;if(o===sf.error)return React.createElement(AwaitContext.Provider,{value:r,children:t});if(o===sf.success)return React.createElement(AwaitContext.Provider,{value:r,children:e});throw r}}function cf(e,t){void 0===t&&(t=[]);let n=[];return h.Children.forEach(e,((e,r)=>{if(!h.isValidElement(e))return;if(e.type===h.Fragment)return void n.push.apply(n,cf(e.props.children,t));e.type!==of&&kd(!1);let o=[...t,r],i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,hasErrorBoundary:null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle};e.props.children&&(i.children=cf(e.props.children,o)),n.push(i)})),n}function df(e){let{children:t}=e,n=Ri(),[r,o]=h.useState((()=>({location:n.location,action:n.action})));return h.useLayoutEffect((()=>{n.listen(((e,t)=>o({location:e,action:t})))}),[n]),h.createElement(af,{navigationType:r.action,location:r.location,navigator:n},h.createElement(lf,null,h.createElement(of,{path:"*",element:t})))}let ff=h.createContext(null);function pf(e){let{children:t}=e,n=function(){let[e,t]=(0,h.useState)(null);return(0,h.useEffect)((()=>{let e=hr(fr("accounts").select("*"),(async n=>{e&&t(n)}));return()=>{e.unsubscribe(),e=null}}),[]),e}();return(0,wo.jsx)(ff.Provider,{value:n,children:t})}function hf(e){let{children:t,idKey:n}=e;return t(yf({idKey:n}))}function yf(){let{idKey:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,h.useContext)(ff);return e&&t?Zr(t):t}let gf=h.createContext(null);function mf(e){let{children:t}=e,n=function(){let[e,t]=(0,h.useState)([]);return(0,h.useEffect)((()=>{let e=hr(fr("payees").select("*"),(async n=>{e&&t(n)}));return()=>{e.unsubscribe(),e=null}}),[]),e}();return(0,wo.jsx)(gf.Provider,{value:n,children:t})}function vf(e){let{children:t,idKey:n}=e;return t(bf({idKey:n}))}function bf(){let{idKey:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,h.useContext)(gf);return e&&t?Jr(t):t}var xf=n(7521),wf=n.n(xf);const jf=h.createContext(void 0);function Sf(){return(0,h.useContext)(jf)}function kf(e){let{children:t}=e,n=(0,h.useMemo)((()=>function(){const e={},t=new(wf())({max:1200}),n={};let r=!1;return new class{observeCell(t,r){return e[t]||(e[t]=[]),e[t].push(r),()=>{e[t]=e[t].filter((e=>e!==r)),0===e[t].length&&(n[t]=null)}}disableObservers(){r=!0}enableObservers(){r=!1}prewarmCache(e,n){t.set(e,n)}listen(){return Ye("cells-changed",(function(o){r||o.forEach((r=>{const o=e[r.name];o&&(o.forEach((e=>e(r))),n[r.name]=Promise.resolve(r),t.set(r.name,r))}))}))}bind(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__global",r=arguments.length>1?arguments[1]:void 0,o=arguments.length>3?arguments[3]:void 0;r="string"===typeof r?{name:r,value:null}:r;let i=`${e}!${r.name}`,a=this.observeCell(i,o);if(t.has(i)&&o(t.get(i)),null!=n[i])n[i].then(o);else{const a=this.get(e,r.name);n[i]=a,a.then((e=>{n[i]===a&&(t.set(i,e),o(e))}))}return a}get(e,t){return qe("getCell",{sheetName:e,name:t})}getCellNames(e){return qe("getCellNamesInSheet",{sheetName:e})}createQuery(e,t,n){return qe("create-query",{sheetName:e,name:t,query:n.serialize()})}}}()),[]);return(0,h.useEffect)((()=>n.listen()),[n]),(0,wo.jsx)(jf.Provider,{value:n,children:t})}var Cf=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M3.94 6.5 2.22 3.64l1.42-1.42L6.5 3.94c.52-.3 1.1-.54 1.7-.7L9 0h2l.8 3.24c.6.16 1.18.4 1.7.7l2.86-1.72 1.42 1.42-1.72 2.86c.3.52.54 1.1.7 1.7L20 9v2l-3.24.8c-.16.6-.4 1.18-.7 1.7l1.72 2.86-1.42 1.42-2.86-1.72c-.52.3-1.1.54-1.7.7L11 20H9l-.8-3.24c-.6-.16-1.18-.4-1.7-.7l-2.86 1.72-1.42-1.42 1.72-2.86c-.3-.52-.54-1.1-.7-1.7L0 11V9l3.24-.8c.16-.6.4-1.18.7-1.7zM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",fill:"currentColor"})});var _f=e=>(0,wo.jsxs)("svg",{...e,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("g",{clipPath:"url(#a)",children:(0,wo.jsx)("path",{d:"M1.857 7.612H.98a.98.98 0 0 0-.98.98v2.224c0 .449.184.857.51 1.163.612.551 1.816 1.49 3.735 2.368a.571.571 0 0 1 .306.346l.939 3.286a.484.484 0 0 0 .469.347h1.47a.479.479 0 0 0 .469-.367l.47-1.817a.262.262 0 0 1 .326-.183c.571.122 1.183.163 1.795.163.613 0 1.225-.061 1.796-.163.143-.02.286.06.327.183l.47 1.817a.502.502 0 0 0 .468.367h1.47a.484.484 0 0 0 .47-.347l1.224-4.245a.487.487 0 0 1 .122-.224c.919-.98 1.53-2.163 1.735-3.47h.49c.53 0 .959-.448.938-.979-.02-.51-.47-.918-.98-.918h-.448C18.06 4.673 14.632 2 10.489 2c-1.775 0-3.428.49-4.755 1.326-.591-.408-1.469-.734-2.693-.632-.49.04-.715.612-.388.959.408.429.796 1 .877 1.735L1.857 7.612Zm3.122.98a.862.862 0 0 1-.857-.858c0-.469.388-.857.857-.857.47 0 .858.388.858.857 0 .47-.388.858-.858.858Z",fill:"currentColor"})}),(0,wo.jsx)("defs",{children:(0,wo.jsx)("clipPath",{id:"a",children:(0,wo.jsx)("path",{fill:"currentColor",d:"M0 0h20v20H0z"})})})]});var Of=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M0 4c0-1.1.9-2 2-2h15a1 1 0 0 1 1 1v1H2v1h17a1 1 0 0 1 1 1v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm16.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z",fill:"currentColor"})});function Ef(){let e=navigator.userAgent;return/Mobi|android|iphone|kindle|ipad/i.test(e)}let Tf=Date.now();function Pf(e,t){return e.state&&e.state._version===Tf?t?e.state[t]:e.state:null}function Af(e){return e.replace("v","").split(".").map((e=>parseInt(e)))}function Mf(e,t){let n=Af(e),r=Af(t);return n[0]-r[0]||n[1]-r[1]||n[2]-r[2]}async function Df(){let e=await fetch("https://api.github.com/repos/actualbudget/actual/tags"),t=(await e.json()).map((e=>e.name)).concat([`v${window.Actual.ACTUAL_VERSION}`]);return t.sort(Mf),t[t.length-1]}async function If(e){return Mf(window.Actual.ACTUAL_VERSION,e)<0}var Rf=n(4881),Nf=n.n(Rf);function Lf(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Ff(e){return Ff="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ff(e)}function Bf(e){return Bf="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bf(e)}function zf(e){Lf(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Bf(e)&&"[object Date]"===t?new Date(e.getTime()):"number"===typeof e||"[object Number]"===t?new Date(e):("string"!==typeof e&&"[object String]"!==t||"undefined"===typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function Uf(e){if(Lf(1,arguments),!function(e){return Lf(1,arguments),e instanceof Date||"object"===Ff(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!==typeof e)return!1;var t=zf(e);return!isNaN(Number(t))}function Wf(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Hf(e,t){return Lf(2,arguments),function(e,t){Lf(2,arguments);var n=zf(e).getTime(),r=Wf(t);return new Date(n+r)}(e,-Wf(t))}var Kf=864e5;function $f(e){Lf(1,arguments);var t=zf(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function Vf(e){Lf(1,arguments);var t=zf(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=$f(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=$f(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}var qf=6048e5;function Gf(e){Lf(1,arguments);var t=zf(e),n=$f(t).getTime()-function(e){Lf(1,arguments);var t=Vf(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),$f(n)}(t).getTime();return Math.round(n/qf)+1}var Yf={};function Qf(){return Yf}function Xf(e,t){var n,r,o,i,a,l,s,u;Lf(1,arguments);var c=Qf(),d=Wf(null!==(n=null!==(r=null!==(o=null!==(i=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==i?i:null===t||void 0===t||null===(a=t.locale)||void 0===a||null===(l=a.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(s=c.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=zf(e),p=f.getUTCDay(),h=(p<d?7:0)+p-d;return f.setUTCDate(f.getUTCDate()-h),f.setUTCHours(0,0,0,0),f}function Zf(e,t){var n,r,o,i,a,l,s,u;Lf(1,arguments);var c=zf(e),d=c.getUTCFullYear(),f=Qf(),p=Wf(null!==(n=null!==(r=null!==(o=null!==(i=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null===t||void 0===t||null===(a=t.locale)||void 0===a||null===(l=a.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:f.firstWeekContainsDate)&&void 0!==r?r:null===(s=f.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,p),h.setUTCHours(0,0,0,0);var y=Xf(h,t),g=new Date(0);g.setUTCFullYear(d,0,p),g.setUTCHours(0,0,0,0);var m=Xf(g,t);return c.getTime()>=y.getTime()?d+1:c.getTime()>=m.getTime()?d:d-1}var Jf=6048e5;function ep(e,t){Lf(1,arguments);var n=zf(e),r=Xf(n,t).getTime()-function(e,t){var n,r,o,i,a,l,s,u;Lf(1,arguments);var c=Qf(),d=Wf(null!==(n=null!==(r=null!==(o=null!==(i=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null===t||void 0===t||null===(a=t.locale)||void 0===a||null===(l=a.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:c.firstWeekContainsDate)&&void 0!==r?r:null===(s=c.locale)||void 0===s||null===(u=s.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),f=Zf(e,t),p=new Date(0);return p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0),Xf(p,t)}(n,t).getTime();return Math.round(r/Jf)+1}function tp(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var np={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return tp("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):tp(n+1,2)},d:function(e,t){return tp(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return tp(e.getUTCHours()%12||12,t.length)},H:function(e,t){return tp(e.getUTCHours(),t.length)},m:function(e,t){return tp(e.getUTCMinutes(),t.length)},s:function(e,t){return tp(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return tp(Math.floor(r*Math.pow(10,n-3)),t.length)}},rp=np,op="midnight",ip="noon",ap="morning",lp="afternoon",sp="evening",up="night",cp={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return rp.y(e,t)},Y:function(e,t,n,r){var o=Zf(e,r),i=o>0?o:1-o;return"YY"===t?tp(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):tp(i,t.length)},R:function(e,t){return tp(Vf(e),t.length)},u:function(e,t){return tp(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return tp(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return tp(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return rp.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return tp(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=ep(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):tp(o,t.length)},I:function(e,t,n){var r=Gf(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):tp(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):rp.d(e,t)},D:function(e,t,n){var r=function(e){Lf(1,arguments);var t=zf(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/Kf)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):tp(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return tp(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return tp(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return tp(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?ip:0===o?op:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?sp:o>=12?lp:o>=4?ap:up,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return rp.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):rp.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):tp(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):tp(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):rp.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):rp.s(e,t)},S:function(e,t){return rp.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return fp(o);case"XXXX":case"XX":return pp(o);default:return pp(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return fp(o);case"xxxx":case"xx":return pp(o);default:return pp(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dp(o,":");default:return"GMT"+pp(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dp(o,":");default:return"GMT"+pp(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return tp(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return tp((r._originalDate||e).getTime(),t.length)}};function dp(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t||"";return n+String(o)+a+tp(i,2)}function fp(e,t){return e%60===0?(e>0?"-":"+")+tp(Math.abs(e)/60,2):pp(e,t)}function pp(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+tp(Math.floor(o/60),2)+n+tp(o%60,2)}var hp=cp,yp=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},gp=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},mp={p:gp,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return yp(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",yp(o,t)).replace("{{time}}",gp(i,t))}},vp=mp;function bp(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var xp=["D","DD"],wp=["YY","YYYY"];function jp(e){return-1!==xp.indexOf(e)}function Sp(e){return-1!==wp.indexOf(e)}function kp(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Cp={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},_p=function(e,t,n){var r,o=Cp[e];return r="string"===typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!==n&&void 0!==n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Op(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Ep={date:Op({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Op({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Op({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Tp={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pp=function(e,t,n,r){return Tp[e]};function Ap(e){return function(t,n){var r;if("formatting"===(null!==n&&void 0!==n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!==n&&void 0!==n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,l=null!==n&&void 0!==n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var Mp={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Ap({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ap({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ap({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ap({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ap({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},Dp=Mp;function Ip(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,l=i[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,(function(e){return e.test(l)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(s,(function(e){return e.test(l)}));return a=e.valueCallback?e.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:t.slice(l.length)}}}var Rp,Np={ordinalNumber:(Rp={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(Rp.matchPattern);if(!n)return null;var r=n[0],o=e.match(Rp.parsePattern);if(!o)return null;var i=Rp.valueCallback?Rp.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(r.length)}}),era:Ip({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Ip({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ip({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Ip({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Ip({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},Lp={code:"en-US",formatDistance:_p,formatLong:Ep,formatRelative:Pp,localize:Dp,match:Np,options:{weekStartsOn:0,firstWeekContainsDate:1}},Fp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zp=/^'([^]*?)'?$/,Up=/''/g,Wp=/[a-zA-Z]/;function Hp(e,t,n){var r,o,i,a,l,s,u,c,d,f,p,h,y,g,m,v,b,x;Lf(2,arguments);var w=String(t),j=Qf(),S=null!==(r=null!==(o=null===n||void 0===n?void 0:n.locale)&&void 0!==o?o:j.locale)&&void 0!==r?r:Lp,k=Wf(null!==(i=null!==(a=null!==(l=null!==(s=null===n||void 0===n?void 0:n.firstWeekContainsDate)&&void 0!==s?s:null===n||void 0===n||null===(u=n.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==l?l:j.firstWeekContainsDate)&&void 0!==a?a:null===(d=j.locale)||void 0===d||null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=Wf(null!==(p=null!==(h=null!==(y=null!==(g=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==g?g:null===n||void 0===n||null===(m=n.locale)||void 0===m||null===(v=m.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==y?y:j.weekStartsOn)&&void 0!==h?h:null===(b=j.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var _=zf(e);if(!Uf(_))throw new RangeError("Invalid time value");var O=Hf(_,bp(_)),E={firstWeekContainsDate:k,weekStartsOn:C,locale:S,_originalDate:_};return w.match(Bp).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,vp[t])(e,S.formatLong):e})).join("").match(Fp).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(zp);if(!t)return e;return t[1].replace(Up,"'")}(r);var i=hp[o];if(i)return null!==n&&void 0!==n&&n.useAdditionalWeekYearTokens||!Sp(r)||kp(r,t,String(e)),null!==n&&void 0!==n&&n.useAdditionalDayOfYearTokens||!jp(r)||kp(r,t,String(e)),i(O,r,S.localize,E);if(o.match(Wp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function Kp(e,t){Lf(2,arguments);var n=zf(e),r=Wf(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function $p(e,t){return Lf(2,arguments),Kp(e,-Wf(t))}function Vp(e,t){Lf(2,arguments);var n=zf(e),r=Wf(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function qp(e,t){return Lf(2,arguments),Vp(e,-Wf(t))}function Gp(e,t){Lf(2,arguments);var n=zf(e),r=zf(t);return n.getTime()<r.getTime()}function Yp(e){if("string"===typeof e){let[t,n,r]=e.split("-");return null!=r?new Date(parseInt(t),parseInt(n)-1,parseInt(r),12):null!=n?new Date(parseInt(t),parseInt(n)-1,1,12):new Date(parseInt(t),0,1,12)}return e}function Qp(e){return Hp(Yp(e),"yyyy-MM")}function Xp(e){return Hp(Yp(e),"yyyy-MM-dd")}function Zp(){return n.g.IS_TESTING?n.g.currentMonth||"2017-01":Hp(new Date,"yyyy-MM")}function Jp(){return n.g.IS_TESTING?"2017-01-01":Hp(new Date,"yyyy-MM-dd")}function eh(e){return Hp($p(Yp(e),1),"yyyy-MM")}function th(e,t){return Hp(Kp(Yp(e),t),"yyyy-MM")}function nh(e,t){return Hp($p(Yp(e),t),"yyyy-MM")}function rh(e,t){return Hp(Vp(Yp(e),t),"yyyy-MM-dd")}function oh(e,t){return Hp(qp(Yp(e),t),"yyyy-MM-dd")}function ih(e,t){return function(e,t){Lf(2,arguments);var n=zf(e),r=zf(t);return n.getTime()>r.getTime()}(Yp(e),Yp(t))}function ah(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=Qp(e);for(;Gp(Yp(o),Yp(t));)r.push(o),o=th(o,1);return n&&r.push(o),r}function lh(e,t){return ah(e,t,!0)}function sh(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];let o=e;for(;Gp(Yp(o),Yp(t));)r.push(o),o=rh(o,1);return n&&r.push(o),r}function uh(e){return e.slice(0,4)}function ch(e){return e.slice(0,7)}function dh(e){return"budget"+e.replace("-","")}function fh(e,t){return Hp(Yp(e),t)}Qr((e=>new RegExp(e.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}"))));const ph=Qr((e=>e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,""))),hh=Qr((e=>{let t=e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}");return new RegExp("^"+t+"$")})),yh=Qr((e=>e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-"))),gh=(Qr((e=>{let t=e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{2,4}");return new RegExp("^"+t+"$")})),Qr((e=>e.replace(/y+/g,"yy")))),mh=Qr((e=>{let t=e.replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{2}");return new RegExp("^"+t+"$")}));function vh(e,t,n){let r=Jp();return t?"completed":n?"paid":e===r?"due":e>r&&e<=rh(r,7)?"upcoming":e<r?"missed":"scheduled"}function bh(e){return fh(new Date(2020,0,e,12),"do")}function xh(e){return{SU:"Sunday",MO:"Monday",TU:"Tuesday",WE:"Wednesday",TH:"Thursday",FR:"Friday",SA:"Saturday"}[e]}function wh(e){let t=e.interval||1;switch(e.frequency){case"daily":{let e="Every ";return e+=1!==t?`${t} days`:"day",e}case"weekly":{let n="Every ";return n+=1!==t?`${t} weeks`:"week",n+=" on "+fh(e.start,"EEEE"),n}case"monthly":{let n="Every ";if(n+=1!==t?`${t} months`:"month",e.patterns&&e.patterns.length>0){let t=[...e.patterns].sort(((e,t)=>{let n=("day"===e.type?1:0)-("day"===t.type?1:0),r=e.value-t.value;return 0===n?r:n})).filter((e=>-1!==e.value));t=t.concat(e.patterns.filter((e=>-1===e.value))),n+=" on the ";let r=[],o=new Set(t.map((e=>e.type))),i=1===o.size&&!o.has("day");for(let e of t)if("day"===e.type)-1===e.value?r.push("last day"):r.push(bh(e.value));else{let t=i?"":" "+xh(e.type);-1===e.value?r.push("last"+t):r.push(bh(e.value)+t)}r.length>2?(n+=r.slice(0,r.length-1).join(", "),n+=", and ",n+=r[r.length-1]):n+=r.join(" and "),i&&(n+=" "+xh(t[0].type))}else n+=" on the "+fh(e.start,"do");return n}case"yearly":{let n="Every ";return n+=1!==t?`${t} years`:"year",n+=" on "+fh(e.start,"LLL do"),n}default:return"Recurring error"}}function jh(e){return{payee:e.find((e=>"is"===e.op&&"payee"===e.field))||e.find((e=>"is"===e.op&&"description"===e.field))||null,account:e.find((e=>"is"===e.op&&"account"===e.field))||e.find((e=>"is"===e.op&&"acct"===e.field))||null,amount:e.find((e=>("is"===e.op||"isapprox"===e.op||"isbetween"===e.op)&&"amount"===e.field))||null,date:e.find((e=>("is"===e.op||"isapprox"===e.op)&&"date"===e.field))||null}}function Sh(e){return e&&"number"!==typeof e?Math.round((e.num1+e.num2)/2):e}function kh(e,t){return hr(function(e){let t=e.map((e=>{let t=e._conditions.find((e=>"date"===e.field));return{$and:{schedule:e.id,date:{$gte:t&&"is"===t.op?e.next_date:oh(e.next_date,2)}}}}));return dr("transactions").filter({$or:t}).orderBy({date:"desc"}).groupBy("schedule").select(["schedule","date"])}(e),t,{mapper:t=>{let n=new Set(t.filter(Boolean).map((e=>e.schedule)));return new Map(e.map((e=>[e.id,vh(e.next_date,e.completed,n.has(e.id))])))}})}function Ch(){let{transform:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,n]=(0,h.useState)(null);return(0,h.useEffect)((()=>{let t,r,o=fr("schedules").select("*");return t=hr(e?e(o):o,(async e=>{t&&(r&&r.unsubscribe(),r=kh(e,(t=>n({schedules:e,statuses:t}))))})),()=>{t&&t.unsubscribe(),r&&r.unsubscribe()}}),[e]),t}let _h=h.createContext(null);function Oh(e){let{transform:t,children:n}=e,r=Ch({transform:t});return(0,wo.jsx)(_h.Provider,{value:r,children:n})}function Eh(){return(0,h.useContext)(_h)}function Th(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Ph(e){return Ph="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ph(e)}function Ah(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mh(e,t)}function Mh(e,t){return Mh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mh(e,t)}function Dh(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Rh(e);if(t){var o=Rh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ph(t)||"function"===typeof t))return t;return Ih(e)}(this,n)}}function Ih(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rh(e){return Rh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Rh(e)}function Nh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fh(e,t,n){return t&&Lh(e.prototype,t),n&&Lh(e,n),e}function Bh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zh=10,Uh=function(){function e(){Nh(this,e),Bh(this,"subPriority",0)}return Fh(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),Wh=function(e){Ah(n,e);var t=Dh(n);function n(e,r,o,i,a){var l;return Nh(this,n),(l=t.call(this)).value=e,l.validateValue=r,l.setValue=o,l.priority=i,a&&(l.subPriority=a),l}return Fh(n,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),n}(Uh),Hh=function(e){Ah(n,e);var t=Dh(n);function n(){var e;Nh(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return Bh(Ih(e=t.call.apply(t,[this].concat(o))),"priority",zh),Bh(Ih(e),"subPriority",-1),e}return Fh(n,[{key:"set",value:function(e,t){if(t.timestampIsSet)return e;var n=new Date(0);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}}]),n}(Uh);function Kh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var $h=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,n=[{key:"run",value:function(e,t,n,r){var o=this.parse(e,t,n,r);return o?{setter:new Wh(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,t,n){return!0}}],n&&Kh(t.prototype,n),r&&Kh(t,r),e}();function Vh(e){return Vh="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vh(e)}function qh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gh(e,t){return Gh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Gh(e,t)}function Yh(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Xh(e);if(t){var o=Xh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Vh(t)||"function"===typeof t))return t;return Qh(e)}(this,n)}}function Qh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xh(e){return Xh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xh(e)}function Zh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jh=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gh(e,t)}(i,e);var t,n,r,o=Yh(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Zh(Qh(e=o.call.apply(o,[this].concat(n))),"priority",140),Zh(Qh(e),"incompatibleTokens",["R","u","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}},{key:"set",value:function(e,t,n){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}],n&&qh(t.prototype,n),r&&qh(t,r),i}($h),ey=(Math.pow(10,8),6e4),ty=36e5,ny=1e3,ry={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},oy=/^([+-])(\d{2})(\d{2})?|Z/,iy=/^([+-])(\d{2})(\d{2})|Z/,ay=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ly=/^([+-])(\d{2}):(\d{2})|Z/,sy=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function uy(e,t){return e?{value:t(e.value),rest:e.rest}:e}function cy(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function dy(e,t){var n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};var r="+"===n[1]?1:-1,o=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:r*(o*ty+i*ey+a*ny),rest:t.slice(n[0].length)}}function fy(e){return cy(ry.anyDigitsSigned,e)}function py(e,t){switch(e){case 1:return cy(ry.singleDigit,t);case 2:return cy(ry.twoDigits,t);case 3:return cy(ry.threeDigits,t);case 4:return cy(ry.fourDigits,t);default:return cy(new RegExp("^\\d{1,"+e+"}"),t)}}function hy(e,t){switch(e){case 1:return cy(ry.singleDigitSigned,t);case 2:return cy(ry.twoDigitsSigned,t);case 3:return cy(ry.threeDigitsSigned,t);case 4:return cy(ry.fourDigitsSigned,t);default:return cy(new RegExp("^-?\\d{1,"+e+"}"),t)}}function yy(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function gy(e,t){var n,r=t>0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}function my(e){return e%400===0||e%4===0&&e%100!==0}function vy(e){return vy="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vy(e)}function by(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xy(e,t){return xy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xy(e,t)}function wy(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Sy(e);if(t){var o=Sy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===vy(t)||"function"===typeof t))return t;return jy(e)}(this,n)}}function jy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sy(e){return Sy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sy(e)}function ky(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cy=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xy(e,t)}(i,e);var t,n,r,o=wy(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ky(jy(e=o.call.apply(o,[this].concat(n))),"priority",130),ky(jy(e),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return uy(py(4,e),r);case"yo":return uy(n.ordinalNumber(e,{unit:"year"}),r);default:return uy(py(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var o=gy(n.year,r);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}}],n&&by(t.prototype,n),r&&by(t,r),i}($h);function _y(e){return _y="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_y(e)}function Oy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ey(e,t){return Ey=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ey(e,t)}function Ty(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Ay(e);if(t){var o=Ay(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===_y(t)||"function"===typeof t))return t;return Py(e)}(this,n)}}function Py(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ay(e){return Ay=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ay(e)}function My(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dy=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ey(e,t)}(i,e);var t,n,r,o=Ty(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return My(Py(e=o.call.apply(o,[this].concat(n))),"priority",130),My(Py(e),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return uy(py(4,e),r);case"Yo":return uy(n.ordinalNumber(e,{unit:"year"}),r);default:return uy(py(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n,r){var o=Zf(e,r);if(n.isTwoDigitYear){var i=gy(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Xf(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),Xf(e,r)}}],n&&Oy(t.prototype,n),r&&Oy(t,r),i}($h);function Iy(e){return Iy="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Iy(e)}function Ry(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ny(e,t){return Ny=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ny(e,t)}function Ly(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=By(e);if(t){var o=By(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Iy(t)||"function"===typeof t))return t;return Fy(e)}(this,n)}}function Fy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function By(e){return By=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},By(e)}function zy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uy=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ny(e,t)}(i,e);var t,n,r,o=Ly(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return zy(Fy(e=o.call.apply(o,[this].concat(n))),"priority",130),zy(Fy(e),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t){return hy("R"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),$f(r)}}],n&&Ry(t.prototype,n),r&&Ry(t,r),i}($h);function Wy(e){return Wy="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wy(e)}function Hy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ky(e,t){return Ky=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ky(e,t)}function $y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=qy(e);if(t){var o=qy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Wy(t)||"function"===typeof t))return t;return Vy(e)}(this,n)}}function Vy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qy(e){return qy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qy(e)}function Gy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yy=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ky(e,t)}(i,e);var t,n,r,o=$y(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Gy(Vy(e=o.call.apply(o,[this].concat(n))),"priority",130),Gy(Vy(e),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t){return hy("u"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}],n&&Hy(t.prototype,n),r&&Hy(t,r),i}($h);function Qy(e){return Qy="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qy(e)}function Xy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zy(e,t){return Zy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Zy(e,t)}function Jy(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=tg(e);if(t){var o=tg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Qy(t)||"function"===typeof t))return t;return eg(e)}(this,n)}}function eg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tg(e){return tg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tg(e)}function ng(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rg=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zy(e,t)}(i,e);var t,n,r,o=Jy(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ng(eg(e=o.call.apply(o,[this].concat(n))),"priority",120),ng(eg(e),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"Q":case"QQ":return py(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}],n&&Xy(t.prototype,n),r&&Xy(t,r),i}($h);function og(e){return og="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},og(e)}function ig(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ag(e,t){return ag=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ag(e,t)}function lg(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=ug(e);if(t){var o=ug(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===og(t)||"function"===typeof t))return t;return sg(e)}(this,n)}}function sg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ug(e){return ug=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ug(e)}function cg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dg=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ag(e,t)}(i,e);var t,n,r,o=lg(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return cg(sg(e=o.call.apply(o,[this].concat(n))),"priority",120),cg(sg(e),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"q":case"qq":return py(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}],n&&ig(t.prototype,n),r&&ig(t,r),i}($h);function fg(e){return fg="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fg(e)}function pg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hg(e,t){return hg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},hg(e,t)}function yg(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=mg(e);if(t){var o=mg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===fg(t)||"function"===typeof t))return t;return gg(e)}(this,n)}}function gg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mg(e){return mg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},mg(e)}function vg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bg=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hg(e,t)}(i,e);var t,n,r,o=yg(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return vg(gg(e=o.call.apply(o,[this].concat(n))),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),vg(gg(e),"priority",110),e}return t=i,n=[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"M":return uy(cy(ry.month,e),r);case"MM":return uy(py(2,e),r);case"Mo":return uy(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}],n&&pg(t.prototype,n),r&&pg(t,r),i}($h);function xg(e){return xg="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xg(e)}function wg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jg(e,t){return jg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jg(e,t)}function Sg(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Cg(e);if(t){var o=Cg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===xg(t)||"function"===typeof t))return t;return kg(e)}(this,n)}}function kg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cg(e){return Cg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cg(e)}function _g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Og=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jg(e,t)}(i,e);var t,n,r,o=Sg(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _g(kg(e=o.call.apply(o,[this].concat(n))),"priority",110),_g(kg(e),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"L":return uy(cy(ry.month,e),r);case"LL":return uy(py(2,e),r);case"Lo":return uy(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}],n&&wg(t.prototype,n),r&&wg(t,r),i}($h);function Eg(e){return Eg="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eg(e)}function Tg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pg(e,t){return Pg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pg(e,t)}function Ag(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Dg(e);if(t){var o=Dg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Eg(t)||"function"===typeof t))return t;return Mg(e)}(this,n)}}function Mg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dg(e){return Dg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dg(e)}function Ig(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rg=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pg(e,t)}(i,e);var t,n,r,o=Ag(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ig(Mg(e=o.call.apply(o,[this].concat(n))),"priority",100),Ig(Mg(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"w":return cy(ry.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n,r){return Xf(function(e,t,n){Lf(2,arguments);var r=zf(e),o=Wf(t),i=ep(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*i),r}(e,n,r),r)}}],n&&Tg(t.prototype,n),r&&Tg(t,r),i}($h);function Ng(e){return Ng="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ng(e)}function Lg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fg(e,t){return Fg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fg(e,t)}function Bg(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Ug(e);if(t){var o=Ug(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ng(t)||"function"===typeof t))return t;return zg(e)}(this,n)}}function zg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ug(e){return Ug=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ug(e)}function Wg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hg=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fg(e,t)}(i,e);var t,n,r,o=Bg(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wg(zg(e=o.call.apply(o,[this].concat(n))),"priority",100),Wg(zg(e),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"I":return cy(ry.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n){return $f(function(e,t){Lf(2,arguments);var n=zf(e),r=Wf(t),o=Gf(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(e,n))}}],n&&Lg(t.prototype,n),r&&Lg(t,r),i}($h);function Kg(e){return Kg="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kg(e)}function $g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vg(e,t){return Vg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vg(e,t)}function qg(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Yg(e);if(t){var o=Yg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Kg(t)||"function"===typeof t))return t;return Gg(e)}(this,n)}}function Gg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yg(e){return Yg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Yg(e)}function Qg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xg=[31,28,31,30,31,30,31,31,30,31,30,31],Zg=[31,29,31,30,31,30,31,31,30,31,30,31],Jg=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vg(e,t)}(i,e);var t,n,r,o=qg(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Qg(Gg(e=o.call.apply(o,[this].concat(n))),"priority",90),Qg(Gg(e),"subPriority",1),Qg(Gg(e),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"d":return cy(ry.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){var n=my(e.getUTCFullYear()),r=e.getUTCMonth();return n?t>=1&&t<=Zg[r]:t>=1&&t<=Xg[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}],n&&$g(t.prototype,n),r&&$g(t,r),i}($h);function em(e){return em="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(e)}function tm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nm(e,t){return nm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nm(e,t)}function rm(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=im(e);if(t){var o=im(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===em(t)||"function"===typeof t))return t;return om(e)}(this,n)}}function om(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},im(e)}function am(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lm=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nm(e,t)}(i,e);var t,n,r,o=rm(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return am(om(e=o.call.apply(o,[this].concat(n))),"priority",90),am(om(e),"subpriority",1),am(om(e),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"D":case"DD":return cy(ry.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return my(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}],n&&tm(t.prototype,n),r&&tm(t,r),i}($h);function sm(e,t,n){var r,o,i,a,l,s,u,c;Lf(2,arguments);var d=Qf(),f=Wf(null!==(r=null!==(o=null!==(i=null!==(a=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==a?a:null===n||void 0===n||null===(l=n.locale)||void 0===l||null===(s=l.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==o?o:null===(u=d.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==r?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=zf(e),h=Wf(t),y=((h%7+7)%7<f?7:0)+h-p.getUTCDay();return p.setUTCDate(p.getUTCDate()+y),p}function um(e){return um="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(e)}function cm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dm(e,t){return dm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},dm(e,t)}function fm(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=hm(e);if(t){var o=hm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===um(t)||"function"===typeof t))return t;return pm(e)}(this,n)}}function pm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hm(e)}function ym(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gm=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dm(e,t)}(i,e);var t,n,r,o=fm(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ym(pm(e=o.call.apply(o,[this].concat(n))),"priority",90),ym(pm(e),"incompatibleTokens",["D","i","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=sm(e,n,r)).setUTCHours(0,0,0,0),e}}],n&&cm(t.prototype,n),r&&cm(t,r),i}($h);function mm(e){return mm="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mm(e)}function vm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bm(e,t){return bm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},bm(e,t)}function xm(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=jm(e);if(t){var o=jm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===mm(t)||"function"===typeof t))return t;return wm(e)}(this,n)}}function wm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jm(e){return jm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},jm(e)}function Sm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var km=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bm(e,t)}(i,e);var t,n,r,o=xm(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Sm(wm(e=o.call.apply(o,[this].concat(n))),"priority",90),Sm(wm(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return uy(py(t.length,e),o);case"eo":return uy(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=sm(e,n,r)).setUTCHours(0,0,0,0),e}}],n&&vm(t.prototype,n),r&&vm(t,r),i}($h);function Cm(e){return Cm="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cm(e)}function _m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Om(e,t){return Om=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Om(e,t)}function Em(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Pm(e);if(t){var o=Pm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Cm(t)||"function"===typeof t))return t;return Tm(e)}(this,n)}}function Tm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pm(e)}function Am(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mm=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Om(e,t)}(i,e);var t,n,r,o=Em(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Am(Tm(e=o.call.apply(o,[this].concat(n))),"priority",90),Am(Tm(e),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return uy(py(t.length,e),o);case"co":return uy(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=sm(e,n,r)).setUTCHours(0,0,0,0),e}}],n&&_m(t.prototype,n),r&&_m(t,r),i}($h);function Dm(e){return Dm="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dm(e)}function Im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rm(e,t){return Rm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Rm(e,t)}function Nm(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Fm(e);if(t){var o=Fm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Dm(t)||"function"===typeof t))return t;return Lm(e)}(this,n)}}function Lm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Fm(e)}function Bm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zm=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rm(e,t)}(i,e);var t,n,r,o=Nm(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Bm(Lm(e=o.call.apply(o,[this].concat(n))),"priority",90),Bm(Lm(e),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){var r=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return py(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return uy(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return uy(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return uy(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return uy(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}},{key:"validate",value:function(e,t){return t>=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){Lf(2,arguments);var n=Wf(t);n%7===0&&(n-=7);var r=zf(e),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(e,n),e.setUTCHours(0,0,0,0),e}}],n&&Im(t.prototype,n),r&&Im(t,r),i}($h);function Um(e){return Um="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Um(e)}function Wm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hm(e,t){return Hm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Hm(e,t)}function Km(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Vm(e);if(t){var o=Vm(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Um(t)||"function"===typeof t))return t;return $m(e)}(this,n)}}function $m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vm(e){return Vm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Vm(e)}function qm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gm=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Hm(e,t)}(i,e);var t,n,r,o=Km(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qm($m(e=o.call.apply(o,[this].concat(n))),"priority",80),qm($m(e),"incompatibleTokens",["b","B","H","k","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(yy(n),0,0,0),e}}],n&&Wm(t.prototype,n),r&&Wm(t,r),i}($h);function Ym(e){return Ym="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ym(e)}function Qm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xm(e,t){return Xm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Xm(e,t)}function Zm(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=ev(e);if(t){var o=ev(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ym(t)||"function"===typeof t))return t;return Jm(e)}(this,n)}}function Jm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ev(e){return ev=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ev(e)}function tv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nv=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xm(e,t)}(i,e);var t,n,r,o=Zm(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tv(Jm(e=o.call.apply(o,[this].concat(n))),"priority",80),tv(Jm(e),"incompatibleTokens",["a","B","H","k","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(yy(n),0,0,0),e}}],n&&Qm(t.prototype,n),r&&Qm(t,r),i}($h);function rv(e){return rv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rv(e)}function ov(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iv(e,t){return iv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},iv(e,t)}function av(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=sv(e);if(t){var o=sv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===rv(t)||"function"===typeof t))return t;return lv(e)}(this,n)}}function lv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sv(e){return sv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},sv(e)}function uv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cv=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&iv(e,t)}(i,e);var t,n,r,o=av(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return uv(lv(e=o.call.apply(o,[this].concat(n))),"priority",80),uv(lv(e),"incompatibleTokens",["a","b","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(yy(n),0,0,0),e}}],n&&ov(t.prototype,n),r&&ov(t,r),i}($h);function dv(e){return dv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dv(e)}function fv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pv(e,t){return pv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pv(e,t)}function hv(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=gv(e);if(t){var o=gv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===dv(t)||"function"===typeof t))return t;return yv(e)}(this,n)}}function yv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gv(e){return gv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gv(e)}function mv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vv=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pv(e,t)}(i,e);var t,n,r,o=hv(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return mv(yv(e=o.call.apply(o,[this].concat(n))),"priority",70),mv(yv(e),"incompatibleTokens",["H","K","k","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"h":return cy(ry.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}],n&&fv(t.prototype,n),r&&fv(t,r),i}($h);function bv(e){return bv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bv(e)}function xv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wv(e,t){return wv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wv(e,t)}function jv(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=kv(e);if(t){var o=kv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===bv(t)||"function"===typeof t))return t;return Sv(e)}(this,n)}}function Sv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kv(e){return kv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kv(e)}function Cv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _v=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wv(e,t)}(i,e);var t,n,r,o=jv(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Cv(Sv(e=o.call.apply(o,[this].concat(n))),"priority",70),Cv(Sv(e),"incompatibleTokens",["a","b","h","K","k","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"H":return cy(ry.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}],n&&xv(t.prototype,n),r&&xv(t,r),i}($h);function Ov(e){return Ov="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ov(e)}function Ev(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tv(e,t){return Tv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Tv(e,t)}function Pv(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Mv(e);if(t){var o=Mv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Ov(t)||"function"===typeof t))return t;return Av(e)}(this,n)}}function Av(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mv(e){return Mv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Mv(e)}function Dv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Iv=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tv(e,t)}(i,e);var t,n,r,o=Pv(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Dv(Av(e=o.call.apply(o,[this].concat(n))),"priority",70),Dv(Av(e),"incompatibleTokens",["h","H","k","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"K":return cy(ry.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}],n&&Ev(t.prototype,n),r&&Ev(t,r),i}($h);function Rv(e){return Rv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rv(e)}function Nv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lv(e,t){return Lv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Lv(e,t)}function Fv(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=zv(e);if(t){var o=zv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Rv(t)||"function"===typeof t))return t;return Bv(e)}(this,n)}}function Bv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zv(e){return zv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zv(e)}function Uv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wv=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lv(e,t)}(i,e);var t,n,r,o=Fv(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Uv(Bv(e=o.call.apply(o,[this].concat(n))),"priority",70),Uv(Bv(e),"incompatibleTokens",["a","b","h","H","K","t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"k":return cy(ry.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}],n&&Nv(t.prototype,n),r&&Nv(t,r),i}($h);function Hv(e){return Hv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hv(e)}function Kv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $v(e,t){return $v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$v(e,t)}function Vv(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Gv(e);if(t){var o=Gv(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Hv(t)||"function"===typeof t))return t;return qv(e)}(this,n)}}function qv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gv(e){return Gv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Gv(e)}function Yv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qv=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$v(e,t)}(i,e);var t,n,r,o=Vv(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Yv(qv(e=o.call.apply(o,[this].concat(n))),"priority",60),Yv(qv(e),"incompatibleTokens",["t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"m":return cy(ry.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}],n&&Kv(t.prototype,n),r&&Kv(t,r),i}($h);function Xv(e){return Xv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xv(e)}function Zv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jv(e,t){return Jv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Jv(e,t)}function eb(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=nb(e);if(t){var o=nb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Xv(t)||"function"===typeof t))return t;return tb(e)}(this,n)}}function tb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nb(e){return nb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nb(e)}function rb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ob=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jv(e,t)}(i,e);var t,n,r,o=eb(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return rb(tb(e=o.call.apply(o,[this].concat(n))),"priority",50),rb(tb(e),"incompatibleTokens",["t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t,n){switch(t){case"s":return cy(ry.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return py(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}],n&&Zv(t.prototype,n),r&&Zv(t,r),i}($h);function ib(e){return ib="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ib(e)}function ab(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lb(e,t){return lb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},lb(e,t)}function sb(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=cb(e);if(t){var o=cb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ib(t)||"function"===typeof t))return t;return ub(e)}(this,n)}}function ub(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cb(e){return cb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cb(e)}function db(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fb=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lb(e,t)}(i,e);var t,n,r,o=sb(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return db(ub(e=o.call.apply(o,[this].concat(n))),"priority",30),db(ub(e),"incompatibleTokens",["t","T"]),e}return t=i,n=[{key:"parse",value:function(e,t){return uy(py(t.length,e),(function(e){return Math.floor(e*Math.pow(10,3-t.length))}))}},{key:"set",value:function(e,t,n){return e.setUTCMilliseconds(n),e}}],n&&ab(t.prototype,n),r&&ab(t,r),i}($h);function pb(e){return pb="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pb(e)}function hb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yb(e,t){return yb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yb(e,t)}function gb(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=vb(e);if(t){var o=vb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===pb(t)||"function"===typeof t))return t;return mb(e)}(this,n)}}function mb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vb(e){return vb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vb(e)}function bb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xb=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yb(e,t)}(i,e);var t,n,r,o=gb(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return bb(mb(e=o.call.apply(o,[this].concat(n))),"priority",10),bb(mb(e),"incompatibleTokens",["t","T","x"]),e}return t=i,n=[{key:"parse",value:function(e,t){switch(t){case"X":return dy(oy,e);case"XX":return dy(iy,e);case"XXXX":return dy(ay,e);case"XXXXX":return dy(sy,e);default:return dy(ly,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}],n&&hb(t.prototype,n),r&&hb(t,r),i}($h);function wb(e){return wb="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wb(e)}function jb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sb(e,t){return Sb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Sb(e,t)}function kb(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=_b(e);if(t){var o=_b(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===wb(t)||"function"===typeof t))return t;return Cb(e)}(this,n)}}function Cb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _b(e){return _b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_b(e)}function Ob(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Eb=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sb(e,t)}(i,e);var t,n,r,o=kb(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ob(Cb(e=o.call.apply(o,[this].concat(n))),"priority",10),Ob(Cb(e),"incompatibleTokens",["t","T","X"]),e}return t=i,n=[{key:"parse",value:function(e,t){switch(t){case"x":return dy(oy,e);case"xx":return dy(iy,e);case"xxxx":return dy(ay,e);case"xxxxx":return dy(sy,e);default:return dy(ly,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}],n&&jb(t.prototype,n),r&&jb(t,r),i}($h);function Tb(e){return Tb="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tb(e)}function Pb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ab(e,t){return Ab=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ab(e,t)}function Mb(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Ib(e);if(t){var o=Ib(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Tb(t)||"function"===typeof t))return t;return Db(e)}(this,n)}}function Db(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ib(e){return Ib=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ib(e)}function Rb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nb=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ab(e,t)}(i,e);var t,n,r,o=Mb(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Rb(Db(e=o.call.apply(o,[this].concat(n))),"priority",40),Rb(Db(e),"incompatibleTokens","*"),e}return t=i,n=[{key:"parse",value:function(e){return fy(e)}},{key:"set",value:function(e,t,n){return[new Date(1e3*n),{timestampIsSet:!0}]}}],n&&Pb(t.prototype,n),r&&Pb(t,r),i}($h);function Lb(e){return Lb="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lb(e)}function Fb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bb(e,t){return Bb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bb(e,t)}function zb(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Wb(e);if(t){var o=Wb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===Lb(t)||"function"===typeof t))return t;return Ub(e)}(this,n)}}function Ub(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wb(e){return Wb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Wb(e)}function Hb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kb=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bb(e,t)}(i,e);var t,n,r,o=zb(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Hb(Ub(e=o.call.apply(o,[this].concat(n))),"priority",20),Hb(Ub(e),"incompatibleTokens","*"),e}return t=i,n=[{key:"parse",value:function(e){return fy(e)}},{key:"set",value:function(e,t,n){return[new Date(n),{timestampIsSet:!0}]}}],n&&Fb(t.prototype,n),r&&Fb(t,r),i}($h),$b={G:new Jh,y:new Cy,Y:new Dy,R:new Uy,u:new Yy,Q:new rg,q:new dg,M:new bg,L:new Og,w:new Rg,I:new Hg,d:new Jg,D:new lm,E:new gm,e:new km,c:new Mm,i:new zm,a:new Gm,b:new nv,B:new cv,h:new vv,H:new _v,K:new Iv,k:new Wv,m:new Qv,s:new ob,S:new fb,X:new xb,x:new Eb,t:new Nb,T:new Kb};function Vb(e){return Vb="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vb(e)}function qb(e,t){var n;if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return Gb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gb(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Gb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xb=/^'([^]*?)'?$/,Zb=/''/g,Jb=/\S/,ex=/[a-zA-Z]/;function tx(e,t,n,r){var o,i,a,l,s,u,c,d,f,p,h,y,g,m,v,b,x,w;Lf(3,arguments);var j=String(e),S=String(t),k=Qf(),C=null!==(o=null!==(i=null===r||void 0===r?void 0:r.locale)&&void 0!==i?i:k.locale)&&void 0!==o?o:Lp;if(!C.match)throw new RangeError("locale must contain match property");var _=Wf(null!==(a=null!==(l=null!==(s=null!==(u=null===r||void 0===r?void 0:r.firstWeekContainsDate)&&void 0!==u?u:null===r||void 0===r||null===(c=r.locale)||void 0===c||null===(d=c.options)||void 0===d?void 0:d.firstWeekContainsDate)&&void 0!==s?s:k.firstWeekContainsDate)&&void 0!==l?l:null===(f=k.locale)||void 0===f||null===(p=f.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==a?a:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var O=Wf(null!==(h=null!==(y=null!==(g=null!==(m=null===r||void 0===r?void 0:r.weekStartsOn)&&void 0!==m?m:null===r||void 0===r||null===(v=r.locale)||void 0===v||null===(b=v.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==g?g:k.weekStartsOn)&&void 0!==y?y:null===(x=k.locale)||void 0===x||null===(w=x.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==h?h:0);if(!(O>=0&&O<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===S)return""===j?zf(n):new Date(NaN);var E,T={firstWeekContainsDate:_,weekStartsOn:O,locale:C},P=[new Hh],A=S.match(Qb).map((function(e){var t=e[0];return t in vp?(0,vp[t])(e,C.formatLong):e})).join("").match(Yb),M=[],D=qb(A);try{var I=function(){var t=E.value;null!==r&&void 0!==r&&r.useAdditionalWeekYearTokens||!Sp(t)||kp(t,S,e),null!==r&&void 0!==r&&r.useAdditionalDayOfYearTokens||!jp(t)||kp(t,S,e);var n=t[0],o=$b[n];if(o){var i=o.incompatibleTokens;if(Array.isArray(i)){var a=M.find((function(e){return i.includes(e.token)||e.token===n}));if(a)throw new RangeError("The format string mustn't contain `".concat(a.fullToken,"` and `").concat(t,"` at the same time"))}else if("*"===o.incompatibleTokens&&M.length>0)throw new RangeError("The format string mustn't contain `".concat(t,"` and any other token at the same time"));M.push({token:n,fullToken:t});var l=o.run(j,t,C.match,T);if(!l)return{v:new Date(NaN)};P.push(l.setter),j=l.rest}else{if(n.match(ex))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===t?t="'":"'"===n&&(t=t.match(Xb)[1].replace(Zb,"'")),0!==j.indexOf(t))return{v:new Date(NaN)};j=j.slice(t.length)}};for(D.s();!(E=D.n()).done;){var R=I();if("object"===Vb(R))return R.v}}catch(K){D.e(K)}finally{D.f()}if(j.length>0&&Jb.test(j))return new Date(NaN);var N=P.map((function(e){return e.priority})).sort((function(e,t){return t-e})).filter((function(e,t,n){return n.indexOf(e)===t})).map((function(e){return P.filter((function(t){return t.priority===e})).sort((function(e,t){return t.subPriority-e.subPriority}))})).map((function(e){return e[0]})),L=zf(n);if(isNaN(L.getTime()))return new Date(NaN);var F,B=Hf(L,bp(L)),z={},U=qb(N);try{for(U.s();!(F=U.n()).done;){var W=F.value;if(!W.validate(B,T))return new Date(NaN);var H=W.set(B,z,T);Array.isArray(H)?(B=H[0],Th(z,H[1])):B=H}}catch(K){U.e(K)}finally{U.f()}return B}function nx(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"account";return e?"budgeted"===e?{[`${t}.offbudget`]:!1,[`${t}.closed`]:!1}:"offbudget"===e?{[`${t}.offbudget`]:!0,[`${t}.closed`]:!1}:"uncategorized"===e?{[`${t}.offbudget`]:!1,category:null,is_parent:!1,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]}:{[t]:e}:null}function rx(e){let t=dr("transactions").options({splits:"grouped"}),n=nx(e);return n&&(t=t.filter(n)),t}function ox(e,t,n){let r,o=Wr(t);return r=hh(n).test(t)?tx(t,ph(n),new Date):mh(n).test(t)?tx(t,gh(n),new Date):tx(t,n,new Date),e.filter({$or:{"payee.name":{$like:`%${t}%`},notes:{$like:`%${t}%`},"category.name":{$like:`%${t}%`},"account.name":{$like:`%${t}%`},$or:[Uf(r)&&{date:Xp(r)},null!=o&&{amount:{$transform:"$abs",$eq:$r(o)}},null!=o&&Number.isInteger(o)&&{amount:{$transform:{$abs:{$idiv:["$",100]}},$eq:o}}].filter(Boolean)}})}function ix(e){return{name:`balance-${e.id}`,query:dr("transactions").filter({account:e.id}).options({splits:"none"}).calculate({$sum:"$amount"})}}function ax(){return{query:dr("transactions").filter({"account.closed":!1}).calculate({$sum:"$amount"}),name:"accounts-balance"}}function lx(){return{name:"budgeted-accounts-balance",query:dr("transactions").filter({"account.offbudget":!1,"account.closed":!1}).calculate({$sum:"$amount"})}}function sx(){return{name:"offbudget-accounts-balance",query:dr("transactions").filter({"account.offbudget":!0,"account.closed":!1}).calculate({$sum:"$amount"})}}let ux=dr("transactions").filter({"account.offbudget":!1,category:null,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]});const cx={incomeAvailable:"available-funds",lastMonthOverspent:"last-month-overspent",forNextMonth:"buffered",totalBudgeted:"total-budgeted",toBudget:"to-budget",fromLastMonth:"from-last-month",totalIncome:"total-income",totalSpent:"total-spent",totalBalance:"total-leftover",groupSumAmount:e=>`group-sum-amount-${e}`,groupIncomeReceived:"total-income",groupBudgeted:e=>`group-budget-${e}`,groupBalance:e=>`group-leftover-${e}`,catBudgeted:e=>`budget-${e}`,catSumAmount:e=>`sum-amount-${e}`,catBalance:e=>`leftover-${e}`,catCarryover:e=>`carryover-${e}`},dx={totalBudgetedExpense:"total-budgeted",totalBudgetedIncome:"total-budget-income",totalBudgetedSaved:"total-saved",totalIncome:"total-income",totalSpent:"total-spent",totalSaved:"real-saved",totalLeftover:"total-leftover",groupSumAmount:e=>`group-sum-amount-${e}`,groupIncomeReceived:"total-income",groupBudgeted:e=>`group-budget-${e}`,groupBalance:e=>`group-leftover-${e}`,catBudgeted:e=>`budget-${e}`,catSumAmount:e=>`sum-amount-${e}`,catBalance:e=>`leftover-${e}`,catCarryover:e=>`carryover-${e}`};function fx(e){return"number"===typeof e?e:0}function px(e,t){return{type:"SplitTransactionError",version:1,difference:fx(t.amount)-e}}function hx(e,t){let n="temp"===e.id?"temp":"";return{amount:0,...t,payee:t.payee||e.payee,id:t.id?t.id:n+De(),account:e.account,date:e.date,cleared:null!=e.cleared?e.cleared:null,starting_balance_flag:null!=e.starting_balance_flag?e.starting_balance_flag:null,is_child:!0,parent_id:e.id,error:null}}function yx(e){const t=e.subtransactions.reduce(((e,t)=>e+fx(t.amount)),0);return{...e,error:t===fx(e.amount)?null:px(t,e)}}function gx(e,t){let n=[e[t]],r=t+1;for(;r<e.length&&e[r].is_child;)n.push(e[r]),r++;return n}function mx(e){let t=e.reduce(((e,t)=>{let{subtransactions:n,...r}=t;n=n||[],e.push(r);for(let o=0;o<n.length;o++)e.push(n[o]);return e}),[]);return t}function vx(e){return{...e[0],subtransactions:e.slice(1)}}function bx(e){return null==e?null:mx([e])}function xx(e,t,n){let r=e.findIndex((e=>e.id===t)),o=e[r],i=[...e];if(-1===r)throw new Error("Tried to edit unknown transaction id: "+t);if(o.is_parent||o.is_child){let t=function(e,t){for(;t>=0;){if(e[t].is_parent)return t;t--}return null}(e,r);if(null==t)return console.log("Cannot find parent index"),{diff:{deleted:[],updated:[]}};let o,a=gx(e,t),l=n(vx(a)),s=bx(l);return null==s?(o={deleted:[{id:a[0].id}],updated:[]},l={id:a[0].id,_deleted:!0},i.splice(t,a.length)):(o=Pr(a,s),i.splice(t,a.length,...s)),{data:i,newTransaction:l,diff:o}}{let e=n(o),t=bx(e)||[];return e&&(e.subtransactions=e.subtransactions||[]),i.splice(r,1,...t),{data:i,newTransaction:e||{id:o.id,_deleted:!0},diff:Pr([o],t)}}}function wx(e,t){return xx(e,t,(e=>{if(!e.is_parent)return e;let t=(n=e.subtransactions)[n.length-1];var n;return e.subtransactions.push(hx(e,{amount:0,sort_order:fx(t&&t.sort_order)-1})),e}))}function jx(e,t){return xx(e,t.id,(e=>{if(e.is_parent){let n=e.id===t.id?t:e,r=e.subtransactions.map((r=>{let o=r;return e.id===t.id?o={...r,payee:r.payee===e.payee?t.payee:r.payee}:r.id===t.id&&(o=t),hx(n,o)}));return yx({...n,subtransactions:r})}return t}))}function Sx(e,t){return xx(e,t,(e=>{if(e.is_parent){if(e.id===t)return null;if(1===e.subtransactions.length)return{...e,subtransactions:null,is_parent:!1,error:null};{let n=e.subtransactions.filter((e=>e.id!==t));return yx({...e,subtransactions:n})}}return null}))}function kx(e,t){return xx(e,t,(e=>e.is_parent||e.is_child?e:{...e,is_parent:!0,error:0===fx(e.amount)?null:px(0,e),subtransactions:[hx(e,{amount:0,sort_order:-1})]}))}function Cx(e){let t=e.find((e=>!e.is_child));t={...t,id:De()};let n=e.filter((e=>e.is_child));return[t,...n.map((e=>({...e,id:De(),parent_id:t.id})))]}const _x={syncAccount:!1,goalTemplatesEnabled:!1};function Ox(e){return xe((t=>{const n=t.prefs.local[`flags.${e}`];return void 0===n?_x[e]||!1:n}))}let Ex={},Tx={shift:!1,ctrl:!1,alt:!1,meta:!1};function Px(e,t){let n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);for(let o=n;o<=r;o++)t(o)}function Ax(e,t,n){let[r,o]=(0,h.useReducer)(((e,n)=>{switch(n.type){case"select":{let{selectedRange:r}=e,o=new Set(e.selectedItems),{id:i}=n;if(Tx["shift"]&&r){let n,a,l=t.findIndex((e=>e.id===i)),s=t.findIndex((e=>e.id===r.start)),u=t.findIndex((e=>e.id===r.end));return-1===u?n={start:s,end:l}:u<s?l<=s?(n={start:s,end:l},l>u&&(a={start:l-1,end:u})):n={start:u,end:l}:l>=s?(n={start:s,end:l},l<u&&(a={start:l+1,end:u})):n={start:u,end:l},Px(n,(e=>o.add(t[e].id))),a&&Px(a,(e=>o.delete(t[e].id))),{...e,selectedItems:o,selectedRange:{start:t[n.start].id,end:t[n.end].id}}}{let t=null;return o.delete(i)||(o.add(i),t={start:i,end:null}),{...e,selectedItems:o,selectedRange:t}}}case"select-none":return{...e,selectedItems:new Set};case"select-all":return{...e,selectedItems:new Set(n.ids||t.map((e=>e.id))),selectedRange:n.ids&&1===n.ids.length?{start:n.ids[0],end:null}:null};default:throw new Error("Unexpected action: "+n.type)}}),null,(()=>({selectedItems:new Set(n||[]),selectedRange:n&&1===n.length?{start:n[0],end:null}:null}))),i=(0,h.useRef)(t);(0,h.useEffect)((()=>{if(r.selectedItems.size>0){let e=new Set(t.map((e=>e.id)));if(!(i.current.length===t.length&&i.current.every((t=>e.has(t.id))))){let t=[...r.selectedItems],n=t.filter((t=>e.has(t)));t.length!==n.length&&o({type:"select-all",ids:n})}}i.current=t}),[t,r.selectedItems]),(0,h.useEffect)((()=>{let t=Le("selectedItems");return Ne("selectedItems",{name:e,items:r.selectedItems}),()=>Ne("selectedItems",t)}),[r.selectedItems]);let a=xe((e=>e.app.lastUndoState));return(0,h.useEffect)((()=>{function t(t){let{messages:n,undoTag:r}=t,i=Fe(r),a=new Set(n.filter((e=>"tombstone"===e.column&&1===e.value)).map((e=>e.row)));i&&i.selectedItems&&i.selectedItems.name===e&&o({type:"select-all",ids:[...i.selectedItems.items].filter((e=>!a.has(e)))})}return a&&a.current&&t(a.current),Ye("undo-event",t)}),[]),{items:r.selectedItems,setItems:r.setSelectedItems,dispatch:o}}document.addEventListener("keydown",(e=>{if("Shift"===e.key&&(Tx.shift=!0),"Control"===e.key&&(Tx.ctrl=!0),"Alt"===e.key&&(Tx.alt=!0),"Meta"===e.key&&(Tx.meta=!0),!e.target||!e.target.matches("input")){let t=Ex[e.key.toUpperCase()];t&&t.length>0&&(t[t.length-1](Tx),e.preventDefault(),e.stopPropagation())}})),document.addEventListener("keyup",(e=>{"Shift"===e.key&&(Tx.shift=!1),"Control"===e.key&&(Tx.ctrl=!1),"Alt"===e.key&&(Tx.alt=!1),"Meta"===e.key&&(Tx.meta=!1)}));let Mx=h.createContext(null),Dx=h.createContext(null);function Ix(){return(0,h.useContext)(Mx)}function Rx(){return(0,h.useContext)(Dx)}function Nx(e){let{instance:t,fetchAllIds:n,children:r}=e,o=(0,h.useRef)(null);(0,h.useEffect)((()=>{o.current=t.items}),[t.items]);let i=(0,h.useCallback)((async e=>"select-all"===e.type?o.current&&o.current.size>0?t.dispatch({type:"select-none"}):n?t.dispatch({type:"select-all",ids:await n()}):t.dispatch({type:"select-all"}):t.dispatch(e)),[t.dispatch,n]);return(0,wo.jsx)(Dx.Provider,{value:t.items,children:(0,wo.jsx)(Mx.Provider,{value:i,children:r})})}function Lx(e){let{name:t,items:n,initialSelectedIds:r,fetchAllIds:o,registerDispatch:i,children:a}=e,l=Ax(t,n,r);return(0,h.useEffect)((()=>{i&&i(l.dispatch)}),[i]),(0,wo.jsx)(Nx,{instance:l,fetchAllIds:o,children:a})}const Fx=(0,h.createContext)({}),Bx=()=>(0,h.useContext)(Fx).url,zx=()=>(0,h.useContext)(Fx).version,Ux=()=>(0,h.useContext)(Fx).setURL;async function Wx(){let e=await qe("get-server-url")||"";return"https://not-configured/"===e&&(e=""),e}async function Hx(){let{error:e,version:t}=await qe("get-server-version");return e?"":t}function Kx(e){let{children:t}=e,[n,r]=(0,h.useState)(""),[o,i]=(0,h.useState)("");(0,h.useEffect)((()=>{!async function(){r(await Wx()),i(await Hx())}()}),[]);let a=(0,h.useCallback)((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{error:n}=await qe("set-server-url",{...t,url:e});return n||(r(await Wx()),i(await Hx())),{error:n}}),[r]);return(0,wo.jsx)(Fx.Provider,{value:{url:n,setURL:a,version:o?`v${o}`:"N/A"},children:t})}function $x(){const e=Bx(),t=xe((e=>e.user.data));return e?!t||t.offline?"offline":"online":"no-server"}var Vx=e=>(0,wo.jsxs)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{fill:"currentColor",className:"path",d:"M23 11.5a1.5 1.5 0 0 1-1.5 1.5h-20a1.5 1.5 0 0 1 0-3h20a1.5 1.5 0 0 1 1.5 1.5Z"}),(0,wo.jsx)("path",{fill:"currentColor",className:"path",d:"M11.5 23a1.5 1.5 0 0 1-1.5-1.5v-20a1.5 1.5 0 0 1 3 0v20a1.5 1.5 0 0 1-1.5 1.5Z"})]});var qx=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M10 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0-6a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4z",fill:"currentColor"})});var Gx=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M13.584 12a2.643 2.643 0 0 1-.775 1.875l-9.541 9.541a1.768 1.768 0 0 1-2.5-2.5l8.739-8.739a.25.25 0 0 0 0-.354L.768 3.084a1.768 1.768 0 0 1 2.5-2.5l9.541 9.541A2.643 2.643 0 0 1 13.584 12Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M23.75 12a2.643 2.643 0 0 1-.775 1.875l-9.541 9.541a1.768 1.768 0 0 1-2.5-2.5l8.739-8.739a.25.25 0 0 0 0-.354l-8.739-8.739a1.768 1.768 0 0 1 2.5-2.5l9.541 9.541A2.643 2.643 0 0 1 23.75 12Z",fill:"currentColor"})]});var Yx=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M19.611 2.571h-3.754a1.286 1.286 0 1 1 0-2.571h6.857A1.286 1.286 0 0 1 24 1.286v6.857a1.286 1.286 0 0 1-2.571 0V4.39L15.48 10.34a1.286 1.286 0 0 1-1.817-1.817l5.948-5.95ZM1.286 14.571a1.286 1.286 0 0 1 1.285 1.286v3.754l5.949-5.946a1.286 1.286 0 0 1 1.817 1.817L4.39 21.429h3.753a1.285 1.285 0 1 1 0 2.571H1.286A1.286 1.286 0 0 1 0 22.714v-6.857a1.286 1.286 0 0 1 1.286-1.286Z",fill:"currentColor"})});var Qx=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M14.143 1.714A1.286 1.286 0 0 1 15.429 3v3.753L21.806.377a1.286 1.286 0 0 1 1.817 1.817l-6.376 6.377H21a1.286 1.286 0 1 1 0 2.572h-6.857a1.286 1.286 0 0 1-1.286-1.286V3a1.286 1.286 0 0 1 1.286-1.286ZM9.857 22.286A1.285 1.285 0 0 1 8.571 21v-3.753l-6.377 6.376a1.286 1.286 0 0 1-1.817-1.817l6.376-6.377H3a1.286 1.286 0 0 1 0-2.572h6.857a1.286 1.286 0 0 1 1.286 1.286V21a1.286 1.286 0 0 1-1.286 1.286Z",fill:"currentColor"})});var Xx=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M12 0a12 12 0 1 0 12 12A12.014 12.014 0 0 0 12 0Zm6.927 8.2-6.845 9.289a1.011 1.011 0 0 1-1.43.188l-4.888-3.908a1 1 0 1 1 1.25-1.562l4.076 3.261 6.227-8.451a1 1 0 1 1 1.61 1.183Z",fill:"currentColor"})});var Zx=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M8.616 1.741A1.455 1.455 0 0 1 10.07.287h3.392a1.455 1.455 0 0 1 1.453 1.454v8.228a.25.25 0 0 0 .25.25h2.9a1.138 1.138 0 0 1 .827 2l-6.1 6.1a1.489 1.489 0 0 1-2.056 0l-6.1-6.1a1.137 1.137 0 0 1 .827-2h2.9a.249.249 0 0 0 .25-.25Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M0 19.677a4.039 4.039 0 0 0 4.035 4.035h15.93A4.039 4.039 0 0 0 24 19.677V17.8a1.225 1.225 0 0 0-2.449 0v1.874a1.588 1.588 0 0 1-1.586 1.586H4.035a1.588 1.588 0 0 1-1.586-1.586V17.8A1.225 1.225 0 0 0 0 17.8Z",fill:"currentColor"})]});var Jx=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M15.067 3.986a.5.5 0 0 0-.354-.148.5.5 0 0 0-.354.147L3.437 14.91a.5.5 0 0 0 0 .707l4.948 4.948a.5.5 0 0 0 .707 0L20.009 9.648a.5.5 0 0 0 0-.706ZM2.43 16.8a.5.5 0 0 0-.489-.127.5.5 0 0 0-.351.364L.084 23.314a.5.5 0 0 0 .133.47.507.507 0 0 0 .47.132l6.272-1.5a.5.5 0 0 0 .237-.84ZM23.2 2.924 21.077.8a2.5 2.5 0 0 0-3.532 0l-1.418 1.417a.5.5 0 0 0 0 .707l4.95 4.949a.5.5 0 0 0 .707 0L23.2 6.454a2.5 2.5 0 0 0 0-3.53Z",fill:"currentColor"})});var ew=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M.439 21.44a1.5 1.5 0 0 0 2.122 2.121l9.262-9.261a.25.25 0 0 1 .354 0l9.262 9.263a1.5 1.5 0 1 0 2.122-2.121L14.3 12.177a.25.25 0 0 1 0-.354l9.263-9.262A1.5 1.5 0 0 0 21.439.44L12.177 9.7a.25.25 0 0 1-.354 0L2.561.44A1.5 1.5 0 0 0 .439 2.561L9.7 11.823a.25.25 0 0 1 0 .354Z",fill:"currentColor"})});var tw=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m23.384 21.619-6.529-6.529a9.284 9.284 0 1 0-1.768 1.768l6.529 6.529a1.266 1.266 0 0 0 1.768 0 1.251 1.251 0 0 0 0-1.768ZM2.75 9.5a6.75 6.75 0 1 1 6.75 6.75A6.758 6.758 0 0 1 2.75 9.5Z",fill:"currentColor"})});async function nw(e){let{upgradingAccountId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t,n){let{onSuccess:r,onClose:o}=n;e("nordigen-external-msg",{onMoveExternal:async e=>{let{institutionId:n}=e;const r=await qe("nordigen-create-web-token",{upgradingAccountId:t,institutionId:n,accessValidForDays:30});if(r.error)return r;const{link:o,requisitionId:i}=r;window.Actual.openURLInBrowser(o);let{error:a,data:l}=await qe("nordigen-poll-web-token",{upgradingAccountId:t,requisitionId:i});return{error:a,data:l}},onClose:o,onSuccess:r})}(e,t,{onSuccess:async n=>{e("select-linked-accounts",{accounts:n.accounts,requisitionId:n.id,upgradingAccountId:t})}})}let rw=h.createContext(null);function ow(e){let{location:t,children:n}=e;return(0,wo.jsx)(rw.Provider,{value:t,children:n})}var iw=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M10 3v2a5 5 0 0 0-3.54 8.54l-1.41 1.41A7 7 0 0 1 10 3zm4.95 2.05A7 7 0 0 1 10 17v-2a5 5 0 0 0 3.54-8.54l1.41-1.41zM10 20l-4-4 4-4v8zm0-12V0l4 4-4 4z",fill:"currentColor"})});let aw=lo.iv.keyframes({"0%":{transform:"rotateZ(0deg)"},"100%":{transform:"rotateZ(360deg)"}});function lw(e){let{animating:t,iconStyle:n}=e;return(0,wo.jsx)(Ll,{style:[{animation:t?`${aw} 1s infinite linear`:null}],children:(0,wo.jsx)(iw,{width:14,height:14,style:{color:"currentColor",...n}})})}let sw=h.createContext("app");function uw(e){let{keyName:t,eventType:n="keydown",handler:r}=e,o=(0,h.useContext)(sw);if("keyup"!==n&&"keydown"!==n)throw new Error("KeyHandler: unknown event type: "+n);return(0,h.useEffect)((()=>{function e(e,t){if(e.preventDefault(),e.type===n&&r)return r(e,t)}return xs(t,{scope:o,keyup:!0},e),()=>{xs.unbind({key:t,scope:o,method:e})}}),[t,r,o]),null}function cw(e){let{eventType:t,keys:n={}}=e,r=Object.keys(n).map((e=>(0,wo.jsx)(uw,{keyName:e,eventType:t,handler:n[e]},e)));return r}function dw(e,t,n){let r=new n(e,null,t),o=h.createContext(null);return{Provider:function(e){let{children:t}=e,[n,i]=(0,h.useState)(r.getData()),a=(0,h.useMemo)((()=>({data:n,query:r})),[n,r]);return(0,h.useEffect)((()=>{if(0!==r.getNumListeners())throw new Error("Query already has listeners. You cannot use the same query context `Provider` twice");let e=r.addListener((e=>i(e)));return r.isRunning()||r.run(),i(r.getData()),()=>{e(),r.unsubscribe()}}),[]),(0,wo.jsx)(o.Provider,{value:a,children:t})},useQuery:function(){let e=(0,h.useContext)(o);if(null==e)throw new Error("`useQuery` tried to access a query that hasn\u2019t been run. You need to put its `Provider` in a parent component");return e}}}xs.filter=e=>{var t=e.target||e.srcElement,n=t.tagName;return!!(e.metaKey||!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly))};var fw=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M17 24H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h9a1 1 0 0 1 .707.293l7 7A1 1 0 0 1 19 8v14a2 2 0 0 1-2 2ZM2 21.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5h-4a2 2 0 0 1-2-2v-4A.5.5 0 0 0 10 2H2.5a.5.5 0 0 0-.5.5v19Z",fill:"currentColor"})});function pw(e){let{editable:t,defaultNotes:n,position:r="bottom-left",onClose:o}=e,[i,a]=(0,h.useState)(n),l=h.createRef();return(0,h.useEffect)((()=>{t&&l.current.focus()}),[l,t]),(0,wo.jsx)(Ps,{position:r,onClose:()=>o(i),children:t?(0,wo.jsx)("textarea",{ref:l,...(0,lo.iv)({border:"1px solid "+go.border,padding:7,minWidth:300,minHeight:120,outline:"none"}),value:i||"",onChange:e=>a(e.target.value)}):(0,wo.jsx)(ql,{...(0,lo.iv)({display:"block",maxWidth:225,padding:8,whiteSpace:"pre-wrap",overflowWrap:"break-word"}),children:i})})}function hw(e){let{id:t,width:n=12,height:r=12,defaultColor:o=go.n8,tooltipPosition:i,style:a}=e,[l,s]=(0,h.useState)(!1),u=Ts(),{data:c}=function(e,t){let[n,r]=(0,h.useState)(null);return(0,h.useEffect)((()=>{let n=hr(e,(async e=>{n&&r(e)}),t);return()=>{n.unsubscribe(),n=null}}),[e]),{data:n}}((0,h.useMemo)((()=>fr("notes").filter({id:t}).select("*")),[t])),d=c&&c.length>0?c[0].note:null,f=d&&""!==d;const[p,y]=(0,h.useState)(null),g=u.isOpen||f&&l;return(0,wo.jsxs)(Ll,{style:[{flexShrink:0}],onMouseEnter:()=>{y(setTimeout((()=>{s(!0)}),300))},onMouseLeave:()=>{clearTimeout(p),s(!1)},children:[(0,wo.jsx)(zl,{bare:!0,className:f||g?"":"hover-visible",style:[{color:o},a,f&&{display:"flex !important"},g&&{color:go.n1}],...u.getOpenEvents(),children:(0,wo.jsx)(fw,{style:{width:n,height:r,color:"currentColor"}})}),g&&(0,wo.jsx)(pw,{editable:u.isOpen,defaultNotes:d,position:i,onClose:function(e){qe("notes-save",{id:t,note:e}),u.close()}})]})}function yw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"string";switch(t){case"string":const n=JSON.stringify(e);return'"'===n.charAt(0)&&'"'===n.charAt(n.length-1)?n.slice(1,-1):n;case"number":return""+e;case"financial-with-sign":let r=yw(e,"financial");return e>=0?"+"+r:r;case"financial":if(null==e||""===e)return zr(0);if("string"===typeof e){const t=parseFloat(e);e=isNaN(t)?0:t}if("number"!==typeof e)throw new Error("Value is not a number ("+typeof e+"): "+e);return zr(e);default:throw new Error("Unknown format type: "+t)}}var gw=h.createContext(void 0);function mw(e){let{binding:t,initialValue:r,children:o,onChange:i}=e;if(!t)throw new Error("SheetValue binding is required");if(n.g.IS_TESTING&&"string"!==typeof t&&!t.name&&(t={...t,name:t.value.toString()}),t="string"===typeof t?{name:t,value:null}:t,null==t.name)throw new Error("Binding name is now required");let a=Sf(),l=(0,h.useContext)(gw)||"__global",[s,u]=(0,h.useState)({name:l+"!"+t.name,value:null!=r?r:t.value,query:t.query}),c=(0,h.useRef)(i),d=(0,h.useRef)(s.value);return(0,h.useLayoutEffect)((()=>{c.current=i,d.current=s.value})),(0,h.useLayoutEffect)((()=>(t.query&&a.createQuery(l,t.name,t.query),a.bind(l,t,null,(e=>{c.current&&c.current(e),e.value!==d.current&&u(e)})))),[l,t.name]),null!=s.value?o(s,(function(){throw new Error("setCell is not implemented anymore")})):null}var vw=function(e){let{binding:t,type:n,formatter:r,style:o,getStyle:i,debug:a}=e;return(0,wo.jsx)(mw,{binding:t,debug:a,children:e=>{let{name:t,value:a}=e;return(0,wo.jsx)(ql,{style:["financial"===n&&mo.tnum,o,i&&i(a)],"data-testid":t,"data-cellname":t,children:r?r(a):yw(a,n)})}})};function bw(e,t){if(!e)throw new Error("SheetValue binding is required");if(n.g.IS_TESTING&&"string"!==typeof e&&!e.name&&(e={...e,name:e.value.toString()}),null==(e="string"===typeof e?{name:e,value:null}:e).name)throw new Error("Binding name is now required");let r=(0,h.useContext)(gw)||"__global",o=function(e){let t=e.indexOf("!");return-1!==t?{sheet:e.slice(0,t),name:e.slice(t+1)}:{sheet:null,name:e}}(e.name);o.sheet&&(r=o.sheet,e={...e,name:o.name});let i=Sf(),[a,l]=(0,h.useState)({name:r+"!"+e.name,value:void 0===e.value?null:e.value,query:e.query}),s=(0,h.useRef)(t),u=(0,h.useRef)(a.value);return(0,h.useLayoutEffect)((()=>{s.current=t,u.current=a.value})),(0,h.useLayoutEffect)((()=>(e.query&&i.createQuery(r,e.name,e.query),i.bind(r,e,null,(e=>{s.current&&s.current(e),e.value!==u.current&&l(e)})))),[r,e.name]),a.value}var xw=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ww=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),jw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sw=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t},kw=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Cw=void 0;Cw="undefined"!==typeof window?window:"undefined"!==typeof self?self:n.g;var _w=null,Ow=null,Ew=Cw.clearTimeout,Tw=Cw.setTimeout,Pw=Cw.cancelAnimationFrame||Cw.mozCancelAnimationFrame||Cw.webkitCancelAnimationFrame,Aw=Cw.requestAnimationFrame||Cw.mozRequestAnimationFrame||Cw.webkitRequestAnimationFrame;function Mw(e){var t=void 0,n=void 0,r=void 0,o=void 0,i=void 0,a=void 0,l=void 0,s="undefined"!==typeof document&&document.attachEvent;if(!s){a=function(e){var t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,o=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,o.style.width=n.offsetWidth+1+"px",o.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},i=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},l=function(e){if(!(e.target.className&&"function"===typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)){var t=this;a(this),this.__resizeRAF__&&_w(this.__resizeRAF__),this.__resizeRAF__=Ow((function(){i(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(n){n.call(t,e)})))}))}};var u=!1,c="";r="animationstart";var d="Webkit Moz O ms".split(" "),f="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=document.createElement("fakeelement");if(void 0!==p.style.animationName&&(u=!0),!1===u)for(var h=0;h<d.length;h++)if(void 0!==p.style[d[h]+"AnimationName"]){c="-"+d[h].toLowerCase()+"-",r=f[h],u=!0;break}t="@"+c+"keyframes "+(n="resizeanim")+" { from { opacity: 0; } to { opacity: 0; } } ",o=c+"animation: 1ms "+n+"; "}return{addResizeListener:function(i,u){if(s)i.attachEvent("onresize",u);else{if(!i.__resizeTriggers__){var c=i.ownerDocument,d=Cw.getComputedStyle(i);d&&"static"===d.position&&(i.style.position="relative"),function(n){if(!n.getElementById("detectElementResize")){var r=(t||"")+".resize-triggers { "+(o||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=n.head||n.getElementsByTagName("head")[0],a=n.createElement("style");a.id="detectElementResize",a.type="text/css",null!=e&&a.setAttribute("nonce",e),a.styleSheet?a.styleSheet.cssText=r:a.appendChild(n.createTextNode(r)),i.appendChild(a)}}(c),i.__resizeLast__={},i.__resizeListeners__=[],(i.__resizeTriggers__=c.createElement("div")).className="resize-triggers";var f=c.createElement("div");f.className="expand-trigger",f.appendChild(c.createElement("div"));var p=c.createElement("div");p.className="contract-trigger",i.__resizeTriggers__.appendChild(f),i.__resizeTriggers__.appendChild(p),i.appendChild(i.__resizeTriggers__),a(i),i.addEventListener("scroll",l,!0),r&&(i.__resizeTriggers__.__animationListener__=function(e){e.animationName===n&&a(i)},i.__resizeTriggers__.addEventListener(r,i.__resizeTriggers__.__animationListener__))}i.__resizeListeners__.push(u)}},removeResizeListener:function(e,t){if(s)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",l,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(r,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(Fa){}}}}}null==Pw||null==Aw?(_w=Ew,Ow=function(e){return Tw(e,20)}):(_w=function(e){var t=kw(e,2),n=t[0],r=t[1];Pw(n),Ew(r)},Ow=function(e){var t=Aw((function(){Ew(n),e()})),n=Tw((function(){Pw(t),e()}),20);return[t,n]});var Dw=function(e){function t(){var e,n,r;xw(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=Sw(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.state={height:r.props.defaultHeight||0,width:r.props.defaultWidth||0},r._onResize=function(){var e=r.props,t=e.disableHeight,n=e.disableWidth,o=e.onResize;if(r._parentNode){var i=r._parentNode.offsetHeight||0,a=r._parentNode.offsetWidth||0,l=window.getComputedStyle(r._parentNode)||{},s=parseInt(l.paddingLeft,10)||0,u=parseInt(l.paddingRight,10)||0,c=parseInt(l.paddingTop,10)||0,d=parseInt(l.paddingBottom,10)||0,f=i-c-d,p=a-s-u;(!t&&r.state.height!==f||!n&&r.state.width!==p)&&(r.setState({height:i-c-d,width:a-s-u}),o({height:i,width:a}))}},r._setRef=function(e){r._autoSizer=e},Sw(r,n)}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),ww(t,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=Mw(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.disableHeight,o=e.disableWidth,i=e.style,a=this.state,l=a.height,s=a.width,u={overflow:"visible"},c={},d=!1;return r||(0===l&&(d=!0),u.height=0,c.height=l),o||(0===s&&(d=!0),u.width=0,c.width=s),(0,h.createElement)("div",{className:n,ref:this._setRef,style:jw({},u,i)},!d&&t(c))}}]),t}(h.PureComponent);Dw.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}};var Iw=Dw;var Rw=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m0 11 2-2 5 5L18 3l2 2L7 18z",fill:"currentColor"})});function Nw(e){let t=(0,h.useRef)(null);return t.current||(t.current=new ResizeObserver((t=>{e(t[0].contentRect)}))),(0,h.useCallback)((e=>{t.current.disconnect(),e&&t.current.observe(e,{box:"border-box"})}),[])}const Lw=(e,t)=>e;function Fw(e){let{onResize:t,children:n}=e;return n(Nw(t))}class Bw extends h.PureComponent{constructor(e){super(e),this._resetIsScrollingTimeoutId=null,this.setRowAnimation=e=>{this.animationEnabled=e;let t=this._outerRef;t&&(this.animationEnabled?t.classList.add("animated"):t.classList.remove("animated"))},this.onHeaderResize=e=>{},this.getItemOffset=e=>e*this.props.itemSize,this.getItemSize=e=>this.props.itemSize,this.getEstimatedTotalSize=()=>this.props.itemSize*this.props.itemCount,this.getOffsetForIndexAndAlignment=(e,t,n)=>{const r=this.props.height,o=Math.max(0,this.props.itemCount*this.props.itemSize-r),i=Math.min(o,e*this.props.itemSize),a=Math.max(0,e*this.props.itemSize-r+this.props.itemSize);switch("smart"===t&&(t=n>=a-r&&n<=i+r?"auto":"center"),t){case"start":return i;case"end":return a;case"center":{const e=Math.round(a+(i-a)/2);return e<Math.ceil(r/2)?0:e>o+Math.floor(r/2)?o:e}default:return n>=a&&n<=i?n:n<a?a:i}},this.getStartIndexForOffset=e=>Math.max(0,Math.min(this.props.itemCount-1,Math.floor(e/this.props.itemSize))),this.getStopIndexForStartIndex=(e,t)=>{const n=e*this.props.itemSize,r=this.props.width,o=Math.ceil((r+t-n)/this.props.itemSize);return Math.max(0,Math.min(this.props.itemCount-1,e+o-1))},this._callOnItemsRendered=Qr(((e,t,n,r)=>this.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:r}))),this._callOnScroll=Qr(((e,t,n)=>this.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n}))),this._getItemStyle=e=>{const{direction:t,itemSize:n,layout:r}=this.props,o=this._getItemStyleCache(n,r,t);let i;if(o.hasOwnProperty(e))i=o[e];else{const t=this.getItemOffset(e),n=this.getItemSize(e);o[e]=i={position:"absolute",left:0,top:t,height:n,width:"100%"}}return i},this._getItemStyleCache=Qr(((e,t,n)=>({}))),this._onScrollVertical=e=>{let{scrollTop:t}=e.currentTarget;this.setState((e=>{if(e.scrollOffset===t)return null;let n=t;return{isScrolling:!0,scrollDirection:e.scrollOffset<n?"forward":"backward",scrollOffset:n,scrollUpdateWasRequested:!1}}),this._resetIsScrollingDebounced)},this._outerRefSetter=e=>{const{outerRef:t}=this.props;this._outerRef=e,"function"===typeof t?t(e):null!=t&&"object"===typeof t&&t.hasOwnProperty("current")&&(t.current=e)},this._resetIsScrollingDebounced=()=>{null!==this._resetIsScrollingTimeoutId&&clearTimeout(this._resetIsScrollingTimeoutId),this._resetIsScrollingTimeoutId=setTimeout(this._resetIsScrolling,150)},this._resetIsScrolling=()=>{this._resetIsScrollingTimeoutId=null,this.setState({isScrolling:!1},(()=>{this._getItemStyleCache(-1,null)}))},this.lastPositions=h.createRef(),this.lastPositions.current=new Map,this.needsAnimationRerender=h.createRef(),this.needsAnimationRerender.current=!1,this.animationEnabled=!1,this.state={instance:this,isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"===typeof this.props.initialScrollOffset?this.props.initialScrollOffset:0,scrollUpdateWasRequested:!1}}scrollTo(e){e=Math.max(0,e),this.setState((t=>t.scrollOffset===e?null:(this.requestScrollUpdateHandled=!1,{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0})),this._resetIsScrollingDebounced)}scrollToItem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto";const{itemCount:n}=this.props,{scrollOffset:r}=this.state;e=Math.max(0,Math.min(e,n-1)),this.scrollTo(this.getOffsetForIndexAndAlignment(e,t,r))}componentDidMount(){const{initialScrollOffset:e}=this.props;if("number"===typeof e&&null!=this._outerRef){let t=this._outerRef;t=this._outerRef,t.scrollTop=e}this._callPropsCallbacks()}getAnchoredScrollPos(){if(this.anchored&&this.props.indexForKey&&null!=this._outerRef){let e=this.props.indexForKey(this.anchored.key);return this.getOffsetForIndexAndAlignment(e,"start")+this.anchored.offset}return null}componentDidUpdate(){const{scrollOffset:e,scrollUpdateWasRequested:t}=this.state;let n=this.getAnchoredScrollPos();if(null!=n){this._outerRef.scrollTop=n}else if(t&&!this.requestScrollUpdateHandled&&null!=this._outerRef){this.requestScrollUpdateHandled=!0;this._outerRef.scrollTop=e}this.needsAnimationRerender.current&&(this.needsAnimationRerender.current=!1,this.rerenderTimeout=setTimeout((()=>{this.forceUpdate()}),10)),this._callPropsCallbacks()}componentWillUnmount(){null!==this._resetIsScrollingTimeoutId&&clearTimeout(this._resetIsScrollingTimeoutId)}render(){const{className:e,height:t,header:n,innerRef:r,innerElementType:o,innerTagName:i,itemCount:a,renderRow:l,itemKey:s=Lw,outerElementType:u,outerTagName:c,style:d,useIsScrolling:f,width:p}=this.props,{isScrolling:h}=this.state,[y,g]=this._getRangeToRender(),m=new Map,v=[];if(a>0)for(let j=y;j<=g;j++){let e=s(j),t=this._getItemStyle(j),n=this.lastPositions.current.get(e),r=!1;m.set(e,t.top),this.animationEnabled&&null!=n&&n!==t.top&&(t={...t,top:n},this.needsAnimationRerender.current=!0,r=!0),v.push(l({index:j,key:e,style:t,isScrolling:f?h:void 0,isAnimating:r}))}this.lastPositions.current=m;let b=this.getEstimatedTotalSize(),x=u||c||"div",w=o||i||"div";return(0,wo.jsx)(Fw,{onResize:this.onHeaderResize,children:o=>(0,wo.jsxs)(x,{className:e,onScroll:this._onScrollVertical,ref:this._outerRefSetter,style:{height:t,width:p,overflow:"auto",...d},children:[(0,wo.jsx)(Ll,{innerRef:o,children:n}),(0,wo.jsx)(w,{ref:r,style:{position:"relative",height:b,width:"100%",pointerEvents:h?"none":void 0},children:v})]})})}anchor(){let e=this.props.itemKey||Lw,t=this._outerRef,n=t?t.scrollTop:0,r=this.getStartIndexForOffset(n),o=e(r);this.anchored={key:o,offset:n-this.getItemOffset(r)}}unanchor(){this.anchored=null}isAnchored(){return null!=this.anchored}_callPropsCallbacks(){if("function"===typeof this.props.onItemsRendered){const{itemCount:e}=this.props;if(e>0){const[e,t,n,r]=this._getRangeToRender();this._callOnItemsRendered(e,t,n,r)}}if("function"===typeof this.props.onScroll){const{scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n}=this.state;this._callOnScroll(e,t,n)}}_getRangeToRender(){let{itemCount:e,overscanCount:t}=this.props,{isScrolling:n,scrollDirection:r,scrollOffset:o}=this.state,i=this.getAnchoredScrollPos();if(null!=i&&(o=i),0===e)return[0,0,0,0];const a=this.getStartIndexForOffset(o),l=this.getStopIndexForStartIndex(a,o),s=n&&"backward"!==r?1:Math.max(1,t),u=n&&"forward"!==r?1:Math.max(1,t);return[Math.max(0,a-s),Math.max(0,Math.min(e-1,l+u)),a,l]}}Bw.defaultProps={direction:"ltr",renderRow:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1,headerHeight:0};const zw=32,Uw=go.n11;function Ww(e,t){document.hasFocus()?e&&e(t):t.stopPropagation()}const Hw=h.createContext({backgroundColor:"white",borderColor:go.n9});function Kw(e){let{backgroundColor:t,borderColor:n,children:r}=e,o=(0,h.useMemo)((()=>({backgroundColor:t,borderColor:n})),[t,n]);return(0,wo.jsx)(Hw.Provider,{value:o,children:r})}const $w=h.forwardRef((function(e,t){let{width:n,name:r,borderColor:o,truncate:i=!0,children:a,style:l,contentStyle:s,...u}=e,{backgroundColor:c,borderColor:d}=(0,h.useContext)(Hw);return o&&(d=o),(0,wo.jsx)(Ll,{innerRef:t,...u,style:["flex"===n?{flex:1,flexBasis:0}:{width:n},{position:"relative",borderTopWidth:d?1:0,borderBottomWidth:d?1:0,borderColor:d,backgroundColor:c},mo.smallText,l],"data-testid":r,children:(0,wo.jsx)(Ll,{style:[{flex:1,padding:"0 5px",justifyContent:"center"},s],children:i?(0,wo.jsx)(ql,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}):a})})}));function Vw(e){let{width:t,name:r,exposed:o,focused:i,value:a,formatter:l,textAlign:s,onExpose:u,borderColor:c,children:d,plain:f,style:p,valueStyle:y,...g}=e,m=(0,h.useRef)(null),v=(0,h.useRef)(null),{backgroundColor:b,borderColor:x}=(0,h.useContext)(Hw);Kl(v,void 0!==i?i:o),c&&(x=c);const w="flex"===t?{flex:1,flexBasis:0}:{width:t},j={position:"relative",textAlign:s||"left",justifyContent:"center",borderTopWidth:x?1:0,borderBottomWidth:x?1:0,borderColor:x,backgroundColor:b};return(0,wo.jsx)(Ll,{innerRef:v,style:[w,j,p],className:"animated-cell",...g,"data-testid":r,children:f?d:o?d():(0,wo.jsx)(Ll,{style:[{flex:1,padding:"0 5px",justifyContent:"center"},mo.smallText,y],onMouseDown:e=>m.current=[e.clientX,e.clientY],onMouseUp:e=>{m.current&&Math.abs(e.clientX-m.current[0])<5&&Math.abs(e.clientY-m.current[1])<5&&u&&u(r)},onClick:n.g.IS_TESTING&&(()=>u&&u(r)),children:(0,wo.jsx)(ql,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l?l(a):a})})})}function qw(e){let{backgroundColor:t="white",borderColor:n=go.border,inset:r=0,collapsed:o,focused:i,highlighted:a,children:l,height:s,style:u,...c}=e,[d,f]=(0,h.useState)(!1),p=(0,h.useRef)(!1),y=(0,h.useRef)(null),g=(0,h.useRef)(null);return(0,h.useEffect)((()=>{a&&!p.current&&y.current&&(y.current.classList.add("animated"),f(!0),clearTimeout(g.current),g.current=setTimeout((()=>{f(!1),g.current=setTimeout((()=>{y.current&&y.current.classList.remove("animated")}),500)}),500))}),[a]),(0,h.useEffect)((()=>{p.current=a})),(0,wo.jsx)(Kw,{backgroundColor:d?go.y9:t,borderColor:d?go.y8:n,children:(0,wo.jsxs)(Ll,{innerRef:y,style:[{flexDirection:"row",height:s||zw,flex:"0 0 "+(s||zw)+"px",userSelect:"text","&.animated .animated-cell":{transition:".7s background-color"}},o&&{marginTop:-1},u],"data-testid":"row",...c,children:[0!==r&&(0,wo.jsx)($w,{width:r}),l,0!==r&&(0,wo.jsx)($w,{width:r})]})})}const Gw={backgroundColor:"white",padding:"5px 3px",margin:"0 1px"},Yw={backgroundColor:"transparent","::selection":{backgroundColor:"#d9d9d9"}};function Qw(e){let{value:t,onUpdate:n,onBlur:r,...o}=e,[i,a]=(0,h.useState)(t);return(0,wo.jsx)(Vl,{...o,value:i,onUpdate:e=>a(e),onBlur:function(e){n&&n(i),r&&Ww(r,e)},onKeyDown:function(e){"Enter"!==e.key&&"Tab"!==e.key&&e.stopPropagation(),"Escape"===e.key?i!==t&&a(t):Zw(e)&&n&&n(i)},style:[Gw,o.readOnly?Yw:null,o.style]})}function Xw(e){let{inputProps:t,onUpdate:n,onBlur:r,textAlign:o,error:i,...a}=e;return(0,wo.jsx)(Vw,{textAlign:o,...a,children:()=>(0,wo.jsxs)(h.Fragment,{children:[(0,wo.jsx)(Qw,{value:a.value,onUpdate:n,onBlur:r,style:[{textAlign:o},t&&t.style],...t}),i&&(0,wo.jsx)(Ps,{targetHeight:zw,width:180,position:"bottom-left",children:i},"error")]})})}function Zw(e){switch(e.key){case"Tab":case"Enter":return e.preventDefault(),!0}}function Jw(e){let{value:t,children:n,onUpdate:r,onBlur:o,...i}=e,[a,l]=(0,h.useState)(t),[s,u]=(0,h.useState)(t);function c(e){document.hasFocus()&&(r&&r(a),Ww(o,e))}function d(e){Zw(e)&&r&&r(a)}return s!==t&&(l(t),u(t)),(0,wo.jsx)(Vw,{...i,value:t,children:()=>n({onBlur:c,onKeyDown:d,onUpdate:e=>l(e),onSave:e=>{l(e),r&&r(e)},shouldSaveFromKey:Zw,inputStyle:Gw})})}function ej(e){let{onDelete:t,style:n,...r}=e;return(0,wo.jsx)(Vw,{...r,name:"delete",width:20,style:[{alignItems:"center",userSelect:"none"},n],onClick:e=>{e.stopPropagation(),t&&t()},children:()=>(0,wo.jsx)(ws,{width:7,height:7})})}const tj=h.forwardRef(((e,t)=>{let{style:n,disabled:r,clickBehavior:o,onSelect:i,onEdit:a,children:l}=e;return(0,wo.jsx)(Ll,{innerRef:t,className:"cell-button",tabIndex:"0",onKeyDown:e=>{"x"!==e.key&&" "!==e.key||(e.preventDefault(),r||i&&i())},style:[{flexDirection:"row",alignItems:"center",cursor:"default",transition:"box-shadow .15s",":focus":{outline:0,boxShadow:`0 0 0 3px white, 0 0 0 5px ${go.b5}`}},n],onFocus:()=>a&&a(),"data-testid":"cell-button",onClick:"none"===o?null:()=>{r||(i&&i(),a&&a())},children:l})}));function nj(e){let{focused:t,selected:n,partial:r,style:o,onSelect:i,onEdit:a,...l}=e;return(0,wo.jsx)(Vw,{...l,focused:t,name:"select",width:20,style:[{alignItems:"center",userSelect:"none"},o],onClick:e=>{e.stopPropagation(),i&&i(),a&&a()},children:()=>(0,wo.jsx)(tj,{style:[{width:12,height:12,border:"1px solid "+go.n8,borderRadius:3,justifyContent:"center",alignItems:"center",":focus":{border:"1px solid "+go.b5,boxShadow:"0 1px 2px "+go.b5}},n&&{backgroundColor:r?go.b9:go.b5,borderColor:r?go.b9:go.b5}],onEdit:a,onSelect:i,clickBehavior:"none",children:n&&(0,wo.jsx)(Rw,{width:6,height:6,style:{color:"white"}})})})}function rj(e){let{valueProps:t,valueStyle:n,inputProps:r,sync:o,textAlign:i,onSave:a,...l}=e;const{binding:s,type:u,getValueStyle:c,formatExpr:d,unformatExpr:f}=t;return(0,wo.jsx)(mw,{binding:s,onChange:()=>{l.exposed&&r&&r.onBlur&&r.onBlur()},children:e=>(0,wo.jsx)(Vw,{valueStyle:c?[n,c(e.value)]:n,textAlign:i,...l,value:e.value,formatter:e=>l.formatter?l.formatter(e,u):yw(e,u),"data-cellname":e.name,children:()=>(0,wo.jsx)(Qw,{value:d?d(e.value):e.value,onUpdate:e=>{a(f?f(e):e)},style:{textAlign:i},...r})})})}function oj(e){let{headers:t,children:n,version:r,...o}=e;return(0,wo.jsx)(Ll,{style:"v2"===r&&{borderRadius:"6px 6px 0 0",overflow:"hidden",flexShrink:0},children:(0,wo.jsx)(qw,{backgroundColor:"white",borderColor:go.border,collapsed:!0,...o,style:[{zIndex:200},"v2"===r?{color:go.n4,fontWeight:500}:{color:go.n4},o.style],children:t?t.map((e=>(0,wo.jsx)(Vw,{value:e.name,width:e.width,style:e.style,valueStyle:e.valueStyle},e.name))):n})})}function ij(e){let{name:t,keyHandlers:n,items:r,onSelect:o}=e,i=Rx(),[a,l]=(0,h.useState)(null);return 0===i.size?null:(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(cw,{keys:n||{}}),(0,wo.jsxs)(zl,{bare:!0,style:{color:go.b3},onClick:()=>l(!0),children:[(0,wo.jsx)(Nl,{width:8,height:8,style:{marginRight:5}}),i.size," ",t]}),a&&(0,wo.jsx)(Ps,{position:"bottom-right",width:200,style:{padding:0},onClose:()=>l(!1),children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{o(e,[...i]),l(!1)},items:r})})]})}let aj={position:"absolute",willChange:"transform",width:"100%"};const lj=h.forwardRef(((e,t)=>{let{fields:n,...r}=e,o=uj(r.items,n);return(0,wo.jsx)(sj,{...r,navigator:o})})),sj=h.forwardRef(((e,t)=>{let{items:n,count:r,headers:o,contentHeader:i,loading:a,rowHeight:l=zw,backgroundColor:s=Uw,renderItem:u,renderEmpty:c,getItemKey:d,loadMore:f,style:p,navigator:y,listRef:g,onScroll:m,version:v="v1",animated:b,allowPopupsEscape:x,isSelected:w,...j}=e;y||(y={onEdit:()=>{},editingId:null,focusedField:null,getNavigatorProps:e=>e});let{onEdit:S,editingId:k,focusedField:C,getNavigatorProps:_}=y,O=(0,h.useRef)(null),E=(0,h.useRef)(null),T=(0,h.useRef)(null),P=(0,h.useRef)(null),A=(0,h.useRef)(!1);function M(e){let{index:t,style:r,key:o}=e,i=n[t],a=k===i.id,l=w&&w(i.id),s=u({item:i,editing:a,focusedField:a&&C,onEdit:S,index:t,position:r.top});return(0,wo.jsx)(Ll,{className:"animated-row",style:[aj,{zIndex:a||l?101:"auto",transform:"translateY(var(--pos))"}],nativeStyle:{"--pos":r.top-1+"px"},"data-focus-key":i.id,children:s},o)}function D(e,t){return t*(l-1)+(l-1)/2-e/2+2*(l-1)}function I(e){let{overscanStartIndex:t,overscanStopIndex:r}=e;f&&r>n.length-100&&f()}if((0,h.useImperativeHandle)(t,(()=>({scrollTo:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smart",r=n.findIndex((t=>t.id===e));-1!==r&&(O.current?O.current.scrollToItem(r,t):P.current=r)},scrollToTop:()=>{O.current&&O.current.scrollTo(0)},getScrolledItem:()=>{if(T.current){let e=T.current.scrollTop,t=O.current.getStartIndexForOffset(e);return n[t].id}return 0},setRowAnimation:e=>{O.current&&O.current.setRowAnimation(e)},edit(e,n,r){S(e,n),e&&r&&t.scrollTo(e)},anchor(){O.current&&O.current.anchor()},unanchor(){O.current&&O.current.unanchor()},isAnchored(){return O.current&&O.current.isAnchored()}}))),(0,h.useLayoutEffect)((()=>{!A.current&&E.current&&(O.current&&O.current.setRowAnimation(!0),A.current=!0)})),a)return(0,wo.jsx)(Ll,{style:[{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:s}],children:(0,wo.jsx)(ko,{width:25,color:go.n1})});let R=0===(r||n.length);return(0,wo.jsxs)(Ll,{style:[{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"}},p],tabIndex:"1",..._(j),"data-testid":"table",children:[o&&(0,wo.jsx)(oj,{version:v,height:l,...Array.isArray(o)?{headers:o}:{children:o}}),(0,wo.jsx)(Ll,{style:{flex:1,backgroundColor:s},children:R?(N=c,null==N?null:"function"===typeof N?N():(0,wo.jsx)(Ll,{style:{justifyContent:"center",alignItems:"center",fontStyle:"italic",color:go.n6,flex:1},children:N})):(0,wo.jsx)(Iw,{children:e=>{let{width:t,height:o}=e;return 0===t||0===o?null:(0,wo.jsx)(Es.Provider,{value:!x&&E,children:(0,wo.jsx)(Hl,{children:(0,wo.jsx)(Bw,{ref:O,header:i,innerRef:E,outerRef:T,width:t,height:o,renderRow:M,itemCount:r||n.length,itemSize:l-1,itemKey:d||((e,t)=>n[e].id),indexForKey:e=>n.findIndex((t=>t.id===e)),initialScrollOffset:P.current?D(o,P.current):0,version:v,animated:b,overscanCount:5,onItemsRendered:I,onScroll:m})})})}})})]});var N}));function uj(e,t){let n="function"!==typeof t?()=>t:t,[r,o]=(0,h.useState)(null),[i,a]=(0,h.useState)(null),l=(0,h.useRef)(),s=he(),u=(0,h.useRef)(0),c=(0,h.useCallback)(((e,t)=>{o(e),a(e?t:null)}),[]);function d(){l.current.focus(),c(null),setTimeout((()=>{c(r,i)}),100)}function f(t){if(r){let o=n(e.find((e=>e.id===r))),l=o.indexOf(i)+t;l<0?function(){let t=e.findIndex((e=>e.id===r));if(t>0){let r=e[t-1],o=n(r);c(r.id,o[o.length-1])}else d()}():l>=o.length?function(){let t=e.findIndex((e=>e.id===r));if(t<e.length-1){let r=e[t+1],o=n(r);c(r.id,o[0])}else d()}():a(o[l])}}function p(t){if(r){let o=e.findIndex((e=>e.id===r));for(;;){if(o+=t,!(o>=0&&o<e.length)){d();break}{const t=e[o];if(n(t).includes(i)){c(t.id,i);break}}}}}function y(e){switch(e){case"left":f(-1);break;case"right":f(1);break;case"up":p(-1);break;case"down":p(1);break;default:throw new Error("Unknown direction: "+e)}}return(0,h.useEffect)((()=>{u.current=s.getState().modals.modalStack.length}),[]),{onEdit:c,editingId:r,focusedField:i,getNavigatorProps:function(e){return{...e,innerRef:l,onKeyDown:t=>{if(e&&e.onKeyDown&&e.onKeyDown(t),!t.isPropagationStopped())switch(t.key){case"ArrowUp":case"k":"INPUT"!==t.target.tagName&&y("up");break;case"ArrowDown":case"j":"INPUT"!==t.target.tagName&&y("down");break;case"Enter":case"Tab":t.preventDefault(),t.stopPropagation(),y("Enter"===t.key?t.shiftKey?"up":"down":t.shiftKey?"left":"right")}},onBlur:e=>{let t=u.current,n=s.getState().modals.modalStack.length;!document.hasFocus()||null!=e.relatedTarget&&l.current.contains(e.relatedTarget)&&l.current!==e.relatedTarget||t!==n||c(null)}}}}}const cj={prefix:String(Math.round(1e10*Math.random())),current:0},dj=h.createContext(cj);let fj=Boolean("undefined"!==typeof window&&window.document&&window.document.createElement);function pj(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=pj(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var hj=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=pj(e))&&(r&&(r+=" "),r+=t);return r};const yj="undefined"!==typeof window?h.useLayoutEffect:()=>{};let gj=new Map;function mj(e){let[t,n]=(0,h.useState)(e),r=(0,h.useRef)(null),o=function(e){let t=(0,h.useContext)(dj);return t!==cj||fj||console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server."),(0,h.useMemo)((()=>e||`react-aria${t.prefix}-${++t.current}`),[e])}(t),i=(0,h.useCallback)((e=>{r.current=e}),[]);return gj.set(o,i),yj((()=>{let e=o;return()=>{gj.delete(e)}}),[o]),(0,h.useEffect)((()=>{let e=r.current;e&&(r.current=null,n(e))})),o}function vj(e,t){if(e===t)return e;let n=gj.get(e);if(n)return n(t),t;let r=gj.get(t);return r?(r(e),e):t}function bj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=mj(),[n,r]=function(e){let[t,n]=(0,h.useState)(e),r=(0,h.useRef)(t),o=(0,h.useRef)(null);r.current=t;let i=(0,h.useRef)(null);i.current=()=>{let e=o.current.next();e.done?o.current=null:t===e.value?i.current():n(e.value)},yj((()=>{o.current&&i.current()}));let a=(0,h.useCallback)((e=>{o.current=e(r.current),i.current()}),[o,i]);return[t,a]}(t),o=(0,h.useCallback)((()=>{r((function*(){yield t,yield document.getElementById(t)?t:null}))}),[t,r]);return yj(o,[t,o,...e]),n}function xj(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(let e of t)"function"===typeof e&&e(...arguments)}}function wj(){let e={...arguments.length<=0?void 0:arguments[0]};for(let t=1;t<arguments.length;t++){let n=t<0||arguments.length<=t?void 0:arguments[t];for(let t in n){let r=e[t],o=n[t];"function"===typeof r&&"function"===typeof o&&"o"===t[0]&&"n"===t[1]&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90?e[t]=xj(r,o):"className"!==t&&"UNSAFE_className"!==t||"string"!==typeof r||"string"!==typeof o?"id"===t&&r&&o?e.id=vj(r,o):e[t]=void 0!==o?o:r:e[t]=hj(r,o)}}return e}const jj=new Set(["id"]),Sj=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),kj=/^(data-.*)$/;function Cj(e){if(function(){if(null==_j){_j=!1;try{document.createElement("div").focus({get preventScroll(){return _j=!0,!0}})}catch(Fa){}}return _j}())e.focus({preventScroll:!0});else{let t=function(e){var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let _j=null;let Oj=new Map,Ej=new Set;function Tj(){if("undefined"===typeof window)return;let e=t=>{let n=Oj.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),Oj.delete(t.target)),0===Oj.size)){for(let e of Ej)e();Ej.clear()}};document.body.addEventListener("transitionrun",(t=>{let n=Oj.get(t.target);n||(n=new Set,Oj.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function Pj(e){requestAnimationFrame((()=>{0===Oj.size?e():Ej.add(e)}))}"undefined"!==typeof document&&("loading"!==document.readyState?Tj():document.addEventListener("DOMContentLoaded",Tj));function Aj(){let e=(0,h.useRef)(new Map),t=(0,h.useCallback)(((t,n,r,o)=>{let i=(null===o||void 0===o?void 0:o.once)?function(){e.current.delete(r),r(...arguments)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,r,o)}),[]),n=(0,h.useCallback)(((t,n,r,o)=>{var i;let a=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,a,o),e.current.delete(r)}),[]),r=(0,h.useCallback)((()=>{e.current.forEach(((e,t)=>{n(e.eventTarget,e.type,t,e.options)}))}),[n]);return(0,h.useEffect)((()=>r),[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}let Mj="undefined"!==typeof window&&window.visualViewport;function Dj(){return{width:(null===Mj||void 0===Mj?void 0:Mj.width)||window.innerWidth,height:(null===Mj||void 0===Mj?void 0:Mj.height)||window.innerHeight}}let Ij=0;const Rj=new Map;function Nj(e){var t;return"undefined"!==typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent))}function Lj(e){var t;return"undefined"!==typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Fj(){return Lj(/^Mac/i)}function Bj(){return Lj(/^iPhone/i)||Lj(/^iPad/i)||Fj()&&navigator.maxTouchPoints>1}function zj(){return Nj(/AppleWebKit/i)&&!Nj(/Chrome/i)}function Uj(e,t){let n=Wj(e,t,"left"),r=Wj(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,a=e.scrollLeft,l=e.scrollTop,s=a+e.offsetWidth,u=l+e.offsetHeight;n<=a?a=n:n+o>s&&(a+=n+o-s),r<=l?l=r:r+i>u&&(l+=r+i-u),e.scrollLeft=a,e.scrollTop=l}function Wj(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}let Hj="default",Kj="",$j=new WeakMap;function Vj(e){Bj()?("default"===Hj&&(Kj=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),Hj="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&($j.set(e,e.style.userSelect),e.style.userSelect="none")}function qj(e){if(Bj()){if("disabled"!==Hj)return;Hj="restoring",setTimeout((()=>{Pj((()=>{"restoring"===Hj&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=Kj||""),Kj="",Hj="default")}))}),300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&$j.has(e)){let t=$j.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),$j.delete(e)}}function Gj(e){return!(0!==e.mozInputSource||!e.isTrusted)||0===e.detail&&!e.pointerType}class Yj{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,t){this.nativeEvent=t,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.bubbles=t.bubbles,this.cancelable=t.cancelable,this.defaultPrevented=t.defaultPrevented,this.eventPhase=t.eventPhase,this.isTrusted=t.isTrusted,this.timeStamp=t.timeStamp,this.type=e}}function Qj(e){let t=(0,h.useRef)({isFocused:!1,onBlur:e,observer:null});return t.current.onBlur=e,yj((()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]),(0,h.useCallback)((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let n=e.target,r=e=>{var r,o;t.current.isFocused=!1,n.disabled&&(null===(o=(r=t.current).onBlur)||void 0===o||o.call(r,new Yj("blur",e))),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};n.addEventListener("focusout",r,{once:!0}),t.current.observer=new MutationObserver((()=>{t.current.isFocused&&n.disabled&&(t.current.observer.disconnect(),n.dispatchEvent(new FocusEvent("blur")),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0})))})),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]})}}),[])}const Xj=h.createContext(null);function Zj(e){let t=(0,h.useContext)(Xj);if(t){let{register:n,...r}=t;e=wj(r,e),n()}return function(e,t){yj((()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}}),[e,t])}(t,e.ref),e}function Jj(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,isDisabled:a,isPressed:l,preventFocusOnPress:s,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:d,...f}=Zj(e),p=(0,h.useRef)(null);p.current={onPress:t,onPressChange:n,onPressStart:r,onPressEnd:o,onPressUp:i,isDisabled:a,shouldCancelOnPointerExit:u};let[y,g]=(0,h.useState)(!1),m=(0,h.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:b}=Aj(),x=(0,h.useMemo)((()=>{let e=m.current,t=(t,n)=>{let{onPressStart:r,onPressChange:o,isDisabled:i}=p.current;i||e.didFirePressStart||(r&&r({type:"pressstart",pointerType:n,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),o&&o(!0),e.didFirePressStart=!0,g(!0))},n=function(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],{onPressEnd:o,onPressChange:i,onPress:a,isDisabled:l}=p.current;e.didFirePressStart&&(e.ignoreClickAfterPress=!0,e.didFirePressStart=!1,o&&o({type:"pressend",pointerType:n,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),i&&i(!1),g(!1),a&&r&&!l&&a({type:"press",pointerType:n,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}))},r=(e,t)=>{let{onPressUp:n,isDisabled:r}=p.current;r||n&&n({type:"pressup",pointerType:t,target:e.currentTarget,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},o=t=>{e.isPressed&&(e.isOverTarget&&n(rS(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,b(),c||qj(e.target))},i={onKeyDown(n){tS(n.nativeEvent,n.currentTarget)&&n.currentTarget.contains(n.target)?(aS(n.target,n.key)&&n.preventDefault(),n.stopPropagation(),e.isPressed||n.repeat||(e.target=n.currentTarget,e.isPressed=!0,t(n,"keyboard"),v(document,"keyup",l,!1))):"Enter"===n.key&&eS(n.currentTarget)&&n.stopPropagation()},onKeyUp(t){tS(t.nativeEvent,t.currentTarget)&&!t.repeat&&t.currentTarget.contains(t.target)&&r(rS(e.target,t),"keyboard")},onClick(o){o&&!o.currentTarget.contains(o.target)||o&&0===o.button&&(o.stopPropagation(),a&&o.preventDefault(),e.ignoreClickAfterPress||e.ignoreEmulatedMouseEvents||"virtual"!==e.pointerType&&!Gj(o.nativeEvent)||(a||s||Cj(o.currentTarget),t(o,"virtual"),r(o,"virtual"),n(o,"virtual")),e.ignoreEmulatedMouseEvents=!1,e.ignoreClickAfterPress=!1)}},l=t=>{if(e.isPressed&&tS(t,e.target)){aS(t.target,t.key)&&t.preventDefault(),t.stopPropagation(),e.isPressed=!1;let r=t.target;n(rS(e.target,t),"keyboard",e.target.contains(r)),b(),e.target instanceof HTMLElement&&e.target.contains(r)&&(eS(e.target)||"link"===e.target.getAttribute("role"))&&e.target.click()}};if("undefined"!==typeof PointerEvent){i.onPointerDown=n=>{var r;0===n.button&&n.currentTarget.contains(n.target)&&(0===(r=n.nativeEvent).width&&0===r.height||1===r.width&&1===r.height&&0===r.pressure&&0===r.detail&&"mouse"===r.pointerType?e.pointerType="virtual":(iS(n.currentTarget)&&n.preventDefault(),e.pointerType=n.pointerType,n.stopPropagation(),e.isPressed||(e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=n.pointerId,e.target=n.currentTarget,a||s||Cj(n.currentTarget),c||Vj(e.target),t(n,e.pointerType),v(document,"pointermove",l,!1),v(document,"pointerup",u,!1),v(document,"pointercancel",d,!1))))},i.onMouseDown=e=>{e.currentTarget.contains(e.target)&&0===e.button&&(iS(e.currentTarget)&&e.preventDefault(),e.stopPropagation())},i.onPointerUp=t=>{t.currentTarget.contains(t.target)&&"virtual"!==e.pointerType&&0===t.button&&oS(t,t.currentTarget)&&r(t,e.pointerType||t.pointerType)};let l=r=>{r.pointerId===e.activePointerId&&(oS(r,e.target)?e.isOverTarget||(e.isOverTarget=!0,t(rS(e.target,r),e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,n(rS(e.target,r),e.pointerType,!1),p.current.shouldCancelOnPointerExit&&o(r)))},u=t=>{t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&(oS(t,e.target)?n(rS(e.target,t),e.pointerType):e.isOverTarget&&n(rS(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,b(),c||qj(e.target))},d=e=>{o(e)};i.onDragStart=e=>{e.currentTarget.contains(e.target)&&o(e)}}else{i.onMouseDown=n=>{0===n.button&&n.currentTarget.contains(n.target)&&(iS(n.currentTarget)&&n.preventDefault(),n.stopPropagation(),e.ignoreEmulatedMouseEvents||(e.isPressed=!0,e.isOverTarget=!0,e.target=n.currentTarget,e.pointerType=Gj(n.nativeEvent)?"virtual":"mouse",a||s||Cj(n.currentTarget),t(n,e.pointerType),v(document,"mouseup",l,!1)))},i.onMouseEnter=n=>{n.currentTarget.contains(n.target)&&(n.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!0,t(n,e.pointerType)))},i.onMouseLeave=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!1,n(t,e.pointerType,!1),p.current.shouldCancelOnPointerExit&&o(t)))},i.onMouseUp=t=>{t.currentTarget.contains(t.target)&&(e.ignoreEmulatedMouseEvents||0!==t.button||r(t,e.pointerType))};let l=t=>{0===t.button&&(e.isPressed=!1,b(),e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:(oS(t,e.target)?n(rS(e.target,t),e.pointerType):e.isOverTarget&&n(rS(e.target,t),e.pointerType,!1),e.isOverTarget=!1))};i.onTouchStart=n=>{if(!n.currentTarget.contains(n.target))return;n.stopPropagation();let r=function(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}(n.nativeEvent);r&&(e.activePointerId=r.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,e.target=n.currentTarget,e.pointerType="touch",a||s||Cj(n.currentTarget),c||Vj(e.target),t(n,e.pointerType),v(window,"scroll",u,!0))},i.onTouchMove=r=>{if(!r.currentTarget.contains(r.target))return;if(r.stopPropagation(),!e.isPressed)return;let i=nS(r.nativeEvent,e.activePointerId);i&&oS(i,r.currentTarget)?e.isOverTarget||(e.isOverTarget=!0,t(r,e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,n(r,e.pointerType,!1),p.current.shouldCancelOnPointerExit&&o(r))},i.onTouchEnd=t=>{if(!t.currentTarget.contains(t.target))return;if(t.stopPropagation(),!e.isPressed)return;let o=nS(t.nativeEvent,e.activePointerId);o&&oS(o,t.currentTarget)?(r(t,e.pointerType),n(t,e.pointerType)):e.isOverTarget&&n(t,e.pointerType,!1),e.isPressed=!1,e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,c||qj(e.target),b()},i.onTouchCancel=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&o(t))};let u=t=>{e.isPressed&&t.target.contains(e.target)&&o({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};i.onDragStart=e=>{e.currentTarget.contains(e.target)&&o(e)}}return i}),[v,a,s,b,c]);return(0,h.useEffect)((()=>()=>{c||qj(m.current.target)}),[c]),{isPressed:l||y,pressProps:wj(f,x)}}function eS(e){return"A"===e.tagName&&e.hasAttribute("href")}function tS(e,t){const{key:n,code:r}=e,o=t,i=o.getAttribute("role");return("Enter"===n||" "===n||"Spacebar"===n||"Space"===r)&&!(o instanceof HTMLInputElement&&!sS(o,n)||o instanceof HTMLTextAreaElement||o.isContentEditable)&&(!eS(o)||"button"===i&&"Enter"!==n)&&!("link"===i&&"Enter"!==n)}function nS(e,t){const n=e.changedTouches;for(let r=0;r<n.length;r++){const e=n[r];if(e.identifier===t)return e}return null}function rS(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function oS(e,t){let n=t.getBoundingClientRect(),r=function(e){let t=e.width/2||e.radiusX||0,n=e.height/2||e.radiusY||0;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}(e);return function(e,t){return!(e.left>t.right||t.left>e.right)&&!(e.top>t.bottom||t.top>e.bottom)}(n,r)}function iS(e){return!(e instanceof HTMLElement)||!e.draggable}function aS(e,t){return e instanceof HTMLInputElement?!sS(e,t):!(e instanceof HTMLButtonElement)||"submit"!==e.type}Xj.displayName="PressResponderContext";const lS=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function sS(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:lS.has(e.type)}let uS=null,cS=new Set,dS=!1,fS=!1,pS=!1;const hS={Tab:!0,Escape:!0};function yS(e,t){for(let n of cS)n(e,t)}function gS(e){fS=!0,function(e){return!(e.metaKey||!Fj()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(uS="keyboard",yS("keyboard",e))}function mS(e){uS="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(fS=!0,yS("pointer",e))}function vS(e){Gj(e)&&(fS=!0,uS="virtual")}function bS(e){e.target!==window&&e.target!==document&&(fS||pS||(uS="virtual",yS("virtual",e)),fS=!1,pS=!1)}function xS(){fS=!1,pS=!0}function wS(){if("undefined"===typeof window||dS)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){fS=!0,e.apply(this,arguments)},document.addEventListener("keydown",gS,!0),document.addEventListener("keyup",gS,!0),document.addEventListener("click",vS,!0),window.addEventListener("focus",bS,!0),window.addEventListener("blur",xS,!1),"undefined"!==typeof PointerEvent?(document.addEventListener("pointerdown",mS,!0),document.addEventListener("pointermove",mS,!0),document.addEventListener("pointerup",mS,!0)):(document.addEventListener("mousedown",mS,!0),document.addEventListener("mousemove",mS,!0),document.addEventListener("mouseup",mS,!0)),dS=!0}function jS(){return"pointer"!==uS}function SS(e,t,n){wS(),(0,h.useEffect)((()=>{let t=(t,r)=>{(function(e,t,n){return!(e&&"keyboard"===t&&n instanceof KeyboardEvent&&!hS[n.key])})(null===n||void 0===n?void 0:n.isTextInput,t,r)&&e(jS())};return cS.add(t),()=>{cS.delete(t)}}),t)}function kS(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=(0,h.useRef)({isFocusWithin:!1}),a=(0,h.useCallback)((e=>{i.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(e),o&&o(!1))}),[n,o,i]),l=Qj(a),s=(0,h.useCallback)((e=>{i.current.isFocusWithin||(r&&r(e),o&&o(!0),i.current.isFocusWithin=!0,l(e))}),[r,o,l]);return t?{focusWithinProps:{onFocus:null,onBlur:null}}:{focusWithinProps:{onFocus:s,onBlur:a}}}"undefined"!==typeof document&&("loading"!==document.readyState?wS():document.addEventListener("DOMContentLoaded",wS));let CS=!1,_S=0;function OS(){CS=!0,setTimeout((()=>{CS=!1}),50)}function ES(e){"touch"===e.pointerType&&OS()}function TS(){if("undefined"!==typeof document)return"undefined"!==typeof PointerEvent?document.addEventListener("pointerup",ES):document.addEventListener("touchend",OS),_S++,()=>{_S--,_S>0||("undefined"!==typeof PointerEvent?document.removeEventListener("pointerup",ES):document.removeEventListener("touchend",OS))}}const PS=500;function AS(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:r,onLongPress:o,threshold:i=PS,accessibilityDescription:a}=e;const l=(0,h.useRef)(null);let{addGlobalListener:s,removeGlobalListener:u}=Aj(),{pressProps:c}=Jj({isDisabled:t,onPressStart(e){if(("mouse"===e.pointerType||"touch"===e.pointerType)&&(n&&n({...e,type:"longpressstart"}),l.current=setTimeout((()=>{e.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),o&&o({...e,type:"longpress"}),l.current=null}),i),"touch"===e.pointerType)){let t=e=>{e.preventDefault()};s(e.target,"contextmenu",t,{once:!0}),s(window,"pointerup",(()=>{setTimeout((()=>{u(e.target,"contextmenu",t)}),30)}),{once:!0})}},onPressEnd(e){l.current&&clearTimeout(l.current),!r||"mouse"!==e.pointerType&&"touch"!==e.pointerType||r({...e,type:"longpressend"})}}),d=function(e){let[t,n]=(0,h.useState)(null);return yj((()=>{if(!e)return;let t=Rj.get(e);if(t)n(t.element.id);else{let r="react-aria-description-"+Ij++;n(r);let o=document.createElement("div");o.id=r,o.style.display="none",o.textContent=e,document.body.appendChild(o),t={refCount:0,element:o},Rj.set(e,t)}return t.refCount++,()=>{0===--t.refCount&&(t.element.remove(),Rj.delete(e))}}),[e]),{"aria-describedby":e?t:void 0}}(o&&!t?a:null);return{longPressProps:wj(c,d)}}function MS(e){if("virtual"===uS){let t=document.activeElement;Pj((()=>{document.activeElement===t&&document.contains(e)&&Cj(e)}))}else Cj(e)}function DS(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:n}=e.style,r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||DS(e.parentElement,e))}const IS=h.createContext(null);let RS=null;function NS(e){let{children:t,contain:n,restoreFocus:r,autoFocus:o}=e,i=(0,h.useRef)(),a=(0,h.useRef)(),l=(0,h.useRef)([]),s=(0,h.useContext)(IS);var u;let c=null!==(u=null===s||void 0===s?void 0:s.scopeRef)&&void 0!==u?u:null;yj((()=>{let e=i.current.nextSibling,t=[];for(;e&&e!==a.current;)t.push(e),e=e.nextSibling;l.current=t}),[t,c]),QS.getTreeNode(c)&&!QS.getTreeNode(l)&&QS.addTreeNode(l,c),QS.getTreeNode(l).contain=n,function(e,t){let n=(0,h.useRef)(),r=(0,h.useRef)(null);yj((()=>{let o=e.current;if(!t)return void(r.current&&(cancelAnimationFrame(r.current),r.current=null));let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!US(e))return;let n=document.activeElement,r=e.current;if(!WS(n,r))return;let o=qS(zS(r),{tabbable:!0},r);o.currentNode=n;let i=t.shiftKey?o.previousNode():o.nextNode();i||(o.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,i=t.shiftKey?o.previousNode():o.nextNode()),t.preventDefault(),i&&$S(i,!0)},a=t=>{!RS||KS(RS,e)?(RS=e,n.current=t.target):US(e)&&!HS(t.target,e)?n.current?n.current.focus():RS&&VS(RS.current):US(e)&&(n.current=t.target)},l=t=>{r.current=requestAnimationFrame((()=>{US(e)&&!HS(document.activeElement,e)&&(RS=e,document.body.contains(t.target)?(n.current=t.target,n.current.focus()):RS&&VS(RS.current))}))};return document.addEventListener("keydown",i,!1),document.addEventListener("focusin",a,!1),o.forEach((e=>e.addEventListener("focusin",a,!1))),o.forEach((e=>e.addEventListener("focusout",l,!1))),()=>{document.removeEventListener("keydown",i,!1),document.removeEventListener("focusin",a,!1),o.forEach((e=>e.removeEventListener("focusin",a,!1))),o.forEach((e=>e.removeEventListener("focusout",l,!1)))}}),[e,t]),(0,h.useEffect)((()=>()=>{r.current&&cancelAnimationFrame(r.current)}),[r])}(l,n),function(e,t,n){const r=(0,h.useRef)("undefined"!==typeof document?document.activeElement:null);yj((()=>{let r=e.current;if(!t||n)return;let o=()=>{RS&&!KS(RS,e)||(RS=e)};return document.addEventListener("focusin",o,!1),r.forEach((e=>e.addEventListener("focusin",o,!1))),()=>{document.removeEventListener("focusin",o,!1),r.forEach((e=>e.removeEventListener("focusin",o,!1)))}}),[e,n]),yj((()=>{if(QS.getTreeNode(e).nodeToRestore=r.current,!t)return;let o=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey)return;let n=document.activeElement;if(!WS(n,e.current))return;let r=QS.getTreeNode(e).nodeToRestore,o=qS(document.body,{tabbable:!0});o.currentNode=n;let i=t.shiftKey?o.previousNode():o.nextNode();if(document.body.contains(r)&&r!==document.body||(r=null,QS.getTreeNode(e).nodeToRestore=null),(!i||!WS(i,e.current))&&r){o.currentNode=r;do{i=t.shiftKey?o.previousNode():o.nextNode()}while(WS(i,e.current));t.preventDefault(),t.stopPropagation(),i?$S(i,!0):HS(r)?$S(r,!0):n.blur()}};return n||document.addEventListener("keydown",o,!0),()=>{n||document.removeEventListener("keydown",o,!0);let r=QS.getTreeNode(e).nodeToRestore;if(t&&r&&(WS(document.activeElement,e.current)||document.activeElement===document.body&&RS===e)){let t=QS.clone();requestAnimationFrame((()=>{if(document.activeElement===document.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&document.body.contains(n.nodeToRestore))return void $S(n.nodeToRestore);n=n.parent}}}))}}}),[e,t,n])}(l,r,n),function(e,t){const n=h.useRef(t);(0,h.useEffect)((()=>{n.current&&(RS=e,WS(document.activeElement,RS.current)||VS(e.current)),n.current=!1}),[e])}(l,o),yj((()=>{if(l&&(c||null==c))return()=>{l!==RS&&!KS(l,RS)||c&&!QS.getTreeNode(c)||(RS=c),QS.removeTreeNode(l)}}),[l,c]);let d=function(e){return{focusNext(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,l=r||document.activeElement,s=n[0].previousElementSibling,u=qS(zS(n),{tabbable:o,accept:a},n);u.currentNode=WS(l,n)?l:s;let c=u.nextNode();return!c&&i&&(u.currentNode=s,c=u.nextNode()),c&&$S(c,!0),c},focusPrevious(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{from:r,tabbable:o,wrap:i,accept:a}=t,l=r||document.activeElement,s=n[n.length-1].nextElementSibling,u=qS(zS(n),{tabbable:o,accept:a},n);u.currentNode=WS(l,n)?l:s;let c=u.previousNode();return!c&&i&&(u.currentNode=s,c=u.previousNode()),c&&$S(c,!0),c},focusFirst(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{tabbable:r,accept:o}=t,i=qS(zS(n),{tabbable:r,accept:o},n);i.currentNode=n[0].previousElementSibling;let a=i.nextNode();return a&&$S(a,!0),a},focusLast(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.current,{tabbable:r,accept:o}=t,i=qS(zS(n),{tabbable:r,accept:o},n);i.currentNode=n[n.length-1].nextElementSibling;let a=i.previousNode();return a&&$S(a,!0),a}}}(l);return h.createElement(IS.Provider,{value:{scopeRef:l,focusManager:d}},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}const LS=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],FS=LS.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";LS.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const BS=LS.join(':not([hidden]):not([tabindex="-1"]),');function zS(e){return e[0].parentElement}function US(e){let t=QS.getTreeNode(RS);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function WS(e,t){return t.some((t=>t.contains(e)))}function HS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;for(let{scopeRef:n}of QS.traverse(QS.getTreeNode(t)))if(WS(e,n.current))return!0;return!1}function KS(e,t){var n;let r=null===(n=QS.getTreeNode(t))||void 0===n?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function $S(e){if(null==e||arguments.length>1&&void 0!==arguments[1]&&arguments[1]){if(null!=e)try{e.focus()}catch(t){}}else try{MS(e)}catch(n){}}function VS(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e[0].previousElementSibling,r=qS(zS(e),{tabbable:t},e);r.currentNode=n;let o=r.nextNode();t&&!o&&(r=qS(zS(e),{tabbable:!1},e),r.currentNode=n,o=r.nextNode()),$S(o)}function qS(e,t,n){let r=(null===t||void 0===t?void 0:t.tabbable)?BS:FS,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var o;return(null===t||void 0===t||null===(o=t.from)||void 0===o?void 0:o.contains(e))?NodeFilter.FILTER_REJECT:!e.matches(r)||!DS(e)||n&&!WS(e,n)||(null===t||void 0===t?void 0:t.accept)&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return(null===t||void 0===t?void 0:t.from)&&(o.currentNode=t.from),o}class GS{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(null!==t&&void 0!==t?t:null),o=new YS({scopeRef:e});r.addChild(o),o.parent=r,this.fastMap.set(e,o),n&&(o.nodeToRestore=n)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e),n=t.parent;for(let o of this.traverse())o!==t&&t.nodeToRestore&&o.nodeToRestore&&t.scopeRef.current&&WS(o.nodeToRestore,t.scopeRef.current)&&(o.nodeToRestore=t.nodeToRestore);let r=t.children;n.removeChild(t),r.length>0&&r.forEach((e=>n.addChild(e))),this.fastMap.delete(t.scopeRef)}traverse(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.root;return function*(){if(null!=t.scopeRef&&(yield t),t.children.length>0)for(let n of t.children)yield*e.traverse(n)}()}clone(){let e=new GS;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent.scopeRef,t.nodeToRestore);return e}constructor(){this.fastMap=new Map,this.root=new YS({scopeRef:null}),this.fastMap.set(null,this.root)}}class YS{addChild(e){this.children.push(e),e.parent=this}removeChild(e){this.children.splice(this.children.indexOf(e),1),e.parent=void 0}constructor(e){this.children=[],this.contain=!1,this.scopeRef=e.scopeRef}}let QS=new GS;function XS(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{autoFocus:t=!1,isTextInput:n,within:r}=e,o=(0,h.useRef)({isFocused:!1,isFocusVisible:t||jS()}),[i,a]=(0,h.useState)(!1),[l,s]=(0,h.useState)((()=>o.current.isFocused&&o.current.isFocusVisible)),u=(0,h.useCallback)((()=>s(o.current.isFocused&&o.current.isFocusVisible)),[]),c=(0,h.useCallback)((e=>{o.current.isFocused=e,a(e),u()}),[u]);SS((e=>{o.current.isFocusVisible=e,u()}),[],{isTextInput:n});let{focusProps:d}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=(0,h.useCallback)((e=>{if(e.target===e.currentTarget)return r&&r(e),o&&o(!1),!0}),[r,o]),a=Qj(i),l=(0,h.useCallback)((e=>{e.target===e.currentTarget&&(n&&n(e),o&&o(!0),a(e))}),[o,n,a]);return{focusProps:{onFocus:!t&&(n||o||r)?l:void 0,onBlur:t||!r&&!o?null:i}}}({isDisabled:r,onFocusChange:c}),{focusWithinProps:f}=kS({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:o.current.isFocused&&l,focusProps:r?f:d}}const ZS={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:!1},id:{ops:["is","contains","oneOf"],nullable:!0},string:{ops:["is","contains","oneOf"],nullable:!1},number:{ops:["is","isapprox","isbetween","gt","gte","lt","lte"],nullable:!1},boolean:{ops:["is"],nullable:!1}},JS=new Map(Object.entries({imported_payee:"string",payee:"id",date:"date",notes:"string",amount:"number",amountInflow:"number",amountOutfow:"number",category:"id",account:"id",cleared:"boolean"}));function ek(e,t){switch(t=t||{},e){case"imported_payee":return"imported payee";case"amount":return t.inflow?"amount (inflow)":t.outflow?"amount (outflow)":"amount";case"amount-inflow":return"amount (inflow)";case"amount-outflow":return"amount (outflow)";default:return e}}function tk(e,t){switch(e){case"oneOf":return"one of";case"is":return"is";case"isapprox":return"is approx";case"isbetween":return"is between";case"contains":return"contains";case"gt":return"date"===t?"is after":"is greater than";case"gte":return"date"===t?"is after or equals":"is greater than or equals";case"lt":return"date"===t?"is before":"is less than";case"lte":return"date"===t?"is before or equals":"is less than or equals";case"true":return"is true";case"false":return"is false";case"set":return"set";case"link-schedule":return"link schedule";case"and":return"and";case"or":return"or";default:return""}}function nk(e){switch(e){case"date-format":return"Invalid date format";case"no-null":case"no-empty-array":case"no-empty-string":return"Value cannot be empty";case"not-number":return"Value must be a number";case"invalid-field":return"Please choose a valid field for this type of rule";default:return"Internal error, sorry! Please get in touch https://actualbudget.github.io/docs/Contact/ for support"}}function rk(e){switch(e.type){case"number":{let t=e.value;return"amount"===e.field&&"isbetween"!==e.op&&null!=t&&(t=Vr(t)),{...e,value:t}}case"string":{let t=null==e.value?"":e.value;return{...e,value:t}}case"boolean":{let t=e.value;return{...e,value:t}}}return{...e,error:null}}function ok(e){let{error:t,inputKey:n,...r}=e;switch(r.type){case"number":{let e=r.value;return"amount"===r.field&&"isbetween"!==r.op&&(e=$r(e)),{...r,value:e}}case"string":{let e=null==r.value?"":r.value;return{...r,value:e}}case"boolean":{let e=null!=r.value&&r.value;return{...r,value:e}}}return r}function ik(e,t){if("number"===t.type)if("isbetween"!==t.op)return{...t,error:null,value:e&&Wr(String(e))||0};return{...t,error:null,value:e}}var ak=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M4.5 17.5h6.646a3.5 3.5 0 0 0 6.708 0H19.5a1 1 0 0 0 0-2h-1.646a3.5 3.5 0 0 0-6.708 0H4.5a1 1 0 0 0 0 2Zm10-2.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM19.5 6.5h-6.646a3.5 3.5 0 0 0-6.708 0H4.5a1 1 0 0 0 0 2h1.646a3.5 3.5 0 0 0 6.708 0H19.5a1 1 0 1 0 0-2ZM9.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z",fill:"currentColor"})});function lk(e,t){var n;Lf(1,arguments);var r=Wf(null!==(n=null===t||void 0===t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!==typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,i=function(e){var t,n={},r=e.split(sk.dateTimeDelimiter);if(r.length>2)return n;/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],sk.timeZoneDelimiter.test(n.date)&&(n.date=e.split(sk.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length)));if(t){var o=sk.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}(e);if(i.date){var a=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?o:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(i.date,r);o=function(e,t){if(null===t)return new Date(NaN);var n=e.match(uk);if(!n)return new Date(NaN);var r=!!n[4],o=fk(n[1]),i=fk(n[2])-1,a=fk(n[3]),l=fk(n[4]),s=fk(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,l,s)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}(t,l,s):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(hk[t]||(yk(e)?29:28))}(t,i,a)&&function(e,t){return t>=1&&t<=(yk(e)?366:365)}(t,o)?(u.setUTCFullYear(t,i,Math.max(o,a)),u):new Date(NaN)}(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var l,s=o.getTime(),u=0;if(i.time&&(u=function(e){var t=e.match(ck);if(!t)return NaN;var n=pk(t[1]),r=pk(t[2]),o=pk(t[3]);if(!function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o))return NaN;return n*ty+r*ey+1e3*o}(i.time),isNaN(u)))return new Date(NaN);if(!i.timezone){var c=new Date(s+u),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return l=function(e){if("Z"===e)return 0;var t=e.match(dk);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;if(!function(e,t){return t>=0&&t<=59}(0,o))return NaN;return n*(r*ty+o*ey)}(i.timezone),isNaN(l)?new Date(NaN):new Date(s+u+l)}var sk={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},uk=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ck=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dk=/^([+-])(\d{2})(?::?(\d{2}))?$/;function fk(e){return e?parseInt(e):1}function pk(e){return e&&parseFloat(e.replace(",","."))||0}var hk=[31,null,31,30,31,30,31,31,30,31,30,31];function yk(e){return e%400===0||e%4===0&&e%100!==0}var gk=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{fill:"currentColor",d:"M63.004.003a3 3 0 0 0-1.875 5.219L79.44 22.034H3.16a3.257 3.257 0 0 0-.313 0c-1.57.082-2.925 1.585-2.843 3.156.081 1.571 1.585 2.926 3.156 2.844H79.44L61.129 44.815a3 3 0 1 0 4.062 4.407l24-22a3 3 0 0 0 0-4.407l-24-22a3 3 0 0 0-2.187-.812Z"})});let mk=dw(fr("schedules").select("*"),vk,gr);var vk;function bk(e){let{value:t,field:n,valueIsRaw:r,inline:o=!1,data:i,describe:a=(e=>e.name)}=e,{data:l,dateFormat:s}=xe((e=>{let t;if(i)t=i;else switch(n){case"payee":t=e.queries.payees;break;case"category":t=e.queries.categories.list;break;case"account":t=e.queries.accounts;break;default:t=[]}return{data:t,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}})),[u,c]=(0,h.useState)(!1);function d(e){if(null==e||""===e)return"(nothing)";if("boolean"===typeof e)return e?"true":"false";switch(n){case"amount":return zr(e);case"date":return e?e.frequency?wh(e):Hp(lk(e),s):null;case"month":return e?Hp(lk(e),yh(s)):null;case"year":return e?Hp(lk(e),"yyyy"):null;case"notes":case"imported_payee":return e;case"payee":case"category":case"account":case"rule":if(r)return e;if(l&&l.length){let t=l.find((t=>t.id===e));return t?a(t):"(deleted)"}return"\u2026";default:throw new Error(`Unknown field ${n}`)}}if(Array.isArray(t)){if(0===t.length)return(0,wo.jsx)(ql,{style:{color:go.p4},children:"(empty)"});if(1===t.length)return(0,wo.jsxs)(ql,{children:["[",(0,wo.jsx)(ql,{style:{color:go.p4},children:d(t[0])}),"]"]});let e=t;!u&&t.length>4&&(e=t.slice(0,3));let n=t.length-e.length;return(0,wo.jsxs)(ql,{style:{color:go.n3},children:["[",e.map(((e,n)=>{let r,i=(0,wo.jsx)(ql,{style:{color:go.p4},children:d(e)});return r=o?0!==n?" ":"":(0,wo.jsxs)(wo.Fragment,{children:[0===n&&(0,wo.jsx)("br",{}),"\xa0\xa0"]}),(0,wo.jsxs)(ql,{children:[r,i,n===t.length-1?"":",",!o&&(0,wo.jsx)("br",{})]},n)})),n>0&&(0,wo.jsxs)(ql,{style:{color:go.p4},children:["\xa0\xa0",(0,wo.jsxs)("a",{href:"#",onClick:function(e){e.preventDefault(),c(!0)},...(0,lo.iv)({color:go.p4,textDecoration:"none",":hover":{textDecoration:"underline"}}),children:[n," more items..."]}),!o&&(0,wo.jsx)("br",{})]}),"]"]})}return t&&null!=t.num1&&null!=t.num2?(0,wo.jsxs)(ql,{children:[(0,wo.jsx)(ql,{style:{color:go.p4},children:d(t.num1)})," and"," ",(0,wo.jsx)(ql,{style:{color:go.p4},children:d(t.num2)})]}):(0,wo.jsx)(ql,{style:{color:go.p4},children:d(t)})}function xk(e){let{field:t,op:n,value:r,options:o,prefix:i,style:a}=e;return(0,wo.jsxs)(Ll,{style:[{display:"block",maxWidth:"100%",backgroundColor:go.n10,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},a],children:[i&&(0,wo.jsxs)(ql,{style:{color:go.n3},children:[i," "]}),(0,wo.jsx)(ql,{style:{color:go.p4},children:ek(t,o)})," ",(0,wo.jsx)(ql,{style:{color:go.n3},children:tk(n)})," ",(0,wo.jsx)(bk,{value:r,field:t})]})}function wk(e,t){return t?`${t.name} (${e.next_date})`:`Next: ${e.next_date}`}function jk(e){let{value:t}=e,n=xe((e=>e.queries.payees)),r=Jr(n),{data:o}=mk.useQuery();return(0,wo.jsx)(bk,{value:t,field:"rule",data:o,describe:e=>wk(e,r[e._payee])})}function Sk(e){let{field:t,op:n,value:r,options:o,style:i}=e;return(0,wo.jsx)(Ll,{style:[{display:"block",maxWidth:"100%",backgroundColor:go.n10,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},i],children:"set"===n?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(ql,{style:{color:go.n3},children:tk(n)})," ",(0,wo.jsx)(ql,{style:{color:go.p4},children:ek(t,o)})," ",(0,wo.jsx)(ql,{style:{color:go.n3},children:"to "}),(0,wo.jsx)(bk,{value:r,field:t})]}):"link-schedule"===n?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(ql,{style:{color:go.n3},children:tk(n)})," ",(0,wo.jsx)(jk,{value:r})]}):null})}let kk=h.memo((e=>{let{rule:t,hovered:n,selected:r,editing:o,focusedField:i,onHover:a,onEdit:l,onEditRule:s}=e,u=Ix(),c=r?go.b8:go.border,d=n||"select"===i;return(0,wo.jsxs)(qw,{height:"auto",borderColor:c,backgroundColor:r?go.selected:d?go.hover:"white",style:{fontSize:13,zIndex:o||r?101:"auto"},collapsed:"true",onMouseEnter:()=>a&&a(t.id),onMouseLeave:()=>a&&a(null),children:[(0,wo.jsx)(nj,{exposed:n||r||o,focused:"select"===i,onSelect:()=>{u({type:"select",id:t.id})},onEdit:()=>l(t.id,"select"),selected:r}),(0,wo.jsx)(Vw,{name:"stage",width:50,plain:!0,style:{color:go.n5},children:t.stage&&(0,wo.jsx)(Ll,{style:{alignSelf:"flex-start",margin:5,backgroundColor:go.b10,color:go.b1,borderRadius:4,padding:"3px 5px"},children:t.stage})}),(0,wo.jsx)($w,{width:"flex",style:{padding:"15px 0"},truncate:!1,children:(0,wo.jsxs)(Os,{direction:"row",align:"center",children:[(0,wo.jsx)(Ll,{style:{flex:1,alignItems:"flex-start"},"data-testid":"conditions",children:t.conditions.map(((e,n)=>(0,wo.jsx)(xk,{field:e.field,op:e.op,value:e.value,options:e.options,prefix:n>0?tk(t.conditionsOp):null,style:0!==n&&{marginTop:3}},n)))}),(0,wo.jsx)(ql,{children:(0,wo.jsx)(gk,{color:go.n4,style:{width:12,height:12}})}),(0,wo.jsx)(Ll,{style:{flex:1,alignItems:"flex-start"},"data-testid":"actions",children:t.actions.map(((e,t)=>(0,wo.jsx)(Sk,{field:e.field,op:e.op,value:e.value,options:e.options,style:0!==t&&{marginTop:3}},t)))})]})}),(0,wo.jsx)(Vw,{name:"edit",focused:"edit"===i,plain:!0,style:{padding:"0 15px",paddingLeft:5},children:(0,wo.jsx)(zl,{as:tj,onSelect:()=>s(t),onEdit:()=>l(t.id,"edit"),children:"Edit"})})]})})),Ck=h.forwardRef(((e,t)=>{let{data:n,navigator:r,loadMore:o,style:i,onHoverLeave:a,children:l,...s}=e,u=(0,h.useRef)(),c=(0,h.useRef)(),d=(0,h.useRef)(),{getNavigatorProps:f}=r;return(0,h.useEffect)((()=>{u.current?c.current=u.current.getBoundingClientRect().height:c.current=null}),[u.current,n]),(0,wo.jsx)(Ll,{style:[{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"}},i],tabIndex:"1","data-testid":"table",...f(s),children:(0,wo.jsx)(Ll,{innerRef:d,style:{maxWidth:"100%",overflow:"auto"},onScroll:function(e){null!=c.current&&o&&e.target.scrollTop>c.current-750&&o()},children:(0,wo.jsx)("div",{ref:u,onMouseLeave:a,children:l})})})}));function _k(){let e=Rx(),t=Ix();return(0,wo.jsxs)(oj,{version:"v2",style:{},children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,selected:e.size>0,onSelect:()=>t({type:"select-all"})}),(0,wo.jsx)(Vw,{value:"Stage",width:50}),(0,wo.jsx)(Vw,{value:"Rule",width:"flex"})]})}function Ok(e){let{rules:t,selectedItems:n,navigator:r,hoveredRule:o,collapsed:i,onHover:a,onCollapse:l,onEditRule:s}=e;return 0===t.length?null:(0,wo.jsx)(Ll,{children:t.map((e=>{let t=o===e.id,i=n.has(e.id),l=r.editingId===e.id;return(0,wo.jsx)(kk,{rule:e,hovered:t,selected:i,editing:l,focusedField:l&&r.focusedField,onHover:a,onEdit:r.onEdit,onEditRule:s},e.id)}))})}function Ek(e,t,n){let{payees:r,categories:o,accounts:i}=n;if(!t)return"";let a=null;if("payee"===e)a=r.find((e=>e.id===t));else if("category"===e)a=o.find((e=>e.id===t));else{if("account"!==e)return t;a=i.find((e=>e.id===t))}return a?a.name:"(deleted)"}function Tk(e){let{isModal:t,payeeId:n,setLoading:r}=e,[o,i]=(0,h.useState)(null),[a,l]=(0,h.useState)(null),[s,u]=(0,h.useState)(""),c=ge(),d=uj(a,["select","edit"]),{data:f}=mk.useQuery(),p=xe((e=>({payees:e.queries.payees,categories:e.queries.categories.list,accounts:e.queries.accounts,schedules:f}))),y=(0,h.useMemo)((()=>""!==s&&a?a.filter((e=>function(e,t){let n=e.conditions.flatMap((e=>[ek(e.field),tk(e.op),"oneOf"===e.op?e.value.map((n=>Ek(e.field,n,t))).join(", "):Ek(e.field,e.value,t)])),r=e.actions.flatMap((e=>{if("set"===e.op)return[tk(e.op),ek(e.field),"to",Ek(e.field,e.value,t)];if("link-schedule"===e.op){let n=t.schedules.find((t=>t.id===e.value));return[tk(e.op),wk(n,t.payees.find((e=>e.id===n._payee)))]}return[]}));return(e.stage||"")+" "+n.join(" ")+" "+r.join(" ")}(e,p).toLowerCase().includes(s.toLowerCase()))):a),[a,s,p]),g=Ax("manage-rules",o,[]),[m,v]=(0,h.useState)(null),b=(0,h.useRef)(null);async function x(){r(!0);let e=null;return e=n?await qe("payees-get-rules",{id:n}):await qe("rules-get"),i(e),e}(0,h.useEffect)((()=>(Ne("openModal","manage-rules"),async function(){let e=await x();l(e.slice(0,100)),r(!1),await c(nn())}(),()=>{Ne("openModal",null)})),[]);let w=(0,h.useCallback)((e=>{c(Nt("edit-rule",{rule:e,onSave:async e=>{let t=await x();l((n=>{let r=t.findIndex((t=>t.id===e.id));return r>n.length?t.slice(0,r+75):t.slice(0,n.length)})),r(!1)}}))}),[]);let j=(0,h.useCallback)((e=>{v(e)}),[]);return null===a?null:(0,wo.jsx)(Nx,{instance:g,children:(0,wo.jsxs)(Ll,{style:{overflow:"hidden"},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",padding:t?"0 13px 15px":"0 0 15px",flexShrink:0},children:[(0,wo.jsx)(Ll,{style:{color:go.n4,flexDirection:"row",alignItems:"center",width:"50%"},children:(0,wo.jsxs)(ql,{children:["Rules are always run in the order that you see them."," ",(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Budgeting/rules/",style:{color:go.n4},children:"Learn more"})]})}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(Vl,{placeholder:"Filter rules...",value:s,onChange:e=>{u(e.target.value),d.onEdit(null)},style:{width:350,borderColor:t?null:"transparent",backgroundColor:t?null:go.n11,":focus":t?null:{backgroundColor:"white","::placeholder":{color:go.n8}}}})]}),(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(_k,{}),(0,wo.jsx)(Ck,{ref:b,data:y,navigator:d,loadMore:function(){l(a.concat(o.slice(a.length,a.length+50)))},style:{marginBottom:-1},children:(0,wo.jsx)(Ok,{rules:y,selectedItems:g.items,navigator:d,hoveredRule:m,onHover:j,onEditRule:w})})]}),(0,wo.jsx)(Ll,{style:{paddingBlock:15,paddingInline:t?13:0,borderTop:t&&"1px solid "+go.border,flexShrink:0},children:(0,wo.jsxs)(Os,{direction:"row",align:"center",justify:"flex-end",spacing:2,children:[g.items.size>0&&(0,wo.jsxs)(zl,{onClick:async function(){r(!0);let{someDeletionsFailed:e}=await qe("rule-delete-all",[...g.items]);e&&alert("Some rules were not deleted because they are linked to schedules");let t=await x();l((e=>t.slice(0,e.length))),g.dispatch({type:"select-none"}),r(!1)},children:["Delete ",g.items.size," rules"]}),(0,wo.jsx)(zl,{primary:!0,onClick:function(){c(Nt("edit-rule",{rule:{stage:null,conditionsOp:"and",conditions:[{field:"payee",op:"is",value:n||null,type:"id"}],actions:[{op:"set",field:"category",value:null,type:"id"}]},onSave:async e=>{let t=await x();d.onEdit(e.id,"edit"),l((n=>{let r=t.findIndex((t=>t.id===e.id));return t.slice(0,r+75)})),r(!1)}}))},children:"Create new rule"})]})})]})})}function Pk(e){let{isModal:t,payeeId:n,setLoading:r=(()=>{})}=e;return(0,wo.jsx)(mk.Provider,{children:(0,wo.jsx)(Tk,{isModal:t,payeeId:n,setLoading:r})})}function Ak(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(3612);let Mk=e=>"object"==typeof e&&null!=e&&1===e.nodeType,Dk=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,Ik=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Dk(n.overflowY,t)||Dk(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Rk=(e,t,n,r,o,i,a,l)=>i<e&&a>t||i>e&&a<t?0:i<=e&&l<=n||a>=t&&l>=n?i-e-r:a>t&&l<n||i<e&&l>n?a-t+o:0,Nk=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var Lk=(e,t)=>{var n,r,o,i,a,l;if("undefined"==typeof document)return[];let{scrollMode:s,block:u,inline:c,boundary:d,skipOverflowHiddenElements:f}=t,p="function"==typeof d?d:e=>e!==d;if(!Mk(e))throw new TypeError("Invalid target");let h=document.scrollingElement||document.documentElement,y=[],g=e;for(;Mk(g)&&p(g);){if(g=Nk(g),g===h){y.push(g);break}null!=g&&g===document.body&&Ik(g)&&!Ik(document.documentElement)||null!=g&&Ik(g,f)&&y.push(g)}let m=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,b=null!=(a=window.scrollX)?a:pageXOffset,x=null!=(l=window.scrollY)?l:pageYOffset,{height:w,width:j,top:S,right:k,bottom:C,left:_}=e.getBoundingClientRect(),O="start"===u||"nearest"===u?S:"end"===u?C:S+w/2,E="center"===c?_+j/2:"end"===c?k:_,T=[];for(let P=0;P<y.length;P++){let e=y[P],{height:t,width:n,top:r,right:o,bottom:i,left:a}=e.getBoundingClientRect();if("if-needed"===s&&S>=0&&_>=0&&C<=v&&k<=m&&S>=r&&C<=i&&_>=a&&k<=o)return T;let l=getComputedStyle(e),d=parseInt(l.borderLeftWidth,10),f=parseInt(l.borderTopWidth,10),p=parseInt(l.borderRightWidth,10),g=parseInt(l.borderBottomWidth,10),A=0,M=0,D="offsetWidth"in e?e.offsetWidth-e.clientWidth-d-p:0,I="offsetHeight"in e?e.offsetHeight-e.clientHeight-f-g:0,R="offsetWidth"in e?0===e.offsetWidth?0:n/e.offsetWidth:0,N="offsetHeight"in e?0===e.offsetHeight?0:t/e.offsetHeight:0;if(h===e)A="start"===u?O:"end"===u?O-v:"nearest"===u?Rk(x,x+v,v,f,g,x+O,x+O+w,w):O-v/2,M="start"===c?E:"center"===c?E-m/2:"end"===c?E-m:Rk(b,b+m,m,d,p,b+E,b+E+j,j),A=Math.max(0,A+x),M=Math.max(0,M+b);else{A="start"===u?O-r-f:"end"===u?O-i+g+I:"nearest"===u?Rk(r,i,t,f,g+I,O,O+w,w):O-(r+t/2)+I/2,M="start"===c?E-a-d:"center"===c?E-(a+n/2)+D/2:"end"===c?E-o+p+D:Rk(a,o,n,d,p+D,E,E+j,j);let{scrollLeft:l,scrollTop:s}=e;A=Math.max(0,Math.min(s+A/N,e.scrollHeight-t/N+I)),M=Math.max(0,Math.min(l+M/R,e.scrollWidth-n/R+D)),O+=s-A,E+=l-M}T.push({el:e,top:A,left:M})}return T};var Fk=function(){return Fk=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Fk.apply(this,arguments)};Object.create;Object.create;var Bk=0;function zk(e){return"function"===typeof e?e:Uk}function Uk(){}function Wk(e,t){e&&Lk(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach((function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r}))}function Hk(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function Kk(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r(),n=setTimeout((function(){n=null,e.apply(void 0,i)}),t)}return o.cancel=r,o}function $k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some((function(t){return t&&t.apply(void 0,[e].concat(r)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault}))}}function Vk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){"function"===typeof t?t(e):t&&(t.current=e)}))}}function qk(){return String(Bk++)}function Gk(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function Yk(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function Qk(e){return"string"===typeof e.type}function Xk(e){return e.props}var Zk=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Jk(e){void 0===e&&(e={});var t={};return Zk.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function eC(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=tC(t,r)?t[r]:e[r],n}),{})}function tC(e,t){return void 0!==e[t]}function nC(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function rC(e,t,n,r,o){if(void 0===o&&(o=!0),0===n)return-1;var i=n-1;("number"!==typeof t||t<0||t>=n)&&(t=e>0?-1:i+1);var a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);var l=oC(e,a,n,r,o);return-1===l?t>=n?-1:t:l}function oC(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a<n;a++)if(!r(a).hasAttribute("disabled"))return a}else for(var l=t-1;l>=0;l--)if(!r(l).hasAttribute("disabled"))return l;return o?e>0?oC(1,0,n,r,!1):oC(-1,n-1,n,r,!1):-1}function iC(e,t,n,r){return void 0===r&&(r=!0),t.some((function(t){return t&&(Hk(t,e,n)||r&&Hk(t,n.document.activeElement,n))}))}var aC=Kk((function(e){sC(e).textContent=""}),500);function lC(e,t){var n=sC(t);e&&(n.textContent=e,aC(t))}function sC(e){void 0===e&&(e=document);var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var uC=0,cC=2,dC=3,fC=4,pC=5,hC=6,yC=7,gC=8,mC=9,vC=10,bC=11,xC=12,wC=13,jC=14,SC=Object.freeze({__proto__:null,unknown:uC,mouseUp:1,itemMouseEnter:cC,keyDownArrowUp:dC,keyDownArrowDown:fC,keyDownEscape:pC,keyDownEnter:hC,keyDownHome:yC,keyDownEnd:gC,clickItem:mC,blurInput:vC,changeInput:bC,keyDownSpaceButton:xC,clickButton:wC,blurButton:jC,controlledPropUpdatedSelectedItem:15,touchEnd:16}),kC=["refKey","ref"],CC=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],_C=["onKeyDown","onBlur","onChange","onInput","onChangeText"],OC=["refKey","ref"],EC=["onMouseMove","onMouseDown","onClick","onPress","index","item"],TC=function(){var e=function(e){function t(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+qk(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.input=null,n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var r=setTimeout((function(){n.timeoutIds=n.timeoutIds.filter((function(e){return e!==r})),e()}),t);n.timeoutIds.push(r)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=Jk(t),n.internalSetState(j({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,r){t=Jk(t),n.internalSetState(j({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),r)},n.selectItemAtIndex=function(e,t,r){var o=n.items[e];null!=o&&n.selectItem(o,t,r)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var r,o,i={},a="function"===typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,j({},n.getStateAndHelpers(),e)),n.setState((function(t){t=n.getState(t);var l=a?e(t):e;l=n.props.stateReducer(t,l),r=l.hasOwnProperty("selectedItem");var s={};return r&&l.selectedItem!==t.selectedItem&&(o=l.selectedItem),l.type=l.type||uC,Object.keys(l).forEach((function(e){t[e]!==l[e]&&(i[e]=l[e]),"type"!==e&&(l[e],tC(n.props,e)||(s[e]=l[e]))})),a&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,j({},n.getStateAndHelpers(),l)),s}),(function(){zk(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),r&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==o&&n.props.onChange(o,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())}))},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,l=o.ref,s=S(o,kC),u=(void 0===t?{}:t).suppressRefError,c=void 0!==u&&u;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=c;var d=n.getState().isOpen;return j(((r={})[a]=Vk(l,n.rootRef),r.role="combobox",r["aria-expanded"]=d,r["aria-haspopup"]="listbox",r["aria-owns"]=d?n.menuId:null,r["aria-labelledby"]=n.labelId,r),s)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:fC})}else this.internalSetState({isOpen:!0,type:fC},(function(){var e=t.getItemCount();if(e>0){var n=rC(1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:fC})}}))},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:dC})}else this.internalSetState({isOpen:!0,type:dC},(function(){var e=t.getItemCount();if(e>0){var n=rC(-1,t.getState().highlightedIndex,e,(function(e){return t.getItemNodeFromIndex(e)}));t.setHighlightedIndex(n,{type:dC})}}))},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,r=t.highlightedIndex;if(n&&null!=r){e.preventDefault();var o=this.items[r],i=this.getItemNodeFromIndex(r);if(null==o||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:hC})}}},Escape:function(e){e.preventDefault(),this.reset(j({type:pC},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=j({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:xC})}}),n.inputKeyDownHandlers=j({},n.keyDownHandlers,{Home:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=oC(1,0,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:yC})}}},End:function(e){var t=this,n=this.getState().isOpen;if(n){e.preventDefault();var r=this.getItemCount();if(!(r<=0)&&n){var o=oC(-1,r-1,r,(function(e){return t.getItemNodeFromIndex(e)}),!1);this.setHighlightedIndex(o,{type:gC})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,r=t.onClick;t.onPress;var o=t.onKeyDown,i=t.onKeyUp,a=t.onBlur,l=S(t,CC),s=n.getState().isOpen,u={onClick:$k(r,n.buttonHandleClick),onKeyDown:$k(o,n.buttonHandleKeyDown),onKeyUp:$k(i,n.buttonHandleKeyUp),onBlur:$k(a,n.buttonHandleBlur)};return j({type:"button",role:"button","aria-label":s?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},l.disabled?{}:u,l)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=nC(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(Ak(n),e)},n.buttonHandleClick=function(e){e.preventDefault(),n.props.environment.document.activeElement===n.props.environment.document.body&&e.target.focus(),n.internalSetTimeout((function(){return n.toggleMenu({type:wC})}))},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout((function(){n.isMouseDown||null!=n.props.environment.document.activeElement&&n.props.environment.document.activeElement.id===n.inputId||n.props.environment.document.activeElement===t||n.reset({type:jC})}))},n.getLabelProps=function(e){return j({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,r=t.onKeyDown,o=t.onBlur,i=t.onChange,a=t.onInput;t.onChangeText;var l=S(t,_C),s={};var u,c=n.getState(),d=c.inputValue,f=c.isOpen,p=c.highlightedIndex;l.disabled||((u={}).onChange=$k(i,a,n.inputHandleChange),u.onKeyDown=$k(r,n.inputHandleKeyDown),u.onBlur=$k(o,n.inputHandleBlur),s=u);return j({"aria-autocomplete":"list","aria-activedescendant":f&&"number"===typeof p&&p>=0?n.getItemId(p):null,"aria-controls":f?n.menuId:null,"aria-labelledby":l&&l["aria-label"]?void 0:n.labelId,autoComplete:"off",value:d,id:n.inputId},s,l)},n.inputHandleKeyDown=function(e){var t=nC(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(Ak(n),e)},n.inputHandleChange=function(e){n.internalSetState({type:bC,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout((function(){var e=n.props.environment.document&&!!n.props.environment.document.activeElement&&!!n.props.environment.document.activeElement.dataset&&n.props.environment.document.activeElement.dataset.toggle&&n._rootNode&&n._rootNode.contains(n.props.environment.document.activeElement);n.isMouseDown||e||n.reset({type:vC})}))},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var r,o=void 0===e?{}:e,i=o.refKey,a=void 0===i?"ref":i,l=o.ref,s=S(o,OC),u=(void 0===t?{}:t).suppressRefError,c=void 0!==u&&u;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=c,j(((r={})[a]=Vk(l,n.menuRef),r.role="listbox",r["aria-labelledby"]=s&&s["aria-label"]?null:n.labelId,r.id=n.menuId,r),s)},n.getItemProps=function(e){var t,r=void 0===e?{}:e,o=r.onMouseMove,i=r.onMouseDown,a=r.onClick;r.onPress;var l=r.index,s=r.item,u=void 0===s?void 0:s,c=S(r,EC);void 0===l?(n.items.push(u),l=n.items.indexOf(u)):n.items[l]=u;var d=a,f=((t={onMouseMove:$k(o,(function(){l!==n.getState().highlightedIndex&&(n.setHighlightedIndex(l,{type:cC}),n.avoidScrolling=!0,n.internalSetTimeout((function(){return n.avoidScrolling=!1}),250))})),onMouseDown:$k(i,(function(e){e.preventDefault()}))}).onClick=$k(d,(function(){n.selectItemAtIndex(l,{type:mC})})),t),p=c.disabled?{onMouseDown:f.onMouseDown}:f;return j({id:n.getItemId(l),role:"option","aria-selected":n.getState().highlightedIndex===l},p,c)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=Jk(e),n.internalSetState((function(t){var r=t.selectedItem;return j({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(r)},e)}),t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=Jk(e),n.internalSetState((function(t){var r=t.isOpen;return j({isOpen:!r},r&&{highlightedIndex:n.props.defaultHighlightedIndex},e)}),(function(){var r=n.getState(),o=r.isOpen,i=r.highlightedIndex;o&&n.getItemCount()>0&&"number"===typeof i&&n.setHighlightedIndex(i,e),zk(t)()}))},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=Kk((function(){var e=n.getState(),t=n.items[e.highlightedIndex],r=n.getItemCount(),o=n.props.getA11yStatusMessage(j({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:t},e));n.previousResultCount=r,lC(o,n.props.environment.document)}),200);var r=n.props,o=r.defaultHighlightedIndex,i=r.initialHighlightedIndex,a=void 0===i?o:i,l=r.defaultIsOpen,s=r.initialIsOpen,u=void 0===s?l:s,c=r.initialInputValue,d=void 0===c?"":c,f=r.initialSelectedItem,p=void 0===f?null:f,h=n.getState({highlightedIndex:a,isOpen:u,inputValue:d,selectedItem:p});return null!=h.selectedItem&&void 0===n.props.initialInputValue&&(h.inputValue=n.props.itemToString(h.selectedItem)),n.state=h,n}Eo(t,e);var n=t.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach((function(e){clearTimeout(e)})),this.timeoutIds=[]},n.getState=function(e){return void 0===e&&(e=this.state),eC(e,this.props)},n.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},n.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},n.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},n.moveHighlightedIndex=function(e,t){var n=this,r=this.getItemCount(),o=this.getState().highlightedIndex;if(r>0){var i=rC(e,o,r,(function(e){return n.getItemNodeFromIndex(e)}));this.setHighlightedIndex(i,t)}},n.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,r=e.selectedItem,o=e.isOpen,i=this.props.itemToString,a=this.id,l=this.getRootProps,s=this.getToggleButtonProps,u=this.getLabelProps,c=this.getMenuProps,d=this.getInputProps,f=this.getItemProps,p=this.openMenu,h=this.closeMenu,y=this.toggleMenu,g=this.selectItem,m=this.selectItemAtIndex,v=this.selectHighlightedItem,b=this.setHighlightedIndex,x=this.clearSelection,w=this.clearItems;return{getRootProps:l,getToggleButtonProps:s,getLabelProps:u,getMenuProps:c,getInputProps:d,getItemProps:f,reset:this.reset,openMenu:p,closeMenu:h,toggleMenu:y,selectItem:g,selectItemAtIndex:m,selectHighlightedItem:v,setHighlightedIndex:b,clearSelection:x,clearItems:w,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:o,selectedItem:r}},n.componentDidMount=function(){var e=this;var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!iC(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},r=function(){e.isTouchMove=!1},o=function(){e.isTouchMove=!0},i=function(t){var n=iC(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",r),a.addEventListener("touchmove",o),a.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",r),a.removeEventListener("touchmove",o),a.removeEventListener("touchend",i)}},n.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,r=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==r},n.componentDidUpdate=function(e,t){tC(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var e=Yk(this.props.children,Uk);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=Yk(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:Qk(t)?(0,h.cloneElement)(t,this.getRootProps(Xk(t))):void 0:null},t}(h.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:Gk,itemToString:function(e){return null==e?"":String(e)},onStateChange:Uk,onInputValueChange:Uk,onUserAction:Uk,onChange:Uk,onSelect:Uk,onOuterClick:Uk,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"===typeof window?{}:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:Wk},e.stateChangeTypes=SC,e}(),PC=TC;Kk((function(e,t){lC(e(),t)}),200),"undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?h.useLayoutEffect:h.useEffect;var AC={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""},scrollIntoView:Wk,environment:"undefined"===typeof window?{}:window};oi().array.isRequired,oi().func,oi().func,oi().func,oi().number,oi().number,oi().number,oi().bool,oi().bool,oi().bool,oi().any,oi().any,oi().any,oi().string,oi().string,oi().string,oi().func,oi().string,oi().func,oi().func,oi().func,oi().func,oi().func,oi().shape({addEventListener:oi().func,removeEventListener:oi().func,document:oi().shape({getElementById:oi().func,activeElement:oi().any,body:oi().any})});Fk(Fk({},AC),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}});oi().array.isRequired,oi().func,oi().func,oi().func,oi().func,oi().number,oi().number,oi().number,oi().bool,oi().bool,oi().bool,oi().any,oi().any,oi().any,oi().string,oi().string,oi().string,oi().string,oi().string,oi().string,oi().func,oi().string,oi().string,oi().func,oi().func,oi().func,oi().func,oi().func,oi().func,oi().shape({addEventListener:oi().func,removeEventListener:oi().func,document:oi().shape({getElementById:oi().func,activeElement:oi().any,body:oi().any})});j({},AC,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:Gk});oi().array,oi().array,oi().array,oi().func,oi().func,oi().func,oi().number,oi().number,oi().number,oi().func,oi().func,oi().string,oi().string,oi().shape({addEventListener:oi().func,removeEventListener:oi().func,document:oi().shape({getElementById:oi().func,activeElement:oi().any,body:oi().any})});const MC={};function DC(e,t,n){if(e){let e=t.findIndex((e=>e.id===n));return-1===e?null:t[e]}return n}function IC(e){return null==e?"":"string"===typeof e?e:e.name||""}function RC(e){return"string"===typeof e?e:e?e.id:null}function NC(e,t){return IC(e).toLowerCase().includes(t.toLowerCase())}function LC(e,t){return e.filter((e=>NC(e,t)))}function FC(e,t,n,r,o){let i=null;if(t)if(null==r){let e=n.find((e=>e.id===o));e&&(i=e.id)}else r<n.length&&(i=n[r].id);else i=o;e&&e(i,o)}function BC(e){return(0,wo.jsx)(Vl,{...e})}function zC(e,t,n){return(0,wo.jsx)("div",{children:e.map(((e,r)=>{let o=IC(e);return(0,h.createElement)("div",{...t({item:e}),key:o,...(0,lo.iv)({padding:5,cursor:"default",backgroundColor:n===r?go.n4:null})},o)}))})}function UC(e){return"Enter"===e.code}function WC(e){return e?IC(e):""}function HC(e){let{focused:t,embedded:n=!1,containerProps:r,labelProps:o={},inputProps:i={},suggestions:a,tooltipStyle:l,tooltipProps:s,renderInput:u=BC,renderItems:c=zC,itemToString:d=WC,shouldSaveFromKey:f=UC,filterSuggestions:p=LC,openOnFocus:y=!0,getHighlightedIndex:g,highlightFirst:m,onUpdate:v,strict:b,onSelect:x,tableBehavior:w,value:j,isMulti:S=!1}=e;const[k,C]=(0,h.useState)((()=>DC(b,a,j))),[_,O]=(0,h.useState)(k?IC(k):""),[E,T]=(0,h.useState)(!1),[P,A]=(0,h.useState)(k),M=(0,h.useMemo)((()=>p(a,_)),[p,a,_]),[D,I]=(0,h.useState)(null),[R,N]=(0,h.useState)(n);(0,h.useEffect)((()=>{C(DC(b,a,j))}),[j,a,b]);const L=E&&M||a;return(0,wo.jsx)(PC,{onSelect:(e,t)=>{let{inputValue:n}=t;C(e),I(null),S?O(""):N(!1),x&&setTimeout((()=>{x(RC(e),n)}),0)},highlightedIndex:D,selectedItem:k||null,itemToString:d,inputValue:_,isOpen:R,onInputValueChange:(e,t)=>{if(!document.hasFocus())return;if([PC.stateChangeTypes.controlledPropUpdatedSelectedItem,PC.stateChangeTypes.touchEnd].includes(t.type))return;const n=p(a,e);if(""===e)t.type!==PC.stateChangeTypes.clickItem&&FC(v,b,n,null,null),I(null);else{let r=e=>m&&e.length?0:null,o=(g||r)(n);t.type!==PC.stateChangeTypes.clickItem&&FC(v,b,n,o,e),I(o)}O(e),T(!0)},onStateChange:e=>{w&&e.type===PC.stateChangeTypes.mouseUp||("highlightedIndex"in e&&e.type!==PC.stateChangeTypes.changeInput&&I(e.highlightedIndex),"selectedItem"in e&&C(e.selectedItem),!R||e.type!==PC.stateChangeTypes.keyDownArrowUp&&e.type!==PC.stateChangeTypes.keyDownArrowDown||FC(v,b,M||a,null!=e.highlightedIndex?e.highlightedIndex:D,_),MC.lastChangeType=e.type)},labelId:null===o||void 0===o?void 0:o.id,children:e=>{let{getInputProps:o,getItemProps:d,isOpen:p,inputValue:h,highlightedIndex:g}=e;return(0,wo.jsxs)("div",{className:"view "+(0,lo.iv)({display:"flex"}).toString(),...r,children:[u(o({focused:t,...i,onFocus:e=>{i.onFocus&&i.onFocus(e),y&&N(!0)},onBlur:e=>{if(e.preventDownshiftDefault=!0,i.onBlur&&i.onBlur(e),w)N(!1);else{if(""===e.target.value)return x&&x(null,e.target.value),C(null),void N(!1);!function(e){let t=DC(b,a,void 0===e?j:e);C(t),O(t?IC(t):""),A(t),I(null),N(n),T(!1)}(k?RC(k):null)}},onKeyDown:e=>{let{onKeyDown:t}=i||{};if(p)if("Enter"===e.key)if(null!=g)MC.lastChangeType===PC.stateChangeTypes.itemMouseEnter?e.preventDefault():e.stopPropagation();else{if(!b)return e.stopPropagation(),x(_,e.target.value),O(""),C(null),I(null),void T(!1);e.preventDefault(),t&&t(e)}else f(e)&&(e.preventDefault(),t&&t(e));"Escape"===e.key&&(e.nativeEvent.preventDownshiftDefault=!0,n||e.stopPropagation(),FC(v,b,a,null,RC(P)),O(IC(P)),C(DC(b,a,P)),I(null),N(!!n))},onChange:e=>{const{onChange:t}=i||{};t&&t(e.target.value)}})),p&&L.length>0&&(n?(0,wo.jsx)(Ll,{style:{marginTop:5},"data-testid":"autocomplete",children:c(L,d,g,h)}):(0,wo.jsx)(Ps,{position:"bottom-stretch",offset:2,style:{padding:0,backgroundColor:go.n1,color:"white",minWidth:200,...l},...s,"data-testid":"autocomplete",children:c(L,d,g,h)}))]})}})}function KC(e){let{name:t,onRemove:n}=e;return(0,wo.jsxs)(Ll,{style:{alignItems:"center",flexDirection:"row",backgroundColor:go.b9,padding:"2px 4px",margin:"2px",borderRadius:4},children:[t,(0,wo.jsx)(zl,{type:"button",bare:!0,style:{marginLeft:1},onClick:n,children:(0,wo.jsx)(ew,{style:{width:8,height:8}})})]})}function $C(e){let{value:t,onSelect:n,suggestions:r,strict:o,...i}=e,[a,l]=(0,h.useState)(!1),s=(0,h.useRef)();function u(e){let r=t.filter((t=>t!==e));n(r)}return(0,h.useEffect)((()=>{s.current=t})),(0,wo.jsx)(GC,{...i,isMulti:!0,value:null,suggestions:r.filter((e=>!t.includes(RC(e)))),onSelect:function(e){e&&(e=e.trim(),n([...t,e],e))},highlightFirst:!0,strict:o,tooltipProps:{forceLayout:s.current!==t},renderInput:e=>(0,wo.jsxs)(Ll,{style:[{display:"flex",flexWrap:"wrap",flexDirection:"row",alignItems:"center",backgroundColor:"white",borderRadius:4,border:"1px solid #d0d0d0"},a&&{border:"1px solid "+go.b5,boxShadow:"0 1px 1px "+go.b7}],children:[t.map(((e,t)=>(e=DC(o,r,e))&&(0,wo.jsx)(KC,{name:IC(e),onRemove:()=>u(RC(e))},RC(e)||t))),(0,wo.jsx)(Vl,{...e,onKeyDown:n=>function(e,n){"Backspace"===e.key&&""===e.target.value&&u(t[t.length-1]),n&&n(e)}(n,e.onKeyDown),onFocus:t=>{l(!0),e.onFocus(t)},onBlur:t=>{l(!1),e.onBlur(t)},style:[{flex:1,minWidth:30,border:0,":focus":{border:0,boxShadow:"none"}},e.style]})]})})}function VC(e){let{title:t,style:n,hoveredStyle:r,onClick:o}=e;return(0,wo.jsx)(zl,{style:[{fontSize:12,color:go.n10,backgroundColor:"transparent",borderColor:go.n5},n],hoveredStyle:[{backgroundColor:"rgba(200, 200, 200, .25)"},r],onClick:o,children:t})}function qC(e){let{show:t=!0,embedded:n,children:r}=e;return t&&(0,wo.jsx)(Ll,{style:[{flexShrink:0},n?{paddingTop:5}:{padding:5}],onMouseDown:e=>e.preventDefault(),children:r})}function GC(e){let{multi:t,...n}=e;return t?(0,wo.jsx)($C,{...n}):(0,wo.jsx)(HC,{...n})}function YC(e){let{items:t,getItemProps:n,highlightedIndex:r,embedded:o}=e,i=null;return(0,wo.jsx)(Ll,{children:(0,wo.jsx)(Ll,{style:[{overflow:"auto",padding:"5px 0"},!o&&{maxHeight:175}],children:t.map(((e,t)=>{const a=!i||e.offbudget!==i.offbudget,l=e.offbudget?"Off Budget":"For Budget";return i=e,[a?(0,wo.jsx)("div",{style:{color:go.y9,padding:"4px 9px"},"data-testid":"account-item-group",children:l},l):null,(0,h.createElement)("div",{...n?n({item:e}):null,key:e.id,style:{backgroundColor:r===t?go.n4:"transparent",padding:4,paddingLeft:20,borderRadius:o?4:0},"data-testid":"account-item"+(r===t?"-highlighted":"")},e.name)]}))})})}function QC(e){let{embedded:t,includeClosedAccounts:n=!0,...r}=e,o=yf()||[];return(0,wo.jsx)(GC,{strict:!0,highlightFirst:!0,embedded:t,suggestions:n?o:o.filter((e=>!1===e.closed)),renderItems:(e,n,r)=>(0,wo.jsx)(YC,{items:e,getItemProps:n,highlightedIndex:r,embedded:t}),...r})}var XC=e=>(0,wo.jsx)("svg",{...e,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m30 9-4-4M30 9l-4 4M6 5 2 9M2 9l4 4M10 9H3M22 9h7M16 15l6-6M16 15l-6-6M16 28V15",fill:"none",stroke:"currentColor",strokeWidth:3.5,strokeMiterlimit:10,strokeLinecap:"round"})});const ZC=h.forwardRef(((e,t)=>{let{categoryGroups:n,emptyLabel:r,...o}=e;return(0,wo.jsxs)(zs,{...o,ref:t,children:[(0,wo.jsx)("option",{value:"",children:r||"Select category..."}),n.map((e=>(0,wo.jsx)("optgroup",{label:e.name,children:e.categories.map((e=>(0,wo.jsx)("option",{value:e.id,children:e.name},e.id)))},e.id)))]})}));function JC(e){let{items:t,getItemProps:n,highlightedIndex:r,embedded:o,footer:i}=e,a=null;return(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(Ll,{style:[{overflow:"auto",padding:"5px 0"},!o&&{maxHeight:175}],children:t.map(((e,t)=>{if("split"===e.id)return(0,wo.jsxs)(Ll,{...n?n({item:e}):null,style:{backgroundColor:r===t?go.n4:"transparent",borderRadius:o?4:0,flexShrink:0,flexDirection:"row",alignItems:"center",fontSize:11,fontWeight:500,color:go.g8,padding:"6px 8px"},"data-testid":"split-transaction-button",children:[(0,wo.jsx)(ql,{style:{lineHeight:0},children:(0,wo.jsx)(XC,{width:10,height:10,style:{marginRight:5,color:"inherit"}})}),"Split Transaction"]},"split");const i=e.cat_group!==a;return a=e.cat_group,(0,wo.jsxs)(h.Fragment,{children:[i&&(0,wo.jsx)("div",{style:{color:go.y9,padding:"4px 9px"},"data-testid":"category-item-group",children:e.groupName}),(0,wo.jsx)("div",{...n?n({item:e}):null,style:{backgroundColor:r===t?go.n4:"transparent",padding:4,paddingLeft:20,borderRadius:o?4:0},"data-testid":"category-item"+(r===t?"-highlighted":""),children:e.name})]},e.id)}))}),i]})}function e_(e){let{categoryGroups:t,showSplitOption:n,embedded:r,onSplit:o,...i}=e,a=(0,h.useMemo)((()=>t.reduce(((e,t)=>e.concat(t.categories.map((e=>({...e,groupName:t.name}))))),n?[{id:"split",name:""}]:[])),[t]);return(0,wo.jsx)(GC,{strict:!0,highlightFirst:!0,embedded:r,getHighlightedIndex:e=>0===e.length?null:"split"===e[0].id?e.length>1?1:null:0,filterSuggestions:(e,t)=>e.filter((e=>"split"===e.id||NC(e,t)||e.groupName.toLowerCase().includes(t.toLowerCase()))),suggestions:a,renderItems:(e,t,n)=>(0,wo.jsx)(JC,{items:e,embedded:r,getItemProps:t,highlightedIndex:n}),...i})}function t_(e,t){return"new"!==e||t.startsWith("new:")?e:"new:"+t}function n_(e){return"string"===typeof e&&e.startsWith("new:")?"new":e}function r_(e){let{items:t,getItemProps:n,highlightedIndex:r,embedded:o,inputValue:i,footer:a}=e,l=t.filtered,s=null;if(t=[...t],"new"===t[0].id){let[e,...n]=t;s=e,t=n}let u=s?1:0,c=null;return(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)(Ll,{style:[{overflow:"auto",padding:"5px 0"},!o&&{maxHeight:175}],children:[s&&(0,wo.jsx)(Ll,{...n?n({item:s}):null,style:{flexShrink:0,padding:"6px 9px",backgroundColor:0===r?go.n4:"transparent",borderRadius:o?4:0},children:(0,wo.jsxs)(Ll,{style:{display:"block",color:go.g8,borderRadius:4,fontSize:11,fontWeight:500},children:[(0,wo.jsx)(Vx,{width:8,height:8,style:{color:go.g8,marginRight:5,display:"inline-block"}}),"Create Payee \u201c",i,"\u201d"]})}),t.map(((e,i)=>{let a,s=e.transfer_acct?"account":"payee";"payee"===s&&c!==s?a="Payees":"account"===s&&c!==s&&(a="Transfer To/From");let d=i===t.length-1&&l;return c=s,(0,wo.jsxs)(h.Fragment,{children:[a&&(0,wo.jsx)("div",{style:{color:go.y9,padding:"4px 9px"},children:a},"title-"+i),(0,h.createElement)("div",{...n?n({item:e}):null,key:e.id,style:{backgroundColor:r===i+u?go.n4:"transparent",borderRadius:o?4:0,padding:4,paddingLeft:20}},e.name),d&&(0,wo.jsx)("div",{style:{fontSize:11,padding:5,color:go.n5,textAlign:"center"},children:"More payees are available, search to find them"})]},e.id)}))]}),a]})}function o_(e){let{value:t,inputProps:n,showMakeTransfer:r=!0,showManagePayees:o=!1,defaultFocusTransferPayees:i=!1,tableBehavior:a,embedded:l,onUpdate:s,onSelect:u,onManagePayees:c,...d}=e,f=bf(),p=yf(),[y,g]=(0,h.useState)(i),[m,v]=(0,h.useState)(""),b=!!m,x=(0,h.useMemo)((()=>{const e=function(e,t,n){let r=n?to(e,n):e;return t&&r&&(r=r.filter((e=>!!e.transfer_acct))),r||[]}(f,y,p);return b?[{id:"new",name:""},...e]:e}),[f,y,p,b]),w=ge();const[j,S]=(0,h.useState)(!1);return(0,wo.jsx)(GC,{strict:!0,embedded:l,value:n_(t),suggestions:x,tableBehavior:a,itemToString:e=>e?"new"===e.id?m:e.name:"",focused:j,inputProps:{...n,onBlur:()=>{v(""),S(!1)},onFocus:()=>S(!0),onChange:v},onUpdate:(e,t)=>s&&s(t_(e,t)),onSelect:async function(e,t){if(a)u&&u(t_(e,t));else{let n=()=>w(rn(t));Array.isArray(e)?e=await Promise.all(e.map((e=>"new"===e?n():e))):"new"===e&&(e=await n()),u&&u(e)}},getHighlightedIndex:e=>e.length>1&&"new"===e[0].id?1:0,filterSuggestions:(e,t)=>{let n=e.filter((e=>"new"===e.id?!(!t||""===t||y):NC(e,t)));n.sort(((e,n)=>{let r=e.name.toLowerCase().startsWith(t.toLowerCase()),o=n.name.toLowerCase().startsWith(t.toLowerCase()),i=e.name.toLowerCase()===t.toLowerCase(),a=n.name.toLowerCase()===t.toLowerCase();return"new"===e.id?-1:"new"===n.id?1:i&&!a?-1:!i&&a?1:r===o?0:r&&!o?-1:1}));let r=n.length>100;return n=n.slice(0,100),n.filtered=r,n.length>=2&&"new"===n[0].id&&n[1].name.toLowerCase()===t.toLowerCase()&&!n[1].transfer_acct?n.slice(1):n},renderItems:(e,t,n,i)=>(0,wo.jsx)(r_,{items:e,getItemProps:t,highlightedIndex:n,inputValue:i,embedded:l,footer:(0,wo.jsxs)(qC,{embedded:l,children:[r&&(0,wo.jsx)(VC,{title:"Make Transfer",style:[o&&{marginBottom:5},y&&{backgroundColor:go.y8,color:go.g2,borderColor:go.y8}],hoveredStyle:y&&{backgroundColor:go.y8,colors:go.y2},onClick:()=>{s&&s(null),g(!y)}}),o&&(0,wo.jsx)(VC,{title:"Manage Payees",onClick:()=>c()})]})}),...d},y?"transfers":"all")}var i_=n(8582),a_=n.n(i_);let l_={"& .pika-single.actual-date-picker":{color:go.n11,background:go.n1,border:"none",boxShadow:"0 0px 4px rgba(0, 0, 0, .25)",borderRadius:4},"& .actual-date-picker":{"& .pika-lendar":{float:"none",width:"auto"},"& .pika-label":{backgroundColor:go.n1},"& .pika-prev":{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAQ0lEQVR4Ae3KIQ4AIBTD0N0/IeHGI3UIRA3ut/Zl+ltXc5++htVAmIAwAWECwgSEKbgthEoIlRAqIVRCqINQB9nDgQd7ktwFo6UpWQAAAABJRU5ErkJggg==)"},"& .pika-next":{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAQAAACGG/bgAAAAP0lEQVQ4y+3TMQoAMAgEwfwfAvvjTZ1uGzuvHhBPPGczEG+FRqqRaqQaqUaqkX6QBmmjacvQ6qEVTjsh+xizebvlaWptGXZAAAAAAElFTkSuQmCC)"},"& .pika-table th":{color:go.n11,"& abbr":{textDecoration:"none"}},"& .pika-button":{backgroundColor:go.n2,color:go.n11},"& .is-today .pika-button":{textDecoration:"underline"},"& .is-selected .pika-button":{backgroundColor:go.n5,boxShadow:"none"}}},s_=h.forwardRef(((e,t)=>{let{value:n,firstDayOfWeekIdx:r,dateFormat:o,onUpdate:i,onSelect:a}=e,l=(0,h.useRef)(null),s=(0,h.useRef)(null);return(0,h.useImperativeHandle)(t,(()=>({handleInputKeyDown(e){let t=null;switch(e.key){case"ArrowLeft":e.preventDefault(),t=qp(l.current.getDate(),1);break;case"ArrowUp":e.preventDefault(),t=qp(l.current.getDate(),7);break;case"ArrowRight":e.preventDefault(),t=Vp(l.current.getDate(),1);break;case"ArrowDown":e.preventDefault(),t=Vp(l.current.getDate(),7)}t&&(l.current.setDate(t,!0),i&&i(t))}})),[]),(0,h.useLayoutEffect)((()=>(l.current=new(a_())({theme:"actual-date-picker",keyboardInput:!1,firstDay:Kr(r),defaultDate:n?tx(n,o,new Date):new Date,setDefaultDate:!0,toString(e){return Hp(e,o)},parse(e){return tx(e,o,new Date)},onSelect:a}),s.current.appendChild(l.current.el),()=>{l.current.destroy()})),[]),(0,h.useEffect)((()=>{l.current.getDate()!==n&&l.current.setDate(tx(n,o,new Date),!0)}),[n,o]),(0,wo.jsx)(Ll,{style:[l_,{flex:1}],innerRef:s})}));function u_(e){return"Enter"===e.key}function c_(e){let{containerProps:t,inputProps:n,tooltipStyle:r,value:o,isOpen:i,embedded:a,dateFormat:l="yyyy-MM-dd",focused:s,openOnFocus:u=!0,inputRef:c,shouldSaveFromKey:d=u_,tableBehavior:f,onUpdate:p,onSelect:y}=e,g=(0,h.useMemo)((()=>{if(o){let e=lk(o);if(Uf(e))return Hp(e,l)}return""}),[o,l]),m=(0,h.useRef)(null),[v,b]=(0,h.useState)(g),[x,w]=(0,h.useState)(a||i||!1),j=(0,h.useRef)(null);(0,h.useLayoutEffect)((()=>{c&&(c.current=j.current)}),[]);let[S,k]=(0,h.useState)(v),C=(0,h.useRef)(S);const _=xe((e=>{var t;return null!==(t=e.prefs.local)&&void 0!==t&&t.firstDayOfWeekIdx?e.prefs.local.firstDayOfWeekIdx:"0"}));(0,h.useEffect)((()=>{C.current=v}),[v]),(0,h.useEffect)((()=>b(g)),[g]),(0,h.useEffect)((()=>{if(hh(l).test(v)){let e=tx(v,ph(l),new Date);Uf(e)&&(p&&p(Hp(e,"yyyy-MM-dd")),k(Hp(e,l)))}else if(mh(l).test(v)){let e=tx(v,gh(l),new Date);Uf(e)&&(p&&p(Hp(e,"yyyy-MM-dd")),k(Hp(e,l)))}else{let e=tx(v,l,new Date);if(Uf(e)){let t=Hp(e,"yyyy-MM-dd");p&&p(t),k(v)}}}),[v]);return(0,wo.jsxs)(Ll,{...t,children:[(0,wo.jsx)(Vl,{focused:s,...n,inputRef:j,value:v,onKeyDown:function(e){if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)||e.shiftKey||e.metaKey||e.altKey||!x)if("Escape"===e.key)b(g),k(g),g===v?x&&(a||e.stopPropagation(),w(!1)):(w(!0),p&&p(o));else if(d(e)){b(S),w(!1);let t=tx(S,l,new Date);y(Hp(t,"yyyy-MM-dd")),x&&C.current!==S&&(e.stopPropagation(),e.preventDefault());let{onKeyDown:r}=n||{};r&&r(e)}else x||(w(!0),j.current&&j.current.setSelectionRange(0,1e4));else m.current.handleInputKeyDown(e)},onChange:function(e){b(e.target.value)},onFocus:e=>{!a&&u&&w(!0),n&&n.onFocus&&n.onFocus(e)},onBlur:e=>{if(a||w(!1),n&&n.onBlur&&n.onBlur(e),!f)if(""===v)k(null),y(null);else{b(S||"");let e=tx(S,l,new Date);e instanceof Date&&!isNaN(e)&&y(Hp(e,"yyyy-MM-dd"))}}}),x&&(O=(0,wo.jsx)(s_,{ref:m,value:S,firstDayOfWeekIdx:_,dateFormat:l,onUpdate:e=>{k(Hp(e,l)),p&&p(Hp(e,"yyyy-MM-dd"))},onSelect:e=>{b(Hp(e,l)),y(Hp(e,"yyyy-MM-dd")),w(!1)}}),a?O:(0,wo.jsx)(Ps,{position:"bottom-left",offset:2,style:[{padding:0,minWidth:225},r],children:O}))]});var O}var d_=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M23 11.5a1.5 1.5 0 0 1-1.5 1.5h-20a1.5 1.5 0 0 1 0-3h20a1.5 1.5 0 0 1 1.5 1.5Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M11.5 23a1.5 1.5 0 0 1-1.5-1.5v-20a1.5 1.5 0 0 1 3 0v20a1.5 1.5 0 0 1-1.5 1.5Z",fill:"currentColor"})]});var f_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M23 11.5a1.5 1.5 0 0 1-1.5 1.5h-20a1.5 1.5 0 0 1 0-3h20a1.5 1.5 0 0 1 1.5 1.5Z",fill:"currentColor"})});const p_=5,h_=[{id:"daily",name:"Days"},{id:"weekly",name:"Weeks"},{id:"monthly",name:"Months"},{id:"yearly",name:"Years"}],y_=[...Array(31).keys()].map((e=>e+1)),g_=[{id:"SU",name:"Sunday"},{id:"MO",name:"Monday"},{id:"TU",name:"Tuesday"},{id:"WE",name:"Wednesday"},{id:"TH",name:"Thursday"},{id:"FR",name:"Friday"},{id:"SA",name:"Saturday"}];function m_(e){return e||{start:Jp(),interval:1,frequency:"monthly",patterns:[b_(Jp())]}}function v_(e){return{...e,interval:S_(e.interval)}}function b_(e){return{value:parseInt(fh(e,"d")),type:"day"}}function x_(e){let{field:t,value:n,recurrence:r}=e;return"value"===t&&"day"!==r.type&&n>p_||"type"===t&&"day"!==n&&r.value>p_?{[t]:n,value:p_}:{[t]:n}}function w_(e,t){switch(t.type){case"replace-config":return{...e,config:t.config};case"change-field":return{...e,config:{...e.config,[t.field]:t.value,patterns:"monthly"!==e.config.frequency?[]:e.config.patterns}};case"update-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.map((e=>e===t.recurrence?{...t.recurrence,...x_(t)}:e))}};case"add-recurrence":return{...e,config:{...e.config,patterns:[...e.config.patterns||[],b_(e.config.start)]}};case"remove-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.filter((e=>e!==t.recurrence))}};default:return e}}function j_(e){let{previewDates:t}=e;const n=xe((e=>(e.prefs.local.dateFormat||"MM/dd/yyyy").replace("MM","M").replace("dd","d")));if(!t)return null;let r=null;return r="string"===typeof t?(0,wo.jsx)(ql,{children:t}):(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(ql,{style:{fontWeight:600},children:"Upcoming dates"}),(0,wo.jsx)(Os,{direction:"row",spacing:4,style:{marginTop:10},children:t.map((e=>(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(ql,{children:fh(e,n)}),(0,wo.jsx)(ql,{children:fh(e,"EEEE")})]})))})]}),(0,wo.jsx)(Os,{direction:"column",spacing:1,style:{marginTop:15,color:go.n4},children:r})}function S_(e){const t=parseInt(e);return Number.isInteger(t)&&t>0?t:1}function k_(e){let{config:t,dispatch:n}=e,r=(e,t,r)=>n({type:"update-recurrence",recurrence:e,field:t,value:r});return(0,wo.jsx)(Os,{spacing:2,style:{marginTop:10},children:t.patterns.map(((e,t)=>(0,wo.jsxs)(Ll,{style:{display:"flex",flexDirection:"row"},children:[(0,wo.jsxs)(zs,{style:{marginRight:10},value:e.value,onChange:t=>r(e,"value",function(e){return"last"===e?-1:Number(e)}(t.target.value)),children:[(0,wo.jsx)("option",{value:-1,children:"Last"}),(0,wo.jsx)("option",{disabled:!0,children:"---"}),y_.map((e=>(0,wo.jsx)("option",{value:e,children:e},e)))]}),(0,wo.jsxs)(zs,{style:{marginRight:10},value:e.type,onChange:t=>r(e,"type",t.target.value),children:[(0,wo.jsx)("option",{value:"day",children:"Day"}),(0,wo.jsx)("option",{disabled:!0,children:"---"}),g_.map((e=>(0,wo.jsx)("option",{value:e.id,children:e.name},e.id)))]}),(0,wo.jsx)(zl,{bare:!0,style:{padding:7},onClick:()=>n({type:"remove-recurrence",recurrence:e}),children:(0,wo.jsx)(f_,{style:{width:8,height:8}})}),(0,wo.jsx)(zl,{bare:!0,style:{padding:7,marginLeft:5},onClick:()=>n({type:"add-recurrence"}),children:(0,wo.jsx)(d_,{style:{width:10,height:10}})})]},t)))})}function C_(e){let{config:t,onClose:n,onSave:r}=e,[o,i]=(0,h.useState)(null),[a,l]=(0,h.useReducer)(w_,{config:m_(t)}),s=xe((e=>e.prefs.local.dateFormat||"MM/dd/yyyy"));(0,h.useEffect)((()=>{l({type:"replace-config",config:m_(t)})}),[t]);let{config:u}=a,c=(e,t)=>l({type:"change-field",field:e,value:t});return(0,h.useEffect)((()=>{!async function(){let{data:e,error:t}=await Ge("schedule/get-upcoming-dates",{config:v_(u),count:4});i(t?"Invalid rule":e)}()}),[u]),null==o?null:(0,wo.jsxs)(Ps,{style:{padding:10,width:380},offset:1,position:"bottom-left",onClose:n,children:[(0,wo.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,wo.jsx)("label",{htmlFor:"start",style:{marginRight:5},children:"Starts:"}),(0,wo.jsx)(c_,{id:"start",inputProps:{placeholder:"Start Date"},value:u.start,onSelect:e=>c("start",e),containerProps:{style:{width:100}},dateFormat:s})]}),(0,wo.jsxs)(Os,{direction:"row",align:"center",justify:"flex-start",style:{marginTop:10},spacing:2,children:[(0,wo.jsx)(ql,{style:{whiteSpace:"nowrap"},children:"Repeat every"}),(0,wo.jsx)(Vl,{id:"interval",style:{width:40},type:"text",onBlur:e=>c("interval",e.target.value),onEnter:e=>c("interval",e.target.value),defaultValue:u.interval||1}),(0,wo.jsx)(zs,{onChange:e=>c("frequency",e.target.value),value:u.frequency,style:{flex:0},children:h_.map((e=>(0,wo.jsx)("option",{value:e.id,children:e.name},e.id)))}),"monthly"!==u.frequency||null!=u.patterns&&0!==u.patterns.length?null:(0,wo.jsx)(zl,{onClick:()=>l({type:"add-recurrence"}),children:"Add specific days"})]}),"monthly"===u.frequency&&u.patterns&&u.patterns.length>0&&(0,wo.jsx)(k_,{config:u,dispatch:l}),(0,wo.jsx)(j_,{previewDates:o}),(0,wo.jsxs)("div",{style:{display:"flex",marginTop:15,justifyContent:"flex-end"},children:[(0,wo.jsx)(zl,{onClick:n,children:"Cancel"}),(0,wo.jsx)(zl,{onClick:()=>r(v_(u)),primary:!0,style:{marginLeft:10},children:"Apply"})]})]})}function __(e){let{value:t,buttonStyle:n,onChange:r}=e,{isOpen:o,close:i,getOpenEvents:a}=Ts();return(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(zl,{...a(),style:[{textAlign:"left"},n],children:t?wh(t):"No recurring date"}),o&&(0,wo.jsx)(C_,{config:t,onClose:i,onSave:function(e){r(e),i()}})]})}function O_(e){let{field:t,subfield:n,type:r,multi:o,value:i,inputRef:a,style:l,onChange:s}=e,{payees:u,accounts:c,categoryGroups:d,dateFormat:f}=xe((e=>({payees:e.queries.payees,accounts:e.queries.accounts,categoryGroups:e.queries.categories.grouped,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"})));if(o&&!Array.isArray(i))i=[];else if(!o&&Array.isArray(i))return null;let p,h=!o||0===i.length;switch(r){case"id":switch(t){case"payee":p=(0,wo.jsx)(o_,{payees:u,accounts:c,multi:o,showMakeTransfer:!1,openOnFocus:!0,value:i,onSelect:s,inputProps:{inputRef:a,...h?{placeholder:"nothing"}:null}});break;case"account":p=(0,wo.jsx)(QC,{accounts:c,value:i,multi:o,openOnFocus:!0,onSelect:s,inputProps:{inputRef:a,...h?{placeholder:"nothing"}:null}});break;case"category":p=(0,wo.jsx)(e_,{categoryGroups:d,value:i,multi:o,openOnFocus:!0,onSelect:s,inputProps:{inputRef:a,...h?{placeholder:"nothing"}:null}})}break;case"date":switch(n){case"month":p=(0,wo.jsx)(Vl,{inputRef:a,defaultValue:i||"",placeholder:yh(f).toLowerCase(),onEnter:e=>s(e.target.value),onBlur:e=>s(e.target.value)});break;case"year":p=(0,wo.jsx)(Vl,{inputRef:a,defaultValue:i||"",placeholder:"yyyy",onEnter:e=>s(e.target.value),onBlur:e=>s(e.target.value)});break;default:p=i&&i.frequency?(0,wo.jsx)(__,{value:i,buttonStyle:{justifyContent:"flex-start"},onChange:s}):(0,wo.jsx)(c_,{value:i,dateFormat:f,openOnFocus:!1,inputRef:a,inputProps:{placeholder:f.toLowerCase()},onSelect:s})}break;case"boolean":p=(0,wo.jsx)(tu,{checked:i,value:i,onChange:()=>s(!i)});break;default:p=o?(0,wo.jsx)(GC,{multi:!0,suggestions:[],value:i,inputProps:{inputRef:a},onSelect:s}):(0,wo.jsx)(Vl,{inputRef:a,defaultValue:i||"",placeholder:"nothing",onEnter:e=>s(e.target.value),onBlur:e=>s(e.target.value)})}return(0,wo.jsx)(Ll,{style:[{flex:1},l],children:p})}let E_=["date","account","payee","notes","category","amount","cleared"].map((e=>[e,ek(e)]));function T_(e){let{field:t,options:n,value:r}=e;if("date"===t){if(7===r.length)return"month";if(4===r.length)return"year"}else if("amount"===t){if(n&&n.inflow)return"amount-inflow";if(n&&n.outflow)return"amount-outflow"}return t}function P_(e,t){switch(e){case"amount":switch(t){case"amount-inflow":return{inflow:!0};case"amount-outflow":return{outflow:!0};default:return null}case"date":switch(t){case"month":return{month:!0};case"year":return{year:!0};default:return null}default:return null}}function A_(e){let{op:t,selected:n,style:r,onClick:o}=e;return(0,wo.jsx)(zl,{bare:!0,style:[{backgroundColor:go.n10,marginBottom:5},r,n&&{color:"white","&,:hover,:active":{backgroundColor:go.b4}}],onClick:o,children:tk(t)})}function M_(e,t){switch(t.type){case"set-op":{let n=JS.get(e.field),r=e.value;return"id"===n&&"contains"===t.op&&(r=null),{...e,op:t.op,value:r}}case"set-value":{let{value:n}=ik(t.value,{type:JS.get(e.field)});return{...e,value:n}}default:throw new Error(`Unhandled action type: ${t.type}`)}}function D_(e){let{field:t,initialSubfield:n=t,op:r,value:o,dispatch:i,onApply:a}=e,[l,s]=(0,h.useState)(n),u=(0,h.useRef)(),c=(0,h.useRef)(null);(0,h.useEffect)((()=>{c.current!==r&&u.current&&u.current.focus(),c.current=r}),[r]);let d=JS.get(t),f=ZS[d].ops;return"month"!==l&&"year"!==l||(f=["is"]),(0,wo.jsx)(Ps,{position:"bottom-left",style:{padding:15},width:300,onClose:()=>i({type:"close"}),children:(0,wo.jsxs)(NS,{children:[(0,wo.jsx)(Ll,{style:{marginBottom:10},children:"amount"===t||"date"===t?(0,wo.jsx)(Us,{options:"amount"===t?[["amount","Amount"],["amount-inflow","Amount (inflow)"],["amount-outflow","Amount (outflow)"]]:"date"===t?[["date","Date"],["month","Month"],["year","Year"]]:null,value:l,onChange:e=>{s(e),"month"!==e&&"year"!==e||i({type:"set-op",op:"is"})},style:{borderWidth:1}}):Mr(ek(t))}),(0,wo.jsx)(Os,{direction:"row",align:"flex-start",spacing:1,style:{flexWrap:"wrap"},children:"boolean"===d?[(0,wo.jsx)(A_,{op:"true",selected:!0===o,onClick:()=>{i({type:"set-op",op:"is"}),i({type:"set-value",value:!0})}},"true"),(0,wo.jsx)(A_,{op:"false",selected:!1===o,onClick:()=>{i({type:"set-op",op:"is"}),i({type:"set-value",value:!1})}},"false")]:f.map((e=>(0,wo.jsx)(A_,{op:e,selected:e===r,onClick:()=>i({type:"set-op",op:e})},e)))}),(0,wo.jsxs)("form",{action:"#",children:["boolean"!==d&&(0,wo.jsx)(O_,{inputRef:u,field:t,subfield:l,type:"id"===d&&"contains"===r?"string":d,value:o,multi:"oneOf"===r,style:{marginTop:10},onChange:e=>i({type:"set-value",value:e})}),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(zl,{primary:!0,style:{marginTop:15},onClick:e=>{e.preventDefault(),a({field:t,op:r,value:o,options:P_(t,l)})},children:"Apply"})})]})]})})}function I_(e){let{onApply:t}=e,{dateFormat:n}=xe((e=>({dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}))),[r,o]=(0,h.useReducer)(((e,t)=>{switch(t.type){case"select-field":return{...e,fieldsOpen:!0,condOpen:!1};case"configure":{let{field:n}=function(e){return"amount-inflow"===e?{field:"amount",options:{inflow:!0}}:"amount-outflow"===e?{field:"amount",options:{outflow:!0}}:{field:e}}(t.field),r=JS.get(n),o=ZS[r].ops;return{...e,fieldsOpen:!1,condOpen:!0,field:t.field,op:o[0],value:"boolean"===r||null}}case"close":return{fieldsOpen:!1,condOpen:!1,value:null};default:return M_(e,t)}}),{fieldsOpen:!1,condOpen:!1,field:null,value:null});return(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)(zl,{bare:!0,onClick:()=>o({type:"select-field"}),children:[(0,wo.jsx)(ak,{style:{width:16,height:16,color:"inherit",marginRight:5}})," ","Filter"]}),r.fieldsOpen&&(0,wo.jsx)(Ps,{position:"bottom-left",style:{padding:0},onClose:()=>o({type:"close"}),children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{o({type:"configure",field:e})},items:E_.map((e=>{let[t,n]=e;return{name:t,text:Mr(n)}}))})}),r.condOpen&&(0,wo.jsx)(D_,{field:r.field,op:r.op,value:r.value,dispatch:o,onApply:async function(e){if("date"===(e=ok({...e,type:JS.get(e.field)})).type&&e.options)if(e.options.month){let t=tx(e.value,yh(n),new Date);if(!Uf(t))return void alert("Invalid date format");e.value=Hp(t,"yyyy-MM")}else if(e.options.year){let t=tx(e.value,"yyyy",new Date);if(!Uf(t))return void alert("Invalid date format");e.value=Hp(t,"yyyy")}let{error:r}=await qe("rule-validate",{conditions:[e],actions:[]});if(r&&r.conditionErrors.length>0){let t=Mr(ek(e.field));alert(t+": "+nk(r.conditionErrors[0]))}else t(e),o({type:"close"})}})]})}function R_(e){let{field:t,op:n,value:r,options:o,onSave:i,onClose:a}=e,[l,s]=(0,h.useReducer)(((e,t)=>"close"===t.type?(a(),e):M_(e,t)),{field:t,op:n,value:r,options:o});return(0,wo.jsx)(D_,{field:l.field,initialSubfield:T_({field:t,options:o,value:r}),op:l.op,value:l.value,options:l.options,dispatch:s,onApply:e=>{i(e),a()}})}function N_(e){let{field:t,customName:n,op:r,value:o,options:i,stage:a,style:l,onChange:s,onDelete:u}=e,[c,d]=(0,h.useState)(!1),f=T_({field:t,value:o});return(0,wo.jsxs)(Ll,{style:[{backgroundColor:go.n10,borderRadius:4,flexDirection:"row",alignItems:"center",marginBottom:10,marginRight:10},l],children:[(0,wo.jsx)(zl,{bare:!0,disabled:null!=n,onClick:()=>d(!0),style:{marginRight:-7},children:(0,wo.jsx)("div",{style:{paddingBlock:1,paddingLeft:5,paddingRight:2},children:n?(0,wo.jsx)(ql,{style:{color:go.p4},children:n}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(ql,{style:{color:go.p4},children:ek(f,i)})," ",(0,wo.jsx)(ql,{style:{color:go.n3},children:tk(r)})," ",(0,wo.jsx)(bk,{value:o,field:f,inline:!0,valueIsRaw:"contains"===r})]})})}),(0,wo.jsx)(zl,{bare:!0,onClick:u,children:(0,wo.jsx)(ws,{style:{width:8,height:8,color:go.n4,margin:5,marginLeft:3}})}),c&&(0,wo.jsx)(R_,{field:t,customName:n,op:r,value:o,options:i,stage:a,onSave:s,onClose:()=>d(!1)})]})}function L_(e){let{filters:t,editingFilter:n,onUpdate:r,onDelete:o}=e;return(0,wo.jsx)(Ll,{style:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",marginTop:10,marginBottom:-5},children:t.map(((e,t)=>(0,wo.jsx)(N_,{customName:e.customName,field:e.field,op:e.op,value:e.value,options:e.options,editing:n===e,onChange:t=>r(e,t),onDelete:()=>o(e)},t)))})}function F_(e,t){throw new Error(t+": "+JSON.stringify(e.str.slice(e.index,10)))}function B_(e){return e.str[e.index]}function z_(e){if(e.index>=e.str.length)return null;let t=B_(e);return e.index++,t}function U_(e,t){return B_(e)===t&&(z_(e),!0)}function W_(e){if("("===B_(e)){z_(e);let t=H_(e);return")"!==B_(e)&&F_(e,"Unbalanced parentheses"),z_(e),t}return function(e){let t="-"===B_(e);t&&z_(e),/\p{Sc}/u.test(B_(e))&&z_(e);let n="";for(;B_(e)&&B_(e).match(/[0-9,.]/);){let t=","===Nr().separator?".":",";B_(e)===t?z_(e):n+=z_(e)}""===n&&F_(e,"Unexpected character");let r=parseFloat(n.replace(Nr().separator,"."));return t?-r:r}(e)}let H_=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>n=>{let r=e(n);for(;U_(n,t);)r={op:t,left:r,right:e(n)};return r}),W_)}("^","/","*","-","+");function K_(e){if("number"===typeof e)return e;let{left:t,right:n,op:r}=e;switch(r){case"+":return K_(t)+K_(n);case"-":return K_(t)-K_(n);case"*":return K_(t)*K_(n);case"/":return K_(t)/K_(n);case"^":return Math.pow(K_(t),K_(n));default:throw new Error("Unknown operator: "+r)}}function $_(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(""===e)return n;try{t=K_(function(e){let t={str:e.replace(/\s/g,""),index:0};return H_(t)}(e))}catch(Fa){return n}return isNaN(t)?n:t}var V_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{fill:"currentColor",d:"M30.256 48.614a3.14 3.14 0 0 0-.989-2.153L10.803 29.063h76.915a3.2 3.2 0 0 0 .315 0c1.584-.084 2.95-1.64 2.867-3.266-.082-1.625-1.598-3.028-3.182-2.943H10.803L29.267 5.49c1.284-1.099 1.456-3.057.385-4.373a2.972 2.972 0 0 0-4.48-.187L.971 23.695a3.163 3.163 0 0 0 0 4.56l24.2 22.766a2.98 2.98 0 0 0 2.205.84c1.669-.08 2.958-1.534 2.88-3.247Z"})});var q_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m9.293 12.95.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z",fill:"currentColor"})});var G_=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("g",{fill:"#000",children:(0,wo.jsx)("path",{d:"m23.962 17.457-.82-3.297a1.287 1.287 0 0 0-1.56-.934l-3.294.823a1.286 1.286 0 0 0-.343 2.35L19 17.03A9.538 9.538 0 0 1 12 20.604a8.652 8.652 0 0 1-8.085-5.667 1.286 1.286 0 0 0-2.415.884A11.232 11.232 0 0 0 12 23.175a12.108 12.108 0 0 0 9.214-4.8l.839.503a1.286 1.286 0 0 0 1.91-1.415ZM2.422 10.774l3.295-.823a1.286 1.286 0 0 0 .352-2.35l-.972-.583A9.588 9.588 0 0 1 12 3.396a8.652 8.652 0 0 1 8.085 5.667A1.286 1.286 0 0 0 22.5 8.18 11.232 11.232 0 0 0 12 .825 12.242 12.242 0 0 0 2.866 5.68l-.919-.552a1.286 1.286 0 0 0-1.91 1.414l.82 3.297a1.287 1.287 0 0 0 1.246.974 1.311 1.311 0 0 0 .32-.04Z",fill:"currentColor"})})});var Y_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M21.5 3h-2.75a.25.25 0 0 1-.25-.25V1a1 1 0 0 0-2 0v4.75a.75.75 0 0 1-.75.75.75.75 0 0 1-.75-.75V3.5a.5.5 0 0 0-.5-.5H8.25A.25.25 0 0 1 8 2.751V1a1 1 0 1 0-2 0v4.75a.75.75 0 0 1-.75.75.75.75 0 0 1-.75-.75V3.5A.5.5 0 0 0 4 3H2.5a2 2 0 0 0-2 2v17a2 2 0 0 0 2 2h19a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2ZM21 22H3a.5.5 0 0 1-.5-.5v-12A.5.5 0 0 1 3 9h18a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5Z",fill:"currentColor"})});var Q_=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M12.406 14.905a1 1 0 0 0-.543 1.307 1 1 0 0 1-.217 1.09l-2.828 2.829a2 2 0 0 1-2.828 0L3.868 18.01a2 2 0 0 1 0-2.829L6.7 12.353a1.013 1.013 0 0 1 1.091-.217 1 1 0 0 0 .763-1.849 3.034 3.034 0 0 0-3.268.652l-2.832 2.828a4.006 4.006 0 0 0 0 5.657l2.122 2.121a4 4 0 0 0 5.656 0l2.829-2.828a3.008 3.008 0 0 0 .651-3.27 1 1 0 0 0-1.306-.542Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M7.757 16.241a1.011 1.011 0 0 0 1.414 0l7.779-7.778a1 1 0 0 0-1.414-1.414l-7.779 7.778a1 1 0 0 0 0 1.414Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"m21.546 4.574-2.121-2.121a4.006 4.006 0 0 0-5.657 0l-2.829 2.828a3.006 3.006 0 0 0-.651 3.269 1 1 0 1 0 1.849-.764 1 1 0 0 1 .217-1.086l2.828-2.828a2 2 0 0 1 2.829 0l2.121 2.121a2 2 0 0 1 0 2.829L17.3 11.645a1.015 1.015 0 0 1-1.091.217 1 1 0 0 0-.765 1.849 3.026 3.026 0 0 0 3.27-.651l2.828-2.828a4.007 4.007 0 0 0 .004-5.658Z",fill:"currentColor"})]});var X_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M23.119 20 13.772 2.15a2 2 0 0 0-3.543 0L.881 20a2 2 0 0 0 1.772 2.928h18.694A2 2 0 0 0 23.119 20ZM11 8.423a1 1 0 0 1 2 0v6a1 1 0 1 1-2 0Zm1.05 11.51h-.028a1.528 1.528 0 0 1-1.522-1.47 1.476 1.476 0 0 1 1.448-1.53h.028A1.527 1.527 0 0 1 13.5 18.4a1.475 1.475 0 0 1-1.45 1.533Z",fill:"currentColor"})});var Z_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M12 0C1.308 0-4.044 12.925 3.516 20.484 11.075 28.044 24 22.692 24 12 23.992 5.376 18.624.008 12 0zm.01 1.988c5.521.007 9.995 4.48 10.002 10.002 0 8.912-10.774 13.373-17.075 7.072-6.3-6.3-1.839-17.074 7.073-17.074zm6.234 4.588a1 1 0 0 0-.928.442l-6.226 8.45-4.076-3.261a1 1 0 1 0-1.25 1.563l4.888 3.908a1.011 1.011 0 0 0 1.43-.19L18.928 8.2a1 1 0 0 0-.684-1.623z",fill:"currentColor"})});var J_=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M12 0a10.286 10.286 0 0 0-6.243 18.45 1.714 1.714 0 0 1 .672 1.36v1.619A2.571 2.571 0 0 0 9 24a1.714 1.714 0 0 0 1.714-1.714V21a1.286 1.286 0 0 1 2.572 0v1.286A1.714 1.714 0 0 0 15 24a2.571 2.571 0 0 0 2.571-2.571V19.81a1.714 1.714 0 0 1 .672-1.36A10.286 10.286 0 0 0 12 0ZM7.714 12.429a2.143 2.143 0 1 1 2.143-2.143 2.143 2.143 0 0 1-2.143 2.143Zm8.572 0a2.143 2.143 0 1 1 2.143-2.143 2.143 2.143 0 0 1-2.143 2.143Z",fill:"currentColor"})});var eO=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M23.91 9.113a1.785 1.785 0 0 0-1.453-1.227l-6.132-.926-2.714-5.506a1.863 1.863 0 0 0-3.222 0l-2.78 5.552-6.066.88a1.798 1.798 0 0 0-1 3.068l4.428 4.361-1.028 6.055a1.797 1.797 0 0 0 2.607 1.895l5.488-2.865 5.429 2.858a1.797 1.797 0 0 0 2.607-1.895l-1.011-6.128 4.394-4.286a1.786 1.786 0 0 0 .454-1.836Z",fill:"currentColor"})});var tO=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M7.176 22.5a4.111 4.111 0 0 1-3.17-1.486l-3.62-4.6a1.8 1.8 0 1 1 2.828-2.228l3.6 4.56a.384.384 0 0 0 .379.152.52.52 0 0 0 .408-.197L20.794 2.177a1.8 1.8 0 1 1 2.812 2.246L10.39 20.964A4.12 4.12 0 0 1 7.2 22.5Z",fill:"currentColor"})});function nO(e){let t,n,r;switch(e){case"missed":t=go.r1,n=go.r10,r=J_;break;case"due":t=go.y1,n=go.y9,r=X_;break;case"upcoming":t=go.p1,n=go.p10,r=Y_;break;case"paid":t=go.g2,n=go.g10,r=tO;break;case"completed":t=go.n4,n=go.n11,r=eO;break;case"pending":t=go.g4,n=go.g11,r=Y_;break;case"scheduled":t=go.n1,n=go.n11,r=Y_;break;case"cleared":t=go.g5,n=go.n11,r=Xx;break;default:t=go.n1,n=go.n11,r=Z_}return{color:t,backgroundColor:n,Icon:r}}function rO(e){let{status:t,style:n}=e,{color:r,backgroundColor:o,Icon:i}=nO(t);return(0,wo.jsxs)(Ll,{style:[{color:r,backgroundColor:o,padding:"6px 8px",borderRadius:4,flexDirection:"row",alignItems:"center",flexShrink:0},n],children:[(0,wo.jsx)(i,{style:{width:13,height:13,color:"inherit",marginRight:7}}),(0,wo.jsx)(ql,{style:{lineHeight:"1em"},children:Mr(t)})]})}function oO(e,t){let{amount:n,date:r}=e;mO(e.id)&&(n=(e._inverse?-1:1)*Sh(n));let o=n<0?-n:null,i=n>0?n:null;return 0===n&&(t?i=0:o=0),Uf(lk(r))||(r=null),{...e,date:r,debit:null!=o?zr(o):"",credit:null!=i?zr(i):""}}function iO(e,t){let n=e[t];return n&&n.is_child&&(null==e[t+1]||e[t+1].parent_id!==n.parent_id)}let aO=h.createContext(null);function lO(){let e=(0,h.useContext)(aO);return(0,h.useMemo)((()=>({...e,expanded:t=>"collapse"===e.state.mode?!e.state.ids.has(t):e.state.ids.has(t)})),[e])}function sO(e){let{children:t,initialMode:n="expand"}=e,r=xe((e=>e.app.lastSplitState)),o=ge(),[i,a]=(0,h.useReducer)(((e,t)=>{switch(t.type){case"toggle-split":{let n=new Set([...e.ids]),{id:r}=t;return n.has(r)?n.delete(r):n.add(r),{...e,ids:n}}case"open-split":{let n=new Set([...e.ids]),{id:r}=t;return"collapse"===e.mode?n.delete(r):n.add(r),{...e,ids:n}}case"set-mode":return{...e,mode:t.mode,ids:new Set,transitionId:null};case"switch-mode":return null!=e.transitionId?e:{...e,mode:"expand"===e.mode?"collapse":"expand",transitionId:t.id,ids:new Set};case"finish-switch-mode":return{...e,transitionId:null};default:throw new Error("Unknown action type: "+t.type)}}),r.current||{ids:new Set,mode:n});(0,h.useEffect)((()=>{null!=i.transitionId&&setTimeout((()=>{a({type:"finish-switch-mode"})}),250)}),[i.transitionId]),(0,h.useEffect)((()=>{null==i.transitionId&&o({type:"SET_LAST_SPLIT_STATE",splitState:i})}),[i]);let l=(0,h.useMemo)((()=>({state:i,dispatch:a})),[i,a]);return(0,wo.jsx)(aO.Provider,{value:l,children:t})}const uO=h.memo((e=>{let{hasSelected:t,showAccount:n,showCategory:r,showBalance:o,showCleared:i}=e,a=Ix();return(0,wo.jsxs)(qw,{borderColor:go.n9,backgroundColor:"white",style:{color:go.n4,fontWeight:300,zIndex:200},children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,selected:t,width:20,onSelect:()=>a({type:"select-all"})}),(0,wo.jsx)(Vw,{value:"Date",width:110}),n&&(0,wo.jsx)(Vw,{value:"Account",width:"flex"}),(0,wo.jsx)(Vw,{value:"Payee",width:"flex"}),(0,wo.jsx)(Vw,{value:"Notes",width:"flex"}),r&&(0,wo.jsx)(Vw,{value:"Category",width:"flex"}),(0,wo.jsx)(Vw,{value:"Payment",width:80,textAlign:"right"}),(0,wo.jsx)(Vw,{value:"Deposit",width:80,textAlign:"right"}),o&&(0,wo.jsx)(Vw,{value:"Balance",width:88,textAlign:"right"}),i&&(0,wo.jsx)($w,{width:21,truncate:!1}),(0,wo.jsx)(Vw,{value:"",width:15+mo.scrollbarWidth})]})}));function cO(e){let{id:t,focused:n,selected:r,status:o,isChild:i,onEdit:a,onUpdate:l}=e,s="cleared"===o||null==o,u=nO(o),c={color:"cleared"===o?go.g5:"missed"===o?go.r6:"due"===o?go.y5:r?go.b7:go.n7};return(0,wo.jsx)(Vw,{name:"cleared",width:"auto",focused:n,style:{padding:1},plain:!0,children:(0,wo.jsx)(tj,{style:[{padding:3,border:"1px solid transparent",borderRadius:50,":focus":{border:"1px solid "+c.color,boxShadow:`0 1px 2px ${c.color}`},cursor:s?"pointer":"default"},i&&{visibility:"hidden"}],onEdit:()=>a(t,"cleared"),onSelect:function(){s&&l("cleared",!("cleared"===o))},children:h.createElement(u.Icon,{style:{width:13,height:13,color:c.color,marginTop:"due"===o?-1:0}})})})}function dO(e){let{id:t,payeeId:n,accountId:r,focused:o,inherited:i,payees:a,accounts:l,valueStyle:s,transaction:u,payee:c,transferAcct:d,isPreview:f,onEdit:p,onUpdate:y,onCreatePayee:g,onManagePayees:m}=e,v=(0,h.useRef)(!1);return l=l.filter((e=>e.id!==r)),(0,wo.jsx)(Jw,{width:"flex",name:"payee",value:n,valueStyle:[s,i&&{color:go.n8}],formatter:()=>function(e,t,n){let{payee:r}=e;if(n){const t=(e._inverse?-1:1)*e.amount>0?V_:gk;return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(t,{width:10,height:8,style:{marginRight:5,flexShrink:0}}),(0,wo.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:n.name})]})}return t&&!t.transfer_acct?t.name:r&&r.startsWith("new:")?r.slice("new:".length):""}(u,c,d),exposed:o,onExpose:!f&&(e=>p(t,e)),onUpdate:async e=>{if(y("payee",e),e&&e.startsWith("new:")&&!v.current){v.current=!0;let t=await g(e.slice("new:".length));y("payee",t),v.current=!1}},children:e=>{let{onBlur:t,onKeyDown:r,onUpdate:o,onSave:i,shouldSaveFromKey:s,inputStyle:c}=e;return(0,wo.jsx)(o_,{payees:a,accounts:l,value:n,shouldSaveFromKey:s,inputProps:{onBlur:t,onKeyDown:r,style:c},showManagePayees:!0,tableBehavior:!0,defaultFocusTransferPayees:u.is_child,focused:!0,onUpdate:o,onSelect:i,onManagePayees:()=>m(n),isCreatable:!0,menuPortalTarget:void 0})}})}function fO(e){let{scheduleId:t,children:n}=e,r=Eh().schedules.find((e=>e.id===t));if(null==r)return n;let o=r._date&&!!r._date.frequency,i={width:13,height:13,marginLeft:5,marginRight:3,color:"inherit"};return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",alignItems:"stretch"},children:[(0,wo.jsx)(Vw,{exposed:!0,children:()=>o?(0,wo.jsx)(G_,{style:i}):(0,wo.jsx)(Y_,{style:{...i,transform:"translateY(-1px)"}})}),n]})}const pO=h.memo((function(e){let{transaction:t,editing:n,backgroundColor:r="white",showAccount:o,showBalance:i,showCleared:a,showZeroInDeposit:l,style:s,hovered:u,selected:c,highlighted:d,added:f,matched:p,expanded:y,inheritedFields:g,focusedField:m,categoryGroups:v,payees:b,accounts:x,balance:w,dateFormat:j="MM/dd/yyyy",hideFraction:S,onSave:k,onEdit:C,onHover:_,onDelete:O,onSplit:E,onManagePayees:T,onCreatePayee:P,onToggleSplit:A}=e,M=Ix(),[D,I]=(0,h.useState)(l),[R,N]=(0,h.useState)(t),[L,F]=(0,h.useState)(oO(t,l)),B=mO(L.id);function z(e,n){if(L[e]!==n){let r={...L,[e]:n};if("note"===e&&""===n&&null==L.note)return;if("account"===e&&n&&Zr(x)[n].offbudget&&(r.category=null),"credit"===e?r.debit="":"debit"===e&&(r.credit=""),"payee"===e&&n&&n.startsWith("new:"))F(r);else{let e=function(e,t){let n,{debit:r,credit:o,date:i,...a}=e;if(""!==r){let e=$_(r,null);n=null!=e?-e:null}else n=$_(o,null);return n=null!=n?$r(n):t.amount,null==i&&(i=t.date||Jp()),{...a,date:i,amount:n}}(r,t);F(oO(e,l)),k(e)}}}t===R&&l===D||(F(oO(t,l)),N(t),I(l));let U,{id:W,debit:H,credit:K,payee:$,imported_payee:V,notes:q,date:G,account:Y,category:Q,cleared:X,is_parent:Z,_unmatched:J=!1,_inverse:ee=!1}=L,te=b&&$&&Jr(b)[$],ne=x&&Y&&Zr(x)[Y];U=ee?x&&Y&&Zr(x)[Y]:te&&te.transfer_acct&&Zr(x)[te.transfer_acct];let re=L.is_child,oe=c?go.b8:go.border,ie=U&&0===U.offbudget,ae=ne&&1===ne.offbudget,le=f?{fontWeight:600}:null,se=u||"select"===m,ue=S?{letterSpacing:-.5}:null;return(0,wo.jsxs)(qw,{borderColor:oe,backgroundColor:c?go.selected:se?go.hover:B?"#fcfcfc":r,highlighted:d,style:[s,B&&{color:go.n5,fontStyle:"italic"},J&&{opacity:.5}],onMouseEnter:()=>_&&_(L.id),children:[re&&(0,wo.jsx)($w,{borderColor:"transparent",width:110,style:{width:110,backgroundColor:go.n11,borderBottomWidth:0}}),re&&o&&(0,wo.jsx)($w,{borderColor:"transparent",style:{flex:1,backgroundColor:go.n11,opacity:0}}),gO(L.id)?re?(0,wo.jsx)(ej,{onDelete:()=>O&&O(L.id),exposed:u||n,style:[re&&{borderLeftWidth:1},{lineHeight:0}]}):(0,wo.jsx)(Vw,{width:20}):(0,wo.jsx)(nj,{exposed:u||c||n,focused:"select"===m,onSelect:()=>{M({type:"select",id:L.id})},onEdit:()=>C(W,"select"),selected:c,style:[re&&{borderLeftWidth:1}],value:p&&(0,wo.jsx)(Q_,{style:{width:13,height:13,color:go.n7}})}),!re&&(0,wo.jsx)(Jw,{name:"date",width:110,exposed:"date"===m,value:G,valueStyle:le,formatter:e=>e?Hp(lk(e),j):"",onExpose:!B&&(e=>C(W,e)),onUpdate:e=>{z("date",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,wo.jsx)(c_,{value:G||"",dateFormat:j,inputProps:{onBlur:t,onKeyDown:n,style:a},shouldSaveFromKey:i,tableBehavior:!0,onUpdate:r,onSelect:o})}}),!re&&o&&(0,wo.jsx)(Jw,{name:"account",width:"flex",value:Y,formatter:e=>{let t=e&&Zr(x)[e];return t?t.name:""},valueStyle:le,exposed:"account"===m,onExpose:!B&&(e=>C(W,e)),onUpdate:async e=>{e&&z("account",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,wo.jsx)(QC,{value:Y,accounts:x,shouldSaveFromKey:i,tableBehavior:!0,focused:!0,inputProps:{onBlur:t,onKeyDown:n,style:a},onUpdate:r,onSelect:o,menuPortalTarget:void 0})}}),(()=>{let e=(0,wo.jsx)(dO,{id:W,payeeId:$,accountId:Y,focused:"payee"===m,inherited:g&&g.has("payee"),payees:b,accounts:x,valueStyle:le,transaction:L,payee:te,transferAcct:U,importedPayee:V,isPreview:B,onEdit:C,onUpdate:z,onCreatePayee:P,onManagePayees:T});return L.schedule?(0,wo.jsx)(fO,{scheduleId:L.schedule,children:e}):e})(),B?(0,wo.jsx)(Vw,{name:"notes",width:"flex"}):(0,wo.jsx)(Xw,{width:"flex",name:"notes",exposed:"notes"===m,focused:"notes"===m,value:q||"",valueStyle:le,onExpose:!B&&(e=>C(W,e)),inputProps:{value:q||"",onUpdate:z.bind(null,"notes")}}),B?(0,wo.jsx)(Vw,{width:"flex",style:{alignItems:"flex-start"},exposed:!0,children:()=>(0,wo.jsx)(Ll,{style:{color:"missed"===q?go.r6:"due"===q?go.y4:c?go.b5:go.n6,backgroundColor:"missed"===q?go.r10:"due"===q?go.y9:c?go.b8:go.n10,margin:"0 5px",padding:"3px 7px",borderRadius:4},children:Mr(q)})}):Z?(0,wo.jsx)(Vw,{name:"category",width:"flex",focused:"category"===m,style:{padding:0},plain:!0,children:(0,wo.jsx)(tj,{style:{alignSelf:"flex-start",color:go.n6,borderRadius:4,transition:"none","&:hover":{backgroundColor:"rgba(100, 100, 100, .15)",color:go.n5}},disabled:gO(L.id),onEdit:()=>C(W,"category"),onSelect:()=>A(W),children:(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",alignSelf:"stretch",borderRadius:4,flex:1,padding:4},children:[Z&&(0,wo.jsx)(q_,{style:{width:14,height:14,color:"currentColor",transition:"transform .08s",transform:y?"rotateZ(0)":"rotateZ(-90deg)"}}),(0,wo.jsx)(ql,{style:{fontStyle:"italic",userSelect:"none"},children:"Split"})]})})}):ie||ae||B?(0,wo.jsx)(Xw,{name:"category",width:"flex",exposed:"category"===m,focused:"category"===m,onExpose:!B&&(e=>C(W,e)),value:Z?"Split":ae?"Off Budget":ie?"Transfer":"",valueStyle:le,style:{fontStyle:"italic",color:"#c0c0c0",fontWeight:300},inputProps:{readOnly:!0,style:{fontStyle:"italic"}}}):(0,wo.jsx)(Jw,{name:"category",width:"flex",value:Q,formatter:e=>{return e?(t=eo(v)[e],n="name",t?t[n]:""):L.id?"Categorize":"";var t,n},exposed:"category"===m,onExpose:e=>C(W,e),valueStyle:Q?le:{fontStyle:"italic",fontWeight:300,color:go.p8},onUpdate:async e=>{"split"===e?E(L.id):z("category",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,wo.jsx)(e_,{categoryGroups:v,value:Q,focused:!0,tableBehavior:!0,showSplitOption:!re&&!Z,shouldSaveFromKey:i,inputProps:{onBlur:t,onKeyDown:n,style:a},onUpdate:r,onSelect:o,menuPortalTarget:void 0})}}),(0,wo.jsx)(Xw,{type:"input",width:80,name:"debit",exposed:"debit"===m,focused:"debit"===m,value:null==H?"":H,valueStyle:le,textAlign:"right",title:H,onExpose:!B&&(e=>C(W,e)),style:[Z&&{fontStyle:"italic"},mo.tnum,ue],inputProps:{value:H,onUpdate:z.bind(null,"debit")}}),(0,wo.jsx)(Xw,{type:"input",width:80,name:"credit",exposed:"credit"===m,focused:"credit"===m,value:null==K?"":K,valueStyle:le,textAlign:"right",title:K,onExpose:!B&&(e=>C(W,e)),style:[Z&&{fontStyle:"italic"},mo.tnum,ue],inputProps:{value:K,onUpdate:z.bind(null,"credit")}}),i&&(0,wo.jsx)(Vw,{name:"balance",value:null==w||re||B?"":zr(w),valueStyle:{color:w<0?go.r4:go.g4},style:[mo.tnum,ue],width:88,textAlign:"right"}),a&&(0,wo.jsx)(cO,{id:W,focused:"cleared"===m,selected:c,isPreview:B,status:B?q:X?"cleared":null,isChild:re,onEdit:C,onUpdate:z}),(0,wo.jsx)(Vw,{width:15})]})}));function hO(e){let{error:t,isDeposit:n,onAddSplit:r,style:o}=e;return"SplitTransactionError"!==t.type?null:1===t.version?(0,wo.jsxs)(Ll,{style:[{flexDirection:"row",alignItems:"center",padding:"0 5px"},o],"data-testid":"transaction-error",children:[(0,wo.jsxs)(ql,{children:["Amount left:"," ",(0,wo.jsx)(ql,{style:{fontWeight:500},children:zr(n?t.difference:-t.difference)})]}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(zl,{style:{marginLeft:15,padding:"4px 10px"},primary:!0,onClick:r,children:"Add Split"})]}):void 0}function yO(e,t){return[{id:"temp",date:t||Jp(),account:e||null,cleared:!1,amount:0}]}function gO(e){return-1!==e.indexOf("temp")}function mO(e){return-1!==e.indexOf("preview/")}function vO(e){let{transactions:t,accounts:n,categoryGroups:r,payees:o,editingTransaction:i,hoveredTransaction:a,focusedField:l,showAccount:s,showCategory:u,showBalance:c,showCleared:d,dateFormat:f,hideFraction:p,onHover:h,onClose:y,onSplit:g,onEdit:m,onDelete:v,onSave:b,onAdd:x,onAddSplit:w,onManagePayees:j,onCreatePayee:S}=e;const k=t[0].error,C=t[0].amount>0;return(0,wo.jsxs)(Ll,{style:{borderBottom:"1px solid #ebebeb",paddingBottom:6,backgroundColor:"white"},"data-testid":"new-transaction",onKeyDown:e=>{"Escape"===e.key&&y()},onMouseLeave:()=>h(null),children:[t.map(((e,t)=>(0,wo.jsx)(pO,{editing:i===e.id,hovered:a===e.id,transaction:e,showAccount:s,showCategory:u,showBalance:c,showCleared:d,focusedField:i===e.id&&l,showZeroInDeposit:C,accounts:n,categoryGroups:r,payees:o,dateFormat:f,hideFraction:p,expanded:!0,onHover:h,onEdit:m,onSave:b,onSplit:g,onDelete:v,onAdd:x,onManagePayees:j,onCreatePayee:S,style:{marginTop:-1}},e.id))),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginTop:6,marginRight:20},children:[(0,wo.jsx)(zl,{style:{marginRight:10,padding:"4px 10px"},onClick:()=>y(),"data-testid":"cancel-button",children:"Cancel"}),k?(0,wo.jsx)(hO,{error:k,isDeposit:C,onAddSplit:()=>w(t[0].id)}):(0,wo.jsx)(zl,{style:{padding:"4px 10px"},primary:!0,onClick:x,"data-testid":"add-button",children:"Add"})]})]})}function bO(e){let{tableNavigator:t,tableRef:n,dateFormat:r="MM/dd/yyyy",newNavigator:o,renderEmpty:i,onHover:a,onScroll:l,...s}=e;const u=h.createRef(),c=function(e){const t=(0,h.useRef)();return(0,h.useEffect)((()=>{t.current=e}),[e]),t.current}(s.isAdding);(0,h.useEffect)((()=>{!c&&s.isAdding&&o.onEdit("temp","date")}),[c,s.isAdding,o]);return(0,wo.jsxs)(Ll,{innerRef:u,style:[{flex:1,cursor:"default"},s.style],children:[(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(uO,{hasSelected:s.selectedItems.size>0,showAccount:s.showAccount,showCategory:s.showCategory,showBalance:!!s.balances,showCleared:s.showCleared}),s.isAdding&&(0,wo.jsx)(Ll,{...o.getNavigatorProps({onKeyDown:e=>s.onCheckNewEnter(e)}),children:(0,wo.jsx)(vO,{transactions:s.newTransactions,editingTransaction:o.editingId,hoveredTransaction:s.hoveredTransaction,focusedField:o.focusedField,accounts:s.accounts,categoryGroups:s.categoryGroups,payees:s.payees||[],showAccount:s.showAccount,showCategory:s.showCategory,showBalance:!!s.balances,showCleared:s.showCleared,dateFormat:r,hideFraction:s.hideFraction,onClose:s.onCloseAddTransaction,onAdd:s.onAddTemporary,onAddSplit:s.onAddSplit,onSplit:s.onSplit,onEdit:o.onEdit,onSave:s.onSave,onDelete:s.onDelete,onHover:a,onManagePayees:s.onManagePayees,onCreatePayee:s.onCreatePayee})})]}),(0,wo.jsxs)(Ll,{style:[{flex:1,overflow:"hidden"}],"data-testid":"transaction-table",onMouseLeave:()=>a(null),children:[(0,wo.jsx)(sj,{navigator:t,ref:n,items:s.transactions,renderItem:e=>{let{item:n,index:o,position:i,editing:l}=e;const{transactions:u,selectedItems:c,hoveredTransaction:d,accounts:f,categoryGroups:p,payees:h,showCleared:y,showAccount:g,showCategory:m,balances:v,hideFraction:b,isNew:x,isMatched:w,isExpanded:j}=s;let S=n,k=d===S.id,C=c.has(S.id),_=s.transactionMap.get(S.parent_id),O=_&&_.amount>0,E=j&&j((_||S).id),T=E&&_&&_.error||S.error;return(0,wo.jsxs)(wo.Fragment,{children:[(!E||iO(u,o))&&T&&"SplitTransactionError"===T.type&&(0,wo.jsx)(Ps,{position:"bottom-right",width:250,forceTop:i,forceLayout:!0,style:{transform:"translate(-5px, 2px)"},children:(0,wo.jsx)(hO,{error:T,isDeposit:O,onAddSplit:()=>s.onAddSplit(S.id)})}),(0,wo.jsx)(pO,{editing:l,transaction:S,showAccount:g,showCategory:m,showBalance:!!v,showCleared:y,hovered:k,selected:C,highlighted:!1,added:x&&x(S.id),expanded:j&&j(S.id),matched:w&&w(S.id),showZeroInDeposit:O,balance:v&&v[S.id]&&v[S.id].balance,focusedField:l&&t.focusedField,accounts:f,categoryGroups:p,payees:h,inheritedFields:_&&_.payee===S.payee?new Set(["payee"]):new Set,dateFormat:r,hideFraction:b,onHover:a,onEdit:t.onEdit,onSave:s.onSave,onDelete:s.onDelete,onSplit:s.onSplit,onManagePayees:s.onManagePayees,onCreatePayee:s.onCreatePayee,onToggleSplit:s.onToggleSplit})]})},renderEmpty:i,loadMore:s.loadMoreTransactions,isSelected:e=>s.selectedItems.has(e),onKeyDown:e=>s.onCheckEnter(e),onScroll:l}),s.isAdding&&(0,wo.jsx)("div",{style:{position:"absolute",top:-20,left:0,right:0,height:20,backgroundColor:"red",boxShadow:"0 0 6px rgba(0, 0, 0, .20)"}},"shadow")]})]})}let xO=h.forwardRef(((e,t)=>{let[n,r]=(0,h.useState)(null),[o,i]=(0,h.useState)(e.hoveredTransaction),[a,l]=(0,h.useState)(!1),s=lO(),u=(0,h.useRef)(null),c=(0,h.useRef)(null),d=(f=c,p=t,(0,h.useMemo)((()=>function(e){[f,p].forEach((t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)}))}),[f,p]));var f,p;let y=(0,h.useMemo)((()=>{let t;if(null!=s.state.transitionId){let n=e.transactions.findIndex((e=>e.id===s.state.transitionId));t=e.transactions.filter(((e,t)=>{if(e.parent_id){if(t>=n)return s.expanded(e.parent_id);if(u.current)return u.current.expanded(e.parent_id)}return!0}))}else u.current&&null!=u.current.state.transitionId&&(c.current.anchor(),c.current.setRowAnimation(!1)),u.current=s,t=e.transactions.filter((e=>!e.parent_id||s.expanded(e.parent_id)));return u.current=s,t}),[e.transactions,s]);const g=(0,h.useMemo)((()=>new Map(y.map((e=>[e.id,e])))),[y]);(0,h.useEffect)((()=>{c.current.isAnchored()&&(c.current.unanchor(),c.current.setRowAnimation(!0))}),[u.current]);let m=uj(n,_),v=uj(y,_),b=(0,h.useRef)(!1),x=(0,h.useRef)({newTransactions:n,newNavigator:m,tableNavigator:v}),w=(0,h.useRef)(!1),j=(0,h.useRef)(!1),[S,k]=(0,h.useState)({}),C=Rx();function _(t){let n=["select","date","account","payee","notes","category","debit","credit","cleared"];return n=t.is_child?["select","payee","notes","category","debit","credit"]:n.filter((t=>(e.showAccount||"account"!==t)&&(e.showCategory||"category"!==t))),mO(t.id)&&(n=["select","cleared"]),gO(t.id)&&(n=n.slice(1)),n}function O(t){w.current?j.current=t:t(e)}(0,h.useLayoutEffect)((()=>{x.current={newTransactions:n,newNavigator:m,tableNavigator:v,transactions:e.transactions}})),a!==e.isAdding&&(!a&&e.isAdding&&r(yO(e.currentAccountId)),l(e.isAdding)),(0,h.useEffect)((()=>{if(b.current){if(null==n[0].account)e.addNotification({type:"error",message:"Account is a required field"}),m.onEdit("temp","account");else{let t=x.current.newTransactions,n=t.length>0?t[0].date:null;r(yO(e.currentAccountId,n)),m.onEdit("temp","date"),e.onAdd(t)}b.current=!1}})),(0,h.useEffect)((()=>{w.current&&j.current&&(j.current(e),j.current=null),w.current=!1}),[n,e.transactions]);let E=(0,h.useCallback)((()=>{b.current=!0,k({})}),[e.onAdd,m.onEdit]),T=(0,h.useCallback)((async t=>{if(w.current=!0,gO(t.id)){e.onApplyRules&&(t=await e.onApplyRules(t));let n=x.current.newTransactions;r(jx(n,t).data)}else e.onSave(t)}),[e.onSave]),P=(0,h.useCallback)((e=>{i(e)}),[]),A=(0,h.useCallback)((e=>{if(gO(e)){let t=x.current.newTransactions;if(e===t[0].id)return;r(Sx(t,e).data)}}),[]),M=(0,h.useMemo)((()=>t=>{if(gO(t)){let{newNavigator:e}=x.current,n=x.current.newTransactions,{data:o,diff:i}=kx(n,t);r(o),e.onEdit(i.added[0].id,x.current.newNavigator.focusedField)}else{let n=x.current.transactions.find((e=>e.id===t)),r=e.onSplit(t);s.dispatch({type:"open-split",id:n.id});let{tableNavigator:o}=x.current;null==n.amount?o.onEdit(n.id,"debit"):o.onEdit(r,o.focusedField)}}),[e.onSplit,s.dispatch]),D=(0,h.useCallback)((t=>{if(gO(t)){let e=x.current.newTransactions,{data:n,diff:o}=wx(e,t);r(n),m.onEdit(o.added[0].id,x.current.newNavigator.focusedField)}else{let n=e.onAddSplit(t);v.onEdit(n,x.current.tableNavigator.focusedField)}}),[e.onAddSplit]);let I=(0,h.useCallback)((e=>s.dispatch({type:"toggle-split",id:e})),[s.dispatch]);return(0,wo.jsx)(bO,{tableRef:d,...e,transactions:y,transactionMap:g,selectedItems:C,hoveredTransaction:o,isExpanded:s.expanded,onHover:P,onSave:T,onDelete:A,onSplit:M,onCheckNewEnter:function(e){if("Enter"===e.key)if(e.metaKey)e.stopPropagation(),E();else if(!e.shiftKey){function t(e){let{newTransactions:t}=e.current;return t[t.length-1]}m.editingId===t(x).id&&e.stopPropagation(),O((()=>{let e=t(x),n=e.parent_id||e.is_parent;x.current.newTransactions[0].error&&m.editingId===e.id?D(e.id):m.editingId!==e.id||n&&e.error||E()}))}},onCheckEnter:function(e){if("Enter"===e.key&&!e.shiftKey){let{editingId:t,focusedField:n}=v;O((()=>{var r;let o=x.current.transactions,i=o.findIndex((e=>e.id===t)),a=g.get(null===(r=o[i])||void 0===r?void 0:r.parent_id);iO(o,i)&&a&&a.error&&"select"!==n&&(e.stopPropagation(),D(t))}))}},onAddTemporary:E,onAddSplit:D,onCloseAddTransaction:function(){r(yO(e.currentAccountId)),e.onCloseAddTransaction()},onToggleSplit:I,newTransactions:n,tableNavigator:v,newNavigator:m})}));async function wO(e){let t=await qe("transactions-batch-update",{...e,learnCategories:!0});return t.length>0?{updates:t}:{}}async function jO(e,t,n){let r=await wO(e);n(function(e,t){return vx(Er(t,bx(e)))}(t.newTransaction,r),Er(r,t.data))}function SO(e){let{tableRef:t,transactions:n,allTransactions:r,loadMoreTransactions:o,account:i,accounts:a,categoryGroups:l,payees:s,balances:u,showCleared:c,showAccount:d,headerContent:f,animated:p,isAdding:y,isNew:g,isMatched:m,isFiltered:v,dateFormat:b,hideFraction:x,addNotification:w,renderEmpty:j,onChange:S,onRefetch:k,onCloseAddTransaction:C,onCreatePayee:_}=e,O=(0,h.useRef)(),E=Ri();(0,h.useLayoutEffect)((()=>{O.current=n}),[n]);let T=(0,h.useCallback)((async e=>{e=Cx(e),await wO({added:e}),k()}),[]),P=(0,h.useCallback)((async e=>{let t=jx(O.current,e);if(t.diff.updated.length>0){!!t.diff.updated[0].date?(t.diff.updated[0].sort_order=Date.now(),await wO(t.diff),k()):(S(t.newTransaction,t.data),jO(t.diff,t,S))}}),[]),A=(0,h.useCallback)((e=>{const t=wx(O.current,e);return S(t.newTransaction,t.data),jO(t.diff,t,S),t.diff.added[0].id}),[]),M=(0,h.useCallback)((e=>{const t=kx(O.current,e);return S(t.newTransaction,t.data),jO(t.diff,t,S),t.diff.added[0].id}),[]),D=(0,h.useCallback)((async e=>{let t=Or(e,await qe("rules-run",{transaction:e})),n={...e};return t&&Object.keys(t).forEach((e=>{null!=n[e]&&""!==n[e]&&0!==n[e]&&!1!==n[e]||(n[e]=t[e])})),n}),[]),I=(0,h.useCallback)((e=>{E.push("/payees",{selectedPayee:e})}),[E]);return(0,wo.jsx)(xO,{ref:t,transactions:r,loadMoreTransactions:o,accounts:a,categoryGroups:l,payees:s,balances:u,showCleared:c,showAccount:d,showCategory:!0,animated:p,currentAccountId:i&&i.id,isAdding:y,isNew:g,isMatched:m,isFiltered:v,dateFormat:b,hideFraction:x,addNotification:w,headerContent:f,renderEmpty:j,onSave:P,onApplyRules:D,onSplit:M,onCloseAddTransaction:C,onAdd:T,onAddSplit:A,onManagePayees:I,onCreatePayee:_,style:{backgroundColor:"white"}})}function kO(e){let{onAdd:t}=e;return(0,wo.jsx)(Ll,{style:{backgroundColor:"white",flex:1,alignItems:"center",borderTopWidth:1,borderColor:go.n9},children:(0,wo.jsxs)(Ll,{style:{width:550,marginTop:75,fontSize:15,alignItems:"center"},children:[(0,wo.jsxs)(ql,{style:{textAlign:"center",lineHeight:"1.4em"},children:["For Actual to be useful, you need to ",(0,wo.jsx)("strong",{children:"add an account"}),". You can link an account to automatically download transactions, or manage it locally yourself."]}),(0,wo.jsx)(zl,{primary:!0,style:{marginTop:20},onClick:t,children:"Add account"}),(0,wo.jsx)(Ll,{style:{marginTop:20,fontSize:13,color:go.n5},children:"In the future, you can add accounts from the sidebar."})]})})}function CO(e){let{balanceQuery:t,targetBalance:n,onDone:r,onCreateTransaction:o}=e,i=bw({name:t.name+"-cleared",value:0,query:t.query.filter({cleared:!0})}),a=n-i;return(0,wo.jsx)(Ll,{style:{flexDirection:"row",alignSelf:"center",backgroundColor:"white",...mo.shadow,borderRadius:4,marginTop:5,marginBottom:15,padding:10},children:(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[0===a?(0,wo.jsxs)(Ll,{style:{color:go.g4,flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},children:[(0,wo.jsx)(Xx,{style:{width:13,height:13,color:go.g5,marginRight:3}}),"All reconciled!"]}):(0,wo.jsx)(Ll,{style:{color:go.n3},children:(0,wo.jsxs)(ql,{style:{fontStyle:"italic",textAlign:"center"},children:["Your cleared balance"," ",(0,wo.jsx)("strong",{children:yw(i,"financial")})," needs"," ",(0,wo.jsx)("strong",{children:(a>0?"+":"")+yw(a,"financial")})," ","to match",(0,wo.jsx)("br",{})," your bank\u2019s balance of"," ",(0,wo.jsx)(ql,{style:{fontWeight:700},children:yw(n,"financial")})]})}),(0,wo.jsx)(Ll,{style:{marginLeft:15},children:(0,wo.jsx)(zl,{primary:!0,onClick:r,children:"Done Reconciling"})}),0!==a&&(0,wo.jsx)(Ll,{style:{marginLeft:15},children:(0,wo.jsx)(zl,{onClick:()=>o(a),children:"Create Reconciliation Transaction"})})]})})}function _O(e){let{account:t,onReconcile:n,onClose:r}=e,o=bw(ix(t));return(0,wo.jsx)(Ps,{position:"bottom-right",width:275,onClose:r,children:(0,wo.jsxs)(Ll,{style:{padding:"5px 8px"},children:[(0,wo.jsx)(ql,{children:"Enter the current balance of your bank account that you want to reconcile with:"}),(0,wo.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=e.target.elements[0],i=Hr(t.value);null!=i?(n(null==i?o:i),r()):t.select()},children:[null!=o&&(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{defaultValue:yw(o,"financial"),style:{margin:"7px 0"}})}),(0,wo.jsx)(zl,{primary:!0,children:"Reconcile"})]})]})})}function OO(e){let{onClick:t}=e;return(0,wo.jsx)(zl,{bare:!0,onClick:t,"aria-label":"Menu",children:(0,wo.jsx)(qx,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}})})}function EO(e){let{onClose:t,children:n}=e;return(0,wo.jsx)(Ps,{position:"bottom-right",width:200,style:{padding:0},onClose:t,children:n})}function TO(e){let{account:t,canSync:n,syncEnabled:r,showBalances:o,canShowBalances:i,showCleared:a,onClose:l,onReconcile:s,onMenuSelect:u}=e,[c,d]=(0,h.useState)("default");const f=$x();return"reconcile"===c?(0,wo.jsx)(_O,{account:t,onClose:l,onReconcile:s}):(0,wo.jsx)(EO,{onClose:l,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{"reconcile"===e?d("reconcile"):u(e)},items:[i&&{name:"toggle-balance",text:(o?"Hide":"Show")+" Running Balance"},{name:"toggle-cleared",text:(a?"Hide":"Show")+" \u201cCleared\u201d Checkboxes"},{name:"export",text:"Export"},{name:"reconcile",text:"Reconcile"},r&&t&&!t.closed&&(n?{name:"unlink",text:"Unlink Account"}:"online"===f&&{name:"link",text:"Link Account"}),t.closed?{name:"reopen",text:"Reopen Account"}:{name:"close",text:"Close Account"}].filter((e=>e))})})}function PO(e){let{onClose:t,onMenuSelect:n}=e;return(0,wo.jsx)(EO,{onClose:t,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{n(e)},items:[{name:"export",text:"Export"}]})})}function AO(e){let{name:t,balance:n}=e;return(0,wo.jsxs)(ql,{style:{marginLeft:15,backgroundColor:go.n10,borderRadius:4,padding:"4px 6px",color:go.n5},children:[t," ",(0,wo.jsx)(ql,{style:{fontWeight:600},children:yw(n,"financial")})]})}function MO(e){let{selectedItems:t}=e,n=`selected-balance-${[...t].join("-")}`,r=bw({name:n,query:fr("transactions").filter({id:{$oneof:[...t]},parent_id:{$oneof:[...t]}}).select("id")}),o=new Set((r||[]).map((e=>e.id))),i=[...t].filter((e=>!o.has(e))),a=bw({name:n+"-sum",query:fr("transactions").filter({id:{$oneof:i}}).options({splits:"all"}).calculate({$sum:"$amount"})});return null==a?null:(0,wo.jsx)(AO,{name:"Selected balance:",balance:a})}function DO(e){let{balanceQuery:t}=e,n=bw({name:t.name+"-cleared",query:t.query.filter({cleared:!0})}),r=bw({name:t.name+"-uncleared",query:t.query.filter({cleared:!1})});return(0,wo.jsxs)(Ll,{style:{flexDirection:"row"},children:[(0,wo.jsx)(AO,{name:"Cleared total:",balance:n}),(0,wo.jsx)(AO,{name:"Uncleared total:",balance:r})]})}function IO(e){let{balanceQuery:t,showExtraBalances:n,onToggleExtraBalances:r}=e,o=Rx();return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",marginTop:-5,marginLeft:-5},children:[(0,wo.jsxs)(zl,{"data-testid":"account-balance",bare:!0,onClick:r,style:{"& svg":{opacity:o.size>0||n?1:0},"&:hover svg":{opacity:1}},children:[(0,wo.jsx)(vw,{binding:{...t,value:0},type:"financial",style:{fontSize:22,fontWeight:400},getStyle:e=>({color:e<0?go.r5:e>0?go.g5:go.n8})}),(0,wo.jsx)(Gx,{style:{width:10,height:10,marginLeft:10,color:go.n5,transform:n?"rotateZ(180deg)":"rotateZ(0)"}})]}),n&&(0,wo.jsx)(DO,{balanceQuery:t}),o.size>0&&(0,wo.jsx)(MO,{selectedItems:o})]})}function RO(e){let{style:t,getTransaction:n,onShow:r,onDuplicate:o,onDelete:i,onEdit:a,onUnlink:l,onCreateRule:s,onScheduleAction:u}=e,c=Rx(),d=Ri(),f=(0,h.useMemo)((()=>{let e=[...c];return{preview:!!e.find((e=>mO(e))),trans:!!e.find((e=>!mO(e)))}}),[c]),p=(0,h.useMemo)((()=>{let e=[...c].map((e=>n(e)));return e.some((e=>e&&e.is_child))}),[c]),y=(0,h.useMemo)((()=>!f.preview&&[...c].every((e=>{let t=n(e);return t&&t.schedule}))),[f.preview,c,n]);return(0,wo.jsx)(ij,{name:"transactions",keyHandlers:f.trans&&{f:()=>r([...c]),d:()=>i([...c]),a:()=>a("account",[...c]),p:()=>a("payee",[...c]),n:()=>a("notes",[...c]),c:()=>a("category",[...c]),l:()=>a("cleared",[...c])},items:[...f.trans?[{name:"show",text:"Show",key:"F"},{name:"duplicate",text:"Duplicate",disabled:p},{name:"delete",text:"Delete",key:"D"},...y?[{name:"view-schedule",text:"View schedule",disabled:c.size>1},{name:"unlink-schedule",text:"Unlink schedule"}]:[{name:"link-schedule",text:"Link schedule"},{name:"create-rule",text:"Create rule"}],Hs.line,{type:Hs.label,name:"Edit field"},{name:"date",text:"Date"},{name:"account",text:"Account",key:"A"},{name:"payee",text:"Payee",key:"P"},{name:"notes",text:"Notes",key:"N"},{name:"category",text:"Category",key:"C"},{name:"amount",text:"Amount"},{name:"cleared",text:"Cleared",key:"L"}]:[{name:"view-schedule",text:"View schedule"},{name:"post-transaction",text:"Post transaction"},{name:"skip",text:"Skip scheduled date"}]],onSelect:e=>{switch(e){case"show":r([...c]);break;case"duplicate":o([...c]);break;case"delete":i([...c]);break;case"post-transaction":case"skip":u(e,c);break;case"view-schedule":let t,f=[...c][0];if(mO(f)){t=f.split("/")[1]}else{let e=n(f);t=e&&e.schedule}t&&d.push(`/schedule/edit/${t}`,{locationPtr:d.location});break;case"link-schedule":d.push("/schedule/link",{locationPtr:d.location,transactionIds:[...c]});break;case"unlink-schedule":l([...c]);break;case"create-rule":s([...c]);break;default:a(e,[...c])}}})}const NO=h.memo((e=>{let{tableRef:t,editingName:n,isNameEditable:r,workingHard:o,accountName:i,account:a,accountsSyncing:l,accounts:s,transactions:u,syncEnabled:c,showBalances:d,showExtraBalances:f,showCleared:p,showEmptyMessage:y,balanceQuery:g,reconcileAmount:m,canCalculateBalance:v,search:b,filters:x,savePrefs:w,onSearch:j,onAddTransaction:S,onShowTransactions:k,onDoneReconciling:C,onCreateReconciliationTransaction:_,onToggleExtraBalances:O,onSaveName:E,onExposeName:T,onSync:P,onImport:A,onMenuSelect:M,onReconcile:D,onBatchDelete:I,onBatchDuplicate:R,onBatchEdit:N,onBatchUnlink:L,onCreateRule:F,onApplyFilter:B,onUpdateFilter:z,onDeleteFilter:U,onScheduleAction:W}=e,[H,K]=(0,h.useState)(!1),$=(0,h.useRef)(null),V=lO(),q=c&&a&&a.account_id;return a||(q=!!s.find((e=>!!e.account_id))),(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(cw,{keys:{"mod+f":()=>{$.current&&$.current.focus()}}}),(0,wo.jsxs)(Ll,{style:[mo.pageContent,{paddingBottom:10,flexShrink:0}],children:[(0,wo.jsx)(Ll,{style:{marginTop:2,alignItems:"flex-start"},children:(0,wo.jsx)(Ll,{children:n?(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{defaultValue:i,onEnter:e=>E(e.target.value),onBlur:()=>T(!1),style:{fontSize:25,fontWeight:500,marginTop:-5,marginBottom:-2,marginLeft:-5}})}):r?(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",gap:3,"& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:[(0,wo.jsx)(Ll,{style:{fontSize:25,fontWeight:500,marginRight:5,marginBottom:5},"data-testid":"account-name",children:a&&a.closed?"Closed: "+i:i}),a&&(0,wo.jsx)(hw,{id:`account-${a.id}`}),(0,wo.jsx)(zl,{bare:!0,className:"hover-visible",onClick:()=>T(!0),children:(0,wo.jsx)(Jx,{style:{width:11,height:11,color:go.n8}})})]}):(0,wo.jsx)(Ll,{style:{fontSize:25,fontWeight:500,marginBottom:5},"data-testid":"account-name",children:a&&a.closed?"Closed: "+i:i})})}),(0,wo.jsx)(IO,{balanceQuery:g,showExtraBalances:f,onToggleExtraBalances:O}),(0,wo.jsxs)(Os,{spacing:2,direction:"row",align:"center",style:{marginTop:12},children:[(a&&!a.closed||q)&&(0,wo.jsx)(zl,{bare:!0,onClick:q?P:A,children:q?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(lw,{width:13,height:13,animating:a&&l===a.name||"__all"===l,style:{color:"currentColor",marginRight:4}})," ","Sync"]}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(Zx,{width:13,height:13,style:{color:"currentColor",marginRight:4}})," ","Import"]})}),!y&&(0,wo.jsxs)(zl,{bare:!0,onClick:S,children:[(0,wo.jsx)(Vx,{width:10,height:10,style:{color:"inherit",marginRight:3}})," ","Add New"]}),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(I_,{onApply:B})}),(0,wo.jsx)(Fs,{leftContent:(0,wo.jsx)(tw,{style:{width:13,height:13,flexShrink:0,color:b?go.p7:"inherit",margin:5,marginRight:0}}),rightContent:b&&(0,wo.jsx)(zl,{bare:!0,style:{padding:8},onClick:()=>j(""),title:"Clear search term",children:(0,wo.jsx)(ew,{style:{width:8,height:8,color:"inherit"}})}),inputRef:$,value:b,placeholder:"Search",onKeyDown:e=>{"Escape"===e.key&&j("")},getStyle:e=>[{backgroundColor:"transparent",borderWidth:0,boxShadow:"none",transition:"color .15s","& input::placeholder":{color:go.n1,transition:"color .25s"}},e&&{boxShadow:"0 0 0 2px "+go.b5},!e&&""!==b&&{color:go.p4}],onChange:e=>j(e.target.value)}),o?(0,wo.jsx)(Ll,{children:(0,wo.jsx)(ko,{color:go.n1,style:{width:16,height:16}})}):(0,wo.jsx)(RO,{getTransaction:e=>u.find((t=>t.id===e)),onShow:k,onDuplicate:R,onDelete:I,onEdit:N,onUnlink:L,onCreateRule:F,onScheduleAction:W}),(0,wo.jsx)(zl,{bare:!0,disabled:""!==b||x.length>0,style:{padding:6},onClick:function(){t.current&&(V.dispatch({type:"switch-mode",id:t.current.getScrolledItem()}),w({"expand-splits":!("expand"===V.state.mode)}))},title:"collapse"===V.state.mode?"Collapse split transactions":"Expand split transactions",children:"collapse"===V.state.mode?(0,wo.jsx)(Qx,{style:{width:14,height:14,color:"inherit"}}):(0,wo.jsx)(Yx,{style:{width:14,height:14,color:"inherit"}})}),a?(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(OO,{onClick:()=>K(!0)}),H&&(0,wo.jsx)(TO,{account:a,canSync:q,syncEnabled:c,canShowBalances:v(),showBalances:d,showCleared:p,onMenuSelect:e=>{K(!1),M(e)},onReconcile:D,onClose:()=>K(!1)})]}):(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(OO,{onClick:()=>K(!0)}),H&&(0,wo.jsx)(PO,{onMenuSelect:e=>{K(!1),M(e)},onClose:()=>K(!1)})]})]}),x&&x.length>0&&(0,wo.jsx)(L_,{filters:x,onUpdate:z,onDelete:U})]}),null!=m&&(0,wo.jsx)(CO,{targetBalance:m,balanceQuery:g,onDone:C,onCreateTransaction:_})]})}));function LO(e){let{account:t={},transactions:n,filtered:r,children:o}=e;const{id:i}=t;let a=Eh(),l=(0,h.useMemo)((()=>a?a.schedules.filter((e=>!e.completed&&["due","upcoming","missed"].includes(a.statuses.get(e.id)))):[]),[a]),s=(0,h.useMemo)((()=>l.map((e=>({id:"preview/"+e.id,payee:e._payee,account:e._account,amount:e._amount,date:e.next_date,notes:a.statuses.get(e.id),schedule:e.id,_inverse:i!==e._account})))),[l,i]),u=(0,h.useMemo)((()=>!r&&s.length>0?s.concat(n):n),[r,s,n]);return o(null==a?null:u)}class FO extends h.PureComponent{constructor(e){super(e),this.fetchAllIds=async()=>{let{data:e}=await pr(this.paged.getQuery().select("id"));return e.reduce(((e,t)=>(e.push(t.id),t.subtransactions.forEach((t=>e.push(t.id))),e)),[])},this.refetchTransactions=async()=>{this.paged&&this.paged.run()},this.fetchTransactions=()=>{let e=this.makeRootQuery();this.rootQuery=this.currentQuery=e,this.updateQuery(e),this.props.accountId&&this.props.markAccountRead(this.props.accountId)},this.makeRootQuery=()=>{let e=this.props.location.state,t=this.props.accountId;return e&&e.filter?fr("transactions").options({splits:"grouped"}).filter({"account.offbudget":!1,...e.filter}):rx(t)},this.onSearch=e=>{this.paged.unsubscribe(),this.setState({search:e},this.onSearchDone)},this.onSearchDone=(0,Rf.debounce)((()=>{""===this.state.search?this.updateQuery(this.currentQuery,this.state.filters.length>0):this.updateQuery(ox(this.currentQuery,this.state.search,this.props.dateFormat),!0)}),150),this.onSync=async()=>{const e=this.props.accountId,t=this.props.accounts.find((t=>t.id===e));await this.props.syncAndDownload(t?t.id:null)},this.onImport=async()=>{const e=this.props.accountId;if(this.props.accounts.find((t=>t.id===e))){const t=await window.Actual.openFileDialog({filters:[{name:"Financial Files",extensions:["qif","ofx","qfx","csv"]}]});t&&this.props.pushModal("import-transactions",{accountId:e,filename:t[0],onImported:e=>{e&&this.fetchTransactions()}})}},this.onExport=async e=>{let t=await qe("transactions-export-query",{query:this.currentQuery.serialize()}),n=`${e&&e.replace(/[()]/g,"").replace(/\s+/g,"-")||"transactions"}.csv`;window.Actual.saveFile(t,n,"Export Transactions")},this.onTransactionsChange=(e,t)=>{this.paged.optimisticUpdate((t=>e._deleted?t.filter((t=>t.id!==e.id)):t.map((t=>t.id===e.id?e:t))),(e=>t)),this.props.updateNewTransactions(e.id)},this.canCalculateBalance=()=>{let e=this.props.accountId;return this.props.accounts.find((t=>t.id===e))&&""===this.state.search&&0===this.state.filters.length},this.onAddTransaction=()=>{this.setState({isAdding:!0})},this.onExposeName=e=>{this.setState({editingName:e})},this.onSaveName=e=>{if(e.trim().length){const t=this.props.accountId,n=this.props.accounts.find((e=>e.id===t));this.props.updateAccount({...n,name:e}),this.setState({editingName:!1})}},this.onToggleExtraBalances=()=>{let{accountId:e,showExtraBalances:t}=this.props,n="show-extra-balances-"+e;this.props.savePrefs({[n]:!t})},this.onMenuSelect=async e=>{const t=this.props.accountId,n=this.props.accounts.find((e=>e.id===t));switch(e){case"link":nw(this.props.pushModal,{upgradingAccountId:t});break;case"unlink":this.props.unlinkAccount(t);break;case"close":this.props.openAccountCloseModal(t);break;case"reopen":this.props.reopenAccount(t);break;case"export":const e=this.getAccountTitle(n,t);this.onExport(e);break;case"toggle-balance":this.state.showBalances?(this.props.savePrefs({["show-balances-"+t]:!1}),this.setState({showBalances:!1,balances:[]})):(this.props.savePrefs({["show-balances-"+t]:!0}),this.setState({showBalances:!0}),this.calculateBalances());break;case"toggle-cleared":this.state.showCleared?(this.props.savePrefs({["hide-cleared-"+t]:!0}),this.setState({showCleared:!1})):(this.props.savePrefs({["hide-cleared-"+t]:!1}),this.setState({showCleared:!0}))}},this.isNew=e=>this.props.newTransactions.includes(e),this.isMatched=e=>this.props.matchedTransactions.includes(e),this.onCreatePayee=e=>""!==e.trim()?this.props.createPayee(e):null,this.onReconcile=e=>{this.setState({reconcileAmount:e})},this.onDoneReconciling=()=>{this.setState({reconcileAmount:null})},this.onCreateReconciliationTransaction=async e=>{const t=Cx([{id:"temp",account:this.props.accountId,cleared:!0,amount:e,date:Jp(),notes:"Reconciliation balance adjustment"}]);this.setState({transactions:[...this.state.transactions,...t]}),await qe("transactions-batch-update",{added:t}),await this.refetchTransactions()},this.onShowTransactions=async e=>{this.onApplyFilter({customName:"Selected transactions",filter:{id:{$oneof:e}}})},this.onBatchEdit=async(e,t)=>{let n=async(e,n)=>{this.setState({workingHard:!0});let{data:r}=await pr(fr("transactions").filter({id:{$oneof:t}}).select("*").options({splits:"grouped"})),o=mx(r),i={deleted:[],updated:[]};"cleared"===e&&(n=!!o.find((e=>!e.cleared)));const a=new Set(t);o.forEach((t=>{if(!a.has(t.id))return;let{diff:r}=jx(o,{...t,[e]:n});o=Er(r,o),i.deleted=i.deleted?i.deleted.concat(r.deleted):r.deleted,i.updated=i.updated?i.updated.concat(r.updated):r.updated,i.added=i.added?i.added.concat(r.added):r.added})),await qe("transactions-batch-update",i),await this.refetchTransactions(),this.table.current&&this.table.current.edit(o[0].id,"select",!1)};"cleared"===e?n("cleared",null):this.props.pushModal("edit-field",{name:e,onSubmit:n})},this.onBatchDuplicate=async e=>{this.setState({workingHard:!0});let{data:t}=await pr(fr("transactions").filter({id:{$oneof:e}}).select("*").options({splits:"grouped"})),n={added:t.reduce(((e,t)=>e.concat(Cx(bx(t)))),[]).map((e=>{let{sort_order:t,...n}=e;return{...n}}))};await qe("transactions-batch-update",n),await this.refetchTransactions()},this.onBatchDelete=async e=>{this.setState({workingHard:!0});let{data:t}=await pr(fr("transactions").filter({id:{$oneof:e}}).select("*").options({splits:"grouped"})),n=mx(t),r=new Set(e),o={deleted:[],updated:[]};n.forEach((e=>{let t=e.parent_id;if(!r.has(e.id)||t&&r.has(t))return;let{diff:i}=Sx(n,e.id);n=Er(i,n),o.deleted=i.deleted?o.deleted.concat(i.deleted):i.deleted,o.updated=i.updated?o.updated.concat(i.updated):i.updated})),await qe("transactions-batch-update",o),await this.refetchTransactions()},this.onBatchUnlink=async e=>{await qe("transactions-batch-update",{updated:e.map((e=>({id:e,schedule:null})))}),await this.refetchTransactions()},this.onCreateRule=async e=>{let{data:t}=await pr(fr("transactions").filter({id:{$oneof:e}}).select("*").options({splits:"grouped"})),n=mx(t),r={stage:null,conditionsOp:"and",conditions:[n[0].imported_payee?{field:"imported_payee",op:"is",value:n[0].imported_payee,type:"string"}:{field:"payee",op:"is",value:n[0].payee,type:"id"}],actions:[{op:"set",field:"category",value:n[0].category,type:"id"}]};this.props.pushModal("edit-rule",{rule:r})},this.onUpdateFilter=(e,t)=>{this.applyFilters(this.state.filters.map((n=>n===e?t:n)))},this.onDeleteFilter=e=>{this.applyFilters(this.state.filters.filter((t=>t!==e)))},this.onApplyFilter=async e=>{let t=this.state.filters;e.customName&&(t=t.filter((t=>t.customName!==e.customName))),this.applyFilters([...t,e])},this.onScheduleAction=async(e,t)=>{switch(e){case"post-transaction":for(let e of t){let t=e.split("/");await qe("schedule/post-transaction",{id:t[1]})}this.refetchTransactions();break;case"skip":for(let e of t){let t=e.split("/");await qe("schedule/skip-next-date",{id:t[1]})}}},this.applyFilters=async e=>{if(e.length>0){let t=e.filter((e=>!!e.customName)).map((e=>e.filter)),{filters:n}=await qe("make-filters-from-conditions",{conditions:e.filter((e=>!e.customName))});this.currentQuery=this.rootQuery.filter({$and:[...n,...t]}),this.updateQuery(this.currentQuery,!0),this.setState({filters:e,search:""})}else this.setState({transactions:[],transactionCount:0}),this.fetchTransactions(),this.setState({filters:e,search:""})},this.paged=null,this.table=h.createRef(),this.animated=!0,this.state={search:"",filters:[],loading:!0,workingHard:!1,reconcileAmount:null,transactions:[],transactionsCount:0,showBalances:e.showBalances,balances:[],showCleared:e.showCleared,editingName:!1,isAdding:!1,latestDate:null}}async componentDidMount(){let e=e=>{if(e.includes("transactions")||e.includes("category_mapping")||e.includes("payee_mapping"))return this.refetchTransactions()},t=async t=>{let n,{tables:r,messages:o,undoTag:i}=t;if(await e(r),o.every((e=>"transactions"===e.dataset))&&!o.find((e=>"tombstone"===e.column))){let e=o.filter((e=>"transactions"===e.dataset&&!("tombstone"===e.column)));n=1===e.length?e[0].row:null}this.table.current&&(this.table.current.edit(null),n&&this.table.current.scrollTo(n)),this.props.setLastUndoState(null)},n=[Ye("undo-event",t)];this.unlisten=()=>{n.forEach((e=>e()))},0===this.props.categoryGroups.length&&await this.props.getCategories(),await this.props.initiallyLoadPayees(),await this.fetchTransactions(),this.props.lastUndoState&&this.props.lastUndoState.current&&t(this.props.lastUndoState.current)}componentDidUpdate(e){e.modalShowing&&!this.props.modalShowing&&setTimeout((()=>{this.refetchTransactions()}),100)}componentWillUnmount(){this.unlisten&&this.unlisten(),this.paged&&this.paged.unsubscribe()}updateQuery(e,t){this.paged&&this.paged.unsubscribe(),this.paged=yr(e.select("*"),(async(e,n)=>{const r=null==n;r&&(this.table.current&&this.table.current.setRowAnimation(!1),t?this.props.splitsExpandedDispatch({type:"set-mode",mode:"collapse"}):this.props.splitsExpandedDispatch({type:"set-mode",mode:this.props.expandSplits?"expand":"collapse"})),this.setState({transactions:e,transactionCount:this.paged.getTotalCount(),transactionsFiltered:t,loading:!1,workingHard:!1},(()=>{this.state.showBalances&&this.calculateBalances(),r&&this.table.current&&this.table.current.scrollToTop(),setTimeout((()=>{this.table.current&&this.table.current.setRowAnimation(!0)}),0)}))}),{pageCount:150,onlySync:!0,mapper:mx})}componentWillReceiveProps(e){this.props.match!==e.match&&this.setState({editingName:!1,loading:!0,search:"",showBalances:e.showBalances,balances:[],showCleared:e.showCleared},(()=>{this.fetchTransactions()}))}async calculateBalances(){if(!this.canCalculateBalance())return;let{data:e}=await pr(this.paged.getQuery().options({splits:"none"}).select([{balance:{$sumOver:"$amount"}}]));this.setState({balances:Ar(e)})}getAccountTitle(e,t){let{filterName:n}=this.props.location.state||{};return n||(e?e.name:"budgeted"===t?"Budgeted Accounts":"offbudget"===t?"Off Budget Accounts":"uncategorized"===t?"Uncategorized":t?null:"All Accounts")}getBalanceQuery(e,t){return{name:`balance-query-${t}`,query:this.makeRootQuery().calculate({$sum:"$amount"})}}render(){let{accounts:e,categoryGroups:t,payees:n,syncEnabled:r,dateFormat:o,hideFraction:i,addNotification:a,accountsSyncing:l,replaceModal:s,showExtraBalances:u,accountId:c}=this.props,{transactions:d,loading:f,workingHard:p,reconcileAmount:h,transactionsFiltered:y,editingName:g,showBalances:m,balances:v,showCleared:b}=this.state,x=e.find((e=>e.id===c));const w=this.getAccountTitle(x,c);if(!w&&!f)return(0,wo.jsx)(wi,{to:"/accounts"});let j=!f&&!c&&0===e.length,S=c&&"budgeted"!==c&&"offbudget"!==c&&"uncategorized"!==c,k=this.getBalanceQuery(x,c);return(0,wo.jsx)(LO,{account:x,transactions:d,filtered:y,children:y=>null==y?null:(0,wo.jsx)(Lx,{name:"transactions",items:y,fetchAllIds:this.fetchAllIds,registerDispatch:e=>this.dispatchSelected=e,children:(0,wo.jsxs)(Ll,{style:[mo.page,{backgroundColor:go.n11}],children:[(0,wo.jsx)(NO,{tableRef:this.table,editingName:g,isNameEditable:S,workingHard:p,account:x,accountName:w,accountsSyncing:l,accounts:e,transactions:d,showBalances:m,showExtraBalances:u,showCleared:b,showEmptyMessage:j,balanceQuery:k,syncEnabled:r,canCalculateBalance:this.canCalculateBalance,reconcileAmount:h,search:this.state.search,filters:this.state.filters,savePrefs:this.props.savePrefs,onSearch:this.onSearch,onShowTransactions:this.onShowTransactions,onMenuSelect:this.onMenuSelect,onAddTransaction:this.onAddTransaction,onToggleExtraBalances:this.onToggleExtraBalances,onSaveName:this.onSaveName,onExposeName:this.onExposeName,onReconcile:this.onReconcile,onDoneReconciling:this.onDoneReconciling,onCreateReconciliationTransaction:this.onCreateReconciliationTransaction,onSync:this.onSync,onImport:this.onImport,onBatchDelete:this.onBatchDelete,onBatchDuplicate:this.onBatchDuplicate,onBatchEdit:this.onBatchEdit,onBatchUnlink:this.onBatchUnlink,onCreateRule:this.onCreateRule,onUpdateFilter:this.onUpdateFilter,onDeleteFilter:this.onDeleteFilter,onApplyFilter:this.onApplyFilter,onScheduleAction:this.onScheduleAction}),(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(SO,{tableRef:this.table,account:x,transactions:d,allTransactions:y,animated:this.animated,loadMoreTransactions:()=>this.paged&&this.paged.fetchNext(),accounts:e,categoryGroups:t,payees:n,balances:m&&this.canCalculateBalance()?v:null,showCleared:b,showAccount:!c||"offbudget"===c||"budgeted"===c||"uncategorized"===c,isAdding:this.state.isAdding,isNew:this.isNew,isMatched:this.isMatched,isFiltered:""!==this.state.search||this.state.filters.length>0,dateFormat:o,hideFraction:i,addNotification:a,renderEmpty:()=>j?(0,wo.jsx)(kO,{onAdd:()=>s(r?"add-account":"add-local-account")}):f?null:(0,wo.jsx)(Ll,{style:{marginTop:20,textAlign:"center",fontStyle:"italic"},children:"No transactions"}),onChange:this.onTransactionsChange,onRefetch:this.refetchTransactions,onRefetchUpToRow:e=>this.paged.refetchUpToRow(e,{field:"date",order:"desc"}),onCloseAddTransaction:()=>this.setState({isAdding:!1}),onCreatePayee:this.onCreatePayee})})]})})})}}function BO(e){let{dispatch:t}=lO();return(0,wo.jsx)(FO,{...e,splitsExpandedDispatch:t})}function zO(t){const n=Ox("syncAccount");let r=xe((e=>({newTransactions:e.queries.newTransactions,matchedTransactions:e.queries.matchedTransactions,accounts:e.queries.accounts,failedAccounts:e.account.failedAccounts,categoryGroups:e.queries.categories.grouped,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy",hideFraction:e.prefs.local.hideFraction||!1,expandSplits:t.match&&e.prefs.local["expand-splits"],showBalances:t.match&&e.prefs.local["show-balances-"+t.match.params.id],showCleared:t.match&&!e.prefs.local["hide-cleared-"+t.match.params.id],showExtraBalances:t.match&&e.prefs.local["show-extra-balances-"+t.match.params.id],payees:e.queries.payees,modalShowing:e.modals.modalStack.length>0,accountsSyncing:e.account.accountsSyncing,lastUndoState:e.app.lastUndoState,tutorialStage:e.tutorial.stage}))),o=ge(),i=(0,h.useMemo)((()=>Q(e,o)),[o]),a=Li(),l=Ni(),s=(0,h.useContext)(rw),u=(0,h.useMemo)((()=>{let e=nx(a.id,"_account"),t=nx(a.id,"_payee.transfer_acct");return(l.state&&l.state.filter||"uncategorized"===a.id)&&(e={id:null},t={id:null}),n=>(n=n.filter({$and:[{"_account.closed":!1}],$or:[e,t]})).orderBy({next_date:"desc"})}),[a.id]);return(0,wo.jsx)(Oh,{transform:u,children:(0,wo.jsx)(sO,{initialMode:r.expandSplits?"collapse":"expand",children:(0,wo.jsx)(BO,{...r,...i,syncEnabled:n,modalShowing:r.modalShowing||!(!s.state||!s.state.locationPtr),accountId:a.id,location:t.location})})})}const UO=e=>t=>{class n extends h.Component{componentDidMount(){WO(e)}componentDidUpdate(){WO(e)}render(){return(0,wo.jsx)(t,{...this.props})}}return n};function WO(e){[...document.getElementsByTagName("meta")].find((e=>"theme-color"===e.name)).setAttribute("content",e)}function HO(e){let{onSync:t,children:n}=e,[r,o]=(0,h.useState)(!1);return n({refreshing:r,onRefresh:async function(){o(!0),await t(),o(!1)}})}var KO=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M7.05 9.293 6.343 10 12 15.657l1.414-1.414L9.172 10l4.242-4.243L12 4.343z",fill:"currentColor"})});function $O(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":o,labelElementType:i="label"}=e;t=mj(t);let a=mj(),l={};n?(r=r?`${r} ${a}`:a,l={id:a,htmlFor:"label"===i?t:void 0}):r||o||console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");let s=function(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;if(n=mj(n),o&&r){let e=new Set([...o.trim().split(/\s+/),n]);o=[...e].join(" ")}else o&&(o=o.trim().split(/\s+/).join(" "));return r||o||!t||(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}({id:t,"aria-label":o,"aria-labelledby":r});return{labelProps:l,fieldProps:s}}const VO=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),qO=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function GO(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script;return VO.has(t)}let t=e.split("-")[0];return qO.has(t)}function YO(){let e="undefined"!==typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch(t){e="en-US"}return{locale:e,direction:GO(e)?"rtl":"ltr"}}let QO=YO(),XO=new Set;function ZO(){QO=YO();for(let e of XO)e(QO)}function JO(){let e=function(){let e=(0,h.useContext)(dj)!==cj,[t,n]=(0,h.useState)(e);return"undefined"!==typeof window&&e&&(0,h.useLayoutEffect)((()=>{n(!1)}),[]),t}(),[t,n]=(0,h.useState)(QO);return(0,h.useEffect)((()=>(0===XO.size&&window.addEventListener("languagechange",ZO),XO.add(n),()=>{XO.delete(n),0===XO.size&&window.removeEventListener("languagechange",ZO)})),[]),e?{locale:"en-US",direction:"ltr"}:t}const eE=h.createContext(null);function tE(){let e=JO();return(0,h.useContext)(eE)||e}new WeakMap;let nE=new Map;function rE(e){let{locale:t}=tE(),n=t+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"");if(nE.has(n))return nE.get(n);let r=new Intl.Collator(t,e);return nE.set(n,r),r}function oE(e){return Fj()||Bj()?e.altKey:e.ctrlKey}function iE(e){return Fj()?e.metaKey:e.ctrlKey}function aE(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:o=!1,shouldFocusWrap:i=!1,disallowEmptySelection:a=!1,disallowSelectAll:l=!1,selectOnFocus:s="replace"===t.selectionBehavior,disallowTypeAhead:u=!1,shouldUseVirtualFocus:c,allowsTabNavigation:d=!1,isVirtualized:f,scrollRef:p=r}=e,{direction:y}=tE(),g=(0,h.useRef)({top:0,left:0});!function(e,t,n,r){let o=(0,h.useRef)(n);o.current=n;let i=null==n;(0,h.useEffect)((()=>{if(i)return;let n=e.current,a=e=>o.current.call(this,e);return n.addEventListener(t,a,r),()=>{n.removeEventListener(t,a,r)}}),[e,t,r,i])}(p,"scroll",f?null:()=>{g.current={top:p.current.scrollTop,left:p.current.scrollLeft}});const m=(0,h.useRef)(o);(0,h.useEffect)((()=>{if(m.current){let e=null;"first"===o&&(e=n.getFirstKey()),"last"===o&&(e=n.getLastKey());let i=t.selectedKeys;i.size&&(e=i.values().next().value),t.setFocused(!0),t.setFocusedKey(e),null!=e||c||MS(r.current)}m.current=!1}),[]),(0,h.useEffect)((()=>{if(!f&&t.focusedKey&&(null===p||void 0===p?void 0:p.current)){let e=p.current.querySelector(`[data-key="${t.focusedKey}"]`);e&&Uj(p.current,e)}}),[f,p,t.focusedKey]);let v,b={onKeyDown:e=>{if(e.altKey&&"Tab"===e.key&&e.preventDefault(),!r.current.contains(e.target))return;const o=(n,r)=>{null!=n&&(t.setFocusedKey(n,r),e.shiftKey&&"multiple"===t.selectionMode?t.extendSelection(n):s&&!oE(e)&&t.replaceSelection(n))};switch(e.key){case"ArrowDown":if(n.getKeyBelow){var u,c;e.preventDefault();let r=null!=t.focusedKey?n.getKeyBelow(t.focusedKey):null===(u=n.getFirstKey)||void 0===u?void 0:u.call(n);null==r&&i&&(r=null===(c=n.getFirstKey)||void 0===c?void 0:c.call(n,t.focusedKey)),o(r)}break;case"ArrowUp":if(n.getKeyAbove){var f,p;e.preventDefault();let r=null!=t.focusedKey?n.getKeyAbove(t.focusedKey):null===(f=n.getLastKey)||void 0===f?void 0:f.call(n);null==r&&i&&(r=null===(p=n.getLastKey)||void 0===p?void 0:p.call(n,t.focusedKey)),o(r)}break;case"ArrowLeft":if(n.getKeyLeftOf){e.preventDefault(),o(n.getKeyLeftOf(t.focusedKey),"rtl"===y?"first":"last")}break;case"ArrowRight":if(n.getKeyRightOf){e.preventDefault(),o(n.getKeyRightOf(t.focusedKey),"rtl"===y?"last":"first")}break;case"Home":if(n.getFirstKey){e.preventDefault();let r=n.getFirstKey(t.focusedKey,iE(e));t.setFocusedKey(r),iE(e)&&e.shiftKey&&"multiple"===t.selectionMode?t.extendSelection(r):s&&t.replaceSelection(r)}break;case"End":if(n.getLastKey){e.preventDefault();let r=n.getLastKey(t.focusedKey,iE(e));t.setFocusedKey(r),iE(e)&&e.shiftKey&&"multiple"===t.selectionMode?t.extendSelection(r):s&&t.replaceSelection(r)}break;case"PageDown":if(n.getKeyPageBelow){e.preventDefault(),o(n.getKeyPageBelow(t.focusedKey))}break;case"PageUp":if(n.getKeyPageAbove){e.preventDefault(),o(n.getKeyPageAbove(t.focusedKey))}break;case"a":iE(e)&&"multiple"===t.selectionMode&&!0!==l&&(e.preventDefault(),t.selectAll());break;case"Escape":e.preventDefault(),a||t.clearSelection();break;case"Tab":if(!d){if(e.shiftKey)r.current.focus();else{let e,t,n=qS(r.current,{tabbable:!0});do{t=n.lastChild(),t&&(e=t)}while(t);e&&!e.contains(document.activeElement)&&Cj(e)}break}}},onFocus:e=>{if(t.isFocused)e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey){let i=e=>{null!=e&&(t.setFocusedKey(e),s&&t.replaceSelection(e))},a=e.relatedTarget;var r,o;a&&e.currentTarget.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?i(null!==(r=t.lastSelectedKey)&&void 0!==r?r:n.getLastKey()):i(null!==(o=t.firstSelectedKey)&&void 0!==o?o:n.getFirstKey())}else if(!f){p.current.scrollTop=g.current.top,p.current.scrollLeft=g.current.left;let e=p.current.querySelector(`[data-key="${t.focusedKey}"]`);e&&(Cj(e),Uj(p.current,e))}},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)},onMouseDown(e){e.currentTarget.contains(e.target)&&e.preventDefault()}},{typeSelectProps:x}=function(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,o=(0,h.useRef)({search:"",timeout:null}).current;return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{let i=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(e.key);if(!i||e.ctrlKey||e.metaKey)return;" "===i&&o.search.trim().length>0&&(e.preventDefault(),"continuePropagation"in e||e.stopPropagation()),o.search+=i;let a=t.getKeyForSearch(o.search,n.focusedKey);null==a&&(a=t.getKeyForSearch(o.search)),null!=a&&(n.setFocusedKey(a),r&&r(a)),clearTimeout(o.timeout),o.timeout=setTimeout((()=>{o.search=""}),500)}:null}}}({keyboardDelegate:n,selectionManager:t});return u||(b=wj(x,b)),c||(v=null==t.focusedKey?0:-1),{collectionProps:{...b,tabIndex:v}}}function lE(){let e=window.event;return"Enter"===(null===e||void 0===e?void 0:e.key)}function sE(){let e=window.event;return" "===(null===e||void 0===e?void 0:e.key)||"Space"===(null===e||void 0===e?void 0:e.code)}class uE{getKeyBelow(e){for(e=this.collection.getKeyAfter(e);null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyAfter(e)}}getKeyAbove(e){for(e=this.collection.getKeyBefore(e);null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyBefore(e)}}getFirstKey(){let e=this.collection.getFirstKey();for(;null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyAfter(e)}}getLastKey(){let e=this.collection.getLastKey();for(;null!=e;){if("item"===this.collection.getItem(e).type&&!this.disabledKeys.has(e))return e;e=this.collection.getKeyBefore(e)}}getItem(e){return this.ref.current.querySelector(`[data-key="${e}"]`)}getKeyPageAbove(e){let t=this.ref.current,n=this.getItem(e);if(!n)return null;let r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);for(;n&&n.offsetTop>r;)e=this.getKeyAbove(e),n=this.getItem(e);return e}getKeyPageBelow(e){let t=this.ref.current,n=this.getItem(e);if(!n)return null;let r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);for(;n&&n.offsetTop<r;)e=this.getKeyBelow(e),n=this.getItem(e);return e}getKeyForSearch(e,t){if(!this.collator)return null;let n=this.collection,r=t||this.getFirstKey();for(;null!=r;){let t=n.getItem(r),o=t.textValue.slice(0,e.length);if(t.textValue&&0===this.collator.compare(o,e))return r;r=this.getKeyBelow(r)}return null}constructor(e,t,n,r){this.collection=e,this.disabledKeys=t,this.ref=n,this.collator=r}}function cE(e){return null}function dE(e){return null!=e.hasChildItems?e.hasChildItems:!!e.childItems||!!(e.title&&h.Children.count(e.children)>0)}cE.getCollectionNode=function*(e,t){let{childItems:n,title:r,children:o}=e,i=e.title||e.children,a=e.textValue||("string"===typeof i?i:"")||e["aria-label"]||"";a||(null===t||void 0===t?void 0:t.suppressTextValueWarning)||console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."),yield{type:"item",props:e,rendered:i,textValue:a,"aria-label":e["aria-label"],hasChildNodes:dE(e),*childNodes(){if(n)for(let e of n)yield{type:"item",value:e};else if(r){let e=[];h.Children.forEach(o,(t=>{e.push({type:"item",element:t})})),yield*e}}}};let fE=cE;function pE(e){return null}pE.getCollectionNode=function*(e){let{children:t,title:n,items:r}=e;yield{type:"section",hasChildNodes:!0,rendered:n,"aria-label":e["aria-label"],*childNodes(){if("function"===typeof t){if(!r)throw new Error("props.children was a function but props.items is missing");for(let e of r)yield{type:"item",value:e,renderer:t}}else{let e=[];h.Children.forEach(t,(t=>{e.push({type:"item",element:t})})),yield*e}}}};let hE=pE;class yE{build(e,t){return this.context=t,gE((()=>this.iterateCollection(e)))}*iterateCollection(e){let{children:t,items:n}=e;if("function"===typeof t){if(!n)throw new Error("props.children was a function but props.items is missing");for(let n of e.items)yield*this.getFullNode({value:n},{renderer:t})}else{let e=[];h.Children.forEach(t,(t=>{e.push(t)}));let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}getKey(e,t,n,r){if(null!=e.key)return e.key;if("cell"===t.type&&null!=t.key)return`${r}${t.key}`;let o=t.value;if(null!=o){var i;let e=null!==(i=o.key)&&void 0!==i?i:o.id;if(null==e)throw new Error("No key found for item");return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){let o=e.element;if(!o&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context)))return n.index=e.index,n.parentKey=r?r.key:null,void(yield n);o=t.renderer(e.value)}if(h.isValidElement(o)){let i=o.type;if("function"!==typeof i&&"function"!==typeof i.getCollectionNode){let e="function"===typeof o.type?o.type.name:o.type;throw new Error(`Unknown element <${e}> in collection.`)}let a=i.getCollectionNode(o.props,this.context),l=e.index,s=a.next();for(;!s.done&&s.value;){let i=s.value;e.index=l;let u=i.key;u||(u=i.element?null:this.getKey(o,e,t,n));let c=[...this.getFullNode({...i,key:u,index:l,wrapper:mE(e.wrapper,i.wrapper)},this.getChildState(t,i),n?`${n}${o.key}`:o.key,r)];for(let t of c){if(t.value=i.value||e.value,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw new Error(`Unsupported type <${vE(t.type)}> in <${vE(r.type)}>. Only <${vE(e.type)}> is supported.`);l++,yield t}s=a.next(c)}return}if(null==e.key)return;let i=this,a={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value,level:r?r.level+1:0,index:e.index,rendered:e.rendered,textValue:e.textValue,"aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes,childNodes:gE((function*(){if(!e.hasChildNodes)return;let n=0;for(let r of e.childNodes()){null!=r.key&&(r.key=`${a.key}${r.key}`),r.index=n;let e=i.getFullNode(r,i.getChildState(t,r),a.key,a);for(let t of e)n++,yield t}}))};yield a}constructor(){this.cache=new WeakMap}}function gE(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||(n=e());for(let e of n)t.push(e),yield e}}}function mE(e,t){return e&&t?n=>e(t(n)):e||(t||void 0)}function vE(e){return e[0].toUpperCase()+e.slice(1)}const bE=new WeakMap;function xE(e){let t=bE.get(e);if(null!=t)return t;t=0;for(let n of e)"section"===n.type?t+=xE(n.childNodes):t++;return bE.set(e,t),t}const wE=new WeakMap;function jE(e,t){let n=wE.get(e);if(!n)throw new Error("Unknown list");return`${n.id}-option-${function(e){return"string"===typeof e?e.replace(/\s*/g,""):""+e}(t)}`}function SE(e,t,n){let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{labelable:n,propNames:r}=t,o={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(jj.has(i)||n&&Sj.has(i)||(null===r||void 0===r?void 0:r.has(i))||kj.test(i))&&(o[i]=e[i]);return o}(e,{labelable:!0}),{listProps:o}=function(e){let{selectionManager:t,collection:n,disabledKeys:r,ref:o,keyboardDelegate:i,autoFocus:a,shouldFocusWrap:l,isVirtualized:s,disallowEmptySelection:u,selectOnFocus:c="replace"===t.selectionBehavior,disallowTypeAhead:d,shouldUseVirtualFocus:f,allowsTabNavigation:p}=e,y=rE({usage:"search",sensitivity:"base"}),g=t.disabledBehavior,m=(0,h.useMemo)((()=>i||new uE(n,"selection"===g?new Set:r,o,y)),[i,n,r,o,y,g]),{collectionProps:v}=aE({ref:o,selectionManager:t,keyboardDelegate:m,autoFocus:a,shouldFocusWrap:l,disallowEmptySelection:u,selectOnFocus:c,disallowTypeAhead:d,shouldUseVirtualFocus:f,allowsTabNavigation:p,isVirtualized:s,scrollRef:o});return{listProps:v}}({...e,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys}),{focusWithinProps:i}=kS({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),a=mj(e.id);wE.set(t,{id:a,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized});let{labelProps:l,fieldProps:s}=$O({...e,id:a,labelElementType:"span"});return{labelProps:l,listBoxProps:wj(r,i,"multiple"===t.selectionManager.selectionMode?{"aria-multiselectable":"true"}:{},{role:"listbox",...wj(s,o)})}}function kE(e,t,n){let{key:r}=e,o=wE.get(t);var i;let a=null!==(i=e.isDisabled)&&void 0!==i?i:t.disabledKeys.has(r);var l;let s=null!==(l=e.isSelected)&&void 0!==l?l:t.selectionManager.isSelected(r),u=t.selectionManager.focusedKey===r;var c;let d=null!==(c=e.shouldSelectOnPressUp)&&void 0!==c?c:o.shouldSelectOnPressUp;var f;let p=null!==(f=e.shouldFocusOnHover)&&void 0!==f?f:o.shouldFocusOnHover;var y;let g=null!==(y=e.shouldUseVirtualFocus)&&void 0!==y?y:o.shouldUseVirtualFocus;var m;let v=null!==(m=e.isVirtualized)&&void 0!==m?m:o.isVirtualized,b=bj(),x=bj(),w={role:"option","aria-disabled":a,"aria-selected":"none"!==t.selectionManager.selectionMode?s:void 0};Fj()&&zj()||(w["aria-label"]=e["aria-label"],w["aria-labelledby"]=b,w["aria-describedby"]=x),v&&(w["aria-posinset"]=t.collection.getItem(r).index+1,w["aria-setsize"]=xE(t.collection));let{itemProps:j,isPressed:S}=function(e){let{selectionManager:t,key:n,ref:r,shouldSelectOnPressUp:o,isVirtualized:i,shouldUseVirtualFocus:a,focus:l,isDisabled:s,onAction:u,allowsDifferentPressOrigin:c}=e,d=e=>{if("keyboard"===e.pointerType&&oE(e))t.toggleSelection(n);else{if("none"===t.selectionMode)return;"single"===t.selectionMode?t.isSelected(n)&&!t.disallowEmptySelection?t.toggleSelection(n):t.replaceSelection(n):e&&e.shiftKey?t.extendSelection(n):"toggle"===t.selectionBehavior||e&&(iE(e)||"touch"===e.pointerType||"virtual"===e.pointerType)?t.toggleSelection(n):t.replaceSelection(n)}};(0,h.useEffect)((()=>{n===t.focusedKey&&t.isFocused&&!a&&document.activeElement!==r.current&&(l?l():MS(r.current))}),[r,n,t.focusedKey,t.childFocusStrategy,t.isFocused,a]);let f={};a||(f={tabIndex:n===t.focusedKey?0:-1,onFocus(e){e.target===r.current&&t.setFocusedKey(n)}}),s=s||t.isDisabled(n);let p=!s&&t.canSelectItem(n),y=u&&!s,g=y&&("replace"===t.selectionBehavior?!p:t.isEmpty),m=y&&p&&"replace"===t.selectionBehavior,v=g||m,b=(0,h.useRef)(null),x=v&&p,w=(0,h.useRef)(!1),j=(0,h.useRef)(!1),S={};o?(S.onPressStart=e=>{b.current=e.pointerType,w.current=x,"keyboard"!==e.pointerType||v&&!sE()||d(e)},c?(S.onPressUp=e=>{"keyboard"!==e.pointerType&&d(e)},S.onPress=g?()=>u():null):S.onPress=e=>{if(g||m&&"mouse"!==e.pointerType){if("keyboard"===e.pointerType&&!lE())return;u()}else"keyboard"!==e.pointerType&&d(e)}):(S.onPressStart=e=>{b.current=e.pointerType,w.current=x,j.current=g,("mouse"===e.pointerType&&!g||"keyboard"===e.pointerType&&(!u||sE()))&&d(e)},S.onPress=e=>{("touch"===e.pointerType||"pen"===e.pointerType||"virtual"===e.pointerType||"keyboard"===e.pointerType&&v&&lE()||"mouse"===e.pointerType&&j.current)&&(v?u():d(e))}),i||(f["data-key"]=n),S.preventFocusOnPress=a;let{pressProps:k,isPressed:C}=Jj(S),_=m?e=>{"mouse"===b.current&&(e.stopPropagation(),e.preventDefault(),u())}:void 0,{longPressProps:O}=AS({isDisabled:!x,onLongPress(e){"touch"===e.pointerType&&(d(e),t.setSelectionBehavior("toggle"))}});return{itemProps:wj(f,p||g?k:{},x?O:{},{onDoubleClick:_,onDragStart:e=>{"touch"===b.current&&w.current&&e.preventDefault()}}),isPressed:C,isSelected:t.isSelected(n),isDisabled:s,allowsSelection:p,hasAction:v}}({selectionManager:t.selectionManager,key:r,ref:n,shouldSelectOnPressUp:d,allowsDifferentPressOrigin:d,isVirtualized:v,shouldUseVirtualFocus:g,isDisabled:a}),{hoverProps:k}=function(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,a]=(0,h.useState)(!1),l=(0,h.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,h.useEffect)(TS,[]);let{hoverProps:s,triggerHoverEnd:u}=(0,h.useMemo)((()=>{let e=(e,r)=>{if(l.pointerType=r,o||"touch"===r||l.isHovered||!e.currentTarget.contains(e.target))return;l.isHovered=!0;let i=e.currentTarget;l.target=i,t&&t({type:"hoverstart",target:i,pointerType:r}),n&&n(!0),a(!0)},i=(e,t)=>{if(l.pointerType="",l.target=null,"touch"===t||!l.isHovered)return;l.isHovered=!1;let o=e.currentTarget;r&&r({type:"hoverend",target:o,pointerType:t}),n&&n(!1),a(!1)},s={};return"undefined"!==typeof PointerEvent?(s.onPointerEnter=t=>{CS&&"mouse"===t.pointerType||e(t,t.pointerType)},s.onPointerLeave=e=>{!o&&e.currentTarget.contains(e.target)&&i(e,e.pointerType)}):(s.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},s.onMouseEnter=t=>{l.ignoreEmulatedMouseEvents||CS||e(t,"mouse"),l.ignoreEmulatedMouseEvents=!1},s.onMouseLeave=e=>{!o&&e.currentTarget.contains(e.target)&&i(e,"mouse")}),{hoverProps:s,triggerHoverEnd:i}}),[t,n,r,o,l]);return(0,h.useEffect)((()=>{o&&u({currentTarget:l.target},l.pointerType)}),[o]),{hoverProps:s,isHovered:i}}({isDisabled:a||!p,onHoverStart(){jS()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r))}});return{optionProps:{...w,...wj(j,k),id:jE(t,r)},labelProps:{id:b},descriptionProps:{id:x},isFocused:u,isSelected:s,isDisabled:a,isPressed:S}}class CE extends Set{constructor(e,t,n){super(e),e instanceof CE?(this.anchorKey=t||e.anchorKey,this.currentKey=n||e.currentKey):(this.anchorKey=t,this.currentKey=n)}}function _E(e){let{selectionMode:t="none",disallowEmptySelection:n,allowDuplicateSelectionEvents:r,selectionBehavior:o="toggle",disabledBehavior:i="all"}=e,a=(0,h.useRef)(!1),[,l]=(0,h.useState)(!1),s=(0,h.useRef)(null),u=(0,h.useRef)(null),[,c]=(0,h.useState)(null),d=(0,h.useMemo)((()=>OE(e.selectedKeys)),[e.selectedKeys]),f=(0,h.useMemo)((()=>OE(e.defaultSelectedKeys,new CE)),[e.defaultSelectedKeys]),[p,y]=function(e,t,n){let[r,o]=(0,h.useState)(e||t),i=(0,h.useRef)(void 0!==e),a=i.current,l=void 0!==e,s=(0,h.useRef)(r);a!==l&&console.warn(`WARN: A component changed from ${a?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),i.current=l;let u=(0,h.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];let a=function(e){if(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];Object.is(s.current,e)||n(e,...r)}l||(s.current=e)};if("function"===typeof e){console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320");let t=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];let u=e(l?s.current:t,...o);return a(u,...r),l?t:u};o(t)}else l||o(e),a(e,...r)}),[l,n]);return l?s.current=e:e=r,[e,u]}(d,f,e.onSelectionChange),g=(0,h.useMemo)((()=>e.disabledKeys?new Set(e.disabledKeys):new Set),[e.disabledKeys]),[m,v]=(0,h.useState)(o);"replace"===o&&"toggle"===m&&"object"===typeof p&&0===p.size&&v("replace");let b=(0,h.useRef)(o);return(0,h.useEffect)((()=>{o!==b.current&&(v(o),b.current=o)}),[o]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:m,setSelectionBehavior:v,get isFocused(){return a.current},setFocused(e){a.current=e,l(e)},get focusedKey(){return s.current},get childFocusStrategy(){return u.current},setFocusedKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"first";s.current=e,u.current=t,c(e)},selectedKeys:p,setSelectedKeys(e){!r&&function(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(e,p)||y(e)},disabledKeys:g,disabledBehavior:i}}function OE(e,t){return e?"all"===e?"all":new CE(e):t}class EE{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){this.state.setFocusedKey(e,t)}get selectedKeys(){return"all"===this.state.selectedKeys?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){return"none"!==this.state.selectionMode&&(e=this.getKey(e),"all"===this.state.selectedKeys?this.canSelectItem(e):this.state.selectedKeys.has(e))}get isEmpty(){return"all"!==this.state.selectedKeys&&0===this.state.selectedKeys.size}get isSelectAll(){if(this.isEmpty)return!1;if("all"===this.state.selectedKeys)return!0;if(null!=this._isSelectAll)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every((e=>t.has(e))),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||(null===n||void 0===n?void 0:n.index)<e.index)&&(e=n)}return null===e||void 0===e?void 0:e.key}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||(null===n||void 0===n?void 0:n.index)>e.index)&&(e=n)}return null===e||void 0===e?void 0:e.key}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if("none"===this.selectionMode)return;if("single"===this.selectionMode)return void this.replaceSelection(e);let t;if(e=this.getKey(e),"all"===this.state.selectedKeys)t=new CE([e],e,e);else{let n=this.state.selectedKeys,r=n.anchorKey||e;t=new CE(n,r,e);for(let o of this.getKeyRange(r,n.currentKey||e))t.delete(o);for(let o of this.getKeyRange(e,r))this.canSelectItem(o)&&t.add(o)}this.state.setSelectedKeys(t)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){let n=[],r=e;for(;r;){let e=this.collection.getItem(r);if((e&&"item"===e.type||"cell"===e.type&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t)return e;if("cell"===t.type&&this.allowsCellSelection)return e;for(;"item"!==t.type&&null!=t.parentKey;)t=this.collection.getItem(t.parentKey);return t&&"item"===t.type?t.key:null}toggleSelection(e){if("none"===this.selectionMode)return;if("single"===this.selectionMode&&!this.isSelected(e))return void this.replaceSelection(e);if(null==(e=this.getKey(e)))return;let t=new CE("all"===this.state.selectedKeys?this.getSelectAllKeys():this.state.selectedKeys);t.has(e)?t.delete(e):this.canSelectItem(e)&&(t.add(e),t.anchorKey=e,t.currentKey=e),this.disallowEmptySelection&&0===t.size||this.state.setSelectedKeys(t)}replaceSelection(e){if("none"===this.selectionMode)return;if(null==(e=this.getKey(e)))return;let t=this.canSelectItem(e)?new CE([e],e,e):new CE;this.state.setSelectedKeys(t)}setSelectedKeys(e){if("none"===this.selectionMode)return;let t=new CE;for(let n of e)if(n=this.getKey(n),null!=n&&(t.add(n),"single"===this.selectionMode))break;this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=[],t=n=>{for(;n;){if(this.canSelectItem(n)){let r=this.collection.getItem(n);"item"===r.type&&e.push(n),r.hasChildNodes&&(this.allowsCellSelection||"item"!==r.type)&&t([...r.childNodes][0].key)}n=this.collection.getKeyAfter(n)}};return t(this.collection.getFirstKey()),e}selectAll(){"multiple"===this.selectionMode&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&("all"===this.state.selectedKeys||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new CE)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode&&("single"===this.selectionMode?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior||t&&("touch"===t.pointerType||"virtual"===t.pointerType)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode||this.state.disabledKeys.has(e))return!1;let t=this.collection.getItem(e);return!(!t||"cell"===t.type&&!this.allowsCellSelection)}isDisabled(e){return this.state.disabledKeys.has(e)&&"all"===this.state.disabledBehavior}constructor(e,t,n){var r;this.collection=e,this.state=t,this.allowsCellSelection=null!==(r=null===n||void 0===n?void 0:n.allowsCellSelection)&&void 0!==r&&r,this._isSelectAll=null}}var TE=Symbol.iterator;class PE{*[TE](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}constructor(e){this.keyMap=new Map,this.iterable=e;let t,n=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&"section"===e.type)for(let t of e.childNodes)n(t)};for(let o of e)n(o);let r=0;for(let[o,i]of this.keyMap)t?(t.nextKey=o,i.prevKey=t.key):(this.firstKey=o,i.prevKey=void 0),"item"===i.type&&(i.index=r++),t=i,t.nextKey=void 0;this.lastKey=null===t||void 0===t?void 0:t.key}}function AE(e){let{filter:t}=e,n=_E(e),r=(0,h.useMemo)((()=>e.disabledKeys?new Set(e.disabledKeys):new Set),[e.disabledKeys]),o=(0,h.useMemo)((()=>({suppressTextValueWarning:e.suppressTextValueWarning})),[e.suppressTextValueWarning]),i=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=(0,h.useMemo)((()=>new yE),[]),i=(0,h.useRef)(null);return(0,h.useMemo)((()=>{let r=o.build(e,n);return i.current=t(r,i.current),i.current}),[o,e.children,e.items,n,...r])}(e,(e=>new PE(t?t(e):e)),o,[t]);return(0,h.useEffect)((()=>{null==n.focusedKey||i.getItem(n.focusedKey)||n.setFocusedKey(null)}),[i,n.focusedKey]),{collection:i,disabledKeys:r,selectionManager:new EE(i,n)}}const ME={SECTION_HEADING:10};let DE=Qr((e=>Ar(e))),IE=Qr((e=>Ar(e)));function RE(e){return-1!==e.indexOf("preview/")}function NE(e){let t,{status:n}=e;switch(n){case"missed":t=go.r3;break;case"due":t=go.y3;break;case"upcoming":t=go.n4}return(0,wo.jsx)(ql,{style:{fontSize:11,color:t,fontStyle:"italic"},children:Mr(n)})}class LE extends h.PureComponent{render(){const{transaction:e,accounts:t,categories:n,payees:r,showCategory:o,added:i,style:a}=this.props;let{id:l,payee:s,amount:u,category:c,cleared:d,is_parent:f,notes:p,schedule:h}=e;RE(l)&&(u=Sh(u));let y=c?function(e,t){return e.find((e=>e.id===t)).name}(n,c):null,g=r&&s&&DE(r)[s],m=g&&g.transfer_acct&&IE(t)[g.transfer_acct],v=function(e,t,n){let{amount:r}=e;return n?`Transfer ${r>0?"from":"to"} ${n.name}`:t?t.name:""}(e,g,m),b=m?"Transfer":f?"Split":y,x=RE(l),w=x&&{fontStyle:"italic",color:go.n5};return(0,wo.jsxs)(WE,{style:[{flex:1,height:60,padding:"5px 10px"},x&&{backgroundColor:go.n11},a],children:[(0,wo.jsxs)(Ll,{style:[{flex:1}],children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[h&&(0,wo.jsx)(G_,{style:{width:12,height:12,marginRight:5,color:w.color||go.n1}}),(0,wo.jsx)(As,{style:[mo.text,w,{fontSize:14,fontWeight:i?"600":"400"},""===v&&{color:go.n6,fontStyle:"italic"}],children:v||"Empty"})]}),x?(0,wo.jsx)(NE,{status:p}):(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",marginTop:3},children:[(0,wo.jsx)(Xx,{style:{width:11,height:11,color:d?go.g6:go.n8,marginRight:5}}),o&&(0,wo.jsx)(As,{style:{fontSize:11,marginTop:1,fontWeight:"400",color:b?go.n3:go.p7,fontStyle:b?null:"italic",textAlign:"left"},children:b||"Uncategorized"})]})]}),(0,wo.jsx)(ql,{style:[mo.text,w,{marginLeft:25,marginRight:5,fontSize:14}],children:zr(u)})]})}}class FE extends h.Component{constructor(){super(...arguments),this.makeData=Qr((e=>{const t=[];return e.forEach((e=>{if(0===t.length||e.date!==t[t.length-1].date){let n=t[t.length-1];if(n&&n.data.length>0){let e=n.data;e[e.length-1].isLast=!0}t.push({id:e.date,date:e.date,data:[]})}e.is_child||t[t.length-1].data.push(e)})),t}))}render(){const{transactions:e,scrollProps:t={},onLoadMore:n}=this.props,r=this.makeData(e);return(0,wo.jsxs)(wo.Fragment,{children:[t.ListHeaderComponent,(0,wo.jsxs)(BE,{...t,"aria-label":"transaction list",label:"",loadMore:n,selectionMode:"none",style:{flex:"1 auto",height:"100%",overflowY:"auto"},children:[0===r.length?(0,wo.jsx)(hE,{children:(0,wo.jsx)(fE,{children:(0,wo.jsx)("div",{style:{display:"flex",justifyContent:"center",width:"100%"},children:(0,wo.jsx)(ql,{style:{fontSize:15},children:"No transactions"})})})}):null,r.map((e=>(0,wo.jsx)(hE,{title:fh(e.date,"MMMM dd, yyyy"),children:e.data.map(((e,t,n)=>(0,wo.jsx)(fE,{style:{fontSize:t===n.length-1?98:"inherit"},textValue:e.id,children:(0,wo.jsx)(LE,{transaction:e,categories:this.props.categories,accounts:this.props.accounts,payees:this.props.payees,showCategory:this.props.showCategory,added:this.props.isNew(e.id),onSelect:()=>{}})},e.id)))},e.id)))]})]})}}function BE(e){let t=AE(e),n=h.useRef(),{listBoxProps:r,labelProps:o}=SE(e,t,n);return(0,h.useEffect)((()=>{function t(){Math.abs(n.current.scrollHeight-n.current.clientHeight-n.current.scrollTop)<n.current.clientHeight&&e.loadMore()}return n.current.addEventListener("scroll",t),()=>{n.current&&n.current.removeEventListener("scroll",t)}}),[t.collection]),(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)("div",{...o,children:e.label}),(0,wo.jsx)("ul",{...r,ref:n,style:{padding:0,listStyle:"none",margin:0,overflowY:"auto",width:"100%"},children:[...t.collection].map((e=>(0,wo.jsx)(zE,{section:e,state:t},e.key)))})]})}function zE(e){let{section:t,state:n}=e,{itemProps:r,headingProps:o,groupProps:i}=function(e){let{heading:t,"aria-label":n}=e,r=mj();return{itemProps:{role:"presentation"},headingProps:t?{id:r,"aria-hidden":!0}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":t?r:void 0}}}({heading:t.rendered,"aria-label":t["aria-label"]});return(0,wo.jsxs)("li",{...r,style:{width:"100%"},children:[t.rendered&&(0,wo.jsx)("div",{...o,style:{...mo.smallText,backgroundColor:go.n10,borderBottom:`1px solid ${go.n9}`,borderTop:`1px solid ${go.n9}`,color:go.n4,display:"flex",justifyContent:"center",paddingBottom:4,paddingTop:4,position:"sticky",top:"0",width:"100%",zIndex:ME.SECTION_HEADING},children:t.rendered}),(0,wo.jsx)("ul",{...i,style:{padding:0,listStyle:"none"},children:[...t.childNodes].map(((e,t,r)=>(0,wo.jsx)(UE,{item:e,state:n,isLast:t===r.length-1},e.key)))})]})}function UE(e){let{isLast:t,item:n,state:r}=e,o=h.useRef(),{optionProps:i,isSelected:a}=kE({key:n.key},r,o),{isFocusVisible:l,focusProps:s}=XS();return(0,wo.jsx)("li",{...wj(i,s),ref:o,style:{background:a?"blueviolet":"transparent",color:a?"white":null,outline:l?"2px solid orange":"none",...!t&&{borderBottom:`1px solid ${go.border}`}},children:n.rendered})}const WE=h.forwardRef(((e,t)=>{let{children:n,style:r,...o}=e;return(0,wo.jsx)(Ll,{style:[{height:50,flexDirection:"row",alignItems:"center",paddingLeft:10,paddingRight:10},r],ref:t,...o,children:n})}));function HE(e){let{accountName:t,onSearch:n}=e;const[r,o]=(0,h.useState)("");return(0,wo.jsx)(Ll,{style:{flexDirection:"row",alignItems:"center",backgroundColor:go.n11,margin:"11px auto 4px",borderRadius:4,padding:10,width:"100%"},children:(0,wo.jsx)(Fs,{leftContent:(0,wo.jsx)(tw,{style:{width:13,height:13,flexShrink:0,color:r?go.p7:"inherit",margin:5,marginRight:0}}),value:r,onUpdate:e=>{o(e),n(e)},placeholder:`Search ${t}`,style:{backgroundColor:go.n11,border:`1px solid ${go.n9}`,fontSize:15,flex:1,height:32,marginLeft:4,padding:8}})})}const KE=70;function $E(e){let{account:t,prependTransactions:n,transactions:r,accounts:o,categories:i,payees:a,balance:l,isNewTransaction:s,onLoadMore:u,onSearch:c,onSelectTransaction:d}=e,f=(0,h.useMemo)((()=>n.concat(r)),[n,r]);return(0,wo.jsxs)(Ll,{style:{flex:1,backgroundColor:go.n11,overflowY:"hidden",width:"100%"},children:[(0,wo.jsxs)(Ll,{style:{alignItems:"center",backgroundColor:go.n11,flexShrink:0,overflowY:"hidden",paddingTop:20,top:0,width:"100%"},children:[(0,wo.jsxs)(Ll,{style:{alignItems:"center",flexDirection:"row",justifyContent:"space-between",width:"100%"},children:[(0,wo.jsxs)(Hi,{to:"/accounts",style:{alignItems:"center",display:"flex",textDecoration:"none",width:KE},children:[(0,wo.jsx)(KO,{style:{color:go.b5,width:32,height:32}}),(0,wo.jsx)(ql,{style:{...mo.text,color:go.b5,fontWeight:500},children:"Back"})]}),(0,wo.jsx)(Ll,{style:{fontSize:16,fontWeight:500},children:t.name}),(0,wo.jsx)(Hi,{to:"transaction/new",style:{visibility:"hidden"},children:(0,wo.jsx)(zl,{bare:!0,style:{justifyContent:"center",width:KE},children:(0,wo.jsx)(Vx,{width:20,height:20})})})]}),(0,wo.jsx)(Qs,{title:"BALANCE",style:{marginTop:10}}),(0,wo.jsx)(vw,{binding:l,type:"financial",debug:!0,style:{fontSize:18,fontWeight:"500"},getStyle:e=>({color:e<0?go.r4:go.p5})}),(0,wo.jsx)(HE,{accountName:t.name,onSearch:c})]}),(0,wo.jsx)(FE,{transactions:f,categories:i,accounts:o,payees:a,showCategory:!t.offbudget,isNew:s,onLoadMore:u,onSelect:d})]})}const VE=Qr(((e,t)=>{let n=nx(e,"_account");return t&&(n={id:null}),e=>(e=e.filter({$and:[n,{"_account.closed":!1}]})).orderBy({next_date:"desc"})}));function qE(e){let{accountId:t,children:n}=e,r=Eh();if(null==r)return n(null);let o=r.schedules.filter((e=>!e.completed&&["due","upcoming","missed"].includes(r.statuses.get(e.id))));return n(o.map((e=>({id:"preview/"+e.id,payee:e._payee,account:e._account,amount:e._amount,date:e.next_date,notes:r.statuses.get(e.id),schedule:e.id}))))}let GE;var YE=de((e=>({accounts:e.queries.accounts,newTransactions:e.queries.newTransactions,updatedAccounts:e.queries.updatedAccounts,categories:e.queries.categories.list,prefs:e.prefs.local})),e)(UO(go.n11)((function(t){Xd();const[n,r]=(0,h.useState)([]),[o,i]=(0,h.useState)(""),[a,l]=(0,h.useState)();let s=xe((e=>({payees:e.queries.payees,newTransactions:e.queries.newTransactions,categories:e.queries.categories.list,prefs:e.prefs.local,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}))),u=ge(),c=(0,h.useMemo)((()=>Q(e,u)),[u]);const{id:d}=t.match.params,f=e=>{GE&&GE.unsubscribe(),GE=yr(e.options({splits:"grouped"}).select("*"),(e=>r(e)),{pageCount:150,mapper:mx})},p=async()=>{let e=(()=>{const{id:e}=t.match.params||{};return rx(e)})();l(e),f(e)};(0,h.useEffect)((()=>{let e;return async function(){e=Ye("sync-event",(e=>{let{type:t,tables:n}=e;"applied"===t&&((n.includes("transactions")||n.includes("category_mapping")||n.includes("payee_mapping"))&&GE&&GE.run(),(n.includes("payees")||n.includes("payee_mapping"))&&c.getPayees())})),0===s.categories.length&&await c.getCategories(),0===t.accounts.length&&await c.getAccounts(),await c.initiallyLoadPayees(),await p(),c.markAccountRead(d)}(),()=>e()}),[]);const y=Nf()((()=>{""===o&&a?f(a):o&&a&&f(ox(a,o,s.dateFormat))}),150);if((0,h.useEffect)(y,[o,a,s.dateFormat]),!t.accounts||!t.accounts.length||!t.match)return null;const g=t.accounts.find((e=>e.id===d)),m=e=>s.newTransactions.includes(e),v=async e=>{GE.unsubscribe(),i(e)};let b=ix(g),x=s.prefs.numberFormat||"comma-dot",w=s.prefs.hideFraction||!1;return(0,wo.jsx)(HO,{onSync:async()=>{await t.syncAndDownload()},children:e=>{let{refreshing:r,onRefresh:i}=e;return(0,wo.jsx)(Oh,{transform:VE(d,""!==o),children:(0,wo.jsx)(qE,{accountId:t.accountId,children:e=>null==e?null:(0,h.createElement)($E,{...s,...c,key:x+w,account:g,accounts:t.accounts,categories:s.categories,payees:s.payees,transactions:n,prependTransactions:e||[],balance:b,isNewTransaction:m,onLoadMore:()=>{GE&&GE.fetchNext()},onSearch:v,onSelectTransaction:()=>{}})})})}})})));function QE(e,t){switch(e){case"brokerage":case"investment":return"investment";case"credit":return"credit";case"loan":return"debt";case"other":return"other";default:switch(t){case"money market":case"savings":return"savings";case"cd":return"cd";default:return"checking"}}}function XE(e){switch(e){case"checking":return"Checking";case"savings":return"Savings";case"cd":return"CD";case"investment":return"Investment";case"credit":return"Credit Card";case"mortgage":return"Mortgage";case"debt":return"Debt";default:return"Other"}}function ZE(e){switch(e){case"investment":case"mortgage":case"debt":case"other":return!0}return!1}let JE=h.createContext({type:"page"});const eT=Ef()?10:20;function tT(e){let{type:t,current:n,children:r}=e;return(0,wo.jsx)(JE.Provider,{value:{type:t,current:n},children:r})}function nT(){return h.useContext(JE)}function rT(e){let{name:t,style:n}=e;return Ef()?(0,wo.jsx)(Ll,{style:[{alignItems:"center",backgroundColor:go.b2,color:"white",flexDirection:"row",flex:"1 0 auto",fontSize:18,fontWeight:500,height:50,justifyContent:"center",overflowY:"auto"},n],children:t}):(0,wo.jsx)(ql,{style:[{fontSize:25,fontWeight:500,paddingLeft:eT,paddingRight:eT,marginBottom:15},n],children:t})}function oT(e){let{title:t,modalSize:n,children:r,titleStyle:o}=e,{type:i,current:a}=nT(),l=Ri();if("modal"===i){let e=n;return"string"===typeof n&&(e="medium"===n?{width:750,height:600}:{width:600}),(0,wo.jsx)(ks,{title:t,isCurrent:a,size:e,onClose:()=>l.goBack(),children:r})}return(0,wo.jsxs)(Ll,{style:Ef()?void 0:mo.page,children:[(0,wo.jsx)(rT,{name:t,style:o}),(0,wo.jsx)(Ll,{style:Ef()?{overflowY:"auto",padding:eT}:{paddingLeft:eT,paddingRight:eT,flex:1},children:r})]})}function iT(e){let{name:t,amount:n}=e;return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",marginTop:28,marginBottom:10},children:[(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(ql,{style:[mo.text,{textTransform:"uppercase",color:go.n5,fontSize:13}],"data-testid":"name",children:t})}),(0,wo.jsx)(vw,{binding:n,style:[mo.text,{color:go.n5,fontSize:13}],type:"financial"})]})}function aT(e){let{account:t,updated:n,getBalanceQuery:r,onSelect:o}=e;return(0,wo.jsx)(Ll,{style:{flex:"1 0 auto",flexDirection:"row",backgroundColor:"white",boxShadow:`0 1px 1px ${go.n7}`,borderRadius:6,marginTop:10},children:(0,wo.jsxs)(zl,{onMouseDown:()=>o(t.id),style:{flexDirection:"row",flex:1,alignItems:"center",borderRadius:6,"&:active":{opacity:.1}},children:[(0,wo.jsxs)(Ll,{style:{flex:"1 auto",height:52,marginTop:10},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(As,{style:[mo.text,{fontSize:17,fontWeight:600,color:n?go.b2:go.n2,paddingRight:30}],children:t.name}),t.bankId&&(0,wo.jsx)(Ll,{style:{backgroundColor:go.g5,marginLeft:"-23px",width:8,height:8,borderRadius:8}})]}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",marginTop:"4px"},children:[(0,wo.jsx)(ql,{style:[mo.smallText,{color:go.n5}],children:XE(t.type)}),(0,wo.jsx)(Of,{style:{width:15,height:15,color:go.n9,marginLeft:8,marginBottom:2}})]})]}),(0,wo.jsx)(vw,{binding:r(t),type:"financial",style:{fontSize:16,color:go.n3},getStyle:e=>e<0&&{color:go.r4}})]})})}function lT(e){let{onAdd:t}=e;return(0,wo.jsxs)(Ll,{style:{flex:1,padding:30},children:[(0,wo.jsx)(ql,{style:mo.text,children:"For Actual to be useful, you need to add an account. You can link an account to automatically download transactions, or manage it locally yourself."}),(0,wo.jsx)(zl,{primary:!0,style:{marginTop:20,alignSelf:"center"},onClick:()=>alert("Account creation is not supported on mobile on the self-hosted service yet"),children:"Add Account"}),(0,wo.jsx)(ql,{style:{marginTop:20,color:go.n5},children:"In the future, you can add accounts using the add button in the header."})]})}class sT extends h.Component{constructor(){super(...arguments),this.isNewTransaction=e=>this.props.newTransactions.includes(e)}render(){const{accounts:e,updatedAccounts:t,getBalanceQuery:n,getOnBudgetBalance:r,getOffBudgetBalance:o,onAddAccount:i,onSelectAccount:a}=this.props,l=e.filter((e=>0===e.offbudget)),s=e.filter((e=>1===e.offbudget));if(0===e.length)return(0,wo.jsx)(lT,{onAdd:i});const u=(0,wo.jsxs)(oT,{title:"Accounts",children:[(0,wo.jsx)(iT,{name:"Budgeted",amount:r()}),l.map(((e,r)=>(0,wo.jsx)(aT,{account:e,updated:t.includes(e.id),getBalanceQuery:n,onSelect:a},e.id))),(0,wo.jsx)(iT,{name:"Off budget",amount:o()}),s.map(((e,r)=>(0,wo.jsx)(aT,{account:e,updated:t.includes(e.id),getBalanceQuery:n,onSelect:a},e.id)))]});return(0,wo.jsx)(Ll,{style:{flex:1},children:u})}}var uT=de((e=>({accounts:e.queries.accounts,newTransactions:e.queries.newTransactions,updatedAccounts:e.queries.updatedAccounts,categories:e.queries.categories.list,prefs:e.prefs.local})),e)(UO(go.b2)((function(e){const t=(0,h.useState)({}),n=Xd();(0,h.useEffect)((()=>{(async()=>{0===e.categories.length&&await e.getCategories(),e.getAccounts()})()}),[]);let{accounts:r,categories:o,newTransactions:i,updatedAccounts:a,prefs:l}=e,s=l.numberFormat||"comma-dot",u=l.hideFraction||!1;return(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(sT,{accounts:r.filter((e=>!e.closed)),categories:o,transactions:t||[],updatedAccounts:a,newTransactions:i,getBalanceQuery:ix,getOnBudgetBalance:lx,getOffBudgetBalance:sx,onAddAccount:()=>{},onSelectAccount:e=>{n(`/accounts/${e}`)},onSelectTransaction:e=>{n(`/transaction/${e}`)}},s+u)})})));const cT={arr:Array.isArray,obj:e=>"[object Object]"===Object.prototype.toString.call(e),fun:e=>"function"===typeof e,str:e=>"string"===typeof e,num:e=>"number"===typeof e,und:e=>void 0===e,nul:e=>null===e,set:e=>e instanceof Set,map:e=>e instanceof Map,equ(e,t){if(typeof e!==typeof t)return!1;if(cT.str(e)||cT.num(e))return e===t;if(cT.obj(e)&&cT.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!cT.und(n)||e===t}};function dT(){const e=(0,h.useState)(!1)[1];return(0,h.useCallback)((()=>e((e=>!e))),[])}function fT(e,t){return cT.und(e)||cT.nul(e)?t:e}function pT(e){return cT.und(e)?[]:cT.arr(e)?e:[e]}function hT(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return cT.fun(e)?e(...n):e}function yT(e){const t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,S(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(cT.und(t))return j({to:t},e);const n=Object.keys(e).reduce(((n,r)=>cT.und(t[r])?j({},n,{[r]:e[r]}):n),{});return j({to:t},n)}class gT{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class mT extends gT{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof gT&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof gT&&e.removeChild(this)))}}class vT extends gT{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof gT&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof gT&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof gT)&&(t[n]=r instanceof gT?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let bT,xT;function wT(e,t){bT={fn:e,transform:t}}function jT(e){xT=e}let ST,kT=e=>"undefined"!==typeof window?window.requestAnimationFrame(e):-1;function CT(e){ST=e}let _T,OT=()=>Date.now();function ET(e){_T=e}let TT,PT,AT=e=>e.current;function MT(e){TT=e}class DT extends vT{constructor(e,t){super(),this.update=void 0,this.payload=e.style?j({},e,{style:TT(e.style)}):e,this.update=t,this.attach()}}let IT=!1;const RT=new Set,NT=()=>{if(!IT)return!1;let e=OT();for(let t of RT){let n=!1;for(let r=0;r<t.configs.length;r++){let o,i,a=t.configs[r];for(let t=0;t<a.animatedValues.length;t++){let r=a.animatedValues[t];if(r.done)continue;let l=a.fromValues[t],s=a.toValues[t],u=r.lastPosition,c=s instanceof gT,d=Array.isArray(a.initialVelocity)?a.initialVelocity[t]:a.initialVelocity;if(c&&(s=s.getValue()),a.immediate)r.setValue(s),r.done=!0;else if("string"!==typeof l&&"string"!==typeof s){if(void 0!==a.duration)u=l+a.easing((e-r.startTime)/a.duration)*(s-l),o=e>=r.startTime+a.duration;else if(a.decay)u=l+d/(1-.998)*(1-Math.exp(-(1-.998)*(e-r.startTime))),o=Math.abs(r.lastPosition-u)<.1,o&&(s=u);else{i=void 0!==r.lastTime?r.lastTime:e,d=void 0!==r.lastVelocity?r.lastVelocity:a.initialVelocity,e>i+64&&(i=e);let t=Math.floor(e-i);for(let e=0;e<t;++e){d+=1*((-a.tension*(u-s)+-a.friction*d)/a.mass)/1e3,u+=1*d/1e3}let n=!(!a.clamp||0===a.tension)&&(l<s?u>s:u<s),c=Math.abs(d)<=a.precision,f=0===a.tension||Math.abs(s-u)<=a.precision;o=n||c&&f,r.lastVelocity=d,r.lastTime=e}c&&!a.toValues[t].done&&(o=!1),o?(r.value!==s&&(u=s),r.done=!0):n=!0,r.setValue(u),r.lastPosition=u}else r.setValue(s),r.done=!0}t.props.onFrame&&(t.values[a.name]=a.interpolation.getValue())}t.props.onFrame&&t.props.onFrame(t.values),n||(RT.delete(t),t.stop(!0))}return RT.size?PT?PT():kT(NT):IT=!1,IT};function LT(e,t,n){if("function"===typeof e)return e;if(Array.isArray(e))return LT({range:e,output:t,extrapolate:n});if(ST&&"string"===typeof e.output[0])return ST(e);const r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",l=r.extrapolateRight||r.extrapolate||"extend",s=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,a,l,s){let u=s?s(e):e;if(u<t){if("identity"===a)return u;"clamp"===a&&(u=t)}if(u>n){if("identity"===l)return u;"clamp"===l&&(u=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?u=-u:n===1/0?u-=t:u=(u-t)/(n-t);u=i(u),r===-1/0?u=-u:o===1/0?u+=r:u=u*(o-r)+r;return u}(e,i[t],i[t+1],o[t],o[t+1],s,a,l,r.map)}}class FT extends mT{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof mT&&!(e instanceof FT)?e.getPayload():Array.isArray(e)?e:[e],this.calc=LT(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=LT(e,t,n)}interpolate(e,t,n){return new FT(this,e,t,n)}}function BT(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>BT(e,t)))}class zT extends gT{constructor(e){var t;super(),t=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){0===this.animatedStyles.size&&BT(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new FT(this,e,t,n)}}class UT extends mT{constructor(e){super(),this.payload=e.map((e=>new zT(e)))}setValue(e,t){void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(((e,n)=>this.payload[n].setValue(e,t))):this.payload.forEach((n=>n.setValue(e,t)))}getValue(){return this.payload.map((e=>e.getValue()))}interpolate(e,t){return new FT(this,e,t)}}let WT=0;class HT{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=WT++}update(e){if(!e)return this;const t=yT(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=S(t,["delay","to"]);if(cT.arr(o)||cT.fun(o))this.queue.push(j({},i,{delay:r,to:o}));else if(o){let e={};Object.entries(o).forEach((t=>{let n=t[0];const o=j({to:{[n]:t[1]},delay:hT(r,n)},i),a=e[o.delay]&&e[o.delay].to;e[o.delay]=j({},e[o.delay],o,{to:j({},a,o.to)})})),this.queue=Object.values(e)}return this.queue=this.queue.sort(((e,t)=>e.delay-t.delay)),this.diff(i),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((e=>{let t=e.from,n=void 0===t?{}:t,r=e.to,o=void 0===r?{}:r;cT.obj(n)&&(this.merged=j({},n,this.merged)),cT.obj(o)&&(this.merged=j({},this.merged,o))}));const t=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,o)=>{let i=r.delay,a=S(r,["delay"]);const l=r=>{o===n.length-1&&t===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let s=cT.arr(a.to)||cT.fun(a.to);i?setTimeout((()=>{t===this.guid&&(s?this.runAsync(a,l):this.diff(a).start(l))}),i):s?this.runAsync(a,l):this.diff(a).start(l)}))}else cT.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,RT.has(t)||RT.add(t),IT||(IT=!0,kT(PT||NT));var t;return this}stop(e){return this.listeners.forEach((t=>t(e))),this.listeners=[],this}pause(e){var t;return this.stop(!0),e&&(t=this,RT.has(t)&&RT.delete(t)),this}runAsync(e,t){var n=this;e.delay;let r=S(e,["delay"]);const o=this.local;let i=Promise.resolve(void 0);if(cT.arr(r.to))for(let a=0;a<r.to.length;a++){const e=a,t=j({},r,yT(r.to[e]));cT.arr(t.config)&&(t.config=t.config[e]),i=i.then((()=>{if(o===this.guid)return new Promise((e=>this.diff(t).start(e)))}))}else if(cT.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=j({},r,yT(n));if(cT.arr(i.config)&&(i.config=i.config[t]),t++,o===this.guid)return e=new Promise((e=>this.diff(i).start(e)))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((()=>e))))}i.then(t)}diff(e){this.props=j({},this.props,e);let t=this.props,n=t.from,r=void 0===n?{}:n,o=t.to,i=void 0===o?{}:o,a=t.config,l=void 0===a?{}:a,s=t.reverse,u=t.attach,c=t.reset,d=t.immediate;if(s){var f=[i,r];r=f[0],i=f[1]}this.merged=j({},r,this.merged,i),this.hasChanged=!1;let p=u&&u(this);if(this.animations=Object.entries(this.merged).reduce(((e,t)=>{let n=t[0],o=t[1],i=e[n]||{};const a=cT.num(o),s=cT.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!xT[o],u=cT.arr(o),f=!a&&!u&&!s;let h=cT.und(r[n])?o:r[n],y=a||u||s?o:1,g=hT(l,n);p&&(y=p.animations[n].parent);let m,v=i.parent,b=i.interpolation,x=pT(p?y.getPayload():y),w=o;f&&(w=ST({range:[0,1],output:[o,o]})(1));let S=b&&b.getValue();const k=!cT.und(v)&&i.animatedValues.some((e=>!e.done)),C=!cT.equ(w,S),_=!cT.equ(w,i.previous),O=!cT.equ(g,i.config);if(c||_&&C||O){if(a||s)v=b=i.parent||new zT(h);else if(u)v=b=i.parent||new UT(h);else if(f){let e=i.interpolation&&i.interpolation.calc(i.parent.value);e=void 0===e||c?h:e,i.parent?(v=i.parent,v.setValue(0,!1)):v=new zT(0);const t={output:[e,o]};i.interpolation?(b=i.interpolation,i.interpolation.updateConfig(t)):b=v.interpolate(t)}return x=pT(p?y.getPayload():y),m=pT(v.getPayload()),c&&!f&&v.setValue(h,!1),this.hasChanged=!0,m.forEach((e=>{e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=k?e.lastVelocity:void 0,e.lastTime=k?e.lastTime:void 0,e.startTime=OT(),e.done=!1,e.animatedStyles.clear()})),hT(d,n)&&v.setValue(f?y:o,!1),j({},e,{[n]:j({},i,{name:n,parent:v,interpolation:b,animatedValues:m,toValues:x,previous:w,config:g,fromValues:pT(v.getValue()),immediate:hT(d,n),initialVelocity:fT(g.velocity,0),clamp:fT(g.clamp,!1),precision:fT(g.precision,.01),tension:fT(g.tension,170),friction:fT(g.friction,26),mass:fT(g.mass,1),duration:g.duration,easing:fT(g.easing,(e=>e)),decay:g.decay})})}return C?e:(f&&(v.setValue(1,!1),b.updateConfig({output:[w,w]})),v.done=!0,this.hasChanged=!0,j({},e,{[n]:j({},e[n],{previous:w})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.values[e]=this.animations[e].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}}let KT=0;const $T="enter",VT="leave",qT="update",GT=(e,t)=>("function"===typeof t?e.map(t):pT(t)).map(String),YT=e=>{let t=e.items,n=e.keys,r=void 0===n?e=>e:n,o=S(e,["items","keys"]);return t=pT(void 0!==t?t:null),j({items:t,keys:GT(t,r)},o)};function QT(e,t,n){const r=j({items:e,keys:t||(e=>e)},n),o=YT(r),i=o.lazy,a=void 0!==i&&i,l=(o.unique,o.reset),s=void 0!==l&&l,u=(o.enter,o.leave,o.update,o.onDestroyed),c=(o.keys,o.items,o.onFrame),d=o.onRest,f=o.onStart,p=o.ref,y=S(o,["lazy","unique","reset","enter","leave","update","onDestroyed","keys","items","onFrame","onRest","onStart","ref"]),g=dT(),m=(0,h.useRef)(!1),v=(0,h.useRef)({mounted:!1,first:!0,deleted:[],current:{},transitions:[],prevProps:{},paused:!!r.ref,instances:!m.current&&new Map,forceUpdate:g});return(0,h.useImperativeHandle)(r.ref,(()=>({start:()=>Promise.all(Array.from(v.current.instances).map((e=>{let t=e[1];return new Promise((e=>t.start(e)))}))),stop:e=>Array.from(v.current.instances).forEach((t=>t[1].stop(e))),get controllers(){return Array.from(v.current.instances).map((e=>e[1]))}}))),v.current=function(e,t){let n=e.first,r=e.prevProps,o=S(e,["first","prevProps"]),i=YT(t),a=i.items,l=i.keys,s=i.initial,u=i.from,c=i.enter,d=i.leave,f=i.update,p=i.trail,h=void 0===p?0:p,y=i.unique,g=i.config,m=i.order,v=void 0===m?[$T,VT,qT]:m,b=YT(r),x=b.keys,w=b.items,k=j({},o.current),C=[...o.deleted],_=Object.keys(k),O=new Set(_),E=new Set(l),T=l.filter((e=>!O.has(e))),P=o.transitions.filter((e=>!e.destroyed&&!E.has(e.originalKey))).map((e=>e.originalKey)),A=l.filter((e=>O.has(e))),M=-h;for(;v.length;){switch(v.shift()){case $T:T.forEach(((e,t)=>{y&&C.find((t=>t.originalKey===e))&&(C=C.filter((t=>t.originalKey!==e)));const r=l.indexOf(e),o=a[r],i=n&&void 0!==s?"initial":$T;k[e]={slot:i,originalKey:e,key:y?String(e):KT++,item:o,trail:M+=h,config:hT(g,o,i),from:hT(n&&void 0!==s?s||{}:u,o),to:hT(c,o)}}));break;case VT:P.forEach((e=>{const t=x.indexOf(e),n=w[t],r=VT;C.unshift(j({},k[e],{slot:r,destroyed:!0,left:x[Math.max(0,t-1)],right:x[Math.min(x.length,t+1)],trail:M+=h,config:hT(g,n,r),to:hT(d,n)})),delete k[e]}));break;case qT:A.forEach((e=>{const t=l.indexOf(e),n=a[t],r=qT;k[e]=j({},k[e],{item:n,slot:r,trail:M+=h,config:hT(g,n,r),to:hT(f,n)})}))}}let D=l.map((e=>k[e]));return C.forEach((e=>{let t,n=e.left,r=(e.right,S(e,["left","right"]));-1!==(t=D.findIndex((e=>e.originalKey===n)))&&(t+=1),t=Math.max(0,t),D=[...D.slice(0,t),r,...D.slice(t)]})),j({},o,{changed:T.length||P.length||A.length,first:n&&0===T.length,transitions:D,current:k,deleted:C,prevProps:t})}(v.current,r),v.current.changed&&v.current.transitions.forEach((e=>{const t=e.slot,n=e.from,r=e.to,o=e.config,i=e.trail,l=e.key,h=e.item;v.current.instances.has(l)||v.current.instances.set(l,new HT);const g=v.current.instances.get(l),m=j({},y,{to:r,from:n,config:o,ref:p,onRest:n=>{if(v.current.mounted){e.destroyed&&(p||a||XT(v,l),u&&u(h));!Array.from(v.current.instances).some((e=>!e[1].idle))&&(p||a)&&v.current.deleted.length>0&&XT(v),d&&d(h,t,n)}},onStart:f&&(()=>f(h,t)),onFrame:c&&(e=>c(h,t,e)),delay:i,reset:s&&t===$T});g.update(m),v.current.paused||g.start()})),(0,h.useEffect)((()=>(v.current.mounted=m.current=!0,()=>{v.current.mounted=m.current=!1,Array.from(v.current.instances).map((e=>e[1].destroy())),v.current.instances.clear()})),[]),v.current.transitions.map((e=>{let t=e.item,n=e.slot,r=e.key;return{item:t,key:r,state:n,props:v.current.instances.get(r).getValues()}}))}function XT(e,t){const n=e.current.deleted;for(let r of n){let n=r.key;const o=e=>e.key!==n;(cT.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(o),e.current.deleted=e.current.deleted.filter(o))}e.current.forceUpdate()}class ZT extends vT{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof gT||(e=bT.transform(e)),this.payload=e}}const JT={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},eP="[-+]?\\d*\\.?\\d+",tP=eP+"%";function nP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const rP=new RegExp("rgb"+nP(eP,eP,eP)),oP=new RegExp("rgba"+nP(eP,eP,eP,eP)),iP=new RegExp("hsl"+nP(eP,tP,tP)),aP=new RegExp("hsla"+nP(eP,tP,tP,eP)),lP=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,sP=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,uP=/^#([0-9a-fA-F]{6})$/,cP=/^#([0-9a-fA-F]{8})$/;function dP(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function fP(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=dP(o,r,e+1/3),a=dP(o,r,e),l=dP(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*l)<<8}function pP(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function hP(e){return(parseFloat(e)%360+360)%360/360}function yP(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function gP(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function mP(e){let t=function(e){let t;return"number"===typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=uP.exec(e))?parseInt(t[1]+"ff",16)>>>0:JT.hasOwnProperty(e)?JT[e]:(t=rP.exec(e))?(pP(t[1])<<24|pP(t[2])<<16|pP(t[3])<<8|255)>>>0:(t=oP.exec(e))?(pP(t[1])<<24|pP(t[2])<<16|pP(t[3])<<8|yP(t[4]))>>>0:(t=lP.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=cP.exec(e))?parseInt(t[1],16)>>>0:(t=sP.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=iP.exec(e))?(255|fP(hP(t[1]),gP(t[2]),gP(t[3])))>>>0:(t=aP.exec(e))?(fP(hP(t[1]),gP(t[2]),gP(t[3]))|yP(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const vP=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bP=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,xP=new RegExp(`(${Object.keys(JT).join("|")})`,"g");let wP={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const jP=["Webkit","Ms","Moz","O"];function SP(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||wP.hasOwnProperty(e)&&wP[e]?(""+t).trim():t+"px"}wP=Object.keys(wP).reduce(((e,t)=>(jP.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),wP);const kP={};MT((e=>new ZT(e))),ET("div"),CT((e=>{const t=e.output.map((e=>e.replace(bP,mP))).map((e=>e.replace(xP,mP))),n=t[0].match(vP).map((()=>[]));t.forEach((e=>{e.match(vP).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(vP).map(((t,r)=>LT(j({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(vP,(()=>r[n++](e))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`))}})),jT(JT),wT(((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const o=t.style,i=t.children,a=t.scrollTop,l=t.scrollLeft,s=S(t,["style","children","scrollTop","scrollLeft"]),u="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;void 0!==a&&(e.scrollTop=a),void 0!==l&&(e.scrollLeft=l),void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=SP(t,o[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in s){const n=u?t:kP[t]||(kP[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));"undefined"!==typeof e.getAttribute(n)&&e.setAttribute(n,s[t])}}}),(e=>e));const CP=(_P=e=>{const t=(0,h.forwardRef)(((t,n)=>{const r=dT(),o=(0,h.useRef)(!0),i=(0,h.useRef)(null),a=(0,h.useRef)(null),l=(0,h.useCallback)((e=>{const t=i.current;i.current=new DT(e,(()=>{let e=!1;a.current&&(e=bT.fn(a.current,i.current.getAnimatedValue())),a.current&&!1!==e||r()})),t&&t.detach()}),[]);(0,h.useEffect)((()=>()=>{o.current=!1,i.current&&i.current.detach()}),[]),(0,h.useImperativeHandle)(n,(()=>AT(a,o,r))),l(t);const s=i.current.getValue(),u=(s.scrollTop,s.scrollLeft,S(s,["scrollTop","scrollLeft"])),c=(d=e,!cT.fun(d)||d.prototype instanceof h.Component?e=>a.current=function(e,t){return t&&(cT.fun(t)?t(e):cT.obj(t)&&(t.current=e)),e}(e,n):void 0);var d;return h.createElement(e,j({},u,{ref:c}))}));return t},void 0===(OP=!1)&&(OP=!0),e=>(cT.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=OP?t[0].toLowerCase()+t.substring(1):t;return e[n]=_P(n),e}),_P));var _P,OP;const EP=CP(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);var TP=de((e=>({accountsSyncing:e.account.accountsSyncing})),e)((function(e){let{accountsSyncing:t}=e;const n=QT(t?"__all"===t?"accounts":t:null,null,{from:{opacity:0,transform:"translateY(-100px)"},enter:{opacity:1,transform:"translateY(0)"},leave:{opacity:0,transform:"translateY(-100px)"},unique:!0});return(0,wo.jsx)(Ll,{style:{position:"absolute",top:0,left:0,right:0,marginTop:5,alignItems:"center",zIndex:501},children:n.map((e=>{let{item:t,key:n,props:r}=e;return t&&(0,wo.jsx)(EP.div,{style:r,children:(0,wo.jsxs)(Ll,{style:{borderRadius:4,backgroundColor:go.b9,color:go.b1,padding:"5px 13px",flexDirection:"row",alignItems:"center",...mo.shadow},children:[(0,wo.jsx)(lw,{animating:!0,iconStyle:{color:go.b1}}),(0,wo.jsxs)(ql,{children:["Syncing ",t]})]})},n)}))})}));function PP(e,t){return e.map((e=>(e.id===t.cat_group&&(e.categories=[t,...e.categories]),{...e})))}function AP(e,t){return e.map((e=>(e.id===t.cat_group&&(e.categories=e.categories.map((e=>e.id===t.id?{...e,...t}:e))),e)))}function MP(e,t,n,r){if(t===r)return e;let o=e.reduce(((e,n)=>e||n.categories.find((e=>e.id===t))),null);return o={...o,cat_group:n},e.map((e=>(e.id===n?(e.categories=e.categories.reduce(((e,n)=>(n.id===r?(e.push(o),e.push(n)):n.id!==t&&e.push(n),e)),[]),r||e.categories.push(o)):e.categories=e.categories.filter((e=>e.id!==t)),{...e})))}function DP(e,t,n){if(t===n)return e;let r=e.find((e=>e.id===t));return e=e.reduce(((e,o)=>(o.id===n?(e.push(r),e.push(o)):o.id!==t&&e.push(o),e)),[]),n||e.push(r),e}function IP(e,t){return e.map((e=>(e.categories=e.categories.filter((e=>e.id!==t)),e)))}function RP(e,t){return[...e,t]}function NP(e,t){return e.map((e=>e.id===t.id?{...e,...t}:e))}function LP(e,t){return e.filter((e=>e.id!==t))}var FP=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m3.828 9 6.071-6.071-1.414-1.414L0 10l.707.707 7.778 7.778 1.414-1.414L3.828 11H20V9H3.828z",fill:"currentColor"})});var BP=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("rect",{x:.5,y:2.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"}),(0,wo.jsx)("rect",{x:.5,y:10.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"}),(0,wo.jsx)("rect",{x:.5,y:18.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"})]});var zP=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 5h2v6H9V5zm0 8h2v2H9v-2z",fill:"currentColor"})});function UP(e,t){switch(e.toUpperCase()){case"ITEM_ERROR":switch(t.toUpperCase()){case"NO_ACCOUNTS":return"No open accounts could be found. Did you close the account? If so, unlink the account.";case"ITEM_LOGIN_REQUIRED":return"Your password or something else has changed with your bank and you need to login again."}break;case"INVALID_INPUT":if("INVALID_ACCESS_TOKEN"===t.toUpperCase())return"Item is no longer authorized. You need to login again.";break;case"RATE_LIMIT_EXCEEDED":return"Rate limit exceeded for this item. Please try again later."}return(0,wo.jsxs)(wo.Fragment,{children:["An internal error occurred. Try to login again, or get"," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Contact/",target:"_blank",rel:"noopener noreferrer",children:"in touch"})," ","for support."]})}var WP=de((e=>({accounts:e.queries.accounts,failedAccounts:e.account.failedAccounts})),e)((function(e){let{id:t,accounts:n,failedAccounts:r,syncAndDownload:o,markAccountSuccess:i,unlinkAccount:a,pushModal:l,closeModal:s,getAccounts:u,addNotification:c}=e,[d,f]=(0,h.useState)(!1);if(!r)return null;let p=r.get(t);if(!p)return null;let y=n.find((e=>e.id===t)),{type:g,code:m}=p,v="ITEM_ERROR"===g&&"ITEM_LOGIN_REQUIRED"===m||"INVALID_INPUT"===g&&"INVALID_ACCESS_TOKEN"===m;async function b(){a(y.id),f(!1)}return(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)(zl,{bare:!0,style:{flexDirection:"row",alignItems:"center",color:go.r5,backgroundColor:go.r10,padding:"4px 8px",borderRadius:4},onClick:()=>f(!0),children:[(0,wo.jsx)(zP,{style:{width:14,height:14,marginRight:5,color:"currentColor"}})," ","This account is experiencing connection problems. Let\u2019s fix it."]}),d&&(0,wo.jsxs)(Ps,{position:"bottom-left",onClose:()=>f(!1),style:{fontSize:14,padding:15,maxWidth:400},children:[(0,wo.jsx)("div",{style:{marginBottom:"1.15em"},children:"The server returned the following error:"}),(0,wo.jsx)("div",{style:{marginBottom:"1.25em",color:go.r5},children:UP(p.type,p.code)}),(0,wo.jsx)(Ll,{style:{justifyContent:"flex-end",flexDirection:"row"},children:v?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(zl,{onClick:b,children:"Unlink"}),(0,wo.jsx)(zl,{primary:!0,onClick:function(){f(!1),nw(l,{upgradingAccountId:y.account_id})},style:{marginLeft:5},children:"Reauthorize"})]}):(0,wo.jsx)(zl,{onClick:b,children:"Unlink account"})})]})]})}));let HP=h.createContext();function KP(e){let{children:t}=e,[n,r]=(0,h.useState)(1);return(0,wo.jsx)(HP.Provider,{value:{displayMax:n,setDisplayMax:r},children:t})}function $P(){return(0,h.useContext)(HP)}function VP(e){let{color:t,onClick:n}=e;return(0,wo.jsx)(Y_,{style:{width:13,height:13,color:t,marginRight:5},onClick:n})}function qP(e){let{maxMonths:t,onChange:n}=e,{displayMax:r}=$P();if(r<=1)return null;let o=[];for(let i=1;i<=r;i++)o.push((0,wo.jsx)(VP,{color:t>=i?go.n5:go.n8,onClick:()=>n(i)},i));return(0,wo.jsx)(Ll,{style:{flexDirection:"row",marginRight:20,marginTop:-1,"& svg":{transition:"transform .15s"},"& svg:hover":{transform:"scale(1.2)"}},title:"Choose the number of months shown at a time",children:o})}var GP=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m12.95 10.707.707-.707L8 4.343 6.586 5.757 10.828 10l-4.242 4.243L8 15.657l4.95-4.95z",fill:"currentColor"})});var YP=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M11 12h6v-1l-3-1V2l3-1V0H3v1l3 1v8l-3 1v1h6v7l1 1 1-1v-7z",fill:"currentColor"})});var QP=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M19 18h-1v-8c0-.6-.4-1-1-1s-1 .4-1 1v8h-3V1c0-.6-.4-1-1-1s-1 .4-1 1v17H8V7c0-.6-.4-1-1-1s-1 .4-1 1v11H3V3c0-.6-.4-1-1-1s-1 .4-1 1v15c-.6 0-1 .4-1 1s.4 1 1 1h18c.6 0 1-.4 1-1s-.4-1-1-1z",fill:"currentColor"})});var XP=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M18 9.87V20H2V9.87a4.25 4.25 0 0 0 3-.38V14h10V9.5a4.26 4.26 0 0 0 3 .37zM3 0h4l-.67 6.03A3.43 3.43 0 0 1 3 9C1.34 9 .42 7.73.95 6.15L3 0zm5 0h4l.7 6.3c.17 1.5-.91 2.7-2.42 2.7h-.56A2.38 2.38 0 0 1 7.3 6.3L8 0zm5 0h4l2.05 6.15C19.58 7.73 18.65 9 17 9a3.42 3.42 0 0 1-3.33-2.97L13 0z",fill:"currentColor"})});var ZP=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z",fill:"currentColor"})});var JP=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M10.416 12a2.643 2.643 0 0 1 .775-1.875L20.732.584a1.768 1.768 0 0 1 2.5 2.5l-8.739 8.739a.25.25 0 0 0 0 .354l8.739 8.739a1.768 1.768 0 0 1-2.5 2.5l-9.541-9.541A2.643 2.643 0 0 1 10.416 12Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M.25 12a2.643 2.643 0 0 1 .775-1.875L10.566.584a1.768 1.768 0 0 1 2.5 2.5l-8.739 8.739a.25.25 0 0 0 0 .354l8.739 8.739a1.768 1.768 0 0 1-2.5 2.5l-9.541-9.541A2.643 2.643 0 0 1 .25 12Z",fill:"currentColor"})]}),eA="undefined"!==typeof window?h.useLayoutEffect:h.useEffect;function tA(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),s=0;s<i.length;s++){var u=i[s];if(!l(u))return!1;var c=e[u],d=t[u];if(!1===(o=n?n.call(r,c,d,u):void 0)||void 0===o&&c!==d)return!1}return!0}function nA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function rA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function oA(e,t,n){var r=function(e,t,n){var r=nA((0,h.useState)((function(){return t(e)})),2),o=r[0],i=r[1],a=(0,h.useCallback)((function(){var r=t(e);tA(o,r)||(i(r),n&&n())}),[o,e,n]);return eA(a,[]),[o,a]}(e,t,n),o=rA(r,2),i=o[0],a=o[1];return eA((function(){var t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(a,{handlerIds:[t]})}),[e,a]),i}function iA(){var e=(0,h.useContext)(Cc).dragDropManager;return Lu(null!=e,"Expected drag drop context"),e}function aA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var lA=!1,sA=!1,uA=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sourceId=null,this.internalMonitor=t.getMonitor()}var t,n,r;return t=e,n=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Lu(!lA,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return lA=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{lA=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Lu(!sA,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return sA=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{sA=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}],n&&aA(t.prototype,n),r&&aA(t,r),e}();function cA(e,t){"function"===typeof e?e(t):e.current=t}function dA(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,h.isValidElement)(t)){var r=t;return e(r,n),r}var o=t;!function(e){if("string"!==typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(o);var i=n?function(t){return e(t,n)}:e;return function(e,t){var n=e.ref;return Lu("string"!==typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),n?(0,h.cloneElement)(e,{ref:function(e){cA(n,e),cA(t,e)}}):(0,h.cloneElement)(e,{ref:t})}(o,i)}}function fA(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var o=dA(r);t[n]=function(){return o}}})),t}function pA(e){return pA="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pA(e)}function hA(e){return null!==e&&"object"===pA(e)&&e.hasOwnProperty("current")}function yA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var gA=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=fA({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,hA(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,hA(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}var t,n,r;return t=e,n=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();this.handlerId?this.dragPreview&&t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.disconnectDragPreview(),this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.disconnectDragPreview()}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!tA(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!tA(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}}],n&&yA(t.prototype,n),r&&yA(t,r),e}();function mA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function vA(e){return vA="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vA(e)}function bA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function xA(e){var t=(0,h.useRef)(e);t.current=e,Lu(null!=e.item,"item must be defined"),Lu(null!=e.item.type,"item type must be defined");var n=bA(function(){var e=iA();return[(0,h.useMemo)((function(){return new uA(e)}),[e]),(0,h.useMemo)((function(){return new gA(e.getBackend())}),[e])]}(),2),r=n[0],o=n[1];!function(e,t,n){var r=iA(),o=(0,h.useMemo)((function(){return{beginDrag:function(){var n=e.current,r=n.begin,o=n.item;if(r){var i=r(t);return Lu(null==i||"object"===vA(i),"dragSpec.begin() must either return an object, undefined, or null"),i||o||{}}return o||{}},canDrag:function(){return"boolean"===typeof e.current.canDrag?e.current.canDrag:"function"!==typeof e.current.canDrag||e.current.canDrag(t)},isDragging:function(n,r){var o=e.current.isDragging;return o?o(t):r===n.getSourceId()},endDrag:function(){var r=e.current.end;r&&r(t.getItem(),t),n.reconnect()}}}),[]);eA((function(){var i=function(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return[o,function(){return r.removeSource(o)}]}(e.current.item.type,o,r),a=mA(i,2),l=a[0],s=a[1];return t.receiveHandlerId(l),n.receiveHandlerId(l),s}),[])}(t,r,o);var i=oA(r,t.current.collect||function(){return{}},(function(){return o.reconnect()})),a=(0,h.useMemo)((function(){return o.hooks.dragSource()}),[o]),l=(0,h.useMemo)((function(){return o.hooks.dragPreview()}),[o]);return eA((function(){o.dragSourceOptions=t.current.options||null,o.reconnect()}),[o]),eA((function(){o.dragPreviewOptions=t.current.previewOptions||null,o.reconnect()}),[o]),[i,a,l]}function wA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var jA=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hooks=fA({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,hA(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}var t,n,r;return t=e,n=[{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!tA(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}},{key:"connectTarget",get:function(){return this.dropTarget}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}}],n&&wA(t.prototype,n),r&&wA(t,r),e}();function SA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var kA=!1,CA=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.targetId=null,this.internalMonitor=t.getMonitor()}var t,n,r;return t=e,n=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Lu(!kA,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return kA=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{kA=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}],n&&SA(t.prototype,n),r&&SA(t,r),e}();function _A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function OA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e))&&"[object Arguments]"!==Object.prototype.toString.call(e))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function EA(e){var t=(0,h.useRef)(e);t.current=e,Lu(null!=e.accept,"accept must be defined");var n=OA(function(){var e=iA();return[(0,h.useMemo)((function(){return new CA(e)}),[e]),(0,h.useMemo)((function(){return new jA(e.getBackend())}),[e])]}(),2),r=n[0],o=n[1];!function(e,t,n){var r=iA(),o=(0,h.useMemo)((function(){return{canDrop:function(){var n=e.current.canDrop;return!n||n(t.getItem(),t)},hover:function(){var n=e.current.hover;n&&n(t.getItem(),t)},drop:function(){var n=e.current.drop;if(n)return n(t.getItem(),t)}}}),[t]);eA((function(){var i=function(e,t,n){var r=n.getRegistry(),o=r.addTarget(e,t);return[o,function(){return r.removeTarget(o)}]}(e.current.accept,o,r),a=_A(i,2),l=a[0],s=a[1];return t.receiveHandlerId(l),n.receiveHandlerId(l),s}),[t,n])}(t,r,o);var i=oA(r,t.current.collect||function(){return{}},(function(){return o.reconnect()})),a=(0,h.useMemo)((function(){return o.hooks.dropTarget()}),[o]);return eA((function(){o.dropTargetOptions=e.options||null,o.reconnect()}),[e.options]),[i,a]}function TA(e){let{item:t,type:n,makePreview:r,children:o,canDrag:i,onDragChange:a}=e,l=(0,h.useRef)(a);const[{isDragging:s},u]=xA({item:{type:n,item:t},collect:e=>({isDragging:e.isDragging()}),begin(e){l.current({state:"start-preview",type:n,item:t}),setTimeout((()=>{l.current({state:"start"})}),0)},end(e,t){l.current({state:"end",type:n,item:e})},canDrag(){return i}});return(0,h.useLayoutEffect)((()=>{l.current=a})),{dragRef:u}}function PA(e){let{types:t,id:n,onDrop:r,onLongHover:o}=e,i=(0,h.useRef)(null),[a,l]=(0,h.useState)(null),[{isOver:s},u]=EA({accept:t,drop(e,t){let{item:o}=e;r(o.id,a,n)},hover(e,t){let{item:n,type:r}=e,o=i.current.getBoundingClientRect(),a=(o.bottom-o.top)/2,s=t.getClientOffset().y-o.top;l(s<a?"top":"bottom")},collect(e){return{isOver:e.isOver()}}});return(0,h.useEffect)((()=>{let e;return o&&s&&(e=setTimeout(o,700)),()=>e&&clearTimeout(e)}),[s]),{dropRef:(c=u,d=i,(0,h.useMemo)((()=>function(e){[c,d].forEach((t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)}))}),[c,d])),dropPos:s?a:null};var c,d}const AA=h.createContext(null);function MA(e){let{pos:t,offset:n={}}=e,r=(0,h.useContext)(AA);if(null==t)return null;let o=("first"===r?2:0)+(n.top||0),i=("last"===r?2:0)+(n.bottom||0),a="top"===t?{top:-2+o}:{bottom:-1+i};return(0,wo.jsx)(Ll,{style:[{position:"absolute",left:2,right:2,borderRadius:3,height:3,background:`linear-gradient(90deg, ${go.b4} 0%, ${go.b5} 100%)`,zIndex:1e4,pointerEvents:"none"},a]})}const DA=240,IA=600;function RA(e){let{style:t,to:n,exact:r,onClick:o,activeStyle:i,forceActive:a,children:l}=e;return o?(0,wo.jsx)(Ll,{role:"button",tabIndex:0,style:[t,{touchAction:"auto",userSelect:"none",userDrag:"none",cursor:"pointer",...a?i:{}}],onClick:o,children:l}):(0,wo.jsx)(Rs,{to:n,exact:r,style:t,activeStyle:i,forceActive:a,children:l})}function NA(e){let{children:t,Icon:n,title:r,style:o,indent:i=0,to:a,exact:l,onClick:s,button:u,forceHover:c=!1,forceActive:d=!1}=e;const f={backgroundColor:go.n2},p={borderLeft:"4px solid "+go.p8,paddingLeft:19+i-4,color:go.p8},h=[{...mo.mediumText,paddingTop:9,paddingBottom:9,paddingLeft:19+i,paddingRight:10,textDecoration:"none",color:go.n9,...c?f:{}},{":hover":f}],y=(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",height:20},children:[(0,wo.jsx)(n,{width:15,height:15,style:{color:"inherit"}}),(0,wo.jsx)(Ms,{style:{marginLeft:8},children:r}),(0,wo.jsx)(Ll,{style:{flex:1}}),u]});return(0,wo.jsxs)(Ll,{style:[{flexShrink:0},o],children:[(0,wo.jsx)(RA,{style:h,to:a,exact:l,onClick:s,activeStyle:p,forceActive:d,children:y}),t?(0,wo.jsx)(Ll,{style:{marginTop:5},children:t}):null]})}function LA(e){let{Icon:t,title:n,style:r,to:o,exact:i,onClick:a,bold:l,indent:s=0}=e;const u={backgroundColor:go.n2},c={borderLeft:"4px solid "+go.p8,paddingLeft:10+s,color:go.p8,fontWeight:l?IA:null},d=[FA,{color:go.n9,paddingLeft:14+s,fontWeight:l?IA:null},{":hover":u}],f=(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",height:16},children:[t&&(0,wo.jsx)(t,{width:12,height:12,style:{color:"inherit"}}),(0,wo.jsx)(Ms,{style:{marginLeft:t?8:0,color:"inherit"},children:n})]});return(0,wo.jsx)(Ll,{style:[{flexShrink:0},r],children:(0,wo.jsx)(RA,{style:d,to:o,exact:i,onClick:a,activeStyle:c,children:f})})}let FA=[{marginTop:-2,marginBottom:2,paddingTop:4,paddingBottom:4,paddingRight:15,paddingLeft:10,textDecoration:"none",color:go.n9},{":hover":{backgroundColor:go.n2}},mo.smallText];function BA(e){let{name:t,account:n,connected:r,failed:o,updated:i,to:a,query:l,style:s,outerStyle:u,onDragChange:c,onDrop:d}=e,f=n?n.closed?"account-closed":n.offbudget?"account-offbudget":"account-onbudget":"title",{dragRef:p}=TA({type:f,onDragChange:c,item:{id:n&&n.id},canDrag:null!=n}),{dropRef:h,dropPos:y}=PA({types:n?[f]:[],id:n&&n.id,onDrop:d});return(0,wo.jsx)(Ll,{innerRef:h,style:[{flexShrink:0},u],children:(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(MA,{pos:y}),(0,wo.jsx)(Ll,{innerRef:p,children:(0,wo.jsxs)(Rs,{to:a,style:[FA,s,{position:"relative",borderLeft:"4px solid transparent"},i&&{fontWeight:700}],activeStyle:{borderColor:go.p8,color:go.p8,fontWeight:s&&s.fontWeight||"normal","& .dot":{backgroundColor:go.p8,transform:"translateX(-4.5px)"}},children:[(0,wo.jsx)(Ll,{style:{position:"absolute",left:0,top:0,bottom:0,flexDirection:"row",alignItems:"center"},children:(0,wo.jsx)("div",{className:"dot",...(0,lo.iv)({marginRight:3,width:5,height:5,borderRadius:5,backgroundColor:o?go.r7:go.g5,marginLeft:2,transition:"transform .3s",opacity:r?1:0})})}),(0,wo.jsx)(Ks,{left:t,right:(0,wo.jsx)(vw,{debug:!0,binding:l,type:"financial"})})]})})]})})}function zA(e){let{accounts:t,failedAccounts:n,updatedAccounts:r,getAccountPath:o,allAccountsPath:i,budgetedAccountPath:a,offBudgetAccountPath:l,getBalanceQuery:s,getAllAccountBalance:u,getOnBudgetBalance:c,getOffBudgetBalance:d,showClosedAccounts:f,onAddAccount:p,onToggleClosedAccounts:y,onReorder:g}=e,[m,v]=(0,h.useState)(!1),b=(0,h.useMemo)((()=>t.filter((e=>0===e.closed&&1===e.offbudget))),[t]),x=(0,h.useMemo)((()=>t.filter((e=>0===e.closed&&0===e.offbudget))),[t]),w=(0,h.useMemo)((()=>t.filter((e=>1===e.closed))),[t]);function j(e){v("start"===e.state)}let S=(e,t)=>0===e?{paddingTop:m?15:0,marginTop:m?-15:0}:null;return(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(BA,{name:"All accounts",to:i,query:u(),style:{fontWeight:IA,marginTop:15}}),x.length>0&&(0,wo.jsx)(BA,{name:"For budget",to:a,query:c(),style:{fontWeight:IA,marginTop:13}}),x.map(((e,t)=>(0,wo.jsx)(BA,{name:e.name,account:e,connected:!!e.bankId,failed:n&&n.has(e.id),updated:r&&r.includes(e.id),to:o(e),query:s(e),onDragChange:j,onDrop:g,outerStyle:S(t,x.length)},e.id))),b.length>0&&(0,wo.jsx)(BA,{name:"Off budget",to:l,query:d(),style:{fontWeight:IA,marginTop:13}}),b.map(((e,t)=>(0,wo.jsx)(BA,{name:e.name,account:e,connected:!!e.bankId,failed:n&&n.has(e.id),updated:r&&r.includes(e.id),to:o(e),query:s(e),onDragChange:j,onDrop:g,outerStyle:S(t,b.length)},e.id))),w.length>0&&(0,wo.jsx)(LA,{style:{marginTop:15},title:"Closed accounts"+(f?"":"..."),onClick:y,bold:!0}),f&&w.map(((e,t)=>(0,wo.jsx)(BA,{name:e.name,account:e,to:o(e),query:s(e),onDragChange:j,onDrop:g},e.id))),(0,wo.jsx)(LA,{style:{marginTop:15,marginBottom:9},onClick:p,Icon:Vx,title:"Add account"})]})}function UA(e){let{style:t,isFloating:n,onFloat:r}=e;return(0,wo.jsx)(Ll,{className:"float",style:[t,{flexShrink:0}],children:(0,wo.jsx)(zl,{bare:!0,onClick:r,children:n?(0,wo.jsx)(YP,{style:{margin:-2,width:15,height:15,color:go.n5,transform:"rotate(45deg)"}}):(0,wo.jsx)(JP,{style:{width:13,height:13,color:go.n5}})})})}function WA(){let[e,t]=(0,h.useState)(!1),n=(0,h.useCallback)((()=>t((e=>!e))),[]),r=Ni();const o=["/payees","/rules","/settings","/tools"].some((e=>r.pathname.startsWith(e)));return(0,h.useEffect)((()=>{o&&t(!0)}),[r.pathname]),(0,wo.jsxs)(Ll,{style:{flexShrink:0},children:[(0,wo.jsx)(NA,{title:"More",Icon:e?q_:GP,onClick:n,style:{marginBottom:e?8:0},forceActive:!e&&o}),e&&(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(LA,{title:"Payees",Icon:XP,to:"/payees",indent:15}),(0,wo.jsx)(LA,{title:"Rules",Icon:ZP,to:"/rules",indent:15}),(0,wo.jsx)(LA,{title:"Settings",Icon:Cf,to:"/settings",indent:15})]})]})}function HA(e){let{style:t,budgetName:n,accounts:r,failedAccounts:o,updatedAccounts:i,getBalanceQuery:a,getAllAccountBalance:l,getOnBudgetBalance:s,getOffBudgetBalance:u,showClosedAccounts:c,isFloating:d,onFloat:f,onAddAccount:p,onToggleClosedAccounts:h,onReorder:y}=e,g=!ho&&"mac"===fo;const m=GA();return(0,wo.jsxs)(Ll,{style:[{width:DA,color:go.n9,backgroundColor:go.n1,"& .float":{opacity:d?1:0,transition:"opacity .25s, width .25s",width:g||d?null:0},"&:hover .float":{opacity:1,width:g?null:"auto"}},t],children:[g&&!m.alwaysFloats&&(0,wo.jsx)(UA,{style:[{height:d?0:36,alignItems:"flex-end",justifyContent:"center",overflow:"hidden",WebkitAppRegion:"drag",paddingRight:8}],isFloating:d,onFloat:f}),(0,wo.jsxs)(Ll,{style:[{paddingTop:35,height:30,flexDirection:"row",alignItems:"center",margin:"0 8px 23px 20px",transition:"padding .4s"},g&&{paddingTop:20,justifyContent:"flex-start"}],children:[n,!ho&&(0,wo.jsx)(Ls,{bare:!0,to:"/settings",style:{display:"inherit",color:go.n5,marginLeft:g?0:5,flexShrink:0},activeStyle:{color:go.p7},children:(0,wo.jsx)(Cf,{width:15,height:15,style:{color:"inherit"}})}),(0,wo.jsx)(Ll,{style:{flex:1,flexDirection:"row"}}),!g&&!m.alwaysFloats&&(0,wo.jsx)(UA,{isFloating:d,onFloat:f})]}),(0,wo.jsxs)(Ll,{style:{overflow:"auto"},children:[(0,wo.jsx)(NA,{title:"Budget",Icon:Of,to:"/budget"}),(0,wo.jsx)(NA,{title:"Reports",Icon:QP,to:"/reports"}),(0,wo.jsx)(NA,{title:"Schedules",Icon:Y_,to:"/schedules"}),(0,wo.jsx)(WA,{}),(0,wo.jsx)(Ll,{style:{height:1,backgroundColor:go.n3,marginTop:15,flexShrink:0}}),(0,wo.jsx)(zA,{accounts:r,failedAccounts:o,updatedAccounts:i,getAccountPath:e=>`/accounts/${e.id}`,allAccountsPath:"/accounts",budgetedAccountPath:"/accounts/budgeted",offBudgetAccountPath:"/accounts/offbudget",getBalanceQuery:a,getAllAccountBalance:l,getOnBudgetBalance:s,getOffBudgetBalance:u,showClosedAccounts:c,onAddAccount:p,onToggleClosedAccounts:h,onReorder:y})]})]})}function KA(e){let{prefs:t,savePrefs:n}=e,r=ge(),o=Ri();const[i,a]=(0,h.useState)(!1),[l,s]=(0,h.useState)(!1);let u=[{name:"rename",text:"Rename budget"},{name:"settings",text:"Settings"},...ho?[{name:"help",text:"Help"}]:[],{name:"close",text:"Close file"}];return i?(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{style:{width:160,fontSize:16,fontWeight:500},defaultValue:t.budgetName,onEnter:async e=>{""!==e.target.value.trim()&&(await n({budgetName:e.target.value}),a(!1))},onBlur:()=>a(!1)})}):(0,wo.jsxs)(zl,{bare:!0,style:{color:go.n9,fontSize:16,fontWeight:500,marginLeft:-5,flex:"0 auto"},onClick:()=>s(!0),children:[(0,wo.jsx)(ql,{style:{whiteSpace:"nowrap",overflow:"hidden"},children:t.budgetName||"A budget has no name"}),(0,wo.jsx)(Nl,{width:7,height:7,style:{color:"inherit",marginLeft:5}}),l&&(0,wo.jsx)(Ps,{position:"bottom-left",style:{padding:0},onClose:()=>s(!1),children:(0,wo.jsx)(Hs,{onMenuSelect:function(e){switch(s(!1),e){case"rename":a(!0);break;case"settings":o.push("/settings");break;case"help":window.open("https://actualbudget.github.io/docs","_blank");break;case"close":r(Gn())}},items:u})})]})}var $A=Di(de((e=>({accounts:e.queries.accounts,failedAccounts:e.account.failedAccounts,updatedAccounts:e.queries.updatedAccounts,prefs:e.prefs.local,floatingSidebar:e.prefs.global.floatingSidebar})),(t=>Q(e,t)))((function(e){let{accounts:t,failedAccounts:n,updatedAccounts:r,replaceModal:o,prefs:i,floatingSidebar:a,savePrefs:l,saveGlobalPrefs:s,getAccounts:u}=e;const c=Ox("syncAccount");return(0,h.useEffect)((()=>{u()}),[u]),(0,wo.jsx)(HA,{isFloating:a,budgetName:(0,wo.jsx)(KA,{prefs:i,savePrefs:l}),accounts:t,failedAccounts:n,updatedAccounts:r,getBalanceQuery:ix,getAllAccountBalance:ax,getOnBudgetBalance:lx,getOffBudgetBalance:sx,onFloat:()=>s({floatingSidebar:!a}),onReorder:async function(e,n,r){if("bottom"===n){let e=t.findIndex((e=>e.id===r))+1;r=e<t.length?t[e].id:null}await qe("account-move",{id:e,targetId:r}),await u()},onAddAccount:()=>o(c?"add-account":"add-local-account"),showClosedAccounts:i["ui.showClosedAccounts"],onToggleClosedAccounts:()=>l({"ui.showClosedAccounts":!i["ui.showClosedAccounts"]}),style:[{flex:1},mo.darkScrollbar]})})));const VA=h.createContext(null);function qA(e){let{children:t}=e,[n,r]=(0,h.useState)(!0);return(0,wo.jsx)(VA.Provider,{value:[n,r],children:t})}function GA(){!function(){let[e,t]=(0,h.useState)((()=>Dj()));(0,h.useEffect)((()=>{let e=()=>{t((e=>{let t=Dj();return t.width===e.width&&t.height===e.height?e:t}))};return Mj?Mj.addEventListener("resize",e):window.addEventListener("resize",e),()=>{Mj?Mj.removeEventListener("resize",e):window.removeEventListener("resize",e)}}),[])}();let e=document.documentElement.clientWidth<668,[t,n]=(0,h.useContext)(VA);return(0,h.useMemo)((()=>({hidden:t,setHidden:n,alwaysFloats:e})),[t,n,e])}var YA=Di(de((e=>({floatingSidebar:e.prefs.global.floatingSidebar})),e)((function(e){let{floatingSidebar:t}=e,n=GA(),r=t||n.alwaysFloats;return(0,wo.jsx)(Ll,{onMouseOver:r?e=>{e.stopPropagation(),n.setHidden(!1)}:null,onMouseLeave:r?()=>n.setHidden(!0):null,style:{position:r?"absolute":null,top:12,bottom:r?12:-50,zIndex:1001,borderRadius:r?"0 6px 6px 0":0,overflow:"hidden",boxShadow:!r||n.hidden?"none":"0 15px 30px 0 rgba(0,0,0,0.25), 0 3px 15px 0 rgba(0,0,0,.5)",transform:`translateY(${r?0:-12}px)\n translateX(${r&&n.hidden?-DA:0}px)`,transition:"transform .5s, box-shadow .5s, border-radius .5s, bottom .5s"},children:(0,wo.jsx)($A,{})})})));var QA=de((e=>({userData:e.user.data,files:e.budgets.allFiles,budgetId:e.prefs.local&&e.prefs.local.id})),e)(Di((function(e){let{files:t,budgetId:n,userData:r,getUserData:o,setAppState:i,signOut:a,pushModal:l,closeBudget:s,style:u,color:c}=e,[d,f]=(0,h.useState)(!0),[p,y]=(0,h.useState)(!1);const g=Bx();async function m(){g?r?y(!0):(await s(),window.__history.push("/login")):(await s(),window.__history.push("/config-server"))}return(0,h.useEffect)((()=>{o().then((()=>f(!1)))}),[]),d?(0,wo.jsx)(ql,{style:[{color:go.n5,fontStyle:"italic"},u],children:"Loading account..."}):r?r.offline?(0,wo.jsx)(Ll,{style:[{color:c},u],children:"Offline"}):(0,wo.jsxs)(Ll,{style:[{flexDirection:"row",alignItems:"center"},u],children:[(0,wo.jsx)(zl,{bare:!0,onClick:m,style:{color:c},children:g?"Server":"No server"}),p&&(0,wo.jsx)(Ps,{position:"bottom-right",style:{padding:0},onClose:()=>y(!1),children:(0,wo.jsx)(Hs,{onMenuSelect:function(e){switch(y(!1),e){case"change-password":!async function(){await s(),window.__history.push("/change-password")}();break;case"sign-out":a()}},items:[{name:"change-password",text:"Change password"},{name:"sign-out",text:"Sign out"}]})})]}):(0,wo.jsx)(zl,{bare:!0,onClick:m,style:[{color:c},u],children:"Not logged in"})})));let XA=h.createContext();function ZA(e){let{children:t}=e,n=(0,h.useRef)([]);return(0,wo.jsx)(XA.Provider,{value:{sendEvent:function(e){n.current.forEach((t=>t(e)))},subscribe:function(e){return n.current.push(e),()=>n.current=n.current.filter((t=>t!==e))}},children:t})}function JA(){return(0,wo.jsx)(mw,{binding:{name:"uncategorized-amount",query:ux.calculate({$count:"$id"})},children:e=>{const t=e.value;return 0!==t&&(0,wo.jsxs)(Ls,{bare:!0,to:"/accounts/uncategorized",style:{color:go.r5},children:[t," uncategorized ",1===t?"transaction":"transactions"]})}})}function eM(e){let{localPrefs:t,style:n,onSync:r}=e,[o,i]=(0,h.useState)(!1),[a,l]=(0,h.useState)(null);return(0,h.useEffect)((()=>Ye("sync-event",(e=>{let{type:n,subtype:r,syncDisabled:o}=e;"start"===n?(i(!0),l(null)):setTimeout((()=>{i(!1)}),200),"error"===n?"network"===r?l("offline"):t.cloudFileId?l("error"):l("local"):"success"===n&&l(o?"disabled":null)}))),[]),(0,wo.jsxs)(zl,{bare:!0,style:(0,lo.iv)(n,{WebkitAppRegion:"none",color:"error"===a?go.r7:"disabled"===a||"offline"===a||"local"===a?go.n9:null},(0,lo.BC)(`(min-width: ${yo.breakpoint_medium})`,{color:"error"===a?go.r4:"disabled"===a||"offline"===a||"local"===a?go.n6:null})),onClick:r,children:["error"===a?(0,wo.jsx)(X_,{width:13,style:{color:"currentColor"}}):(0,wo.jsx)(lw,{animating:o}),(0,wo.jsx)(ql,{style:{marginLeft:3},children:"disabled"===a?"Disabled":"offline"===a?"Offline":"Sync"})]})}function tM(e){let{globalPrefs:t,saveGlobalPrefs:n,localPrefs:r}=e,{sendEvent:o}=(0,h.useContext)(XA),[i,a]=(0,h.useState)(!1),[l,s]=(0,h.useState)(!1);const u=Ox("reportBudget");(0,h.useEffect)((()=>{a(!1)}),[r.budgetType]);let{budgetType:c}=r;return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(qP,{maxMonths:t.maxMonths||1,onChange:e=>n({maxMonths:e})}),u&&(0,wo.jsxs)(Ll,{style:{marginLeft:-5},children:[(0,wo.jsx)(Bl,{bare:!0,loading:i,style:{alignSelf:"flex-start",padding:"4px 7px"},title:"Learn more about budgeting",onClick:()=>s(!0),children:"report"===c?"Report budget":"Rollover budget"}),l&&(0,wo.jsxs)(Ps,{position:"bottom-left",onClose:()=>s(!1),style:{padding:10,maxWidth:400},children:[(0,wo.jsxs)($s,{children:["You are currently using a"," ",(0,wo.jsxs)(ql,{style:{fontWeight:600},children:["report"===c?"Report budget":"Rollover budget","."]})," ","Switching will not lose any data and you can always switch back."]}),(0,wo.jsx)($s,{children:(0,wo.jsxs)(Bl,{primary:!0,loading:i,onClick:function(){a(!0),i||o("budget/switch-type")},children:["Switch to a"," ","report"===c?"Rollover budget":"Report budget"]})}),(0,wo.jsx)($s,{isLast:!0,children:(0,wo.jsx)("a",{href:"#",style:{color:go.n4,fontStyle:"italic"},children:"How do these types of budgeting work?"})})]})]})]})}var nM=Di(de((e=>({globalPrefs:e.prefs.global,localPrefs:e.prefs.local,userData:e.user.data,floatingSidebar:e.prefs.global.floatingSidebar})),e)((function(e){let{location:t,globalPrefs:n,saveGlobalPrefs:r,localPrefs:o,userData:i,floatingSidebar:a,syncError:l,setAppState:s,style:u,sync:c}=e,d=GA();const f=Bx();return(0,wo.jsxs)(Ll,{style:[{flexDirection:"row",alignItems:"center",padding:"0 15px",height:36,pointerEvents:"none","& *":{pointerEvents:"auto"}},!ho&&"mac"===fo&&a&&{paddingLeft:80},u],children:[(a||d.alwaysFloats)&&(0,wo.jsx)(zl,{bare:!0,style:{marginRight:8},onPointerEnter:e=>{"mouse"===e.pointerType&&d.setHidden(!1)},onPointerLeave:e=>{"mouse"===e.pointerType&&d.setHidden(!0)},onPointerUp:e=>{"mouse"!==e.pointerType&&d.setHidden(!d.hidden)},children:(0,wo.jsx)(BP,{className:"menu",style:{width:15,height:15,color:go.n5,left:0}})}),(0,wo.jsxs)(Mi,{children:[(0,wo.jsx)(_i,{path:"/accounts",exact:!0,children:e=>(e.location.state||{}).goBack?(0,wo.jsxs)(zl,{onClick:()=>e.history.goBack(),bare:!0,children:[(0,wo.jsx)(FP,{width:10,height:10,style:{marginRight:5,color:"currentColor"}})," ","Back"]}):null}),(0,wo.jsx)(_i,{path:"/accounts/:id",exact:!0,children:e=>e.match&&(0,wo.jsx)(WP,{id:e.match.params.id})}),(0,wo.jsx)(_i,{path:"/budget",exact:!0,children:()=>(0,wo.jsx)(tM,{globalPrefs:n,saveGlobalPrefs:r,localPrefs:o})})]}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(JA,{}),f?(0,wo.jsx)(eM,{style:{marginLeft:10},localPrefs:o,onSync:c}):null,(0,wo.jsx)(QA,{style:{marginLeft:10}})]})})));var rM=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m3.828 9 6.071-6.071-1.414-1.414L0 10l.707.707 7.778 7.778 1.414-1.414L3.828 11H20V9H3.828z",fill:"currentColor"})});var oM=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"m16.172 9-6.071-6.071 1.414-1.414L20 10l-.707.707-7.778 7.778-1.414-1.414L16.172 11H0V9z",fill:"currentColor"})});function iM(e,t){if(!e)throw new Error(t)}function aM(e,t){return"undefined"!==typeof e&&null!==e?e:t}class lM{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._listeners=[],this._currentAnimationStep=0,this._currentTime=0,this._springTime=0,this._currentValue=0,this._currentVelocity=0,this._isAnimating=!1,this._oscillationVelocityPairs=[],this._config={fromValue:aM(e.fromValue,0),toValue:aM(e.toValue,1),stiffness:aM(e.stiffness,100),damping:aM(e.damping,10),mass:aM(e.mass,1),initialVelocity:aM(e.initialVelocity,0),overshootClamping:aM(e.overshootClamping,!1),allowsOverdamping:aM(e.allowsOverdamping,!1),restVelocityThreshold:aM(e.restVelocityThreshold,.001),restDisplacementThreshold:aM(e.restDisplacementThreshold,.001)},this._currentValue=this._config.fromValue,this._currentVelocity=this._config.initialVelocity}start(){const{fromValue:e,toValue:t,initialVelocity:n}=this._config;return e===t&&0===n||(this._reset(),this._isAnimating=!0,this._currentAnimationStep||(this._notifyListeners("onStart"),this._currentAnimationStep=requestAnimationFrame((e=>{this._step(Date.now())})))),this}stop(){return this._isAnimating?(this._isAnimating=!1,this._notifyListeners("onStop"),this._currentAnimationStep&&(cancelAnimationFrame(this._currentAnimationStep),this._currentAnimationStep=0),this):this}get currentValue(){return this._currentValue}get currentVelocity(){return this._currentVelocity}get isAtRest(){return this._isSpringAtRest()}get isAnimating(){return this._isAnimating}updateConfig(e){this._advanceSpringToTime(Date.now());const t={fromValue:this._currentValue,initialVelocity:this._currentVelocity};return this._config=Object.assign({},this._config,t,e),this._reset(),this}onStart(e){return this._listeners.push({onStart:e}),this}onUpdate(e){return this._listeners.push({onUpdate:e}),this}onStop(e){return this._listeners.push({onStop:e}),this}removeListener(e){return this._listeners=this._listeners.reduce(((t,n)=>(-1!==Object.values(n).indexOf(e)||t.push(n),t)),[]),this}removeAllListeners(){return this._listeners=[],this}_reset(){this._currentTime=Date.now(),this._springTime=0,this._currentValue=this._config.fromValue,this._currentVelocity=this._config.initialVelocity}_notifyListeners(e){this._listeners.forEach((t=>{const n=t[e];"function"===typeof n&&n(this)}))}_step(e){this._advanceSpringToTime(e,!0),this._isAnimating&&(this._currentAnimationStep=requestAnimationFrame((e=>this._step(Date.now()))))}_advanceSpringToTime(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this._isAnimating)return;let n=e-this._currentTime;n>lM.MAX_DELTA_TIME_MS&&(n=lM.MAX_DELTA_TIME_MS),this._springTime+=n;const r=this._config.damping,o=this._config.mass,i=this._config.stiffness,a=this._config.fromValue,l=this._config.toValue,s=-this._config.initialVelocity;iM(o>0,"Mass value must be greater than 0"),iM(i>0,"Stiffness value must be greater than 0"),iM(r>0,"Damping value must be greater than 0");let u=r/(2*Math.sqrt(i*o));const c=Math.sqrt(i/o)/1e3,d=c*Math.sqrt(1-u*u),f=c*Math.sqrt(u*u-1),p=l-a;u>1&&!this._config.allowsOverdamping&&(u=1);let h=0,y=0;const g=this._springTime;if(u<1){const e=Math.exp(-u*c*g);h=l-e*((s+u*c*p)/d*Math.sin(d*g)+p*Math.cos(d*g)),y=u*c*e*(Math.sin(d*g)*(s+u*c*p)/d+p*Math.cos(d*g))-e*(Math.cos(d*g)*(s+u*c*p)-d*p*Math.sin(d*g))}else if(1===u){const e=Math.exp(-c*g);h=l-e*(p+(s+c*p)*g),y=e*(s*(g*c-1)+g*p*(c*c))}else{const e=Math.exp(-u*c*g);h=l-e*((s+u*c*p)*Math.sinh(f*g)+f*p*Math.cosh(f*g))/f,y=e*u*c*(Math.sinh(f*g)*(s+u*c*p)+p*f*Math.cosh(f*g))/f-e*(f*Math.cosh(f*g)*(s+u*c*p)+f*f*p*Math.sinh(f*g))/f}return this._currentTime=e,this._currentValue=h,this._currentVelocity=y,t&&(this._notifyListeners("onUpdate"),this._isAnimating)&&(this._isSpringOvershooting()||this._isSpringAtRest())?(0!==i&&(this._currentValue=l,this._currentVelocity=0,this._notifyListeners("onUpdate")),void this.stop()):void 0}_isSpringOvershooting(){const{stiffness:e,fromValue:t,toValue:n,overshootClamping:r}=this._config;let o=!1;return r&&0!==e&&(o=t<n?this._currentValue>n:this._currentValue<n),o}_isSpringAtRest(){const{stiffness:e,toValue:t,restDisplacementThreshold:n,restVelocityThreshold:r}=this._config,o=Math.abs(this._currentVelocity)<=r;return 0!==e&&Math.abs(t-this._currentValue)<=n&&o}}function sM(e,t,n){return{start:t<e.start?e.start:t,end:n>e.end?e.end:n}}lM.MAX_DELTA_TIME_MS=1/60*1e3*4;let uM=h.createContext();function cM(e){let{startMonth:t,numMonths:n,monthBounds:r,type:o,children:i}=e,a=sM(r,t,th(t,n-1)),l=lh(a.start,a.end);return(0,wo.jsx)(uM.Provider,{value:{months:l,type:o},children:i})}function dM(e){let{SummaryComponent:t}=e,{months:n}=(0,h.useContext)(uM),[r,o]=(0,h.useState)(0),i=(0,h.useRef)(null),a=Nw((0,h.useCallback)((e=>{o(e.width)}),[])),l=(0,h.useRef)(),s=(0,h.useRef)(n[0]),u=[...n];u.unshift(nh(n[0],1)),u.push(th(n[n.length-1],1));let c=r/n.length;return(0,h.useLayoutEffect)((()=>{if(!l.current)return;i.current||(i.current=new lM({stiffness:600,damping:80,mass:3,fromValue:-c}),i.current.onUpdate((e=>{l.current&&(l.current.style.transform="translateX("+e.currentValue+"px)")})));let e=s.current,t=e>n[0],r=c,o=t?2*-r:0;e!==u[0]&&e!==u[2]&&(o=-r);let a=-r;i.current.updateConfig({fromValue:o,toValue:a}).start()}),[n[0]]),(0,h.useLayoutEffect)((()=>{s.current=n[0]}),[n[0]]),(0,h.useLayoutEffect)((()=>{l.current.style.transform=`translateX(${-c}px)`}),[c]),(0,wo.jsx)("div",{...(0,lo.iv)([{flex:1,overflow:"hidden"},1===n.length&&{marginLeft:-4,marginRight:-4}]),ref:a,children:(0,wo.jsx)(Ll,{style:{flexDirection:"row",width:r,willChange:"transform"},innerRef:l,children:u.map(((e,n)=>(0,wo.jsx)(Ll,{style:[{flex:`0 0 ${c}px`},{paddingLeft:4,paddingRight:4}],children:(0,wo.jsx)(t,{month:e})},e)))})})}const fM="0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)",pM=5;let hM=h.createContext([]);function yM(e){return[{id:"to-be-budgeted",name:"To Be Budgeted",categories:[{id:"to-be-budgeted",name:"To Be Budgeted"}]},...e]}function gM(e){return 0===e||"0"===e||""===e?{color:go.n10}:null}function mM(e){const t=gM(e);return t||(e<0?{color:go.r4}:void 0)}function vM(e){return{color:e<0?go.r4:0===e?go.n10:go.g4}}function bM(e,t,n){if("top"===t)return{targetId:n};{let t=e.findIndex((e=>e.id===n));if(-1===t)throw new Error("findSort: item not found: "+n);let r=t+1;return r<e.length-1?{targetId:e[r].id}:{targetId:null}}}function xM(){return Math.max(mo.scrollbarWidth-2,0)}class wM extends h.Component{constructor(e){super(e),this.onEditMonth=(e,t)=>{this.setState({editing:e?{id:e,cell:t}:null})},this.onEditName=e=>{this.setState({editing:e?{id:e,cell:"name"}:null})},this.onReorderCategory=(e,t,n)=>{let{categoryGroups:r}=this.props;if(!!r.find((e=>e.id===n))){let{targetId:o}=function(e,t,n){if("bottom"===t)return{targetId:n};{let t=e.findIndex((e=>e.id===n));if(-1===t)throw new Error("findSort: item not found: "+n);let r=t-1;return r>=0?{targetId:e[r].id}:{targetId:null}}}(r,t,n),i=r.find((e=>e.id===o));if(i){let{categories:n}=i;this.props.onReorderCategory({id:e,groupId:i.id,targetId:0===n.length||"top"===t?null:n[0].id})}}else{let o;for(let e of r)if(e.categories.find((e=>e.id===n))){o=e;break}this.props.onReorderCategory({id:e,groupId:o.id,...bM(o.categories,t,n)})}},this.onReorderGroup=(e,t,n)=>{let{categoryGroups:r}=this.props;this.props.onReorderGroup({id:e,...bM(r,t,n)})},this.moveVertically=e=>{let{editing:t}=this.state,{type:n,categoryGroups:r,collapsed:o}=this.props;const i=r.reduce(((e,t)=>o.includes(t.id)?e.concat({id:t.id,isGroup:!0}):e.concat([{id:t.id,isGroup:!0},...t.categories])),[]);if(t){let r=i.findIndex((e=>e.id===t.id))+e;for(;r>=0&&r<i.length;){const o=i[r];if(!o.isGroup){if("report"!==n&&o.is_income)break;return void this.onEditMonth(o.id,t.cell)}r+=e}}},this.onKeyDown=e=>{if(!this.state.editing)return null;"Enter"!==e.key&&"Tab"!==e.key||(e.preventDefault(),this.moveVertically(e.shiftKey?-1:1))},this.onShowActivity=(e,t,n)=>{this.props.onShowActivity(e,t,this.resolveMonth(n))},this.onBudgetAction=(e,t,n)=>{this.props.onBudgetAction(this.resolveMonth(e),t,n)},this.resolveMonth=e=>th(this.props.startMonth,e),this.budgetCategoriesRef=h.createRef(),this.state={editing:null,draggingState:null}}clearEditing(){this.setState({editing:null})}render(){let{type:e,categoryGroups:t,prewarmStartMonth:n,startMonth:r,numMonths:o,monthBounds:i,collapsed:a,setCollapsed:l,newCategoryForGroup:s,dataComponents:u,isAddingGroup:c,onSaveCategory:d,onSaveGroup:f,onDeleteCategory:p,onDeleteGroup:h,onShowNewCategory:y,onHideNewCategory:g,onShowNewGroup:m,onHideNewGroup:v}=this.props,{editing:b,draggingState:x}=this.state;return(0,wo.jsxs)(Ll,{"data-testid":"budget-table",style:[{flex:1},mo.lightScrollbar&&{"& ::-webkit-scrollbar":{backgroundColor:"transparent"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"white"}}],children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",overflow:"hidden",flexShrink:0,paddingLeft:5,paddingRight:5+xM()},children:[(0,wo.jsx)(Ll,{style:{width:200}}),(0,wo.jsx)(cM,{startMonth:n,numMonths:o,monthBounds:i,type:e,children:(0,wo.jsx)(dM,{SummaryComponent:u.SummaryComponent})})]}),(0,wo.jsxs)(cM,{startMonth:r,numMonths:o,monthBounds:i,type:e,children:[(0,wo.jsx)(CM,{MonthComponent:u.BudgetTotalsComponent}),(0,wo.jsx)(Es.Provider,{value:this.budgetCategoriesRef,children:(0,wo.jsx)(Ll,{style:{overflowY:"scroll",overflowAnchor:"none",flex:1,paddingLeft:5,paddingRight:5},innerRef:this.budgetCategoriesRef,children:(0,wo.jsx)(Ll,{style:{opacity:x?.5:1,flexShrink:0},onKeyDown:this.onKeyDown,innerRef:e=>this.budgetDataNode=e,children:(0,wo.jsx)(PM,{categoryGroups:t,newCategoryForGroup:s,isAddingGroup:c,editingCell:b,collapsed:a,setCollapsed:l,dataComponents:u,onEditMonth:this.onEditMonth,onEditName:this.onEditName,onSaveCategory:d,onSaveGroup:f,onDeleteCategory:p,onDeleteGroup:h,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup,onShowNewCategory:y,onHideNewCategory:g,onShowNewGroup:m,onHideNewGroup:v,onBudgetAction:this.onBudgetAction,onShowActivity:this.onShowActivity})})})})]})]})}}function jM(e){let{innerRef:t,category:n,dragPreview:r,dragging:o,editing:i,style:a,borderColor:l=go.border,isLast:s,onDragChange:u,onEditMonth:c,onEditName:d,onSave:f,onDelete:p,onHideNewCategory:y}=e;const g="new"===n.id,[m,v]=(0,h.useState)(!1),b=(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},children:[(0,wo.jsx)("div",{"data-testid":"category-name",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:n.name}),(0,wo.jsxs)(Ll,{style:{flexShrink:0,marginLeft:5},children:[(0,wo.jsx)(zl,{bare:!0,onClick:e=>{e.stopPropagation(),v(!0)},style:{color:"currentColor",padding:3},children:(0,wo.jsx)(q_,{width:14,height:14,style:{color:"currentColor"}})}),m&&(0,wo.jsx)(Ps,{position:"bottom-left",width:200,style:{padding:0},onClose:()=>v(!1),children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{"rename"===e?d(n.id):p(n.id),v(!1)},items:[{name:"rename",text:"Rename"},{name:"delete",text:"Delete"}]})})]}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(hw,{id:n.id,style:o&&{color:"currentColor"}})]});return(0,wo.jsx)(Ll,{innerRef:t,style:[{width:200,"& button":{display:"none"}},!o&&!r&&{"&:hover button":{display:"flex",color:go.n1}},o&&{color:go.n8},r&&{backgroundColor:"white",zIndex:1e4,borderRadius:6,overflow:"hidden"},a],onKeyDown:e=>{"Enter"===e.key&&(d(null),e.stopPropagation())},children:(0,wo.jsx)(Xw,{value:n.name,formatter:e=>b,width:"flex",exposed:i||g,borderColor:r?"transparent":l,onUpdate:e=>{g?""===e?y():""!==e&&f({...n,name:e}):e!==n.name&&f({...n,name:e})},onBlur:()=>d(null),style:[{paddingLeft:13},s&&{borderBottomWidth:0}],inputProps:{placeholder:g?"New Category Name":""}})})}function SM(e){let{group:t,editing:n,collapsed:r,dragPreview:o,innerRef:i,style:a,borderColor:l=go.border,onEdit:s,onSave:u,onDelete:c,onShowNewCategory:d,onHideNewGroup:f,onToggleCollapse:p}=e;const y="new"===t.id,[g,m]=(0,h.useState)(!1),v=(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},onClick:e=>{p(t.id)},children:[!o&&(0,wo.jsx)(Nl,{width:8,height:8,style:{marginRight:5,marginLeft:5,flexShrink:0,transition:"transform .1s",transform:r?"rotate(-90deg)":""}}),(0,wo.jsxs)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:[o&&(0,wo.jsx)(ql,{style:{fontWeight:500},children:"Group: "}),t.name]}),!o&&(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)(Ll,{style:{marginLeft:5,flexShrink:0},children:[(0,wo.jsx)(zl,{bare:!0,onClick:e=>{e.stopPropagation(),m(!0)},style:{padding:3},children:(0,wo.jsx)(q_,{width:14,height:14})}),g&&(0,wo.jsx)(Ps,{position:"bottom-left",width:200,style:{padding:0},onClose:()=>m(!1),children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{"rename"===e?s(t.id):"add-category"===e?d(t.id):c(t.id),m(!1)},items:[{name:"add-category",text:"Add category"},{name:"rename",text:"Rename"},c&&{name:"delete",text:"Delete"}]})})]}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(hw,{id:t.id})]})]});return(0,wo.jsx)(Ll,{innerRef:i,style:[a,{width:200,backgroundColor:go.n11,"& button":{display:"none"},"&:hover button":{display:"flex",color:go.n1}},o&&{paddingLeft:10,zIndex:1e4,borderRadius:6,overflow:"hidden"}],onKeyDown:e=>{"Enter"===e.key&&(s(null),e.stopPropagation())},children:(0,wo.jsx)(Xw,{value:t.name,formatter:e=>v,width:"flex",exposed:n,borderColor:go.border,onUpdate:e=>{y?""===e?f():""!==e&&u({id:t.id,name:e}):u({id:t.id,name:e})},onBlur:()=>s(null),style:{fontWeight:600},inputProps:{style:{marginLeft:20},placeholder:y?"New Group Name":""}})})}function kM(e){let{component:t,editingIndex:n,args:r,style:o}=e,{months:i,type:a}=(0,h.useContext)(uM);return i.map(((e,i)=>{let a=n===i;return(0,wo.jsx)(gw.Provider,{value:dh(e),children:(0,wo.jsx)(Ll,{style:[{flex:1},{borderLeft:"1px solid "+go.border},o],children:(0,wo.jsx)(t,{monthIndex:i,editing:a,...r})})},i)}))}const CM=h.memo((function(e){let{MonthComponent:t}=e;return(0,wo.jsxs)(Ll,{"data-testid":"budget-totals",style:{backgroundColor:"white",flexDirection:"row",flexShrink:0,boxShadow:fM,marginLeft:5,marginRight:5+xM(),borderRadius:"4px 4px 0 0",borderBottom:"1px solid "+go.border},children:[(0,wo.jsx)(Ll,{style:{width:200,color:go.n4,justifyContent:"center",paddingLeft:18},children:"Category"}),(0,wo.jsx)(kM,{component:t})]})}));function _M(e){let{group:t,collapsed:n,editingCell:r,dragState:o,itemPos:i,MonthComponent:a,onEditName:l,onSave:s,onDelete:u,onDragChange:c,onReorderGroup:d,onReorderCategory:f,onToggleCollapse:p,onShowNewCategory:h}=e,y=o&&o.item===t,{dragRef:g}=TA({type:"group",onDragChange:c,item:t,canDrag:null===r}),{dropRef:m,dropPos:v}=PA({types:"group",id:t.id,onDrop:d}),{dropRef:b,dropPos:x}=PA({types:"category",id:t.id,onDrop:f,onLongHover:()=>{n&&p(t.id)}});return(0,wo.jsxs)(qw,{collapsed:!0,backgroundColor:go.n11,style:{fontWeight:600},children:[o&&!o.preview&&"group"===o.type&&(0,wo.jsx)(Ll,{innerRef:m,style:{position:"absolute",left:0,right:0,height:n?zw-1:(1+t.categories.length)*(zw-1)+1,zIndex:1e4},children:(0,wo.jsx)(MA,{pos:v,offset:{top:1}})}),(0,wo.jsx)(MA,{pos:x,offset:{top:1}}),(0,wo.jsxs)(Ll,{innerRef:b,style:{flex:1,flexDirection:"row",opacity:y&&!o.preview?.3:1},children:[(0,wo.jsx)(SM,{innerRef:g,group:t,editing:r&&"name"===r.cell&&r.id===t.id,dragPreview:y&&o.preview,collapsed:n,onToggleCollapse:p,onEdit:l,onSave:s,onDelete:u,onShowNewCategory:h}),(0,wo.jsx)(kM,{component:a,args:{group:t}})]})]})}function OM(e){let{cat:t,budgetArray:n,editingCell:r,dragState:o,MonthComponent:i,onEditName:a,onEditMonth:l,onSave:s,onDelete:u,onBudgetAction:c,onShowActivity:d,onDragChange:f,onReorder:p}=e,h=o&&o.item===t;o&&o.item.id===t.cat_group&&(h=!0);let{dragRef:y}=TA({type:"category",onDragChange:f,item:t,canDrag:null===r}),{dropRef:g,dropPos:m}=PA({types:"category",id:t.id,onDrop:p});return(0,wo.jsxs)(qw,{innerRef:g,collapsed:!0,backgroundColor:"transparent",children:[(0,wo.jsx)(MA,{pos:m,offset:{top:1}}),(0,wo.jsxs)(Ll,{style:[{flex:1,flexDirection:"row"}],children:[(0,wo.jsx)(jM,{innerRef:y,category:t,dragPreview:h&&o.preview,dragging:h&&!o.preview,editing:r&&"name"===r.cell&&r.id===t.id,onEditName:a,onSave:s,onDelete:u,onDragChange:f}),(0,wo.jsx)(kM,{component:i,editingIndex:r&&r.id===t.id&&r.cell,args:{category:t,onEdit:l,onBudgetAction:c,onShowActivity:d}})]})]})}function EM(e){let{group:t,editingCell:n,collapsed:r,MonthComponent:o,onEditName:i,onSave:a,onToggleCollapse:l,onShowNewCategory:s}=e;return(0,wo.jsxs)(qw,{collapsed:!0,backgroundColor:go.n11,style:{fontWeight:600},children:[(0,wo.jsx)(SM,{group:t,collapsed:r,editing:n&&"name"===n.cell&&n.id===t.id,onEdit:i,onSave:a,onToggleCollapse:l,onShowNewCategory:s}),(0,wo.jsx)(kM,{component:o,args:{group:t}})]})}function TM(e){let{cat:t,isLast:n,editingCell:r,MonthComponent:o,onEditName:i,onEditMonth:a,onSave:l,onDelete:s,onDragChange:u,onBudgetAction:c,onReorder:d,onShowActivity:f}=e,{dragRef:p}=TA({type:"income-category",onDragChange:u,item:t,canDrag:null===r}),{dropRef:h,dropPos:y}=PA({types:"income-category",id:t.id,onDrop:d});return(0,wo.jsxs)(qw,{innerRef:h,collapsed:!0,backgroundColor:"transparent",children:[(0,wo.jsx)(MA,{pos:y,offset:{top:1}}),(0,wo.jsx)(jM,{innerRef:p,category:t,isLast:n,editing:r&&"name"===r.cell&&r.id===t.id,onEditName:i,onSave:l,onDelete:s}),(0,wo.jsx)(kM,{component:o,editingIndex:r&&r.id===t.id&&r.cell,args:{category:t,onEdit:a,isLast:n,onShowActivity:f,onBudgetAction:c}})]})}const PM=h.memo((e=>{let{categoryGroups:t,newCategoryForGroup:n,isAddingGroup:r,editingCell:o,collapsed:i,setCollapsed:a,dataComponents:l,onBudgetAction:s,onShowActivity:u,onEditName:c,onEditMonth:d,onSaveCategory:f,onSaveGroup:p,onDeleteCategory:y,onDeleteGroup:g,onReorderCategory:m,onReorderGroup:v,onShowNewCategory:b,onHideNewCategory:x,onShowNewGroup:w,onHideNewGroup:j}=e,S=(0,h.useMemo)((()=>{let[e,o]=function(e){return[e.filter((e=>!e.is_income)),e.find((e=>e.is_income))]}(t),a=Array.prototype.concat.apply([],e.map((e=>{let t=[{type:"expense-group",value:e}];return n===e.id&&t.push({type:"new-category"}),[...t,...(i.includes(e.id)?[]:e.categories).map((e=>({type:"expense-category",value:e})))]})));return r&&a.push({type:"new-group"}),o&&(a=a.concat([{type:"income-separator"},{type:"income-group",value:o},n===o.id&&{type:"new-category"},...(i.includes(o.id)?[]:o.categories).map((e=>({type:"income-category",value:e})))].filter((e=>e)))),a}),[t,i,n,r]),[k,C]=(0,h.useState)(null),[_,O]=(0,h.useState)(null);function E(e){let{state:t}=e;"start-preview"===t?C({type:e.type,item:e.item,preview:!0}):"start"===t?k&&(C({...k,preview:!1}),O(i)):"hover"===t?C({...k,hoveredId:e.id,hoveredPos:e.pos}):"end"===t&&(C(null),a(_))}function T(e){i.includes(e)?a(i.filter((t=>t!==e))):a([...i,e])}return(0,wo.jsx)(Ll,{style:{marginBottom:10,backgroundColor:"white",overflow:"hidden",boxShadow:fM,borderRadius:"0 0 4px 4px",flex:1},children:S.map(((e,r)=>{let a;switch(e.type){case"new-group":a=(0,wo.jsx)(qw,{style:{backgroundColor:go.n11},children:(0,wo.jsx)(SM,{group:{id:"new",name:""},editing:!0,onSave:p,onHideNewGroup:j,onEdit:c})});break;case"new-category":a=(0,wo.jsx)(qw,{children:(0,wo.jsx)(jM,{category:{name:"",cat_group:n,is_income:n===t.find((e=>e.is_income)).id,id:"new"},editing:!0,onSave:f,onHideNewCategory:x,onEditName:c})});break;case"expense-group":a=(0,wo.jsx)(_M,{group:e.value,editingCell:o,collapsed:i.includes(e.value.id),MonthComponent:l.ExpenseGroupComponent,dragState:k,onEditName:c,onSave:p,onDelete:g,onDragChange:E,onReorderGroup:v,onReorderCategory:m,onToggleCollapse:T,onShowNewCategory:b});break;case"expense-category":a=(0,wo.jsx)(OM,{cat:e.value,editingCell:o,MonthComponent:l.ExpenseCategoryComponent,dragState:k,onEditName:c,onEditMonth:d,onSave:f,onDelete:y,onDragChange:E,onReorder:m,onBudgetAction:s,onShowActivity:u});break;case"income-separator":a=(0,wo.jsx)(Ll,{style:{height:70,backgroundColor:"white"},children:(0,wo.jsx)(AM,{MonthComponent:l.IncomeHeaderComponent,onShowNewGroup:w})});break;case"income-group":a=(0,wo.jsx)(EM,{group:e.value,editingCell:o,MonthComponent:l.IncomeGroupComponent,collapsed:i.includes(e.value.id),onEditName:c,onSave:p,onToggleCollapse:T,onShowNewCategory:b});break;case"income-category":a=(0,wo.jsx)(TM,{cat:e.value,editingCell:o,isLast:r===S.length-1,MonthComponent:l.IncomeCategoryComponent,onEditName:c,onEditMonth:d,onSave:f,onDelete:y,onDragChange:E,onReorder:m,onBudgetAction:s,onShowActivity:u});break;default:throw new Error("Unknown item type: "+e.type)}let h=0===r?"first":r===S.length-1?"last":null;return(0,wo.jsx)(AA.Provider,{value:h,children:(0,wo.jsx)(Ll,{style:!k&&{":hover":{backgroundColor:"#fcfcfc"}},children:a})},e.value?e.value.id:"income-separator"===e.type?"separator":r)}))})}));function AM(e){let{MonthComponent:t,onShowNewGroup:n}=e;return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",flex:1},children:[(0,wo.jsx)(Ll,{style:{width:200,alignItems:"flex-start",justifyContent:"flex-start"},children:(0,wo.jsx)(zl,{onClick:n,style:{fontSize:12,margin:10},children:"Add Group"})}),(0,wo.jsx)(kM,{component:t,style:{border:0,justifyContent:"flex-end"}})]})}const MM=h.memo((e=>{let{startMonth:t,onMonthSelect:n,numMonths:r,monthBounds:o,style:i}=e;return(0,wo.jsx)(Ll,{style:{marginLeft:205,flexShrink:0},children:(0,wo.jsx)(Ll,{style:{marginRight:5+xM()},children:(0,wo.jsx)(IM,{startMonth:t,numDisplayed:r,monthBounds:o,style:{paddingTop:5},onSelect:e=>n(function(e){let t=o.start,n=nh(o.end,r-1);return e<t?t:e>n?n:e}(e))})})})}));function DM(e){return lh(uh(e)+"-01",function(e){return uh(e)+"-12"}(e))}const IM=e=>{let{startMonth:t,numDisplayed:n,monthBounds:r,style:o,onSelect:i}=e;const a=Zp(),l=DM(a).map((e=>fh(e,"MMM"))),s=function(e,t){return uh(e)===uh(t)?fh(t,"MMM"):null}(t,a),u=uh(t),c=parseInt(t.slice(5,7))-1;const[d,f]=(0,h.useState)("small"),p=Nw((e=>{f(e.width<=320?"small":e.width<=400?"medium":"big")}));return(0,wo.jsxs)(Ll,{style:[{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},o],children:[(0,wo.jsx)(Ll,{style:{padding:"3px 0px",margin:"3px 0",fontWeight:"bold",fontSize:14,flex:"0 0 40px"},children:fh(u,"yyyy")}),(0,wo.jsx)(Ll,{innerRef:p,style:{flexDirection:"row",flex:1,alignItems:"center",justifyContent:"center"},children:l.map(((e,t)=>{const o=c+n,a=t>=c&&t<o,l=e===s,f=function(e,t){return th(e,t)}(u,t),p=f>=r.start&&f<=r.end;return(0,wo.jsx)(Ll,{style:[{marginRight:1,padding:"big"===d?"3px 5px":"3px 3px",textAlign:"center",cursor:"default",borderRadius:2,":hover":p&&{backgroundColor:go.p6,color:"white"}},!p&&{color:go.n7},mo.smallText,a&&{backgroundColor:go.p6,color:"white",borderRadius:0},t===c&&{borderTopLeftRadius:2,borderBottomLeftRadius:2},t===o-1&&{borderTopRightRadius:2,borderBottomRightRadius:2},t>=c&&t<o-1&&{marginRight:0,borderRight:"solid 1px",borderColor:go.p6},l&&{textDecoration:"underline"}],onClick:()=>i(f),children:"small"===d?e[0]:e},e)}))}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",flex:"0 0 50px",justifyContent:"flex-end"},children:[(0,wo.jsx)(zl,{onClick:()=>i(nh(t,1)),bare:!0,children:(0,wo.jsx)(rM,{width:12,height:12})}),(0,wo.jsx)(zl,{onClick:()=>i(th(t,1)),bare:!0,children:(0,wo.jsx)(oM,{width:12,height:12})})]})]})};const RM=h.forwardRef(((e,t)=>{let{width:n,height:r,categoryGroups:o,prewarmStartMonth:i,startMonth:a,maxMonths:l=3,monthBounds:s,onMonthSelect:u,onPreload:c,...d}=e,{setDisplayMax:f}=$P(),p=function(e){let t=e-200;return t<500?1:t<750?2:t<1e3?3:t<1250?4:t<1500?5:6}(n),y=Math.min(p,l),g=200+500*y;return(0,h.useEffect)((()=>{f(p)}),[p]),(0,wo.jsx)(hM.Provider,{value:o,children:(0,wo.jsx)(Ll,{style:{width:n,height:r,alignItems:"center",opacity:n<=0||r<=0?0:1},children:(0,wo.jsxs)(Ll,{style:{width:"100%",maxWidth:g},children:[(0,wo.jsx)(MM,{startMonth:i,numMonths:y,monthBounds:s,onMonthSelect:function(e){u(e,y)}}),(0,wo.jsx)(wM,{ref:t,categoryGroups:o,prewarmStartMonth:i,startMonth:a,numMonths:y,monthBounds:s,...d})]})})})}));var NM=h.forwardRef(((e,t)=>(0,wo.jsx)(Iw,{children:n=>{let{width:r,height:o}=n;return(0,wo.jsx)(RM,{ref:t,width:r,height:o,...e})}})));function LM(e){let{carryover:t,balance:n,category:r,disabled:o}=e,i=bw(t),a=bw(n);return(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(vw,{binding:n,type:"financial",getStyle:mM,style:[{textAlign:"right"},!o&&{cursor:"pointer",":hover":{textDecoration:"underline"}}]}),!0===i&&(0,wo.jsx)(Ll,{style:{alignSelf:"center",marginLeft:2,position:"absolute",right:-4,top:0,bottom:0,justifyContent:"center"},children:(0,wo.jsx)(oM,{width:7,height:7,style:{...mM(a)}})})]})}var FM=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M12 13.584a2.643 2.643 0 0 1-1.875-.775L.584 3.268a1.768 1.768 0 0 1 2.5-2.5l8.739 8.739a.25.25 0 0 0 .354 0L20.916.768a1.768 1.768 0 0 1 2.5 2.5l-9.541 9.541a2.643 2.643 0 0 1-1.875.775Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M12 23.75a2.643 2.643 0 0 1-1.875-.775L.584 13.434a1.768 1.768 0 0 1 2.5-2.5l8.739 8.739a.25.25 0 0 0 .354 0l8.739-8.739a1.768 1.768 0 0 1 2.5 2.5l-9.541 9.541A2.643 2.643 0 0 1 12 23.75Z",fill:"currentColor"})]});var BM=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M12 10.416a2.643 2.643 0 0 1 1.875.775l9.541 9.541a1.768 1.768 0 0 1-2.5 2.5l-8.739-8.739a.25.25 0 0 0-.354 0l-8.739 8.739a1.768 1.768 0 0 1-2.5-2.5l9.541-9.541A2.643 2.643 0 0 1 12 10.416Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M12 .25a2.643 2.643 0 0 1 1.875.775l9.541 9.541a1.768 1.768 0 0 1-2.5 2.5l-8.739-8.739a.25.25 0 0 0-.354 0l-8.739 8.739a1.768 1.768 0 0 1-2.5-2.5l9.541-9.541A2.643 2.643 0 0 1 12 .25Z",fill:"currentColor"})]});let zM=h.createContext(null);function UM(e){let{summaryCollapsed:t,onBudgetAction:n,onToggleSummaryCollapse:r,children:o}=e,i=Zp();return(0,wo.jsx)(zM.Provider,{value:{currentMonth:i,summaryCollapsed:t,onBudgetAction:n,onToggleSummaryCollapse:r},children:o})}function WM(e){let{style:t,progress:n,color:r,backgroundColor:o}=e,i=2*Math.PI*4,a=n*i,l=i;return(0,wo.jsxs)("svg",{viewBox:"0 0 20 20",style:t,children:[(0,wo.jsx)("circle",{r:"10",cx:"10",cy:"10",fill:o}),(0,wo.jsx)("circle",{r:4,cx:"10",cy:"10",fill:"none",stroke:r,strokeWidth:8,strokeDasharray:`${a} ${l}`,transform:"rotate(-90) translate(-20)"})," "]})}function HM(e,t){return 0===t?e>0?1:0:e/t}function KM(e){let{current:t,target:n}=e,r=bw(t)||0,o=!1;r<0&&(o=!0,r=-r);let i=HM(r,bw(n)||0);return(0,wo.jsx)(WM,{progress:i,color:o?go.r7:go.g5,backgroundColor:o?go.r10:go.n10,style:{width:20,height:20}})}function $M(e){let t,{current:n,target:r}=e,o=bw(n)||0,i=bw(r)||0;o=Math.max(-o,0);let a=!1;return o>i?(t=(o-i)/i,a=!0):t=HM(o,i),(0,wo.jsx)(WM,{progress:t,color:a?go.r7:go.g5,backgroundColor:a?go.r10:go.n10,style:{width:20,height:20}})}function VM(e){let{title:t,current:n,target:r,ProgressComponent:o,style:i}=e;return(0,wo.jsxs)(Ll,{style:[{lineHeight:1.5,flexDirection:"row",alignItems:"center",fontSize:14},i],children:[(0,wo.jsx)(o,{current:n,target:r}),(0,wo.jsxs)(Ll,{style:{marginLeft:10},children:[(0,wo.jsx)(Ll,{children:(0,wo.jsx)(ql,{style:{color:go.n4},children:t})}),(0,wo.jsxs)(ql,{children:[(0,wo.jsx)(vw,{binding:n,type:"financial"}),(0,wo.jsxs)(ql,{style:{color:go.n6,fontStyle:"italic"},children:[" of ",(0,wo.jsx)(vw,{binding:r,type:"financial",style:mo.notFixed})]})]})]})]})}function qM(e){let{projected:t,style:n}=e;return(0,wo.jsx)(VM,{title:"Income",current:dx.totalIncome,target:dx.totalBudgetedIncome,ProgressComponent:KM,style:n})}function GM(e){let{style:t}=e;return(0,wo.jsx)(VM,{title:"Expenses",current:dx.totalSpent,target:dx.totalBudgetedExpense,ProgressComponent:$M,style:t})}function YM(e){let{projected:t,style:n}=e,r=bw(dx.totalBudgetedSaved)||0,o=bw(dx.totalSaved)||0,i=t?r:o,a=i<0;return(0,wo.jsxs)(Ll,{style:[{alignItems:"center",fontSize:14},n],children:[t?(0,wo.jsx)(ql,{style:{color:go.n4},children:"Projected Savings:"}):(0,wo.jsx)(Ll,{style:{color:go.n4},children:a?"Overspent:":"Saved:"}),(0,wo.jsx)(Ys,{renderContent:()=>{if(!t){let e=o-r;return(0,wo.jsxs)(Ps,{position:"bottom-center",style:{padding:10,fontSize:14},children:[(0,wo.jsx)(Ks,{left:"Projected Savings:",right:(0,wo.jsx)(ql,{style:[vM(r),mo.tnum],children:yw(r,"financial-with-sign")})}),(0,wo.jsx)(Ks,{left:"Difference:",right:(0,wo.jsx)(ql,{style:[vM(e),mo.tnum],children:yw(e,"financial-with-sign")})})]})}return null},children:(0,wo.jsx)(Ll,{...(0,lo.iv)([{fontSize:25,color:t?go.y3:a?go.r4:go.p5}]),children:yw(i,"financial")})})]})}const QM=h.memo((function(e){let{month:t}=e,{currentMonth:n,summaryCollapsed:r,onBudgetAction:o,onToggleSummaryCollapse:i}=(0,h.useContext)(zM),[a,l]=(0,h.useState)(!1);function s(e){l(!1)}let u=r?FM:BM;return(0,wo.jsx)(Ll,{style:{backgroundColor:"white",boxShadow:fM,borderRadius:6,marginLeft:0,marginRight:0,marginTop:5,flex:1,cursor:"default",marginBottom:5,overflow:"hidden","& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:(0,wo.jsxs)(gw.Provider,{value:dh(t),children:[(0,wo.jsxs)(Ll,{style:[{padding:"0 13px"},r?{margin:"10px 0"}:{marginTop:16}],children:[(0,wo.jsx)(Ll,{style:{position:"absolute",left:10,top:0},children:(0,wo.jsx)(zl,{className:"hover-visible",bare:!0,onClick:i,children:(0,wo.jsx)(u,{width:13,height:13,style:{color:go.n6,margin:1}})})}),(0,wo.jsx)("div",{...(0,lo.iv)([{textAlign:"center",marginTop:3,fontSize:18,fontWeight:500,textDecorationSkip:"ink"},n===t&&{textDecoration:"underline"}]),children:fh(t,"MMMM")}),(0,wo.jsxs)(Ll,{style:{position:"absolute",right:10,top:0,flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(Ll,{children:(0,wo.jsx)(hw,{id:`budget-${t}`,width:15,height:15,tooltipPosition:"bottom-right",defaultColor:go.n6})}),(0,wo.jsxs)(Ll,{style:{userSelect:"none"},children:[(0,wo.jsx)(zl,{bare:!0,onClick:function(e){l(!0)},children:(0,wo.jsx)(qx,{width:15,height:15,style:{color:go.n5}})}),a&&(0,wo.jsx)(Ps,{position:"bottom-right",width:200,style:{padding:0},onClose:s,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{s(),o(t,e)},items:[{name:"copy-last",text:"Copy last month\u2019s budget"},{name:"set-zero",text:"Set budgets to zero"},{name:"set-3-avg",text:"Set budgets to 3 month avg"}]})})]})]})]}),!r&&(0,wo.jsxs)(Os,{spacing:2,style:{alignSelf:"center",backgroundColor:go.n11,borderRadius:4,padding:"10px 15px",marginTop:13},children:[(0,wo.jsx)(qM,{}),(0,wo.jsx)(GM,{})]}),r?(0,wo.jsx)(Ll,{style:{alignItems:"center",padding:"10px 20px",justifyContent:"space-between",backgroundColor:go.n11,borderTop:"1px solid "+go.n10},children:(0,wo.jsx)(YM,{projected:t>=n})}):(0,wo.jsx)(YM,{projected:t>=n,style:{marginTop:13,marginBottom:20}})]})})}));let XM={flex:1,padding:"0 5px",textAlign:"right"};const ZM=h.memo((function(){return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",marginRight:pM,paddingTop:10,paddingBottom:10},children:[(0,wo.jsxs)(Ll,{style:XM,children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"Budgeted"}),(0,wo.jsx)(vw,{binding:dx.totalBudgetedExpense,type:"financial",style:{color:go.n4,fontWeight:600},formatter:e=>yw(parseFloat(e||"0"),"financial")})]}),(0,wo.jsxs)(Ll,{style:XM,children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"Spent"}),(0,wo.jsx)(vw,{binding:dx.totalSpent,type:"financial",style:{color:go.n4,fontWeight:600}})]}),(0,wo.jsxs)(Ll,{style:XM,children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"Balance"}),(0,wo.jsx)(vw,{binding:dx.totalLeftover,type:"financial",style:{color:go.n4,fontWeight:600}})]})]})}));function JM(){return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",marginRight:pM,paddingBottom:5},children:[(0,wo.jsx)(Ll,{style:XM,children:(0,wo.jsx)(ql,{style:{color:go.n4},children:"Budgeted"})}),(0,wo.jsx)(Ll,{style:XM,children:(0,wo.jsx)(ql,{style:{color:go.n4},children:"Received"})})]})}const eD=h.memo((function(e){let{group:t}=e,n=go.border,{id:r}=t;return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row"},children:[(0,wo.jsx)(rj,{name:"budgeted",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600},mo.tnum],valueProps:{binding:dx.groupBudgeted(r),type:"financial"}}),(0,wo.jsx)(rj,{name:"spent",width:"flex",textAlign:"right",borderColor:n,style:[{fontWeight:600},mo.tnum],valueProps:{binding:dx.groupSumAmount(r),type:"financial"}}),!t.is_income&&(0,wo.jsx)(rj,{name:"balance",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600,paddingRight:pM},mo.tnum],valueProps:{binding:dx.groupBalance(r),type:"financial"}})]})}));function tD(e){let{categoryId:t,tooltip:n,monthIndex:r,onBudgetAction:o}=e,i=bw(dx.catCarryover(t));return(0,wo.jsx)(Ps,{position:"bottom-right",width:200,style:{padding:0},onClose:n.close,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{o(r,"carryover",{category:t,flag:!i}),n.close()},items:[{name:"carryover",text:i?"Remove overspending rollover":"Rollover overspending"}]})})}const nD=h.memo((function(e){let{monthIndex:t,category:n,budgeted:r,currentSum:o,balance:i,editing:a,onEdit:l,onBudgetAction:s,onShowActivity:u}=e,c=go.border,d=Ts();return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row"},children:[(0,wo.jsx)(rj,{name:"budget",sync:!0,exposed:a,width:"flex",borderColor:c,onExpose:()=>l(n.id,t),style:[a&&{zIndex:100},mo.tnum],textAlign:"right",valueStyle:[{cursor:"default",margin:1,padding:"0 4px",borderRadius:4},{":hover":{boxShadow:"inset 0 0 0 1px "+go.n7,backgroundColor:"white"}}],valueProps:{binding:dx.catBudgeted(n.id),type:"financial",getValueStyle:gM,formatExpr:e=>zr(e),unformatExpr:e=>$r($_(e,0))},inputProps:{onBlur:()=>{l(null)}},onSave:e=>{s(t,"budget-amount",{category:n.id,amount:e})}}),(0,wo.jsx)($w,{name:"spent",width:"flex",borderColor:c,style:{textAlign:"right"},children:(0,wo.jsx)("span",{onClick:()=>u(n.name,n.id,t),children:(0,wo.jsx)(vw,{binding:dx.catSumAmount(n.id),type:"financial",getStyle:gM,style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})}),!n.is_income&&(0,wo.jsxs)($w,{name:"balance",width:"flex",borderColor:c,style:{paddingRight:pM,textAlign:"right"},children:[(0,wo.jsx)("span",{...n.is_income?{}:d.getOpenEvents(),children:(0,wo.jsx)(LM,{category:n,disabled:n.is_income,carryover:dx.catCarryover(n.id),balance:dx.catBalance(n.id)})}),d.isOpen&&(0,wo.jsx)(tD,{categoryId:n.id,tooltip:d,monthIndex:t,onBudgetAction:s})]})]})})),rD=eD,oD=nD,iD=eD,aD=nD;function lD(e){let{initialAmount:t,initialAmountName:n,showToBeBudgeted:r,tooltipProps:o,onSubmit:i,onClose:a}=e,l=Sf(),s=(0,h.useContext)(gw),u=(0,h.useContext)(hM);u=u.filter((e=>!e.is_income)),r&&(u=yM(u));let[c,d]=(0,h.useState)(null),[f,p]=(0,h.useState)(null);function y(){let e=$_(c,null);e&&f&&(i($r(e),f),a())}return(0,h.useEffect)((()=>{(async()=>{if(n){const e=await l.get(s,n);d(zr(Math.max(e.value,0)))}else d(zr(Math.max(t,0)))})()}),[]),null===c?null:(0,wo.jsxs)(Ps,{position:"bottom-right",width:200,style:{padding:10},...o,onClose:a,children:[(0,wo.jsx)(Ll,{style:{marginBottom:5},children:"Transfer this amount:"}),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{value:c,onChange:e=>d(e.target.value),onEnter:y})})}),(0,wo.jsx)(Ll,{style:{margin:"10px 0 5px 0"},children:"To:"}),(0,wo.jsx)(e_,{categoryGroups:u,value:null,openOnFocus:!0,onUpdate:e=>{},onSelect:e=>p(e),inputProps:{onEnter:y,placeholder:"(none)"}}),(0,wo.jsx)(Ll,{style:{alignItems:"flex-end",marginTop:10},children:(0,wo.jsx)(zl,{primary:!0,style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:y,children:"Transfer"})})]})}function sD(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}var uD=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=sD(this,e.call.apply(e,[this].concat(i))),cD.call(r),sD(r,n)}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getArgs=function(){return{state:this.state,props:this.props,setState:this._setState,forceUpdate:this._forceUpdate}},t.prototype.componentDidMount=function(){this.props.didMount&&this.props.didMount(this.getArgs())},t.prototype.shouldComponentUpdate=function(e,t){return!this.props.shouldUpdate||this.props.shouldUpdate({props:this.props,state:this.state,nextProps:e,nextState:t})},t.prototype.componentWillUnmount=function(){this.props.willUnmount&&this.props.willUnmount({state:this.state,props:this.props})},t.prototype.componentDidUpdate=function(e,t){this.props.didUpdate&&this.props.didUpdate(Object.assign(this.getArgs(),{prevProps:e,prevState:t}))},t.prototype.render=function(){var e=this.props,t=e.children,n=e.render;return t?"function"===typeof t?t(this.getArgs()):t:n?n(this.getArgs()):null},t}(h.Component),cD=function(){var e=this;this.state=this.props.initialState,this._setState=function(){return e.setState.apply(e,arguments)},this._forceUpdate=function(){return e.forceUpdate.apply(e,arguments)}},dD=uD;function fD(e){let{onSubmit:t,onClose:n}=e;const r=Sf(),o=(0,h.useContext)(gw),[i,a]=(0,h.useState)(null);function l(){const e=$_(i,null);e&&t($r(e)),n()}return(0,h.useEffect)((()=>{(async()=>{const e=await r.get(o,"to-budget");a(zr(Math.max(e.value,0)))})()}),[]),null===i?null:(0,wo.jsxs)(Ps,{position:"bottom-right",width:200,style:{padding:10},onClose:n,children:[(0,wo.jsx)(Ll,{style:{marginBottom:5},children:"Hold this amount:"}),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{value:i,onChange:e=>a(e.target.value),onEnter:l})})}),(0,wo.jsx)(Ll,{style:{alignItems:"flex-end",marginTop:10},children:(0,wo.jsx)(zl,{primary:!0,style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:l,children:"Hold"})})]})}let pD=h.createContext(null);function hD(e){let{categoryGroups:t,summaryCollapsed:n,onBudgetAction:r,onToggleSummaryCollapse:o,children:i}=e,a=Zp();return(0,wo.jsx)(pD.Provider,{value:{currentMonth:a,categoryGroups:t,summaryCollapsed:n,onBudgetAction:r,onToggleSummaryCollapse:o},children:i})}function yD(e){let{prevMonthName:t,collapsed:n}=e;return(0,wo.jsxs)(Ll,{style:[{flexDirection:"row",lineHeight:1.5,justifyContent:"center"},!n&&{padding:"5px 0",marginTop:17,backgroundColor:go.n11,borderTopWidth:1,borderBottomWidth:1,borderColor:go.n9},n&&{padding:7},mo.smallText],children:[(0,wo.jsxs)(Ll,{style:{textAlign:"right",marginRight:10,minWidth:50},children:[(0,wo.jsx)(Ys,{style:{flexShrink:0},renderContent:()=>(0,wo.jsxs)(Ps,{width:200,style:{lineHeight:1.5,padding:"6px 10px"},children:[(0,wo.jsx)(Ks,{left:"Income:",right:(0,wo.jsx)(vw,{binding:cx.totalIncome,type:"financial"})}),(0,wo.jsx)(Ks,{left:"From Last Month:",right:(0,wo.jsx)(vw,{binding:cx.fromLastMonth,type:"financial"})})]}),children:(0,wo.jsx)(vw,{binding:cx.incomeAvailable,type:"financial",style:{fontWeight:600}})}),(0,wo.jsx)(vw,{binding:cx.lastMonthOverspent,formatter:e=>{let t=yw(e,"financial");return e>0?"+"+t:0===e?"-"+t:t},style:[{fontWeight:600},mo.tnum]}),(0,wo.jsx)(vw,{binding:cx.totalBudgeted,formatter:e=>{let t=yw(e,"financial");return e>0?"+"+t:0===e?"-"+t:t},style:[{fontWeight:600},mo.tnum]}),(0,wo.jsx)(vw,{binding:cx.forNextMonth,formatter:e=>{let t=parseInt(e)||0,n=yw(Math.abs(t),"financial");return t>=0?"-"+n:"+"+n},style:[{fontWeight:600},mo.tnum]})]}),(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(Ms,{children:"Available Funds"}),(0,wo.jsxs)(Ms,{children:["Overspent in ",t]}),(0,wo.jsx)(Ms,{children:"Budgeted"}),(0,wo.jsx)(Ms,{children:"For Next Month"})]})]})}function gD(e){let{month:t,prevMonthName:n,collapsed:r,onBudgetAction:o}=e;return(0,wo.jsx)(mw,{binding:cx.toBudget,initialValue:0,children:e=>{const i=parseInt(e.value),a=isNaN(i)?0:i,l=a<0;return(0,wo.jsxs)(Ll,{style:{alignItems:"center"},children:[(0,wo.jsx)(Ms,{children:l?"Overbudgeted:":"To Budget:"}),(0,wo.jsx)(dD,{initialState:{menuOpen:null},children:s=>{let{state:u,setState:c}=s;return(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(Ys,{disabled:!r||u.menuOpen,renderContent:()=>(0,wo.jsx)(Ps,{position:"bottom-center",children:(0,wo.jsx)(yD,{collapsed:!0,prevMonthName:n})}),children:(0,wo.jsx)(Ms,{onClick:()=>c({menuOpen:"actions"}),"data-cellname":e.name,...(0,lo.iv)([mo.veryLargeText,{fontWeight:400,userSelect:"none",cursor:"pointer",color:l?go.r4:go.p5,marginBottom:-1,borderBottom:"1px solid transparent",":hover":{borderColor:l?go.r4:go.p5}}]),children:yw(a,"financial")})}),"actions"===u.menuOpen&&(0,wo.jsx)(Ps,{position:"bottom-center",width:200,style:{padding:0},onClose:()=>c({menuOpen:null}),children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{"reset-buffer"===e?(o(t,"reset-hold"),c({menuOpen:null})):c({menuOpen:e})},items:[{name:"transfer",text:"Move to a category"},{name:"buffer",text:"Hold for next month"},{name:"reset-buffer",text:"Reset next month\u2019s buffer"}]})}),"buffer"===u.menuOpen&&(0,wo.jsx)(fD,{onClose:()=>c({menuOpen:null}),onSubmit:e=>{o(t,"hold",{amount:e})}}),"transfer"===u.menuOpen&&(0,wo.jsx)(lD,{initialAmount:i,onClose:()=>c({menuOpen:null}),onSubmit:(e,n)=>{o(t,"transfer-available",{amount:e,category:n})}})]})}})]})}})}function mD(e){let{month:t,isGoalTemplatesEnabled:n}=e,{currentMonth:r,summaryCollapsed:o,onBudgetAction:i,onToggleSummaryCollapse:a}=(0,h.useContext)(pD),[l,s]=(0,h.useState)(!1);function u(e){s(!1)}let c=fh(eh(t),"MMM"),d=o?FM:BM;return(0,wo.jsx)(Ll,{"data-testid":"budget-summary",style:{backgroundColor:"white",boxShadow:fM,borderRadius:6,marginLeft:0,marginRight:0,marginTop:5,flex:1,cursor:"default",marginBottom:5,overflow:"hidden","& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:(0,wo.jsxs)(gw.Provider,{value:dh(t),children:[(0,wo.jsxs)(Ll,{style:[{padding:"0 13px"},o?{margin:"10px 0"}:{marginTop:16}],children:[(0,wo.jsx)(Ll,{style:{position:"absolute",left:10,top:0},children:(0,wo.jsx)(zl,{className:"hover-visible",bare:!0,onClick:a,children:(0,wo.jsx)(d,{width:13,height:13,style:{color:go.n6,margin:1}})})}),(0,wo.jsx)("div",{...(0,lo.iv)([{textAlign:"center",marginTop:3,fontSize:18,fontWeight:500,textDecorationSkip:"ink"},r===t&&{textDecoration:"underline"}]),children:fh(t,"MMMM")}),(0,wo.jsxs)(Ll,{style:{position:"absolute",right:10,top:0,flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(Ll,{children:(0,wo.jsx)(hw,{id:`budget-${t}`,width:15,height:15,tooltipPosition:"bottom-right",defaultColor:go.n6})}),(0,wo.jsxs)(Ll,{style:{userSelect:"none",marginLeft:2},children:[(0,wo.jsx)(zl,{bare:!0,onClick:function(e){s(!0)},children:(0,wo.jsx)(qx,{width:15,height:15,style:{color:go.n5}})}),l&&(0,wo.jsx)(Ps,{position:"bottom-right",width:200,style:{padding:0},onClose:u,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{u(),i(t,e)},items:[{name:"copy-last",text:"Copy last month\u2019s budget"},{name:"set-zero",text:"Set budgets to zero"},{name:"set-3-avg",text:"Set budgets to 3 month avg"},n&&{name:"apply-goal-template",text:"Apply budget template"},n&&{name:"overwrite-goal-template",text:"Overwrite with budget template"}]})})]})]})]}),o?(0,wo.jsx)(Ll,{style:{alignItems:"center",padding:"10px 20px",justifyContent:"space-between",backgroundColor:go.n11,borderTop:"1px solid "+go.n10},children:(0,wo.jsx)(gD,{collapsed:o,prevMonthName:c,month:t,onBudgetAction:i})}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(yD,{prevMonthName:c}),(0,wo.jsx)(Ll,{style:{margin:"23px 0"},children:(0,wo.jsx)(gD,{month:t,onBudgetAction:i})})]})]})})}function vD(e){let{showToBeBudgeted:t,inline:n,tooltipProps:r,onSubmit:o,onClose:i}=e,a=(0,h.useContext)(hM);a=yM(a.filter((e=>!e.is_income)));let[l,s]=(0,h.useState)(null);function u(){l&&(o(l),i())}return(0,wo.jsxs)(Ps,{position:"bottom-right",width:200,style:{padding:10},...r,onClose:i,children:[(0,wo.jsx)(Ll,{style:{marginBottom:5},children:"Cover from category:"}),(0,wo.jsx)(Gs,{children:e=>(0,wo.jsx)(e_,{categoryGroups:a,value:null,openOnFocus:!0,onUpdate:e=>{},onSelect:e=>s(e),inputProps:{inputRef:e,onKeyDown:e=>{"Enter"===e.key&&u()}}})}),(0,wo.jsx)(Ll,{style:{alignItems:"flex-end",marginTop:10},children:(0,wo.jsx)(zl,{primary:!0,style:{fontSize:12,paddingTop:3},onClick:u,children:"Transfer"})})]})}function bD(e){let{categoryId:t,tooltip:n,monthIndex:r,onBudgetAction:o}=e,i=bw(cx.catCarryover(t)),a=bw(cx.catBalance(t)),[l,s]=(0,h.useState)("menu");return(0,wo.jsxs)(wo.Fragment,{children:["menu"===l&&(0,wo.jsx)(Ps,{position:"bottom-right",width:200,style:{padding:0},onClose:n.close,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{"carryover"===e?(o(r,"carryover",{category:t,flag:!i}),n.close()):s(e)},items:[{name:"transfer",text:"Transfer to another category"},{name:"carryover",text:i?"Remove overspending rollover":"Rollover overspending"},a<0&&{name:"cover",text:"Cover overspending"}].filter((e=>e))})}),"transfer"===l&&(0,wo.jsx)(lD,{initialAmountName:cx.catBalance(t),showToBeBudgeted:!0,onClose:n.close,onSubmit:(e,n)=>{o(r,"transfer-category",{amount:e,from:t,to:n})}}),"cover"===l&&(0,wo.jsx)(vD,{showToBeBudgeted:!0,onClose:n.close,onSubmit:e=>{o(r,"cover",{to:t,from:e})}})]})}let xD={flex:1,padding:"0 5px",textAlign:"right"};const wD=h.memo((function(){return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",marginRight:pM,paddingTop:10,paddingBottom:10},children:[(0,wo.jsxs)(Ll,{style:xD,children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"Budgeted"}),(0,wo.jsx)(vw,{binding:cx.totalBudgeted,type:"financial",style:{color:go.n4,fontWeight:600},formatter:e=>yw(-parseFloat(e||"0"),"financial")})]}),(0,wo.jsxs)(Ll,{style:xD,children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"Spent"}),(0,wo.jsx)(vw,{binding:cx.totalSpent,type:"financial",style:{color:go.n4,fontWeight:600}})]}),(0,wo.jsxs)(Ll,{style:xD,children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"Balance"}),(0,wo.jsx)(vw,{binding:cx.totalBalance,type:"financial",style:{color:go.n4,fontWeight:600}})]})]})}));function jD(){return(0,wo.jsx)(qw,{style:{color:go.n4,alignItems:"center",paddingRight:10},children:(0,wo.jsx)(Ll,{style:{flex:1,textAlign:"right"},children:"Received"})})}const SD=h.memo((function(e){let{group:t}=e,n=go.border,{id:r}=t;return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row"},children:[(0,wo.jsx)(rj,{name:"budgeted",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600},mo.tnum],valueProps:{binding:cx.groupBudgeted(r),type:"financial"}}),(0,wo.jsx)(rj,{name:"spent",width:"flex",textAlign:"right",borderColor:n,style:[{fontWeight:600},mo.tnum],valueProps:{binding:cx.groupSumAmount(r),type:"financial"}}),(0,wo.jsx)(rj,{name:"balance",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600,paddingRight:pM},mo.tnum],valueProps:{binding:cx.groupBalance(r),type:"financial"}})]})})),kD=h.memo((function(e){let{monthIndex:t,category:n,editing:r,onEdit:o,onBudgetAction:i,onShowActivity:a}=e,l=go.border,s=Ts();return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row"},children:[(0,wo.jsx)(rj,{name:"budget",sync:!0,exposed:r,width:"flex",borderColor:l,onExpose:()=>o(n.id,t),style:[r&&{zIndex:100},mo.tnum],textAlign:"right",valueStyle:[{cursor:"default",margin:1,padding:"0 4px",borderRadius:4},{":hover":{boxShadow:"inset 0 0 0 1px "+go.n7,backgroundColor:"white"}}],valueProps:{binding:cx.catBudgeted(n.id),type:"financial",getValueStyle:gM,formatExpr:e=>zr(e),unformatExpr:e=>$r($_(e,0))},inputProps:{onBlur:()=>{o(null)}},onSave:e=>{i(t,"budget-amount",{category:n.id,amount:e})}}),(0,wo.jsx)($w,{name:"spent",width:"flex",borderColor:l,style:{textAlign:"right"},children:(0,wo.jsx)("span",{onClick:()=>a(n.name,n.id,t),children:(0,wo.jsx)(vw,{binding:cx.catSumAmount(n.id),type:"financial",getStyle:gM,style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})}),(0,wo.jsxs)($w,{name:"balance",width:"flex",borderColor:l,style:{paddingRight:pM,textAlign:"right"},children:[(0,wo.jsx)("span",{...s.getOpenEvents(),children:(0,wo.jsx)(LM,{category:n,carryover:cx.catCarryover(n.id),balance:cx.catBalance(n.id)})}),s.isOpen&&(0,wo.jsx)(bD,{categoryId:n.id,tooltip:s,monthIndex:t,onBudgetAction:i})]})]})}));function CD(e){let{group:t}=e;return(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(rj,{name:"received",width:"flex",borderColor:go.border,textAlign:"right",style:[{fontWeight:600,paddingRight:pM},mo.tnum],valueProps:{binding:cx.groupIncomeReceived,type:"financial"}})})}function _D(e){let{category:t,isLast:n,monthIndex:r,onShowActivity:o}=e;return(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)($w,{name:"received",width:"flex",borderColor:go.border,style:[{paddingRight:pM,textAlign:"right"},n&&{borderBottomWidth:0}],children:(0,wo.jsx)("span",{onClick:()=>o(t.name,t.id,r),children:(0,wo.jsx)(vw,{binding:cx.catSumAmount(t.id),type:"financial",style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})})})}let OD=null;class ED extends h.PureComponent{constructor(e){var t;super(e),t=this,this.prewarmMonth=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n=n||t.props.budgetType;let r="report"===n?"report-budget-month":"rollover-budget-month",o=await qe(r,{month:e});for(let i of o)t.props.spreadsheet.prewarmCache(i.name,i)},this.onMonthSelect=async(e,t)=>{let{startMonth:n}=this.state;this.setState({prewarmStartMonth:e}),this.warmingMonth=e,e<n?await this.prewarmMonth(nh(e,1)):e>n&&await this.prewarmMonth(th(e,t)),this.warmingMonth===e&&this.setState({startMonth:e})},this.onShowNewCategory=e=>{this.setState({newCategoryForGroup:e,collapsed:this.state.collapsed.filter((t=>t!==e))})},this.onHideNewCategory=()=>{this.setState({newCategoryForGroup:null})},this.onShowNewGroup=()=>{this.setState({isAddingGroup:!0})},this.onHideNewGroup=()=>{this.setState({isAddingGroup:!1})},this.setCollapsed=e=>{this.setState({collapsed:e})},this.onSaveCategory=async e=>{let{categoryGroups:t}=this.state;if("new"===e.id){let n=await this.props.createCategory(e.name,e.cat_group,e.is_income);this.setState({newCategoryForGroup:null,categoryGroups:PP(t,{...e,is_income:e.is_income?1:0,id:n})})}else this.props.updateCategory(e),this.setState({categoryGroups:AP(t,e)})},this.onDeleteCategory=async e=>{const t=await qe("must-category-transfer",{id:e});let{categoryGroups:n}=this.state;t?this.props.pushModal("confirm-category-delete",{category:e,onDelete:t=>{e!==t&&(this.props.deleteCategory(e,t),this.setState({categoryGroups:IP(n,e)}))}}):(this.props.deleteCategory(e),this.setState({categoryGroups:IP(n,e)}))},this.onSaveGroup=async e=>{let{categoryGroups:t}=this.state;if("new"===e.id){let n=await this.props.createGroup(e.name);this.setState({isAddingGroup:!1,categoryGroups:RP(t,{...e,is_income:0,categories:e.categories||[],id:n})})}else this.props.updateGroup(e),this.setState({categoryGroups:NP(t,e)})},this.onDeleteGroup=async e=>{let{categoryGroups:t}=this.state,n=t.find((t=>t.id===e)),r=!1;for(let o of n.categories)if(await qe("must-category-transfer",{id:o.id})){r=!0;break}r?this.props.pushModal("confirm-category-delete",{group:e,onDelete:n=>{this.props.deleteGroup(e,n),this.setState({categoryGroups:LP(t,e)})}}):(this.props.deleteGroup(e),this.setState({categoryGroups:LP(t,e)}))},this.onBudgetAction=(e,t,n)=>{this.props.applyBudgetAction(e,t,n)},this.onShowActivity=(e,t,n)=>{this.props.history.push({pathname:"/accounts",state:{goBack:!0,filterName:`${e} (${fh(n,"MMMM yyyy")})`,filter:{category:t,date:{$transform:"$month",$eq:n}}}})},this.onReorderCategory=async e=>{let{categoryGroups:t}=this.state;this.props.moveCategory(e.id,e.groupId,e.targetId),this.setState({categoryGroups:MP(t,e.id,e.groupId,e.targetId)})},this.onReorderGroup=async e=>{let{categoryGroups:t}=this.state;this.props.moveCategoryGroup(e.id,e.targetId),this.setState({categoryGroups:DP(t,e.id,e.targetId)})},this.onToggleCollapse=()=>{let e=!this.state.summaryCollapsed;this.setState({summaryCollapsed:e}),this.props.savePrefs({"budget.summaryCollapsed":e})},this.onTitlebarEvent=async e=>{switch(e){case"budget/switch-type":{let e="rollover"===this.props.budgetType?"report":"rollover";this.props.spreadsheet.disableObservers(),await qe("budget-set-type",{type:e}),await this.prewarmAllMonths(this.state.bounds,e),this.props.spreadsheet.enableObservers(),this.props.loadPrefs();break}}};const n=OD||Zp();this.state={initialized:!1,prewarmStartMonth:n,startMonth:n,newCategoryForGroup:null,isAddingGroup:!1,collapsed:e.collapsedPrefs||[],bounds:{start:n,end:n},categoryGroups:null,summaryCollapsed:e.summaryCollapsed}}async loadCategories(){let e=await this.props.getCategories();this.setState({categoryGroups:e.grouped})}async componentDidMount(){let{titlebar:e,budgetType:t}=this.props;this.loadCategories();let{start:n,end:r}=await qe("get-budget-bounds");this.setState({bounds:{start:n,end:r}}),this.prewarmAllMonths({start:n,end:r},t);let o=[Ye("sync-event",(e=>{let{type:t,tables:n}=e;"success"===t&&(n.includes("categories")||n.includes("category_mapping")||n.includes("category_groups"))&&this.loadCategories()})),Ye("undo-event",(e=>{let{tables:t}=e;this.table&&this.table.clearEditing(),t.includes("categories")&&this.loadCategories()})),e.subscribe(this.onTitlebarEvent)];this.cleanup=()=>{o.forEach((e=>e()))}}componentDidUpdate(e,t){t.collapsed!==this.state.collapsed&&this.props.savePrefs({"budget.collapsed":this.state.collapsed}),t.startMonth!==this.state.startMonth&&(OD=this.state.startMonth),this.props.match&&!e.match&&qe("get-budget-bounds").then((e=>{let{start:t,end:n}=e,{bounds:r}=this.state;r.start===t&&r.end===n||this.setState({bounds:{start:t,end:n}})}))}componentWillUnmount(){this.cleanup&&this.cleanup()}async prewarmAllMonths(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{startMonth:n}=this.state,r=lh((e=sM(e,nh(n,1),th(n,4))).start,e.end);await Promise.all(r.map((e=>this.prewarmMonth(e,t)))),this.setState({initialized:!0})}onCopy(e){this.props.copyPreviousMonthInto(e,this.props.categories)}render(){let e,{maxMonths:t,budgetType:n,reportComponents:r,rolloverComponents:o}=this.props,{initialized:i,categoryGroups:a,prewarmStartMonth:l,startMonth:s,newCategoryForGroup:u,isAddingGroup:c,collapsed:d,summaryCollapsed:f,bounds:p}=this.state;return t=t||1,i&&a?(e="report"===n?(0,wo.jsx)(UM,{summaryCollapsed:f,onBudgetAction:this.onBudgetAction,onToggleSummaryCollapse:this.onToggleCollapse,children:(0,wo.jsx)(NM,{ref:e=>this.table=e,type:n,categoryGroups:a,prewarmStartMonth:l,startMonth:s,monthBounds:p,maxMonths:t,collapsed:d,setCollapsed:this.setCollapsed,newCategoryForGroup:u,isAddingGroup:c,dataComponents:r,onMonthSelect:this.onMonthSelect,onShowNewCategory:this.onShowNewCategory,onHideNewCategory:this.onHideNewCategory,onShowNewGroup:this.onShowNewGroup,onHideNewGroup:this.onHideNewGroup,onDeleteCategory:this.onDeleteCategory,onDeleteGroup:this.onDeleteGroup,onSaveCategory:this.onSaveCategory,onSaveGroup:this.onSaveGroup,onBudgetAction:this.onBudgetAction,onShowActivity:this.onShowActivity,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup})}):(0,wo.jsx)(hD,{categoryGroups:a,summaryCollapsed:f,onBudgetAction:this.onBudgetAction,onToggleSummaryCollapse:this.onToggleCollapse,children:(0,wo.jsx)(NM,{ref:e=>this.table=e,type:n,categoryGroups:a,prewarmStartMonth:l,startMonth:s,monthBounds:p,maxMonths:t,collapsed:d,setCollapsed:this.setCollapsed,newCategoryForGroup:u,isAddingGroup:c,dataComponents:o,onMonthSelect:this.onMonthSelect,onShowNewCategory:this.onShowNewCategory,onHideNewCategory:this.onHideNewCategory,onShowNewGroup:this.onShowNewGroup,onHideNewGroup:this.onHideNewGroup,onDeleteCategory:this.onDeleteCategory,onDeleteGroup:this.onDeleteGroup,onSaveCategory:this.onSaveCategory,onSaveGroup:this.onSaveGroup,onBudgetAction:this.onBudgetAction,onShowActivity:this.onShowActivity,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup})}),(0,wo.jsx)(Ll,{style:{flex:1},innerRef:e=>this.page=e,children:e})):null}}const TD=h.memo((e=>{const t=Ox("goalTemplatesEnabled");return(0,wo.jsx)(mD,{...e,isGoalTemplatesEnabled:t})}));var PD=de((e=>({collapsedPrefs:e.prefs.local["budget.collapsed"],summaryCollapsed:e.prefs.local["budget.summaryCollapsed"],budgetType:e.prefs.local.budgetType||"rollover",maxMonths:e.prefs.global.maxMonths,categoryGroups:e.queries.categories.grouped})),e)((function(e){let t=Sf(),n=(0,h.useContext)(XA),i=(0,h.useMemo)((()=>({SummaryComponent:QM,ExpenseCategoryComponent:oD,ExpenseGroupComponent:rD,IncomeCategoryComponent:aD,IncomeGroupComponent:iD,BudgetTotalsComponent:ZM,IncomeHeaderComponent:JM})),[r]),a=(0,h.useMemo)((()=>({SummaryComponent:TD,ExpenseCategoryComponent:kD,ExpenseGroupComponent:SD,IncomeCategoryComponent:_D,IncomeGroupComponent:CD,BudgetTotalsComponent:wD,IncomeHeaderComponent:jD})),[o]);return(0,wo.jsx)(Ll,{style:[mo.page,{paddingLeft:8,paddingRight:8,overflow:"hidden"}],children:(0,wo.jsx)(ED,{...e,reportComponents:i,rolloverComponents:a,spreadsheet:t,titlebar:n})})}));var AD=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 23 3",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M23 1.5A1.5 1.5 0 0 1 21.5 3h-20a1.5 1.5 0 0 1 0-3h20A1.5 1.5 0 0 1 23 1.5z",fillRule:"nonzero",fill:"currentColor"})});function MD(e){let{id:t,defaultValue:n=0,onChange:r,style:o}=e,[i,a]=(0,h.useState)(n<=0),[l,s]=(0,h.useState)(zr(Math.abs(n)));function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=Hr(l);r(e?t<0?t:-t:t>0?t:-t)}return(0,wo.jsx)(Fs,{id:t,leftContent:(0,wo.jsx)(zl,{bare:!0,style:{padding:"0 7px"},onClick:function(){a(!i),u(!i)},children:i?(0,wo.jsx)(AD,{style:{width:8,height:8}}):(0,wo.jsx)(Vx,{style:{width:8,height:8}})}),value:l,style:{flex:1,alignItems:"stretch",...o},inputStyle:{paddingLeft:0},onChange:e=>s(e.target.value),onBlur:e=>u()})}function DD(e){let{defaultValue:t,onChange:n}=e,[r,o]=(0,h.useState)(t.num1),[i,a]=(0,h.useState)(t.num2);return(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(MD,{defaultValue:r,onChange:e=>{o(e),n({num1:e,num2:i})}}),(0,wo.jsx)(Ll,{style:{margin:"0 5px"},children:"and"}),(0,wo.jsx)(MD,{defaultValue:i,onChange:e=>{a(e),n({num1:r,num2:e})}})]})}const ID=e=>{let{children:t,style:n,...r}=e;return(0,wo.jsx)(Ll,{style:[{height:50,borderBottomWidth:1,borderColor:go.border,flexDirection:"row",alignItems:"center",paddingLeft:10,paddingRight:10,zIndex:1},n],...r,children:t})};function RD(e){let{toBudget:t,onClick:n}=e;return(0,wo.jsx)(mw,{binding:t,children:e=>{let{value:t}=e;return(0,wo.jsxs)(zl,{bare:!0,style:{flexDirection:"column",alignItems:"flex-start"},onClick:n,children:[(0,wo.jsx)(Qs,{title:t<0?"OVERBUDGETED":"TO BUDGET",style:{color:go.n1,flexShrink:0}}),(0,wo.jsx)(ql,{style:[mo.smallText,{fontWeight:"500",color:t<0?go.r4:go.n1}],children:yw(t,"financial")})]})}})}function ND(e){let{projected:t}=e,n=bw(dx.totalBudgetedSaved)||0,r=bw(dx.totalSaved)||0,o=t?n:r,i=o<0;return(0,wo.jsxs)(Ll,{style:{flexDirection:"column",alignItems:"flex-start"},children:[t?(0,wo.jsx)(Qs,{title:"PROJECTED SAVINGS",style:{color:go.n1}}):(0,wo.jsx)(Qs,{title:i?"OVERSPENT":"SAVED",style:{color:go.n1}}),(0,wo.jsx)(ql,{style:[mo.smallText,{fontWeight:"500",color:t?go.y3:i?go.r4:go.n1}],children:yw(o,"financial")})]})}class LD extends h.PureComponent{render(){const{name:e,binding:t,editing:n,style:r,textStyle:o,categoryId:i,month:a,onBudgetAction:l}=this.props;return(0,wo.jsx)(mw,{binding:t,children:t=>(0,wo.jsxs)(Ll,{style:r,children:[(0,wo.jsx)(MD,{value:Vr(t.value||0),style:{height:46,transform:"translateX(6px)",...!n&&{opacity:0,position:"absolute",top:0}},focused:n,textStyle:[mo.smallText,o],onChange:()=>{},onBlur:e=>{l(a,"budget-amount",{category:i,amount:$r(e)})}}),(0,wo.jsx)(Ll,{style:{justifyContent:"center",height:46,...n&&{display:"none"}},children:(0,wo.jsx)(ql,{style:[mo.smallText,o],"data-testid":e,children:yw(t.value||0,"financial")})})]})})}}class FD extends h.PureComponent{constructor(e){super(e);let{editMode:t,blank:n}=e;this.opacity=t||n?0:1}render(){let{category:e,editing:t,index:n,style:r,month:o,onBudgetAction:i}=this.props,a=cx.catBudgeted(e.id),l=cx.catBalance(e.id),s=(0,wo.jsxs)(ID,{style:[{backgroundColor:t?go.p11:"transparent",borderBottomWidth:0,borderTopWidth:n>0?1:0},r],"data-testid":"row",children:[(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(ql,{style:mo.smallText,children:e.name})}),(0,wo.jsxs)(Ll,{style:{alignItems:"center",flexDirection:"row",opacity:this.opacity},children:[(0,wo.jsx)(LD,{name:"budgeted",binding:a,editing:t,style:{width:90},textStyle:[mo.smallText,{textAlign:"right"}],categoryId:e.id,month:o,onBudgetAction:i}),(0,wo.jsx)(vw,{name:"balance",binding:l,style:[mo.smallText,{width:90,textAlign:"right"}],getStyle:e=>e<0&&{color:go.r4},type:"financial"})]})]});return(0,wo.jsx)("div",{children:s})}}class BD extends h.PureComponent{constructor(e){super(e);let{editMode:t,blank:n}=e;this.opacity=t||n?0:1}render(){let{group:e,editMode:t,onAddCategory:n}=this.props,r=(0,wo.jsxs)(ID,{style:{flexDirection:"row",alignItems:"center",backgroundColor:go.n11},"data-testid":"totals",children:[(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(ql,{style:[mo.smallText,{fontWeight:"500"}],"data-testid":"name",children:e.name})}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",opacity:this.opacity},children:[(0,wo.jsx)(vw,{binding:cx.groupBudgeted(e.id),style:[mo.smallText,{width:90,fontWeight:"500",textAlign:"right"}],type:"financial"}),(0,wo.jsx)(vw,{binding:cx.groupBalance(e.id),style:[mo.smallText,{width:90,fontWeight:"500",textAlign:"right"}],type:"financial"})]}),t&&(0,wo.jsx)(Ll,{children:(0,wo.jsx)(zl,{onClick:()=>n(e.id),style:{padding:10},children:(0,wo.jsx)(Vx,{width:15,height:15,color:go.n1})})})]});return r}}class zD extends h.PureComponent{render(){const{name:e,budget:t,balance:n,style:r,nameTextStyle:o,amountTextStyle:i}=this.props;return(0,wo.jsxs)(ID,{style:[{flexDirection:"row",alignItems:"center",padding:10,backgroundColor:"transparent"},r],children:[(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(ql,{style:[mo.smallText,o],"data-testid":"name",children:e})}),t&&(0,wo.jsx)(vw,{binding:t,style:[mo.smallText,{width:90,textAlign:"right"},i],type:"financial"}),(0,wo.jsx)(vw,{binding:n,style:[mo.smallText,{width:90,textAlign:"right"},i],type:"financial"})]})}}class UD extends h.PureComponent{render(){const{group:e,editMode:t,gestures:n,month:r,onEditCategory:o,onReorderCategory:i,onAddCategory:a,onBudgetAction:l}=this.props;return(0,wo.jsxs)(Ds,{style:{marginTop:7,marginBottom:7},children:[(0,wo.jsx)(BD,{group:e,budgeted:cx.groupBudgeted(e.id),balance:cx.groupBalance(e.id),editMode:t,onAddCategory:a,onReorderCategory:i}),e.categories.map(((e,a)=>(0,wo.jsx)(FD,{index:a,category:e,editing:void 0,editMode:t,gestures:n,month:r,onEdit:o,onReorder:i,onBudgetAction:l},e.id)))]})}}class WD extends h.Component{render(){const{type:e,group:t}=this.props;return(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginTop:50,marginBottom:5,marginRight:14},children:["report"===e&&(0,wo.jsx)(Qs,{title:"BUDGETED",style:{width:90}}),(0,wo.jsx)(Qs,{title:"RECEIVED",style:{width:90}})]}),(0,wo.jsxs)(Ds,{style:{marginTop:0},children:[(0,wo.jsx)(zD,{name:"Income",budget:"report"===e?dx.groupBudgeted(t.id):null,balance:"report"===e?dx.groupSumAmount(t.id):cx.groupSumAmount(t.id),nameTextStyle:{fontWeight:"500"},amountTextStyle:{fontWeight:"500"},style:{backgroundColor:go.n11}}),t.categories.map(((t,n)=>(0,wo.jsx)(zD,{type:e,name:t.name,budget:"report"===e?dx.catBudgeted(t.id):null,balance:"report"===e?dx.catSumAmount(t.id):cx.catSumAmount(t.id),index:n},t.id)))]})]})}}class HD extends h.Component{constructor(){super(...arguments),this.getGroups=Qr((e=>({incomeGroup:e.find((e=>e.is_income)),expenseGroups:e.filter((e=>!e.is_income))})))}render(){const{type:e,categoryGroups:t,editingId:n,gestures:r,month:o,onEditCategory:i,onAddCategory:a,onReorderCategory:l,onReorderGroup:s,onBudgetAction:u}=this.props,{incomeGroup:c,expenseGroups:d}=this.getGroups(t);return(0,wo.jsxs)(Ll,{"data-testid":"budget-groups",style:{flex:"1 0 auto",overflowY:"auto",paddingBottom:15},children:[d.map((e=>(0,wo.jsx)(UD,{group:e,editingId:n,editMode:void 0,gestures:r,month:o,onEditCategory:i,onAddCategory:a,onReorderCategory:l,onReorderGroup:s,onBudgetAction:u},e.id))),c&&(0,wo.jsx)(WD,{type:e,group:c})]})}}class KD extends h.Component{constructor(){super(...arguments),this.state={editingCategory:null},this.onEditCategory=e=>{this.setState({editingCategory:e})}}render(){const{type:e,categoryGroups:t,month:n,monthBounds:r,editMode:o,onPrevMonth:i,onNextMonth:a,onAddCategory:l,onReorderCategory:s,onReorderGroup:u,onShowBudgetDetails:c,onOpenActionSheet:d,onBudgetAction:f}=this.props;let{editingCategory:p}=this.state,y=Zp();return(0,wo.jsx)(gw.Provider,{value:dh(n),children:(0,wo.jsxs)(Ll,{style:{flex:1,overflowY:"hidden"},"data-testid":"budget-table",children:[(0,wo.jsx)($D,{currentMonth:n,monthBounds:r,editMode:o,onDone:()=>this.props.onEditMode(!1),onOpenActionSheet:d,onPrevMonth:i,onNextMonth:a}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",flex:"1 0 auto",padding:10,paddingRight:14,backgroundColor:"white",borderBottomWidth:1,borderColor:go.n9},children:["report"===e?(0,wo.jsx)(ND,{projected:n>=y}):(0,wo.jsx)(RD,{toBudget:cx.toBudget,onClick:c}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsxs)(Ll,{style:{width:90},children:[(0,wo.jsx)(Qs,{title:"BUDGETED",style:{color:go.n1}}),(0,wo.jsx)(vw,{binding:dx.totalBudgetedExpense,type:"financial",style:[mo.smallText,{color:go.n1,textAlign:"right",fontWeight:"500"}],formatter:e=>yw(-parseFloat(e||"0"),"financial")})]}),(0,wo.jsxs)(Ll,{style:{width:90},children:[(0,wo.jsx)(Qs,{title:"BALANCE",style:{color:go.n1}}),(0,wo.jsx)(vw,{binding:cx.totalBalance,type:"financial",style:[mo.smallText,{color:go.n1,textAlign:"right",fontWeight:"500"}]})]})]}),(0,wo.jsx)(Ll,{style:{overflowY:"auto"},children:o?(0,wo.jsx)(h.Fragment,{children:(0,wo.jsx)(Ll,{children:(0,wo.jsx)(HD,{categoryGroups:t,editingId:p,editMode:o,gestures:this.gestures,onEditCategory:()=>{},onAddCategory:l,onReorderCategory:s,onReorderGroup:u})})}):(0,wo.jsx)(Ll,{children:(0,wo.jsx)(HD,{type:e,categoryGroups:t,editingId:p,editMode:o,gestures:this.gestures,month:n,onEditCategory:this.onEditCategory,onAddCategory:l,onReorderCategory:s,onReorderGroup:u,onBudgetAction:f})})})]})})}}const $D=de((e=>({localPrefs:e.prefs.local})),e)((function(e){let{currentMonth:t,monthBounds:n,editMode:r,onDone:o,onPrevMonth:i,onNextMonth:a,sync:l,localPrefs:s}=e,u=t>n.start,c=t<nh(n.end,1),d={paddingLeft:15,paddingRight:15,backgroundColor:"transparent"};return(0,wo.jsxs)(Ll,{style:{alignItems:"center",flexDirection:"row",flexShrink:0,height:50,justifyContent:"center",backgroundColor:go.p5},children:[!r&&(0,wo.jsx)(zl,{bare:!0,onClick:u&&i,style:[d,{left:0,opacity:u?1:.6,padding:"5px 30px 5px 0"}],children:(0,wo.jsx)(rM,{style:{color:go.n11},width:"15",height:"15"})}),(0,wo.jsx)(ql,{style:[mo.mediumText,{marginTop:12,marginBottom:12,color:go.n11,textAlign:"center"}],children:fh(t,"MMMM ''yy")}),r?(0,wo.jsx)(zl,{bare:!0,onClick:o,style:[d,{position:"absolute",top:0,bottom:0,right:0}],textStyle:{color:go.n11,fontSize:15,fontWeight:"500"},children:"Done"}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(zl,{bare:!0,onClick:c&&a,style:[d,{opacity:c?1:.6}],children:(0,wo.jsx)(oM,{style:{color:go.n11},width:"15",height:"15"})}),(0,wo.jsx)(eM,{style:{color:"white",position:"absolute",top:0,bottom:0,right:0,backgroundColor:"transparent",paddingLeft:12,paddingRight:12},localPrefs:s,onSync:l})]})]})}));class VD extends h.Component{constructor(e){var t;super(e),t=this,this.prewarmMonth=async function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n=n||t.props.budgetType;let r="report"===n?"report-budget-month":"rollover-budget-month",o=await qe(r,{month:e});for(let i of o)t.props.spreadsheet.prewarmCache(i.name,i);t.state.initialized||t.setState({initialized:!0})},this.onShowBudgetDetails=()=>{this.props.pushModal("budget-summary",{month:this.state.currentMonth})},this.onBudgetAction=e=>{const{currentMonth:t}=this.state;this.props.applyBudgetAction(t,e,this.state.bounds)},this.onAddCategory=e=>{this.props.navigation.navigate("AddCategoryModal",{groupId:e,onAdd:async t=>{let n=await this.props.createCategory(t,e),{categoryGroups:r}=this.state;this.setState({categoryGroups:PP(r,{name:t,cat_group:e,is_income:0,id:n})})}})},this.onReorderCategory=(e,t)=>{let n,r,{inGroup:o,aroundCategory:i}=t,{categoryGroups:a}=this.state;if(o)n=o;else if(i){let{id:e,position:t}=i,o=a.find((t=>t.categories.find((t=>t.id===e))));if("bottom"===t){let{categories:t}=o,n=t.findIndex((t=>t.id===e));e=n<t.length-1?t[n+1].id:null}n=o.id,r=e}this.props.moveCategory(e,n,r),this.setState({categoryGroups:MP(a,e,n,r)})},this.onReorderGroup=(e,t,n)=>{let{categoryGroups:r}=this.state;if("bottom"===n){let e=r.findIndex((e=>e.id===t));t=e<r.length-1?r[e+1].id:null}this.props.moveCategoryGroup(e,t),this.setState({categoryGroups:DP(r,e,t)})},this.sync=async()=>{const{updated:e,error:t}=await this.props.sync();return t?"error":e?"updated":null},this.onPrevMonth=async()=>{let e=nh(this.state.currentMonth,1);await this.prewarmMonth(e),this.setState({currentMonth:e})},this.onNextMonth=async()=>{let e=th(this.state.currentMonth,1);await this.prewarmMonth(e),this.setState({currentMonth:e})},this.onOpenActionSheet=()=>{let{budgetType:e}=this.props,t=["Edit Categories","Copy last month\u2019s budget","Set budgets to zero","Set budgets to 3 month average","report"===e&&"Apply to all future budgets","Cancel"].filter(Boolean);this.props.showActionSheetWithOptions({options:t,cancelButtonIndex:t.length-1,title:"Actions"},(t=>{switch(t){case 0:this.setState({editMode:!0});break;case 1:this.onBudgetAction("copy-last");break;case 2:this.onBudgetAction("set-zero");break;case 3:this.onBudgetAction("set-3-avg");break;case 4:"report"===e&&this.onBudgetAction("set-all-future")}}))},this.summary=0;const n=Zp();this.state={bounds:{start:n,end:n},currentMonth:n,initialized:!1,editMode:!1,categoryGroups:null}}async loadCategories(){let e=await this.props.getCategories();this.setState({categoryGroups:e.grouped})}async componentDidMount(){this.loadCategories();const{start:e,end:t}=await qe("get-budget-bounds");this.setState({bounds:{start:e,end:t}}),this.prewarmMonth(this.state.currentMonth);let n=Ye("sync-event",(e=>{let{type:t,tables:n}=e;"success"===t&&(n.includes("categories")||n.includes("category_mapping")||n.includes("category_groups"))&&this.loadCategories()}));this.cleanup=()=>{n()}}componentWillUnmount(){}render(){const{currentMonth:e,bounds:t,editMode:n,initialized:r}=this.state,{categories:o,categoryGroups:i,prefs:a,budgetType:l,navigation:s,applyBudgetAction:u}=this.props;let c=a.numberFormat||"comma-dot",d=a.hideFraction||!1;return i&&r?(0,wo.jsx)(HO,{onSync:this.sync,children:r=>{let{refreshing:a,onRefresh:f}=r;return(0,wo.jsx)(KD,{categories:o,categoryGroups:i,type:l,month:e,monthBounds:t,editMode:n,navigation:s,onEditMode:e=>this.setState({editMode:e}),onShowBudgetDetails:this.onShowBudgetDetails,onPrevMonth:this.onPrevMonth,onNextMonth:this.onNextMonth,onAddCategory:this.onAddCategory,onReorderCategory:this.onReorderCategory,onReorderGroup:this.onReorderGroup,onOpenActionSheet:()=>{},onBudgetAction:u},c+d)}}):(0,wo.jsx)(Ll,{style:{flex:1,backgroundColor:"white",alignItems:"center",justifyContent:"center",marginBottom:25},children:(0,wo.jsx)(ko,{width:25,height:25})})}}var qD=de((e=>({categoryGroups:e.queries.categories.grouped,categories:e.queries.categories.list,budgetType:e.prefs.local.budgetType||"rollover",prefs:e.prefs.local,initialBudgetMonth:e.app.budgetMonth})),e)(UO(go.p5)((function(e){let t=Sf();return(0,wo.jsx)(VD,{...e,spreadsheet:t})})));function GD(){let e=Ri();return(0,h.useEffect)((()=>{const t=t=>{if(!ho&&t.metaKey)switch(t.key){case"1":e.push("/budget");break;case"2":e.push("/reports");break;case"3":e.push("/accounts");break;case",":"mac"===fo&&e.push("/settings")}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}),[]),null}function YD(){return(0,wo.jsx)(oT,{title:"Rules",children:(0,wo.jsx)(Pk,{})})}var QD=function(e){let{month:t,modalProps:n}=e;const r=fh(eh(t),"MMM");return(0,wo.jsx)(ks,{title:"Budget Details",...n,animate:!0,children:()=>(0,wo.jsxs)(gw.Provider,{value:dh(t),children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"center",paddingTop:15,paddingBottom:15},children:[(0,wo.jsxs)(Ll,{style:[mo.text,{fontWeight:"600",textAlign:"right",marginRight:10}],children:[(0,wo.jsx)(vw,{binding:cx.incomeAvailable,type:"financial"}),(0,wo.jsx)(vw,{binding:cx.lastMonthOverspent,type:"financial"}),(0,wo.jsx)(vw,{binding:cx.totalBudgeted,type:"financial"}),(0,wo.jsx)(vw,{binding:cx.forNextMonth,type:"financial"})]}),(0,wo.jsxs)(Ll,{style:[mo.text,{display:"flex",flexDirection:"column",textAlign:"left"}],children:[(0,wo.jsx)(ql,{children:"Available Funds"}),(0,wo.jsxs)(ql,{children:["Overspent in ",r]}),(0,wo.jsx)(ql,{children:"Budgeted"}),(0,wo.jsx)(ql,{children:"For Next Month"})]})]}),(0,wo.jsx)(Ll,{style:{alignItems:"center",marginBottom:15},children:(0,wo.jsx)(mw,{binding:cx.toBudget,children:e=>{let{value:t}=e;return(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(ql,{style:mo.text,children:t<0?"Overbudget:":"To budget:"}),(0,wo.jsx)(ql,{style:[mo.text,{fontWeight:"600",fontSize:22,color:t<0?go.r4:go.n1}],children:yw(t,"financial")})]})}})}),(0,wo.jsx)(Ll,{style:{flexDirection:"row",justifyContent:"center",paddingBottom:15},children:(0,wo.jsx)(zl,{style:{marginRight:10},onClick:n.onClose,children:"Close"})})]})})},XD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function ZD(e,t){function n(){this.constructor=e}XD(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var JD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function eI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}var tI="undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{};function nI(e,t){return e(t={exports:{}},t.exports),t.exports}function rI(e){return function(){return e}}var oI=function(){};oI.thatReturns=rI,oI.thatReturnsFalse=rI(!1),oI.thatReturnsTrue=rI(!0),oI.thatReturnsNull=rI(null),oI.thatReturnsThis=function(){return this},oI.thatReturnsArgument=function(e){return e};var iI=oI,aI=function(e){};var lI=function(e,t,n,r,o,i,a,l){if(aI(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}},sI=Object.getOwnPropertySymbols,uI=Object.prototype.hasOwnProperty,cI=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}})()&&Object.assign;var dI="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";var fI=nI((function(e){e.exports=function(){function e(e,t,n,r,o,i){i!==dI&&lI(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=iI,n.PropTypes=n,n}()})),pI=fI.object,hI=fI.oneOfType,yI=fI.string,gI=fI.node,mI=fI.func,vI=fI.bool,bI=(fI.element,nI((function(e,t){var n=200,r="__lodash_hash_undefined__",o=1,i=2,a=9007199254740991,l="[object Arguments]",s="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",p="[object Function]",h="[object GeneratorFunction]",y="[object Map]",g="[object Number]",m="[object Null]",v="[object Object]",b="[object Promise]",x="[object Proxy]",w="[object RegExp]",j="[object Set]",S="[object String]",k="[object Symbol]",C="[object Undefined]",_="[object WeakMap]",O="[object ArrayBuffer]",E="[object DataView]",T=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,A={};A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A[l]=A[s]=A[O]=A[c]=A[E]=A[d]=A[f]=A[p]=A[y]=A[g]=A[v]=A[w]=A[j]=A[S]=A[_]=!1;var M="object"==typeof tI&&tI&&tI.Object===Object&&tI,D="object"==typeof self&&self&&self.Object===Object&&self,I=M||D||Function("return this")(),R=t&&!t.nodeType&&t,N=R&&e&&!e.nodeType&&e,L=N&&N.exports===R,F=L&&M.process,B=function(){try{return F&&F.binding&&F.binding("util")}catch(Fa){}}(),z=B&&B.isTypedArray;function U(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function W(e,t){return e.has(t)}function H(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,V,q=Array.prototype,G=Function.prototype,Y=Object.prototype,Q=I["__core-js_shared__"],X=G.toString,Z=Y.hasOwnProperty,J=function(){var e=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ee=Y.toString,te=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=L?I.Buffer:void 0,re=I.Symbol,oe=I.Uint8Array,ie=Y.propertyIsEnumerable,ae=q.splice,le=re?re.toStringTag:void 0,se=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,ce=($=Object.keys,V=Object,function(e){return $(V(e))}),de=Be(I,"DataView"),fe=Be(I,"Map"),pe=Be(I,"Promise"),he=Be(I,"Set"),ye=Be(I,"WeakMap"),ge=Be(Object,"create"),me=He(de),ve=He(fe),be=He(pe),xe=He(he),we=He(ye),je=re?re.prototype:void 0,Se=je?je.valueOf:void 0;function ke(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _e;++t<n;)this.add(e[t])}function Ee(e){var t=this.__data__=new Ce(e);this.size=t.size}function Te(e,t){var n=Ve(e),r=!n&&$e(e),o=!n&&!r&&qe(e),i=!n&&!r&&!o&&Ze(e),a=n||r||o||i,l=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=l.length;for(var u in e)!t&&!Z.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||We(u,s))||l.push(u);return l}function Pe(e,t){for(var n=e.length;n--;)if(Ke(e[n][0],t))return n;return-1}function Ae(e){return null==e?void 0===e?C:m:le&&le in Object(e)?function(e){var t=Z.call(e,le),n=e[le];try{e[le]=void 0;var r=!0}catch(Fa){}var o=ee.call(e);r&&(t?e[le]=n:delete e[le]);return o}(e):function(e){return ee.call(e)}(e)}function Me(e){return Xe(e)&&Ae(e)==l}function De(e,t,n,r,a){return e===t||(null==e||null==t||!Xe(e)&&!Xe(t)?e!==e&&t!==t:function(e,t,n,r,a,u){var p=Ve(e),h=Ve(t),m=p?s:Ue(e),b=h?s:Ue(t),x=(m=m==l?v:m)==v,C=(b=b==l?v:b)==v,_=m==b;if(_&&qe(e)){if(!qe(t))return!1;p=!0,x=!1}if(_&&!x)return u||(u=new Ee),p||Ze(e)?Ne(e,t,n,r,a,u):function(e,t,n,r,a,l,s){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!l(new oe(e),new oe(t)));case c:case d:case g:return Ke(+e,+t);case f:return e.name==t.name&&e.message==t.message;case w:case S:return e==t+"";case y:var u=H;case j:var p=r&o;if(u||(u=K),e.size!=t.size&&!p)return!1;var h=s.get(e);if(h)return h==t;r|=i,s.set(e,t);var m=Ne(u(e),u(t),r,a,l,s);return s.delete(e),m;case k:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,m,n,r,a,u);if(!(n&o)){var T=x&&Z.call(e,"__wrapped__"),P=C&&Z.call(t,"__wrapped__");if(T||P){var A=T?e.value():e,M=P?t.value():t;return u||(u=new Ee),a(A,M,n,r,u)}}if(!_)return!1;return u||(u=new Ee),function(e,t,n,r,i,a){var l=n&o,s=Le(e),u=s.length,c=Le(t),d=c.length;if(u!=d&&!l)return!1;var f=u;for(;f--;){var p=s[f];if(!(l?p in t:Z.call(t,p)))return!1}var h=a.get(e);if(h&&a.get(t))return h==t;var y=!0;a.set(e,t),a.set(t,e);var g=l;for(;++f<u;){var m=e[p=s[f]],v=t[p];if(r)var b=l?r(v,m,p,t,e,a):r(m,v,p,e,t,a);if(!(void 0===b?m===v||i(m,v,n,r,a):b)){y=!1;break}g||(g="constructor"==p)}if(y&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(y=!1)}return a.delete(e),a.delete(t),y}(e,t,n,r,a,u)}(e,t,n,r,De,a))}function Ie(e){return!(!Qe(e)||function(e){return!!J&&J in e}(e))&&(Ge(e)?te:T).test(He(e))}function Re(e){if(!function(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||Y;return e===n}(e))return ce(e);var t=[];for(var n in Object(e))Z.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ne(e,t,n,r,a,l){var s=n&o,u=e.length,c=t.length;if(u!=c&&!(s&&c>u))return!1;var d=l.get(e);if(d&&l.get(t))return d==t;var f=-1,p=!0,h=n&i?new Oe:void 0;for(l.set(e,t),l.set(t,e);++f<u;){var y=e[f],g=t[f];if(r)var m=s?r(g,y,f,t,e,l):r(y,g,f,e,t,l);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!U(t,(function(e,t){if(!W(h,t)&&(y===e||a(y,e,n,r,l)))return h.push(t)}))){p=!1;break}}else if(y!==g&&!a(y,g,n,r,l)){p=!1;break}}return l.delete(e),l.delete(t),p}function Le(e){return function(e,t,n){var r=t(e);return Ve(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Je,ze)}function Fe(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Be(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Ie(n)?n:void 0}ke.prototype.clear=function(){this.__data__=ge?ge(null):{},this.size=0},ke.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ke.prototype.get=function(e){var t=this.__data__;if(ge){var n=t[e];return n===r?void 0:n}return Z.call(t,e)?t[e]:void 0},ke.prototype.has=function(e){var t=this.__data__;return ge?void 0!==t[e]:Z.call(t,e)},ke.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ge&&void 0===t?r:t,this},Ce.prototype.clear=function(){this.__data__=[],this.size=0},Ce.prototype.delete=function(e){var t=this.__data__,n=Pe(t,e);return!(n<0)&&(n==t.length-1?t.pop():ae.call(t,n,1),--this.size,!0)},Ce.prototype.get=function(e){var t=this.__data__,n=Pe(t,e);return n<0?void 0:t[n][1]},Ce.prototype.has=function(e){return Pe(this.__data__,e)>-1},Ce.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new ke,map:new(fe||Ce),string:new ke}},_e.prototype.delete=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return Fe(this,e).get(e)},_e.prototype.has=function(e){return Fe(this,e).has(e)},_e.prototype.set=function(e,t){var n=Fe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,r),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.clear=function(){this.__data__=new Ce,this.size=0},Ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ce){var o=r.__data__;if(!fe||o.length<n-1)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new _e(o)}return r.set(e,t),this.size=r.size,this};var ze=se?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(se(e),(function(t){return ie.call(e,t)})))}:function(){return[]},Ue=Ae;function We(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||P.test(e))&&e>-1&&e%1==0&&e<t}function He(e){if(null!=e){try{return X.call(e)}catch(Fa){}try{return e+""}catch(Fa){}}return""}function Ke(e,t){return e===t||e!==e&&t!==t}(de&&Ue(new de(new ArrayBuffer(1)))!=E||fe&&Ue(new fe)!=y||pe&&Ue(pe.resolve())!=b||he&&Ue(new he)!=j||ye&&Ue(new ye)!=_)&&(Ue=function(e){var t=Ae(e),n=t==v?e.constructor:void 0,r=n?He(n):"";if(r)switch(r){case me:return E;case ve:return y;case be:return b;case xe:return j;case we:return _}return t});var $e=Me(function(){return arguments}())?Me:function(e){return Xe(e)&&Z.call(e,"callee")&&!ie.call(e,"callee")},Ve=Array.isArray;var qe=ue||function(){return!1};function Ge(e){if(!Qe(e))return!1;var t=Ae(e);return t==p||t==h||t==u||t==x}function Ye(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Qe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Xe(e){return null!=e&&"object"==typeof e}var Ze=z?function(e){return function(t){return e(t)}}(z):function(e){return Xe(e)&&Ye(e.length)&&!!A[Ae(e)]};function Je(e){return function(e){return null!=e&&Ye(e.length)&&!Ge(e)}(e)?Te(e):Re(e)}e.exports=function(e,t){return De(e,t)}}))),xI=function(){};var wI=xI,jI="Expected a function",SI="__lodash_hash_undefined__",kI=1/0,CI="[object Function]",_I="[object GeneratorFunction]",OI="[object Symbol]",EI=/^\./,TI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,PI=/\\(\\)?/g,AI=/^\[object .+?Constructor\]$/,MI="object"==typeof tI&&tI&&tI.Object===Object&&tI,DI="object"==typeof self&&self&&self.Object===Object&&self,II=MI||DI||Function("return this")();var RI=Array.prototype,NI=Function.prototype,LI=Object.prototype,FI=II["__core-js_shared__"],BI=function(){var e=/[^.]+$/.exec(FI&&FI.keys&&FI.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),zI=NI.toString,UI=LI.hasOwnProperty,WI=LI.toString,HI=RegExp("^"+zI.call(UI).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),KI=II.Symbol,$I=RI.splice,VI=nR(II,"Map"),qI=nR(Object,"create"),GI=KI?KI.prototype:void 0,YI=GI?GI.toString:void 0;function QI(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function XI(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ZI(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function JI(e,t){for(var n=e.length;n--;)if(aR(e[n][0],t))return n;return-1}function eR(e){if(!sR(e)||(t=e,BI&&BI in t))return!1;var t,n=function(e){var t=sR(e)?WI.call(e):"";return t==CI||t==_I}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(Fa){}return t}(e)?HI:AI;return n.test(function(e){if(null!=e){try{return zI.call(e)}catch(Fa){}try{return e+""}catch(Fa){}}return""}(e))}function tR(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function nR(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return eR(n)?n:void 0}QI.prototype.clear=function(){this.__data__=qI?qI(null):{}},QI.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},QI.prototype.get=function(e){var t=this.__data__;if(qI){var n=t[e];return n===SI?void 0:n}return UI.call(t,e)?t[e]:void 0},QI.prototype.has=function(e){var t=this.__data__;return qI?void 0!==t[e]:UI.call(t,e)},QI.prototype.set=function(e,t){return this.__data__[e]=qI&&void 0===t?SI:t,this},XI.prototype.clear=function(){this.__data__=[]},XI.prototype.delete=function(e){var t=this.__data__,n=JI(t,e);return!(n<0)&&(n==t.length-1?t.pop():$I.call(t,n,1),!0)},XI.prototype.get=function(e){var t=this.__data__,n=JI(t,e);return n<0?void 0:t[n][1]},XI.prototype.has=function(e){return JI(this.__data__,e)>-1},XI.prototype.set=function(e,t){var n=this.__data__,r=JI(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ZI.prototype.clear=function(){this.__data__={hash:new QI,map:new(VI||XI),string:new QI}},ZI.prototype.delete=function(e){return tR(this,e).delete(e)},ZI.prototype.get=function(e){return tR(this,e).get(e)},ZI.prototype.has=function(e){return tR(this,e).has(e)},ZI.prototype.set=function(e,t){return tR(this,e).set(e,t),this};var rR=iR((function(e){e=function(e){return null==e?"":function(e){if("string"==typeof e)return e;if(uR(e))return YI?YI.call(e):"";var t=e+"";return"0"==t&&1/e==-kI?"-0":t}(e)}(e);var t=[];return EI.test(e)&&t.push(""),e.replace(TI,(function(e,n,r,o){t.push(r?o.replace(PI,"$1"):n||e)})),t}));function oR(e){if("string"==typeof e||uR(e))return e;var t=e+"";return"0"==t&&1/e==-kI?"-0":t}function iR(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(jI);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(iR.Cache||ZI),n}function aR(e,t){return e===t||e!==e&&t!==t}iR.Cache=ZI;var lR=Array.isArray;function sR(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function uR(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&WI.call(e)==OI}var cR=function(e){return lR(e)?function(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(e,oR):uR(e)?[e]:function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(rR(e))},dR=nI((function(e,t){var n=200,r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Boolean]",l="[object Date]",s="[object Function]",u="[object GeneratorFunction]",c="[object Map]",d="[object Number]",f="[object Object]",p="[object Promise]",h="[object RegExp]",y="[object Set]",g="[object String]",m="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",j="[object Float64Array]",S="[object Int8Array]",k="[object Int16Array]",C="[object Int32Array]",_="[object Uint8Array]",O="[object Uint8ClampedArray]",E="[object Uint16Array]",T="[object Uint32Array]",P=/\w*$/,A=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,D={};D[i]=D["[object Array]"]=D[b]=D[x]=D[a]=D[l]=D[w]=D[j]=D[S]=D[k]=D[C]=D[c]=D[d]=D[f]=D[h]=D[y]=D[g]=D[m]=D[_]=D[O]=D[E]=D[T]=!0,D["[object Error]"]=D[s]=D[v]=!1;var I="object"==typeof tI&&tI&&tI.Object===Object&&tI,R="object"==typeof self&&self&&self.Object===Object&&self,N=I||R||Function("return this")(),L=t&&!t.nodeType&&t,F=L&&e&&!e.nodeType&&e,B=F&&F.exports===L;function z(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function W(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function H(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(Fa){}return t}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function $(e,t){return function(n){return e(t(n))}}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var q=Array.prototype,G=Function.prototype,Y=Object.prototype,Q=N["__core-js_shared__"],X=function(){var e=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Z=G.toString,J=Y.hasOwnProperty,ee=Y.toString,te=RegExp("^"+Z.call(J).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=B?N.Buffer:void 0,re=N.Symbol,oe=N.Uint8Array,ie=$(Object.getPrototypeOf,Object),ae=Object.create,le=Y.propertyIsEnumerable,se=q.splice,ue=Object.getOwnPropertySymbols,ce=ne?ne.isBuffer:void 0,de=$(Object.keys,Object),fe=Le(N,"DataView"),pe=Le(N,"Map"),he=Le(N,"Promise"),ye=Le(N,"Set"),ge=Le(N,"WeakMap"),me=Le(Object,"create"),ve=We(fe),be=We(pe),xe=We(he),we=We(ye),je=We(ge),Se=re?re.prototype:void 0,ke=Se?Se.valueOf:void 0;function Ce(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _e(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ee(e){this.__data__=new _e(e)}function Te(e,t){var n=Ke(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&$e(e)}(e)&&J.call(e,"callee")&&(!le.call(e,"callee")||ee.call(e)==i)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var a in e)!t&&!J.call(e,a)||o&&("length"==a||ze(a,r))||n.push(a);return n}function Pe(e,t,n){var r=e[t];J.call(e,t)&&He(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Ae(e,t){for(var n=e.length;n--;)if(He(e[n][0],t))return n;return-1}function Me(e,t,n,r,o,p,v){var A;if(r&&(A=p?r(e,o,p,v):r(e)),void 0!==A)return A;if(!Ge(e))return e;var M=Ke(e);if(M){if(A=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&J.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,A)}else{var I=Be(e),R=I==s||I==u;if(Ve(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(I==f||I==i||R&&!p){if(H(e))return p?e:{};if(A=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=ie(e),Ge(t)?ae(t):{});var t}(R?{}:e),!t)return function(e,t){return Re(e,Fe(e),t)}(e,function(e,t){return e&&Re(t,Ye(t),e)}(A,e))}else{if(!D[I])return p?e:{};A=function(e,t,n,r){var o=e.constructor;switch(t){case b:return Ie(e);case a:case l:return new o(+e);case x:return function(e,t){var n=t?Ie(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case j:case S:case k:case C:case _:case O:case E:case T:return function(e,t){var n=t?Ie(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case c:return function(e,t,n){var r=t?n(K(e),!0):K(e);return W(r,z,new e.constructor)}(e,r,n);case d:case g:return new o(e);case h:return function(e){var t=new e.constructor(e.source,P.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return function(e,t,n){var r=t?n(V(e),!0):V(e);return W(r,U,new e.constructor)}(e,r,n);case m:return i=e,ke?Object(ke.call(i)):{}}var i}(e,I,Me,t)}}v||(v=new Ee);var N=v.get(e);if(N)return N;if(v.set(e,A),!M)var L=n?function(e){return function(e,t,n){var r=t(e);return Ke(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Ye,Fe)}(e):Ye(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(L||e,(function(o,i){L&&(o=e[i=o]),Pe(A,i,Me(o,t,n,r,i,e,v))})),A}function De(e){return!(!Ge(e)||(t=e,X&&X in t))&&(qe(e)||H(e)?te:A).test(We(e));var t}function Ie(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function Re(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],l=r?r(n[a],e[a],a,n,e):void 0;Pe(n,a,void 0===l?e[a]:l)}return n}function Ne(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return De(n)?n:void 0}Ce.prototype.clear=function(){this.__data__=me?me(null):{}},Ce.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ce.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===r?void 0:n}return J.call(t,e)?t[e]:void 0},Ce.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:J.call(t,e)},Ce.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?r:t,this},_e.prototype.clear=function(){this.__data__=[]},_e.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0)&&(n==t.length-1?t.pop():se.call(t,n,1),!0)},_e.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return Ae(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,r=Ae(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Oe.prototype.clear=function(){this.__data__={hash:new Ce,map:new(pe||_e),string:new Ce}},Oe.prototype.delete=function(e){return Ne(this,e).delete(e)},Oe.prototype.get=function(e){return Ne(this,e).get(e)},Oe.prototype.has=function(e){return Ne(this,e).has(e)},Oe.prototype.set=function(e,t){return Ne(this,e).set(e,t),this},Ee.prototype.clear=function(){this.__data__=new _e},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var r=this.__data__;if(r instanceof _e){var o=r.__data__;if(!pe||o.length<n-1)return o.push([e,t]),this;r=this.__data__=new Oe(o)}return r.set(e,t),this};var Fe=ue?$(ue,Object):function(){return[]},Be=function(e){return ee.call(e)};function ze(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||M.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function We(e){if(null!=e){try{return Z.call(e)}catch(Fa){}try{return e+""}catch(Fa){}}return""}function He(e,t){return e===t||e!==e&&t!==t}(fe&&Be(new fe(new ArrayBuffer(1)))!=x||pe&&Be(new pe)!=c||he&&Be(he.resolve())!=p||ye&&Be(new ye)!=y||ge&&Be(new ge)!=v)&&(Be=function(e){var t=ee.call(e),n=t==f?e.constructor:void 0,r=n?We(n):void 0;if(r)switch(r){case ve:return x;case be:return c;case xe:return p;case we:return y;case je:return v}return t});var Ke=Array.isArray;function $e(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!qe(e)}var Ve=ce||function(){return!1};function qe(e){var t=Ge(e)?ee.call(e):"";return t==s||t==u}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return $e(e)?Te(e):function(e){if(!Ue(e))return de(e);var t=[];for(var n in Object(e))J.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Me(e,!0,!0)}}));function fR(e,t,n,r){void 0===r&&(r=0);for(var o=cR(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e}function pR(e,t,n){for(var r={},o=r,i=0,a=cR(t);i<a.length-1;i++){var l=a[i],s=e[l];if(o[l])o=o[l];else if(s)o=o[l]=dR(s);else{var u=a[i+1];o=o[l]=vR(u)&&Number(u)>=0?[]:{}}}return o[a[i]]=n,JD({},e,r)}function hR(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];mR(l)?n.get(l)||(n.set(l,!0),r[a]=Array.isArray(l)?[]:{},hR(l,t,n,r[a])):r[a]=t}return r}var yR="undefined"!==typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,gR=function(e){return"function"===typeof e},mR=function(e){return null!==e&&"object"===typeof e},vR=function(e){return String(Math.floor(Number(e)))===e},bR=function(e){return 0===h.Children.count(e)};function xR(e){return null!==e&&"object"===typeof e&&(e&&"function"===typeof e.then)}(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleChange=function(e){var n=t.context.formik,r=n.handleChange,o=n.validateOnChange;r(e),o&&t.props.validate&&t.runFieldValidations(e.target.value)},t.handleBlur=function(e){var n=t.context.formik,r=n.handleBlur,o=n.validateOnBlur;r(e),o&&t.props.validate&&t.runFieldValidations(e.target.value)},t.runFieldValidations=function(e){var n=t.context.formik.setFieldError,r=t.props,o=r.name,i=(0,r.validate)(e);xR(i)?i.then((function(){return n(o,void 0)}),(function(e){return n(o,e)})):n(o,i)},t}ZD(t,e),t.prototype.componentWillMount=function(){var e=this.props,t=e.render,n=e.children,r=e.component;wI(!(r&&t),"You should not use <Field component> and <Field render> in the same <Field> component; <Field component> will be ignored"),wI(!(this.props.component&&n&&gR(n)),"You should not use <Field component> and <Field children> as a function in the same <Field> component; <Field component> will be ignored."),wI(!(t&&n&&!bR(n)),"You should not use <Field render> and <Field children> in the same <Field> component; <Field children> will be ignored")},t.prototype.render=function(){var e=this.props,t=e.validate,n=e.name,r=e.render,o=e.children,i=e.component,a=void 0===i?"input":i,l=eI(e,["validate","name","render","children","component"]),s=this.context.formik,u={value:"radio"===l.type||"checkbox"===l.type?l.value:fR(s.values,n),name:n,onChange:t?this.handleChange:s.handleChange,onBlur:t?this.handleBlur:s.handleBlur},c={field:u,form:s};return r?r(c):gR(o)?o(c):"string"===typeof a?(0,h.createElement)(a,JD({},u,l,{children:o})):(0,h.createElement)(a,JD({},c,l,{children:o}))},t.contextTypes={formik:pI},t.propTypes={name:yI.isRequired,component:hI([yI,mI]),render:mI,children:hI([mI,gI]),validate:mI}})(h.Component),Object.getOwnPropertySymbols,Object.prototype.propertyIsEnumerable;var wR=Object.getPrototypeOf;wR&&wR(Object),Object.getOwnPropertyNames;var jR=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r.splice(t,1),r.splice(n,0,o),r},SR=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r[t]=r[n],r[n]=o,r},kR=function(e,t,n){var r=(e||[]).slice();return r.splice(t,0,n),r},CR=(function(e){function t(t){var n=e.call(this,t)||this;return n.updateArrayField=function(e,t,r){var o=n.context.formik,i=o.setFormikState,a=o.validateForm,l=o.values,s=o.touched,u=o.errors,c=n.props,d=c.name,f=c.validateOnChange;i((function(n){return JD({},n,{values:pR(n.values,d,e(fR(l,d))),errors:r?pR(n.errors,d,e(fR(u,d))):n.errors,touched:t?pR(n.touched,d,e(fR(s,d))):n.touched})}),(function(){f&&a()}))},n.push=function(e){return n.updateArrayField((function(t){return(t||[]).concat([e])}),!1,!1)},n.swap=function(e,t){return n.updateArrayField((function(n){return SR(n,e,t)}),!1,!1)},n.move=function(e,t){return n.updateArrayField((function(n){return jR(n,e,t)}),!1,!1)},n.insert=function(e,t){return n.updateArrayField((function(n){return kR(n,e,t)}),!1,!1)},n.unshift=function(e){var t=[];return n.updateArrayField((function(n){return t=n?[e].concat(n):[e]}),!1,!1),t.length},n.remove=n.remove.bind(n),n.pop=n.pop.bind(n),n}ZD(t,e),t.prototype.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?n.slice():[];return t||(t=r[e]),gR(r.splice)&&r.splice(e,1),r}),!0,!0),t},t.prototype.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},t.prototype.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,unshift:this.unshift,remove:this.remove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,a=JD({},e,{form:this.context.formik,name:i});return n?(0,h.createElement)(n,a):r?r(a):o?"function"===typeof o?o(a):bR(o)?null:h.Children.only(o):null},t.defaultProps={validateOnChange:!0},t.contextTypes={formik:pI}}(h.Component),function(e){function t(t){var n=e.call(this,t)||this;return n.setErrors=function(e){n.setState({errors:e})},n.setTouched=function(e){n.setState({touched:e},(function(){n.props.validateOnBlur&&n.runValidations(n.state.values)}))},n.setValues=function(e){n.setState({values:e},(function(){n.props.validateOnChange&&n.runValidations(e)}))},n.setStatus=function(e){n.setState({status:e})},n.setError=function(e){n.setState({error:e})},n.setSubmitting=function(e){n.setState({isSubmitting:e})},n.runValidationSchema=function(e,t){var r=n.props.validationSchema;(function(e,t,n){void 0===n&&(n={});var r={};for(var o in e)if(e.hasOwnProperty(o)){var i=String(o);r[i]=""!==e[i]?e[i]:void 0}return t.validate(r,{abortEarly:!1,context:n})})(e,gR(r)?r():r).then((function(){n.setState({errors:{}}),t&&t()}),(function(e){return n.setState({errors:_R(e),isSubmitting:!1})}))},n.runValidations=function(e){if(void 0===e&&(e=n.state.values),n.props.validationSchema&&n.runValidationSchema(e),n.props.validate){var t=n.props.validate(e);xR(t)?t.then((function(){n.setState({errors:{}})}),(function(e){return n.setState({errors:e,isSubmitting:!1})})):n.setErrors(t)}},n.handleChange=function(e){if(!yR){e.persist();var t,r=e.target,o=r.type,i=r.name,a=r.id,l=r.value,s=r.checked,u=(r.outerHTML,i||a),c=/number|range/.test(o)?(t=parseFloat(l),Number.isNaN(t)?"":t):/checkbox/.test(o)?s:l;0,n.setState((function(e){return JD({},e,{values:pR(e.values,u,c)})})),n.props.validateOnChange&&n.runValidations(pR(n.state.values,u,c))}},n.setFieldValue=function(e,t,r){void 0===r&&(r=!0),n.setState((function(n){return JD({},n,{values:pR(n.values,e,t)})}),(function(){n.props.validateOnChange&&r&&n.runValidations(n.state.values)}))},n.handleSubmit=function(e){e.preventDefault(),n.submitForm()},n.submitForm=function(){if(n.setState({touched:hR(n.state.values,!0),isSubmitting:!0}),n.props.validate){var e=n.props.validate(n.state.values)||{};if(xR(e))return void e.then((function(){n.setState({errors:{}}),n.executeSubmit()}),(function(e){return n.setState({errors:e,isSubmitting:!1})}));var t=0===Object.keys(e).length;n.setState({errors:e,isSubmitting:t}),t&&n.executeSubmit()}else n.props.validationSchema?n.runValidationSchema(n.state.values,n.executeSubmit):n.executeSubmit()},n.executeSubmit=function(){n.props.onSubmit(n.state.values,n.getFormikActions())},n.handleBlur=function(e){if(!yR){e.persist();var t=e.target,r=t.name,o=t.id,i=(t.outerHTML,r||o);0,n.setState((function(e){return{touched:pR(e.touched,i,!0)}})),n.props.validateOnBlur&&n.runValidations(n.state.values)}},n.setFieldTouched=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0),n.setState((function(n){return JD({},n,{touched:pR(n.touched,e,t)})}),(function(){n.props.validateOnBlur&&r&&n.runValidations(n.state.values)}))},n.setFieldError=function(e,t){n.setState((function(n){return JD({},n,{errors:pR(n.errors,e,t)})}))},n.resetForm=function(e){var t=e||n.props.initialValues;n.initialValues=t,n.setState({isSubmitting:!1,errors:{},touched:{},error:void 0,status:void 0,values:t})},n.handleReset=function(){if(n.props.onReset){var e=n.props.onReset(n.state.values,n.getFormikActions());xR(e)?e.then(n.resetForm):n.resetForm()}else n.resetForm()},n.setFormikState=function(e,t){return n.setState(e,t)},n.getFormikActions=function(){return{resetForm:n.resetForm,submitForm:n.submitForm,validateForm:n.runValidations,setError:n.setError,setErrors:n.setErrors,setFieldError:n.setFieldError,setFieldTouched:n.setFieldTouched,setFieldValue:n.setFieldValue,setStatus:n.setStatus,setSubmitting:n.setSubmitting,setTouched:n.setTouched,setValues:n.setValues,setFormikState:n.setFormikState}},n.getFormikComputedProps=function(){var e=n.props.isInitialValid,t=!bI(n.initialValues,n.state.values);return{dirty:t,isValid:t?n.state.errors&&0===Object.keys(n.state.errors).length:!1!==e&&gR(e)?e(n.props):e,initialValues:n.initialValues}},n.getFormikBag=function(){return JD({},n.state,n.getFormikActions(),n.getFormikComputedProps(),{handleBlur:n.handleBlur,handleChange:n.handleChange,handleReset:n.handleReset,handleSubmit:n.handleSubmit,validateOnChange:n.props.validateOnChange,validateOnBlur:n.props.validateOnBlur})},n.state={values:t.initialValues||{},errors:{},touched:{},isSubmitting:!1},n.initialValues=t.initialValues||{},n}return ZD(t,e),t.prototype.getChildContext=function(){return{formik:this.getFormikBag()}},t.prototype.componentWillReceiveProps=function(e){this.props.enableReinitialize&&!bI(e.initialValues,this.props.initialValues)&&(this.initialValues=e.initialValues,this.resetForm(e.initialValues))},t.prototype.componentWillMount=function(){wI(!(this.props.component&&this.props.render),"You should not use <Formik component> and <Formik render> in the same <Formik> component; <Formik render> will be ignored"),wI(!(this.props.component&&this.props.children&&!bR(this.props.children)),"You should not use <Formik component> and <Formik children> in the same <Formik> component; <Formik children> will be ignored"),wI(!(this.props.render&&this.props.children&&!bR(this.props.children)),"You should not use <Formik render> and <Formik children> in the same <Formik> component; <Formik children> will be ignored")},t.prototype.render=function(){var e=this.props,t=e.component,n=e.render,r=e.children,o=this.getFormikBag();return t?(0,h.createElement)(t,o):n?n(o):r?"function"===typeof r?r(o):bR(r)?null:h.Children.only(r):null},t.defaultProps={validateOnChange:!0,validateOnBlur:!0,isInitialValid:!1,enableReinitialize:!1},t.propTypes={validateOnChange:vI,validateOnBlur:vI,isInitialValid:hI([mI,vI]),initialValues:pI,onReset:mI,onSubmit:mI.isRequired,validationSchema:hI([mI,pI]),validate:mI,component:mI,render:mI,children:hI([mI,gI]),enableReinitialize:vI},t.childContextTypes={formik:pI},t}(h.Component));function _R(e){for(var t={},n=0,r=e.inner;n<r.length;n++){var o=r[n];t[o.path]||(t=pR(t,o.path,o.message))}return t}function OR(e,t,n){const r=n.find((e=>e.id===t)),o=r&&1===r.offbudget;return 0===e.offbudget&&o}function ER(e){let{categoryGroups:t,...n}=e;return(0,wo.jsxs)(zs,{...n,children:[(0,wo.jsx)("option",{value:"",children:"Select category..."}),t.map((e=>(0,wo.jsx)("optgroup",{label:e.name,children:e.categories.map((e=>(0,wo.jsx)("option",{value:e.id,children:e.name},e.id)))},e.id)))]})}var TR=function(e){let{account:t,accounts:n,categoryGroups:r,balance:o,canDelete:i,actions:a,modalProps:l}=e,[s,u]=(0,h.useState)(!1),c=n.filter((e=>e.id!==t.id)),d=c.filter((e=>0===e.offbudget)),f=c.filter((e=>1===e.offbudget));return(0,wo.jsx)(ks,{title:"Close Account",...l,style:{flex:0},loading:s,children:()=>(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)($s,{children:["Are you sure you want to close ",(0,wo.jsx)("strong",{children:t.name}),"?"," ",i?(0,wo.jsx)("span",{children:"This account has no transactions so it will be permanently deleted."}):(0,wo.jsx)("span",{children:"This account has transactions so we can\u2019t permanently delete it."})]}),(0,wo.jsx)(CR,{validateOnChange:!1,initialValues:{transfer:"",category:""},onSubmit:(e,r)=>{let{setErrors:i}=r;const s={};0!==o&&""===e.transfer&&(s.transfer="required"),OR(t,e.transfer,n)&&""===e.category&&(s.category="required"),i(s),0===Object.keys(s).length&&(u(!0),a.closeAccount(t.id,e.transfer||null,e.category||null).then((()=>{l.onClose()})))},render:e=>{let{values:s,errors:c,touched:p,handleChange:h,handleBlur:y,handleSubmit:g,isSubmitting:m,setFieldValue:v}=e;return(0,wo.jsxs)("form",{onSubmit:g,children:[0!==o&&(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)($s,{children:["This account has a balance of"," ",(0,wo.jsx)("strong",{children:zr(o)}),". To close this account, select a different account to transfer this balance to:"]}),(0,wo.jsxs)(zs,{name:"transfer",value:s.transfer,onChange:h,onBlur:y,style:{width:200,marginBottom:15},children:[(0,wo.jsx)("option",{value:"",children:"Select account..."}),(0,wo.jsx)("optgroup",{label:"For Budget",children:d.map((e=>(0,wo.jsx)("option",{value:e.id,children:e.name},e.id)))}),(0,wo.jsx)("optgroup",{label:"Off Budget",children:f.map((e=>(0,wo.jsx)("option",{value:e.id,children:e.name},e.id)))})]}),c.transfer&&(0,wo.jsx)(qs,{style:{marginBottom:15},children:"Transfer is required"}),OR(t,s.transfer,n)&&(0,wo.jsxs)(Ll,{style:{marginBottom:15},children:[(0,wo.jsx)($s,{children:"Since you are transferring the balance from a budgeted account to an off-budget account, this transaction must be categorized. Select a category:"}),(0,wo.jsx)(ER,{categoryGroups:r,name:"category",value:s.category,onChange:h,onBlur:y,style:{width:200}}),c.category&&(0,wo.jsx)(qs,{children:"Category is required"})]})]}),!i&&(0,wo.jsx)(Ll,{style:{marginBottom:15},children:(0,wo.jsxs)(ql,{style:{fontSize:12},children:["You can also"," ",(0,wo.jsx)("a",{href:"#",onClick:e=>{e.preventDefault(),u(!0),a.forceCloseAccount(t.id).then((()=>l.onClose()))},style:{color:go.r6},children:"force close"})," ","the account which will delete it and all its transactions permanently. Doing so may change your budget unexpectedly since money in it may vanish."]})}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[(0,wo.jsx)(zl,{type:"submit",style:{marginRight:10},onClick:l.onClose,children:"Cancel"}),(0,wo.jsx)(zl,{type:"submit",primary:!0,children:"Close Account"})]})]})}})]})})};function PR(){return null}function AR(e){let{account:t,offbudget:n,onSelect:r}=e;return(0,wo.jsx)(Ll,{style:[{marginBottom:8,flexShrink:0,userSelect:"none"},mo.mediumText],onClick:r,children:(0,wo.jsxs)(Ll,{style:[{padding:12,...mo.shadow,cursor:"pointer",transition:"transform .20s",fontSize:14,borderRadius:4,flexDirection:"row",alignItems:"center",border:"1px solid "+go.n10}],children:[(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(Ll,{style:{fontWeight:600},children:t.name}),(0,wo.jsxs)(Ll,{style:{fontSize:13,color:go.n5,flexDirection:"row"},children:[XE(QE(t.type,t.subtype)),(0,wo.jsxs)(ql,{style:{marginLeft:4},children:["...",t.mask]})]})]}),n?(0,wo.jsx)(ql,{style:{color:go.n8},children:"Off budget"}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(Rw,{style:{width:15,height:15,color:go.g5}}),(0,wo.jsx)(ql,{style:{color:go.g5,marginLeft:5},children:"Budgeted"})]})]})})}function MR(e){let{institution:t,publicToken:n,upgradingId:r,modalProps:o,accounts:i,actions:a}=e,[l,s]=(0,h.useState)((()=>i.filter((e=>ZE(QE(e.type)))).map((e=>e.id))));async function u(){let e=await a.connectNordigenAccounts(t,n,i.map((e=>e.id)),l);a.closeModal(),1===e.length?window.location.hash="/accounts/"+e[0]:e.length>0&&(window.location.hash="/accounts")}return(0,wo.jsx)(ks,{title:r?"Link Account":"Link Accounts",...o,children:()=>(0,wo.jsxs)(Ll,{style:{maxWidth:500},children:[(0,wo.jsxs)(ql,{style:{fontSize:15,marginBottom:15,lineHeight:"1.4em"},children:["A ",(0,wo.jsx)("strong",{children:"budgeted account"})," is one where expenses and income affect the budget. Usually things like investments are off budget. We\u2019ve chosen some defaults here, but you can change the status if you like."]}),(0,wo.jsx)(Ll,{style:{maxHeight:300,overflow:"auto",paddingLeft:5,paddingRight:5,marginLeft:-5,marginRight:-5},children:(0,wo.jsx)(Ll,{children:0===i.length?(0,wo.jsx)(PR,{}):i.map((e=>{let t=l.includes(e.id);return(0,wo.jsx)(AR,{account:e,offbudget:t,onSelect:()=>function(e){l.includes(e)?s(l.filter((t=>t!==e))):s([...l,e])}(e.id)},e.id)}))})}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:30},children:[(0,wo.jsx)(zl,{style:{marginRight:10},onClick:o.onBack,children:"Back"}),(0,wo.jsx)(zl,{primary:!0,onClick:u,children:r?"Link Account":"Next"})]})]})})}function DR(e){let{modalProps:t,category:n,group:r,categoryGroups:o,onDelete:i}=e;const[a,l]=(0,h.useState)(null),[s,u]=(0,h.useState)(null),c=(0,h.useRef)(null);(0,h.useEffect)((()=>{setTimeout((()=>{c.current.focus()}),200)}),[]);const d=e=>{let t;if("required-transfer"===e)t="You must select a category";else t="Something bad happened, sorry!";return(0,wo.jsx)(ql,{style:{marginTop:15,color:go.r4},children:t})},f=!!(n||r).is_income;return(0,wo.jsx)(ks,{title:"Confirm Delete",...t,style:{flex:0},children:()=>(0,wo.jsxs)(Ll,{style:{lineHeight:1.5},children:[r?(0,wo.jsxs)(Ms,{children:["Categories in the group ",(0,wo.jsx)("strong",{children:r.name})," are used by existing transaction",!f&&" or it has a positive leftover balance currently","."," ",(0,wo.jsx)("strong",{children:"Are you sure you want to delete it?"})," If so, you must select another category to transfer existing transactions and balance to."]}):(0,wo.jsxs)(Ms,{children:[(0,wo.jsx)("strong",{children:n.name})," is used by existing transactions",!f&&" or it has a positive leftover balance currently","."," ",(0,wo.jsx)("strong",{children:"Are you sure you want to delete it?"})," If so, you must select another category to transfer existing transactions and balance to."]}),s&&d(s),(0,wo.jsxs)(Ll,{style:{marginTop:20,flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[(0,wo.jsx)(ql,{children:"Transfer to:"}),(0,wo.jsx)(Ll,{style:{flex:1,marginLeft:10,marginRight:30},children:(0,wo.jsx)(ZC,{ref:c,categoryGroups:r?o.filter((e=>e.id!==r.id&&!!e.is_income===f)):o.filter((e=>!!e.is_income===f)).map((e=>({...e,categories:e.categories.filter((e=>e.id!==n.id))}))),name:"category",value:a,onChange:e=>l(e.target.value)})}),(0,wo.jsx)(zl,{primary:!0,onClick:()=>{a?(i(a),t.onClose()):u("required-transfer")},children:"Delete"})]})]})})}function IR(){const[e,t]=(0,h.useState)(null),[n,r]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{!async function(){r(!0);const e=await qe("nordigen-status");t(e.configured||!1),r(!1)}()}),[t,r]),{configured:e,isLoading:n}}function RR(e){let{modalProps:t,syncServerStatus:n}=e;const r=ge(),[o,i]=(0,h.useState)(null),a=()=>{o?nw(((e,t)=>r(Nt(e,t)))):l()},l=()=>{r(Nt("nordigen-init",{onSuccess:()=>i(!0)}))},s=()=>{r(Nt("add-local-account"))},{configured:u}=IR();return(0,h.useEffect)((()=>{i(u)}),[u]),(0,wo.jsx)(ks,{title:"Add Account",...t,children:()=>(0,wo.jsxs)(Ll,{style:{maxWidth:500},children:[(0,wo.jsxs)(ql,{style:{marginBottom:10,lineHeight:"1.4em",fontSize:15},children:[(0,wo.jsx)("strong",{children:"Link your bank accounts"})," to automatically download transactions. We offer hundreds of banks to sync with, and Nordigen will provide reliable, up-to-date information."]}),(0,wo.jsx)(Bl,{primary:!0,disabled:"online"!==n,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:a,children:o?"Link bank account":"Set-up Nordigen for bank-sync"}),o&&(0,wo.jsx)(zl,{bare:!0,onClick:l,children:"set new API secrets"}),"online"!==n&&(0,wo.jsxs)($s,{style:{color:go.r5,marginTop:5},children:["Nordigen integration is only available for budgets using actual-server."," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Installing/overview",target:"_blank",rel:"noopener noreferrer",children:"Learn more."})]}),(0,wo.jsx)(Ll,{style:{marginTop:30,marginBottom:10,lineHeight:"1.4em",fontSize:15},children:"You can also create a local account if you want to track transactions manually. You can add transactions manually or import QIF/OFX/QFX files."}),(0,wo.jsx)(zl,{style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,color:go.n3},onClick:s,children:"Create local account"})]})})}function NR(e){let{modalProps:t,actions:n,options:r={}}=e,[o,i]=(0,h.useState)(""),[a,l]=(0,h.useState)(!1),[s,u]=(0,h.useState)(""),[c,d]=(0,h.useState)(!1),f=r.recreate;async function p(){if(""!==o&&!a){l(!0),u(null);let e=await qe("key-make",{password:o});if(e.error)return l(null),void u(function(e){return Ln(e)}(e.error));n.loadGlobalPrefs(),n.loadAllFiles(),n.sync(),l(!1),n.popModal()}}return(0,wo.jsx)(ks,{...t,style:{width:600},title:f?"Generate new key":"Enable encryption",onClose:()=>n.popModal(),children:()=>(0,wo.jsxs)(wo.Fragment,{children:[f?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)($s,{style:{marginTop:5},children:["This will generate a new key for encrypting your data."," ",(0,wo.jsx)("strong",{children:"This requires a sync reset"})," and all other devices will have to revert to this version of your data. Actual will take you through that process on those devices."," ",(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}),(0,wo.jsx)($s,{children:"Key generation is randomized. The same password will create different keys, so this will change your key regardless of the password being different."})]}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)($s,{style:{marginTop:5},children:["To enable end-to-end encryption, you need to create a key. We will generate a key based on a password and use it to encrypt from now on. ",(0,wo.jsx)("strong",{children:"This requires a sync reset"})," and all other devices will have to revert to this version of your data."," ",(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}),(0,wo.jsx)($s,{children:(0,wo.jsxs)("ul",{...(0,lo.iv)({marginTop:0,"& li":{marginBottom:8}}),children:[(0,wo.jsxs)("li",{children:[(0,wo.jsx)("strong",{children:"Important:"})," if you forget this password"," ",(0,wo.jsx)("em",{children:"and"})," you don\u2019t have any local copies of your data, you will lose access to all your data. The data cannot be decrypted without the password."]}),(0,wo.jsx)("li",{children:"This key only applies to this file. You will need to generate a new key for each file you want to encrypt."}),(0,wo.jsx)("li",{children:"If you\u2019ve already downloaded your data on other devices, you will need to reset them. Actual will automatically take you through this process."}),(0,wo.jsx)("li",{children:"It is recommended for the encryption password to be different than the log-in password in order to better protect your data."})]})})]}),(0,wo.jsxs)("form",{onSubmit:e=>{e.preventDefault(),p()},children:[(0,wo.jsxs)(Ll,{style:{alignItems:"center"},children:[(0,wo.jsx)(ql,{style:{fontWeight:600,marginBottom:3},children:"Password"}),s&&(0,wo.jsx)(Ll,{style:{color:go.r4,textAlign:"center",fontSize:13,marginBottom:3},children:s}),(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{type:c?"text":"password",style:{width:300},onChange:e=>i(e.target.value)})}),(0,wo.jsx)(ql,{style:{marginTop:5},children:(0,wo.jsxs)("label",{style:{userSelect:"none"},children:[(0,wo.jsx)("input",{type:"checkbox",onClick:()=>d(!c)})," ","Show password"]})})]}),(0,wo.jsx)(Ss,{style:{marginTop:20},children:(0,wo.jsx)(Bl,{loading:a,primary:!0,children:"Enable"})})]})]})})}var LR=function(e){let{modalProps:t,actions:n,history:r}=e;return(0,wo.jsx)(ks,{title:"Create Local Account",...t,showBack:!1,children:()=>(0,wo.jsx)(Ll,{children:(0,wo.jsx)(CR,{validateOnChange:!1,initialValues:{name:"",type:"checking",balance:"0"},validate:()=>({}),onSubmit:async(e,o)=>{let{setErrors:i}=o;const a={};if(e.type||(a.type="required"),e.name||(a.name="required"),isNaN(parseFloat(e.balance))&&(a.balance="format"),i(a),0===Object.keys(a).length){t.onClose();let o=await n.createAccount(e.name,e.type,function(e){return Vr(Hr(e)||0)}(e.balance),e.offbudget);r.push("/accounts/"+o)}},render:e=>{let{values:n,errors:r,touched:o,handleChange:i,handleBlur:a,handleSubmit:l,isSubmitting:s,setFieldValue:u}=e;return(0,wo.jsxs)("form",{onSubmit:l,children:[(0,wo.jsx)(Vs,{label:"Name",width:"75%",children:(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{name:"name",value:n.name,onChange:i,onBlur:a,style:{flex:1}})})}),r.name&&(0,wo.jsx)(qs,{style:{marginLeft:75},children:"Name is required"}),(0,wo.jsx)(Vs,{label:"Type",width:"75%",children:(0,wo.jsxs)(zs,{name:"type",value:n.type,onChange:e=>{u("offbudget",ZE(e.target.value)),i(e)},onBlur:a,children:[(0,wo.jsx)("option",{value:"checking",children:"Checking / Cash"}),(0,wo.jsx)("option",{value:"savings",children:"Savings"}),(0,wo.jsx)("option",{value:"credit",children:"Credit Card"}),(0,wo.jsx)("option",{value:"investment",children:"Investment"}),(0,wo.jsx)("option",{value:"mortgage",children:"Mortgage"}),(0,wo.jsx)("option",{value:"debt",children:"Debt"}),(0,wo.jsx)("option",{value:"other",children:"Other"})]})}),r.type&&(0,wo.jsx)(qs,{style:{marginLeft:75},children:"You must select a type"}),(0,wo.jsx)(Ll,{style:{width:"75%",flexDirection:"row",justifyContent:"flex-end"},children:(0,wo.jsxs)(Ll,{style:{flexDirection:"column"},children:[(0,wo.jsxs)("label",{style:{userSelect:"none",textAlign:"right",width:"100%",display:"flex",verticalAlign:"center",justifyContent:"flex-end"},htmlFor:"offbudget",children:[(0,wo.jsx)("input",{id:"offbudget",name:"offbudget",type:"checkbox",checked:!!n.offbudget,onChange:i,onBlur:a}),"Off-budget"]}),(0,wo.jsx)("div",{style:{textAlign:"right",fontSize:"0.7em",color:go.n5,marginTop:3},children:(0,wo.jsxs)(ql,{children:["This cannot be changed later. ",(0,wo.jsx)("br",{})," ","\n","See"," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Accounts/overview/#off-budget-accounts",target:"_blank",rel:"noopener noreferrer",style:{color:go.n5},children:"Accounts Overview"})," ","for more information."]})})]})}),(0,wo.jsx)(Vs,{label:"Balance",width:"75%",children:(0,wo.jsx)(Vl,{name:"balance",value:n.balance,onChange:i,onBlur:a,style:{flex:1}})}),r.balance&&(0,wo.jsx)(qs,{style:{marginLeft:75},children:"Balance must be a number"}),(0,wo.jsxs)(Ss,{children:[(0,wo.jsx)(zl,{onClick:()=>t.onBack(),type:"button",children:"Back"}),(0,wo.jsx)(zl,{primary:!0,style:{marginLeft:10},children:"Create"})]})]})}})})})};var FR=de((e=>({dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy",categoryGroups:e.queries.categories.grouped,accounts:e.queries.accounts,payees:e.queries.payees})),e)((function(e){let t,n,r,{actions:o,modalProps:i,name:a,accounts:l,categoryGroups:s,payees:u,onSubmit:c,dateFormat:d,createPayee:f}=e;function p(e){null!=e&&("amount"===a&&(e=$r(e)),c(a,e)),i.onClose()}let h={":focus":{boxShadow:0}},y={inputProps:{style:h},containerProps:{style:{height:275}}};switch(a){case"date":{let e=Jp();t="Date",r=350,n=(0,wo.jsx)(c_,{value:Hp(lk(e),d),dateFormat:d,focused:!0,embedded:!0,onUpdate:()=>{},onSelect:e=>{p(Xp(tx(e,"yyyy-MM-dd",new Date)))}});break}case"account":t="Account",n=(0,wo.jsx)(QC,{value:null,accounts:l,focused:!0,embedded:!0,onSelect:e=>{e&&p(e)},...y});break;case"payee":t="Payee",n=(0,wo.jsx)(o_,{payees:u,accounts:l,value:null,focused:!0,embedded:!0,showManagePayees:!1,onSelect:async e=>{e&&e.startsWith("new:")&&(e=await f(e.slice("new:".length))),p(e)},isCreatable:!0,...y});break;case"notes":t="Notes",n=(0,wo.jsx)(Vl,{focused:!0,onEnter:e=>p(e.target.value),style:h});break;case"category":t="Category",n=(0,wo.jsx)(e_,{categoryGroups:s,value:null,focused:!0,embedded:!0,showSplitOption:!1,onUpdate:()=>{},onSelect:e=>{p(e)},...y});break;case"amount":t="Amount",n=(0,wo.jsx)(Vl,{focused:!0,onEnter:e=>p(e.target.value),style:h})}return(0,wo.jsx)(ks,{noAnimation:!0,showHeader:!1,focusAfterClose:!1,...i,padding:0,style:[{flex:0,padding:"15px 10px",backgroundColor:go.n1,color:"white"},r&&{minWidth:r}],children:()=>(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(Zs,{title:t,style:{alignSelf:"center",color:go.b10,marginBottom:10}}),(0,wo.jsx)(Ll,{style:{flex:1},children:n})]})})}));var BR=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 11V9h2v6H9v-4zm0-6h2v2H9V5z",fill:"currentColor"})});function zR(e){let t,{type:n,id:r,noneColor:o=go.n8}=e;switch(n){case"payees":t=vf;break;case"accounts":t=hf;break;default:throw new Error("DisplayId: unknown object type: "+n)}return(0,wo.jsx)(t,{idKey:!0,children:e=>{let t=e[r];return(0,wo.jsx)(ql,{style:null==t?{color:o}:null,title:t?t.name:"None",children:t?t.name:"None"})}})}const UR=h.memo((function(e){let{transaction:t,fields:n,payees:r,categories:o,accounts:i,selected:a}=e,l=eo(o)[t.category],s=Zr(i)[t.account],u=Ix();return(0,wo.jsxs)(qw,{children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,onSelect:()=>{u({type:"select",id:t.id})},selected:a}),n.map(((e,n)=>{switch(e){case"date":return(0,wo.jsx)($w,{width:100,children:t.date},n);case"imported_payee":return(0,wo.jsx)($w,{width:"flex",children:t.imported_payee},n);case"payee":return(0,wo.jsx)(Vw,{width:"flex",exposed:!0,style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:()=>(0,wo.jsxs)(wo.Fragment,{children:[t.schedule&&(0,wo.jsx)(G_,{style:{width:13,height:13,margin:"0 5px"}}),(0,wo.jsx)(zR,{type:"payees",id:t.payee})]})},n);case"category":return(0,wo.jsx)($w,{width:"flex",title:l&&l.name,children:l?l.name:""},n);case"account":return(0,wo.jsx)($w,{width:"flex",title:s.name,children:s.name},n);case"notes":return(0,wo.jsx)($w,{width:"flex",title:t.notes,children:t.notes},n);case"amount":return(0,wo.jsx)($w,{width:75,style:[{textAlign:"right"},mo.tnum],children:zr(t.amount)},n);default:return null}}))]})}));function WR(e){let{transactions:t,schedules:n,renderEmpty:r,fields:o=["date","payee","amount"],style:i}=e,{payees:a,categories:l,accounts:s,dateFormat:u}=xe((e=>({payees:e.queries.payees,accounts:e.queries.accounts,categories:e.queries.categories.grouped,dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy"}))),c=Rx(),d=Ix(),f=(0,h.useMemo)((()=>o),[JSON.stringify(o)]),p=(0,h.useMemo)((()=>t.map((e=>function(e,t){let{date:n}=e;return Uf(lk(n))||(n=null),{...e,date:n?Hp(lk(n),t):null}}(e,u)))),[t]),y=(0,h.useCallback)((e=>{let{item:t}=e;return(0,wo.jsx)(UR,{transaction:t,payees:a,categories:l,accounts:s,fields:f,selected:c&&c.has(t.id)})}),[a,l,f,c]);return(0,wo.jsx)(sj,{style:i,items:p,renderEmpty:r,headers:(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,selected:c.size>0,width:20,onSelect:()=>d({type:"select-all"})}),o.map(((e,t)=>{switch(e){case"date":return(0,wo.jsx)($w,{width:100,children:"Date"},t);case"imported_payee":return(0,wo.jsx)($w,{width:"flex",children:"Imported payee"},t);case"payee":return(0,wo.jsx)($w,{width:"flex",children:"Payee"},t);case"category":return(0,wo.jsx)($w,{width:"flex",children:"Category"},t);case"account":return(0,wo.jsx)($w,{width:"flex",children:"Account"},t);case"notes":return(0,wo.jsx)($w,{width:"flex",children:"Notes"},t);case"amount":return(0,wo.jsx)($w,{width:75,style:{textAlign:"right"},children:"Amount"},t);default:return null}}))]}),renderItem:y})}function HR(e,t,n){return e.map((e=>e===t?n():e))}function KR(e,t){return e.map(((e,n)=>({...e,error:t[n]})))}function $R(e,t){let n=["date"];return e.find((e=>"imported_payee"===e.field))&&n.push("imported_payee"),n.push("payee"),t.find((e=>"category"===e.field))?n.push("category"):t.length>0&&!["payee","date","amount"].includes(t[0].field)&&n.push(t[0].field),n.push("amount"),n}function VR(e){let{fields:t,style:n,value:r,onChange:o}=e;return(0,wo.jsx)(Ll,{style:n,children:(0,wo.jsx)(Us,{options:t,value:r,onChange:e=>o("field",e),style:{color:go.p4}})})}function qR(e){let{ops:t,type:n,style:r,value:o,formatOp:i=tk,onChange:a}=e;return"id"===n&&(t=t.filter((e=>"contains"!==e))),(0,wo.jsx)(Us,{options:t.map((e=>[e,i(e,n)])),value:o,onChange:e=>a("op",e),style:r})}function GR(e){let{onAdd:t,onDelete:n,style:r}=e;return(0,wo.jsxs)(wo.Fragment,{children:[n&&(0,wo.jsx)(zl,{bare:!0,onClick:n,style:{padding:7},"aria-label":"Delete entry",children:(0,wo.jsx)(f_,{style:{width:8,height:8}})}),t&&(0,wo.jsx)(zl,{bare:!0,onClick:t,style:{padding:7},"aria-label":"Add entry",children:(0,wo.jsx)(d_,{style:{width:10,height:10}})})]})}function YR(e){let{type:t}=e;return(0,wo.jsx)(ql,{style:{fontSize:12,textAlign:"center",color:go.r5,marginBottom:5},children:nk(t)})}function QR(e){let{error:t,style:n,children:r}=e;return(0,wo.jsxs)(Ll,{style:n,"data-testid":"editor-row",children:[(0,wo.jsx)(Os,{direction:"row",align:"center",spacing:1,style:{padding:"3px 5px"},children:r}),t&&(0,wo.jsx)(YR,{type:t})]})}function XR(e){let t,{ops:n,condition:r,editorStyle:o,isSchedule:i,onChange:a,onDelete:l,onAdd:s}=e,{field:u,op:c,value:d,type:f,options:p,error:h}=r;return"amount"===u&&p&&(p.inflow?u="amount-inflow":p.outflow&&(u="amount-outflow")),t="number"===f&&"isbetween"===c?(0,wo.jsx)(DD,{defaultValue:d,onChange:e=>a("value",e)}):(0,wo.jsx)(O_,{field:u,type:f,value:d,multi:"oneOf"===c,onChange:e=>a("value",e)}),(0,wo.jsxs)(QR,{style:o,error:h,children:[(0,wo.jsx)(VR,{fields:iN,value:u,onChange:a}),(0,wo.jsx)(qR,{ops:n,value:c,type:f,onChange:a}),(0,wo.jsx)(Ll,{style:{flex:1},children:t}),(0,wo.jsx)(Os,{direction:"row",children:(0,wo.jsx)(GR,{onAdd:s,onDelete:i&&"date"===u?null:l})})]})}function ZR(e){let{id:t}=e,n=xe((e=>e.prefs.local.dateFormat||"MM/dd/yyyy")),r=Ch({transform:(0,h.useCallback)((e=>e.filter({id:t})),[])});if(null==r)return null;if(0===r.schedules.length)return(0,wo.jsx)(Ll,{style:{flex:1},children:t});let[o]=r.schedules,i=o&&r.statuses.get(o.id);return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",alignItems:"center"},children:[(0,wo.jsxs)(Ll,{style:{marginRight:15,flexDirection:"row"},children:[(0,wo.jsxs)(ql,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:["Payee:"," ",(0,wo.jsx)(zR,{type:"payees",id:o._payee,noneColor:go.n5})]}),(0,wo.jsx)(ql,{style:{margin:"0 5px"},children:" \u2014 "}),(0,wo.jsxs)(ql,{style:{flexShrink:0},children:["Amount: ",(a=o._amount,a?"number"===typeof a?zr(a):`${zr(a.num1)} to ${zr(a.num2)}`:zr(0))]}),(0,wo.jsx)(ql,{style:{margin:"0 5px"},children:" \u2014 "}),(0,wo.jsxs)(ql,{style:{flexShrink:0},children:["Next: ",fh(o.next_date,n)]})]}),(0,wo.jsx)(rO,{status:i})]});var a}let JR=["category","payee","notes","cleared","account","date","amount"].map((e=>[e,ek(e)]));function eN(e){let{ops:t,action:n,editorStyle:r,onChange:o,onDelete:i,onAdd:a}=e,{field:l,op:s,value:u,type:c,error:d,inputKey:f="initial"}=n;return(0,wo.jsxs)(QR,{style:r,error:d,children:["set"===s?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(Ll,{style:{padding:"5px 10px",lineHeight:"1em"},children:tk(s)}),(0,wo.jsx)(VR,{fields:JR,value:l,onChange:o}),(0,wo.jsx)(Ll,{style:{flex:1},children:(0,wo.jsx)(O_,{field:l,type:c,op:s,value:u,onChange:e=>o("value",e)},f)})]}):"link-schedule"===s?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(Ll,{style:{padding:"5px 10px",color:go.p4},children:tk(s)}),(0,wo.jsx)(ZR,{id:u||null})]}):null,(0,wo.jsx)(Os,{direction:"row",children:(0,wo.jsx)(GR,{onAdd:a,onDelete:"link-schedule"!==s&&i})})]})}function tN(){let[e,t]=(0,h.useState)();return(0,wo.jsxs)(Ll,{style:{position:"relative",marginLeft:5},children:[(0,wo.jsx)(Ll,{onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:(0,wo.jsx)(BR,{style:{width:11,height:11,color:go.n4}})}),e&&(0,wo.jsx)(Ps,{position:"bottom-left",style:{padding:10,color:go.n4,maxWidth:450,lineHeight:1.5},children:"The stage of a rule allows you to force a specific order. Pre rules always run first, and post rules always run last. Within each stage rules are automatically ordered from least to most specific."})]})}function nN(e){let{selected:t,children:n,style:r,onSelect:o}=e;return(0,wo.jsx)(zl,{bare:!0,style:[{fontSize:"inherit"},t&&{backgroundColor:go.b9,":hover":{backgroundColor:go.b9}},r],onClick:o,children:n})}function rN(e){return{...e,inputKey:""+Math.random()}}function oN(e){let{conditionsOp:t,conditions:n,editorStyle:r,isSchedule:o,onChangeConditions:i}=e;function a(e){let r=iN.map((e=>e[0])).filter((e=>"amount-inflow"!==e&&"amount-outflow"!==e));r=n.length&&"or"===t?[n[0].field]:r.filter((e=>!n.some((t=>t.field.includes(e)||e.includes(t.field)))));let o=r[0]||"payee",a=[...n];a.splice(e+1,0,{type:JS.get(o),field:o,op:"is",value:null}),i(a)}return 0===n.length?(0,wo.jsx)(zl,{style:{alignSelf:"flex-start"},onClick:function(){a(-1)},children:"Add condition"}):(0,wo.jsx)(Os,{spacing:2,"data-testid":"condition-list",children:n.map(((e,t)=>{let l=ZS[e.type].ops;return"date"===e.type&&e.value&&e.value.frequency?l=["is","isapprox"]:e.options&&(e.options.inflow||e.options.outflow)&&(l=l.filter((e=>"isbetween"!==e))),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(XR,{editorStyle:r,ops:l,condition:e,isSchedule:o,onChange:(t,r)=>{!function(e,t,r){i(HR(n,e,(()=>{if("field"===t){let t={field:r};"amount-inflow"===r?(t.field="amount",t.options={inflow:!0}):"amount-outflow"===r&&(t.field="amount",t.options={outflow:!0}),t.type=JS.get(t.field);let n=JS.get(e.field);return"string"!==n&&"number"!==n||n!==t.type||"isbetween"===e.op?(t.op=ZS[t.type].ops[0],rN(ik(null,t))):(t.op=e.op,rN(ik(e.value,t)))}if("op"===t){let t=r;return"oneOf"!==e.op&&"oneOf"===t?rN(ik(null!=e.value?[e.value]:[],{...e,op:r})):"oneOf"===e.op&&"oneOf"!==t?rN(ik(e.value.length>0?e.value[0]:null,{...e,op:r})):"isbetween"!==e.op&&"isbetween"===t?ik({num1:$r(e.value),num2:$r(e.value)},{...e,op:r}):"isbetween"===e.op&&"isbetween"!==t?ik(Vr(e.value.num1||0),{...e,op:r}):{...e,op:r}}return"value"===t?ik(r,e):e})))}(e,t,r)},onDelete:()=>function(e){i(n.filter((t=>t!==e)))}(e),onAdd:()=>a(t)})},t)}))})}let iN=["imported_payee","account","category","date","payee","notes","amount"].map((e=>[e,ek(e)])).concat([["amount-inflow",ek("amount",{inflow:!0})],["amount-outflow",ek("amount",{outflow:!0})]]);function aN(e){let{history:t,modalProps:n,defaultRule:r,onSave:o}=e,[i,a]=(0,h.useState)(r.conditions.map(rk)),[l,s]=(0,h.useState)(r.actions.map(rk)),[u,c]=(0,h.useState)(r.stage),[d,f]=(0,h.useState)(r.conditionsOp),[p,y]=(0,h.useState)([]),g=ge(),m=(0,h.useRef)(),v=l.some((e=>"link-schedule"===e.op));(0,h.useEffect)((()=>(g(nn()),yn(!1),()=>yn(!0))),[]),(0,h.useEffect)((()=>{if(m.current){let e=m.current,t=e.scrollTop;e.scrollTop=t+1,e.scrollTop=t}!async function(){let{filters:e}=await qe("make-filters-from-conditions",{conditions:i.map(ok)});if(e.length>0){const t="or"===d?"$or":"$and";let{data:n}=await pr(fr("transactions").filter({[t]:e}).select("*"));y(n)}else y([])}()}),[l,i,d]);let b=Ax("transactions",p,[]);function x(){w(-1)}function w(e){let t=JR.map((e=>e[0]));for(let o of l)t=t.filter((e=>e!==o.field));let n=t[0]||"category",r=[...l];r.splice(e+1,0,{type:JS.get(n),field:n,op:"set",value:null}),s(r)}function j(e){c(e)}function S(e,t){f(t)}function k(){qe("rule-apply-actions",{transactionIds:[...b.items],actions:l}).then((()=>{s([...l])}))}let C={backgroundColor:go.n10,borderRadius:4};return(0,wo.jsx)(ks,{title:"Rule",padding:0,...n,style:[n.style,{flex:"inherit",maxWidth:"90%"}],children:()=>(0,wo.jsxs)(Ll,{style:{maxWidth:"100%",width:900,height:"80vh",flexGrow:0,flexShrink:0,flexBasis:"auto",overflow:"hidden"},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",marginBottom:15,padding:"0 20px"},children:[(0,wo.jsx)(ql,{style:{color:go.n4,marginRight:15},children:"Stage of rule:"}),(0,wo.jsxs)(Os,{direction:"row",align:"center",spacing:1,children:[(0,wo.jsx)(nN,{selected:"pre"===u,onSelect:()=>j("pre"),children:"Pre"}),(0,wo.jsx)(nN,{selected:null===u,onSelect:()=>j(null),children:"Default"}),(0,wo.jsx)(nN,{selected:"post"===u,onSelect:()=>j("post"),children:"Post"}),(0,wo.jsx)(tN,{})]})]}),(0,wo.jsx)(Ll,{innerRef:m,style:{borderBottom:"1px solid "+go.border,padding:20,overflow:"auto",maxHeight:"calc(100% - 300px)"},children:(0,wo.jsxs)(Ll,{style:{flexShrink:0},children:[(0,wo.jsxs)(Ll,{style:{marginBottom:30},children:[(0,wo.jsxs)(ql,{style:{color:go.n4,marginBottom:15},children:["If",(0,wo.jsx)(VR,{"data-testid":"conditions-op",style:{display:"inline-flex"},fields:[["and","all"],["or","any"]],value:d,onChange:S}),"of these conditions match:"]}),(0,wo.jsx)(oN,{conditionsOp:d,conditions:i,editorStyle:C,isSchedule:v,onChangeConditions:e=>a(e)})]}),(0,wo.jsx)(ql,{style:{color:go.n4,marginBottom:15},children:"Then apply these actions:"}),(0,wo.jsx)(Ll,{style:{flex:1},children:0===l.length?(0,wo.jsx)(zl,{style:{alignSelf:"flex-start"},onClick:x,children:"Add action"}):(0,wo.jsx)(Os,{spacing:2,"data-testid":"action-list",children:l.map(((e,t)=>(0,wo.jsx)(Ll,{children:(0,wo.jsx)(eN,{ops:["set","link-schedule"],action:e,editorStyle:C,onChange:(t,n)=>{!function(e,t,n){s(HR(l,e,(()=>{let r={...e};return r[t]=n,"field"===t?(r.type=JS.get(r.field),r.value=null,rN(r)):"op"===t?(r.value=null,r.inputKey=""+Math.random(),rN(r)):r})))}(e,t,n)},onDelete:()=>function(e){s(l.filter((t=>t!==e)))}(e),onAdd:()=>w(t)})},t)))})})]})}),(0,wo.jsx)(Nx,{instance:b,children:(0,wo.jsxs)(Ll,{style:{padding:"20px",flex:1},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",marginBottom:12},children:[(0,wo.jsx)(ql,{style:{color:go.n4,marginBottom:0},children:"This rule applies to these transactions:"}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsxs)(zl,{disabled:0===b.items.size,onClick:k,children:["Apply actions (",b.items.size,")"]})]}),(0,wo.jsx)(WR,{transactions:p,fields:$R(i,l),style:{border:"1px solid "+go.border}}),(0,wo.jsxs)(Os,{direction:"row",justify:"flex-end",style:{marginTop:20},children:[(0,wo.jsx)(zl,{onClick:()=>n.onClose(),children:"Cancel"}),(0,wo.jsx)(zl,{primary:!0,onClick:()=>async function(){let e={...r,stage:u,conditionsOp:d,conditions:i.map(ok),actions:l.map(ok)},t=e.id?"rule-update":"rule-add",{error:c,id:f}=await qe(t,e);c?(c.conditionErrors&&a(KR(i,c.conditionErrors)),c.actionErrors&&s(KR(l,c.actionErrors))):(f&&(e.id=f),o&&o(e),n.onClose())}(),children:"Save"})]})]})})]})})}function lN(e){let{modalProps:t,actions:n,options:r={}}=e,{hasExistingKey:o,cloudFileId:i,onSuccess:a}=r,[l,s]=(0,h.useState)(""),[u,c]=(0,h.useState)(""),[d,f]=(0,h.useState)(!1),[p,y]=(0,h.useState)(!1);async function g(){if(""!==l&&!d){f(!0),c(null);let{error:e}=await qe("key-test",{password:l,fileId:i});if(e)return c(function(e){let{reason:t}=e;switch(t){case"network":return"Unable to connect to the server. We need to access the server to get some information about your keys.";case"old-key-style":return"This file is encrypted with an old unsupported key style. Recreate the key on a device where the file is available, or use an older version of Actual to download it.";case"decrypt-failure":return"Unable to decrypt file with this password. Please try again.";default:return"Something went wrong trying to create a key, sorry! Contact help@actualbudget.com for support."}}(e)),void f(!1);n.popModal(),a&&a()}}return(0,wo.jsx)(ks,{...t,showHeader:!1,style:{width:600},children:()=>(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(ql,{style:{fontSize:25,fontWeight:700,color:go.n2,margin:"20px 0"},children:o?"Unable to decrypt file":"This file is encrypted"}),o?(0,wo.jsxs)($s,{children:["This file was encrypted with a different key than you are currently using. This probably means you changed your password. Enter your current password to update your key."," ",(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}):(0,wo.jsxs)($s,{children:["We don\u2019t have a key that encrypts or decrypts this file. Enter the password for this file to create the key for encryption."," ",(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}),(0,wo.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g()},children:[(0,wo.jsxs)(Ll,{style:{marginTop:15,flexDirection:"column",alignItems:"center"},children:[(0,wo.jsx)(ql,{style:{fontWeight:600,marginBottom:5},children:"Password"})," ",u&&(0,wo.jsx)(Ll,{style:{color:go.r4,textAlign:"center",fontSize:13,marginBottom:3},children:u}),(0,wo.jsx)(Gs,{children:(0,wo.jsx)(Vl,{type:p?"text":"password",style:{width:"50%"},onChange:e=>s(e.target.value)})}),(0,wo.jsx)(ql,{style:{marginTop:5},children:(0,wo.jsxs)("label",{style:{userSelect:"none"},children:[(0,wo.jsx)("input",{type:"checkbox",onClick:()=>y(!p)})," ","Show password"]})})]}),(0,wo.jsxs)(Ss,{style:{marginTop:20},children:[(0,wo.jsx)(zl,{style:{marginRight:10},onClick:()=>t.onBack(),type:"button",children:"Back"}),(0,wo.jsx)(Bl,{loading:d,primary:!0,onClick:g,children:o?"Update key":"Create key"})]})]})]})})}let sN=[{format:"yyyy mm dd",label:"YYYY MM DD"},{format:"yy mm dd",label:"YY MM DD"},{format:"mm dd yyyy",label:"MM DD YYYY"},{format:"mm dd yy",label:"MM DD YY"},{format:"dd mm yyyy",label:"DD MM YYYY"},{format:"dd mm yy",label:"DD MM YY"}];function uN(e,t){if("string"!==typeof e)return null;function n(e){return e&&1===e.length?"0"+e:e}const r=(e,t)=>n=>{const r=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"").split(/[^\d]+/);if(r.length>=3)return r.slice(0,3);const o=n.replace(/[^\d]/g,"");return[o.slice(0,e),o.slice(e,e+t),o.slice(e+t)]},o=r(4,2),i=r(2,2);let a,l,s,u;switch(t){case"dd mm yyyy":a=i(e),l=a[2],s=a[1],u=a[0];break;case"dd mm yy":a=i(e),l=`20${a[2]}`,s=a[1],u=a[0];break;case"yyyy mm dd":a=o(e),l=a[0],s=a[1],u=a[2];break;case"yy mm dd":a=i(e),l=`20${a[0]}`,s=a[1],u=a[2];break;case"mm dd yy":a=i(e),l=`20${a[2]}`,s=a[0],u=a[1];break;default:a=i(e),l=a[2],s=a[0],u=a[1]}let c=`${l}-${n(s)}-${n(u)}`;return Uf(lk(c))?c:null}function cN(e,t){if(!e)return null;try{return fh(e,t)}catch(Fa){}return null}function dN(e){let t=e.match(/\.([^.]*)$/);return t?t[1].toLowerCase():"ofx"}function fN(e){let{parseDateFormat:t,showParsed:n,dateFormat:r,date:o}=e,i=o&&cN(t?uN(o,t):o,r);return(0,wo.jsxs)(ql,{children:[(0,wo.jsxs)(ql,{children:[o||(0,wo.jsx)(ql,{style:{color:go.n4,fontStyle:"italic"},children:"Empty"})," ","\u2192"," "]}),(0,wo.jsx)(ql,{style:{color:i?go.g3:go.r4},children:i||"Invalid"})]})}function pN(e,t){if(0===e.length||null==t.date)return"yyyy mm dd";let n=e[0][t.date],r=null==n?null:sN.find((e=>null!=uN(n,e.format)));return r?r.format:"mm dd yyyy"}function hN(e){if(0===e.length)return{};let t=e[0],n=Object.entries(t);function r(e){return e?e[0]:null}let o=r(n.find((e=>{let[t,n]=e;return t.toLowerCase().includes("date")}))||n.find((e=>{let[t,n]=e;return n.match(/^\d+[-/]\d+[-/]\d+$/)}))),i=r(n.find((e=>{let[t,n]=e;return t.toLowerCase().includes("amount")}))||n.find((e=>{let[t,n]=e;return n.match(/^-?[.,\d]+$/)}))),a=r(n.find((e=>{let[t,n]=e;return t!==o&&t!==i}))),l=r(n.find((e=>{let[t,n]=e;return t!==o&&t!==i&&t!==a})));return{date:o,amount:i,payee:a,notes:l}}function yN(e,t){let n={};for(let[r,o]of Object.entries(t))"payee"===r&&(r="payee_name"),n[r]=e[o||r];return n}function gN(e,t){if(null==e)return null;let n="string"===typeof e?function(e){function t(e){return isNaN(e)?null:e}function n(e){return e.replace(/[^0-9-]/g,"")}e.startsWith("(")&&e.endsWith(")")&&(e=e.replace("(","-").replace(")",""));let r=e.match(/[.,][^.,]*$/);if(!r||0===r.index)return t(parseFloat(n(e)));let o=n(e.slice(0,r.index)),i=n(e.slice(r.index+1));return t(parseFloat(o+"."+i))}(e):e;return t(n)}function mN(e,t,n,r){const o=parseFloat(r)||1;if(t){let t=gN(e.outflow,(e=>-Math.abs(e)))*o,n=t?0:gN(e.inflow,(e=>Math.abs(e)))*o;return{amount:t||n,outflow:t,inflow:n}}return{amount:gN(e.amount,(e=>n?-1*e:e))*o,outflow:null,inflow:null}}function vN(e){let{transaction:t,fieldMappings:n,showParsed:r,parseDateFormat:o,dateFormat:i,splitMode:a,flipAmount:l,multiplierAmount:s}=e,u=(0,h.useMemo)((()=>n?yN(t,n):t),[t,n]),{amount:c,outflow:d,inflow:f}=mN(u,a,l,s);return c=Ur(c),d=Ur(d),f=Ur(f),(0,wo.jsxs)(qw,{style:{backgroundColor:"white"},children:[(0,wo.jsx)($w,{width:200,borderColor:go.border,children:r?(0,wo.jsx)(fN,{parseDateFormat:o,dateFormat:i,date:u.date}):cN(u.date,i)}),(0,wo.jsx)($w,{width:"flex",borderColor:go.border,title:u.imported_payee||u.payee_name,children:u.payee_name}),(0,wo.jsx)($w,{width:"flex",borderColor:go.border,title:u.notes,children:u.notes}),a?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)($w,{width:90,borderColor:go.border,contentStyle:[{textAlign:"right"},mo.tnum],title:d,children:d}),(0,wo.jsx)($w,{width:90,borderColor:go.border,contentStyle:[{textAlign:"right"},mo.tnum],title:f,children:f})]}):(0,wo.jsx)($w,{width:90,borderColor:go.border,contentStyle:[{textAlign:"right"},mo.tnum],title:c,children:c})]})}function bN(e){let{title:t}=e;return(0,wo.jsx)(ql,{style:{fontSize:13,marginBottom:3,color:go.n3},children:t})}function xN(e){let{width:t,style:n,options:r,value:o,onChange:i}=e;return(0,wo.jsxs)(zs,{value:o,style:n,onChange:e=>i(e.target.value),children:[(0,wo.jsx)("option",{value:"",children:"Choose field..."}),r.map((e=>(0,wo.jsx)("option",{value:e,children:e},e)))]})}function wN(e){let{transactions:t,fieldMappings:n,parseDateFormat:r,onChange:o}=e,i="-";if(t.length>0&&n&&null!=n.date){let e=t[0][n.date],r=e&&e.match(/[/.,-/\\]/);i=r?r[0]:" "}return(0,wo.jsxs)(Ll,{style:{width:120},children:[(0,wo.jsx)(Zs,{title:"Date format"}),(0,wo.jsx)(zs,{value:r||"",onChange:e=>o(e.target.value),children:sN.map((e=>(0,wo.jsx)("option",{value:e.format,children:e.label.replace(/ /g,i)},e.format)))})]})}function jN(e){let{value:t,onChange:n}=e;return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,wo.jsx)(tu,{id:"add_multiplier",checked:t,onChange:n}),(0,wo.jsx)("label",{htmlFor:"add_multiplier",children:"Add Multiplier"})]})}function SN(e){let{value:t,disabled:n,onChange:r}=e;return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,wo.jsx)(tu,{id:"form_flip",checked:t,disabled:n,onChange:r}),(0,wo.jsx)("label",{htmlFor:"form_flip",style:{userSelect:"none",color:n?go.n6:null},children:"Flip amount"})]})}function kN(e){let{value:t,onChange:n}=e;return(0,wo.jsxs)(Ll,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,wo.jsx)(tu,{id:"form_split",checked:t,onChange:n}),(0,wo.jsx)("label",{htmlFor:"form_split",style:{userSelect:"none"},children:"Split amount into separate inflow/outflow columns"})]})}function CN(e){let{transactions:t,mappings:n,onChange:r,splitMode:o}=e;if(0===t.length)return null;let i=Object.keys(t[0]);return n=n||{},(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(Zs,{title:"CSV FIELDS"}),(0,wo.jsxs)(Os,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[(0,wo.jsxs)(Ll,{style:{width:200},children:[(0,wo.jsx)(bN,{title:"Date"}),(0,wo.jsx)(xN,{width:200,options:i,value:n.date||"",style:{marginRight:5},onChange:e=>r("date",e)})]}),(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(bN,{title:"Payee"}),(0,wo.jsx)(xN,{width:"flex",options:i,value:n.payee||"",style:{marginRight:5},onChange:e=>r("payee",e)})]}),(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(bN,{title:"Notes"}),(0,wo.jsx)(xN,{width:"flex",options:i,value:n.notes||"",style:{marginRight:5},onChange:e=>r("notes",e)})]}),o?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)(Ll,{style:{width:90},children:[(0,wo.jsx)(bN,{title:"Outflow"}),(0,wo.jsx)(xN,{width:90,options:i,value:n.outflow||"",onChange:e=>r("outflow",e)})]}),(0,wo.jsxs)(Ll,{style:{width:90},children:[(0,wo.jsx)(bN,{title:"Inflow"}),(0,wo.jsx)(xN,{width:90,options:i,value:n.inflow||"",onChange:e=>r("inflow",e)})]})]}):(0,wo.jsxs)(Ll,{style:{width:90},children:[(0,wo.jsx)(bN,{title:"Amount"}),(0,wo.jsx)(xN,{width:90,options:i,value:n.amount||"",onChange:e=>r("amount",e)})]})]})]})}function _N(e){let{multiplierCB:t,value:n,onChange:r}=e;const o=t?"inherit":"none";return(0,wo.jsx)(Vl,{type:"text",style:{display:o},value:n,placeholder:"Optional",onUpdate:r})}var ON=de((e=>({dateFormat:e.prefs.local.dateFormat||"MM/dd/yyyy",prefs:e.prefs.local})),e)((function(e){let{modalProps:t,options:n,dateFormat:r="MM/dd/yyyy",prefs:o,parseTransactions:i,importTransactions:a,getPayees:l,savePrefs:s,addNotification:u}=e,[c,d]=(0,h.useState)(""),[f,p]=(0,h.useState)("parsing"),[y,g]=(0,h.useState)(null),[m,v]=(0,h.useState)(n.filename),[b,x]=(0,h.useState)([]),[w,j]=(0,h.useState)(null),[S,k]=(0,h.useState)(null),[C,_]=(0,h.useState)(!1),[O,E]=(0,h.useState)(!1),[T,P]=(0,h.useState)(!1),{accountId:A,onImported:M}=n,[D,I]=(0,h.useState)(o[`csv-delimiter-${A}`]||","),[R,N]=(0,h.useState)(null);async function L(e,t){p("parsing");let n=dN(e);v(e),j(n);let r,a,l=await i(e,t);if(p(null),g(null),l.ofxParser?"both"===l.which?(console.log("Old errors: ",l.oldErrors),console.log("New errors: ",l.newErrors),r=l.newErrors,a={}):"old"===l.which?(u({type:"warning",sticky:"false",message:"Import was successful, but please [file a bug report](https://github.com/actualbudget/actual/issues/new?assignees=&labels=bug%2Cneeds+triage&template=bug-report.yml&title=%5BBug%5D%3A+New+OFX+Importer:+bad+old+parse:) and attach a redacted version of the file so we can fix our new algorithm."}),r=[],a=l.transactions):"new"===l.which?(u({type:"warning",sticky:"false",message:"Import was successful, but please [file a bug report](https://github.com/actualbudget/actual/issues/new?assignees=&labels=bug%2Cneeds+triage&template=bug-report.yml&title=%5BBug%5D%3A+New+OFX+Importer:+bad+new+parse:) and attach a redacted version of the file so we can fix our new algorithm."}),r=[],a=l.transactions):"none"===l.which?(r=[],a=l.transactions):"diff"===l.which&&(console.log("Different parse results"),console.log("Old OFX importer: ",l.oldTrans),console.log("New OFX importer: ",l.newTrans),u({type:"warning",sticky:"false",message:"possible error importing file, please [file a bug report](https://github.com/actualbudget/actual/issues/new?assignees=&labels=bug%2Cneeds+triage&template=bug-report.yml&title=%5BBug%5D%3A+New+OFX+Importer:) and attach a redacted version of the file."}),a=l.oldTrans,r=[]):(a=l.transactions,r=l.errors),r.length>0)g({parsed:!0,message:r[0].message||"Internal error"});else{if("csv"!==n&&"qif"!==n||E(o[`flip-amount-${A}-${n}`]||!1),"csv"===n){let e=o[`csv-mappings-${A}`];e=e?JSON.parse(e):hN(a),k(e);let t=!(!e.outflow&&!e.inflow);_(t),N(o[`parse-date-${A}-${n}`]||pN(a,e))}else"qif"===n?N(o[`parse-date-${A}-${n}`]||pN(a,{date:"date"})):(k(null),N(null));x(a.reverse())}}(0,h.useEffect)((()=>{L(n.filename,"csv"===dN(n.filename)?{delimiter:D}:null)}),[i,n.filename]);let F=[{name:"Date",width:200},{name:"Payee",width:"flex"},{name:"Notes",width:"flex"}];return C?(F.push({name:"Outflow",width:90,style:{textAlign:"right"}}),F.push({name:"Inflow",width:90,style:{textAlign:"right"}})):F.push({name:"Amount",width:90,style:{textAlign:"right"}}),(0,wo.jsxs)(ks,{title:"Import transactions"+(w?` (${w.toUpperCase()})`:""),...t,loading:"parsing"===f,style:{width:800},children:[y&&!y.parsed&&(0,wo.jsx)(Ll,{style:{alignItems:"center",marginBottom:15},children:(0,wo.jsxs)(ql,{style:{marginRight:10,color:go.r4},children:[(0,wo.jsx)("strong",{children:"Error:"})," ",y.message]})}),(!y||!y.parsed)&&(0,wo.jsxs)(Ll,{style:{flex:"unset",height:300,border:"1px solid "+go.border},children:[(0,wo.jsx)(oj,{headers:F}),(0,wo.jsx)(lj,{items:b,fields:["payee","amount"],style:{backgroundColor:go.n11},getItemKey:e=>e,renderEmpty:()=>(0,wo.jsx)(Ll,{style:{textAlign:"center",marginTop:25,color:go.n4,fontStyle:"italic"},children:"No transactions found"}),renderItem:e=>{let{key:t,style:n,item:o,editing:i,focusedField:a}=e;return(0,wo.jsx)(Ll,{style:n,children:(0,wo.jsx)(vN,{transaction:o,showParsed:"csv"===w||"qif"===w,parseDateFormat:R,dateFormat:r,fieldMappings:S,splitMode:C,flipAmount:O,multiplierAmount:c})},t)}})]}),y&&y.parsed&&(0,wo.jsxs)(Ll,{style:{color:go.r4,alignItems:"center",marginTop:10},children:[(0,wo.jsxs)(ql,{style:{maxWidth:450,marginBottom:15},children:[(0,wo.jsx)("strong",{children:"Error:"})," ",y.message]}),y.parsed&&(0,wo.jsx)(zl,{onClick:()=>function(){const e=window.Actual.openFileDialog({filters:[{name:"Financial Files",extensions:["qif","ofx","qfx","csv"]}]});L(e[0],"csv"===dN(e[0])?{delimiter:D}:null)}(),children:"Select new file..."})]}),"csv"===w&&(0,wo.jsx)(Ll,{style:{marginTop:25},children:(0,wo.jsx)(CN,{transactions:b,onChange:function(e,t){k({...S,[e]:""===t?null:t})},mappings:S,splitMode:C})}),("qif"===w||"csv"===w)&&(0,wo.jsx)(Ll,{style:{marginTop:25},children:(0,wo.jsxs)(Os,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[(0,wo.jsx)(Ll,{children:("qif"===w||"csv"===w)&&(0,wo.jsx)(wN,{transactions:b,fieldMappings:S,parseDateFormat:R,onChange:N})}),(0,wo.jsx)(Ll,{children:"csv"===w&&(0,wo.jsxs)(Ll,{style:{marginLeft:25},children:[(0,wo.jsx)(Zs,{title:"CSV DELIMITER"}),(0,wo.jsxs)(zs,{value:D,onChange:e=>{I(e.target.value),L(m,{delimiter:e.target.value})},children:[(0,wo.jsx)("option",{value:",",children:","}),(0,wo.jsx)("option",{value:";",children:";"})]})]})}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsxs)(Ll,{style:{marginRight:25},children:[(0,wo.jsx)(Zs,{title:"IMPORT OPTIONS"}),(0,wo.jsx)(Ll,{style:{marginTop:5},children:(0,wo.jsx)(SN,{value:O,disabled:C,onChange:()=>{E(!O)}})}),"csv"===w&&(0,wo.jsx)(Ll,{style:{marginTop:10},children:(0,wo.jsx)(kN,{value:C,onChange:function(){if(null==S)return;!0===O&&E(!O);let e=!C;_(e);let t=hN(b),n=e?{amount:null,outflow:t.amount,inflow:null}:{amount:t.amount,outflow:null,inflow:null};k({...S,...n})}})}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",marginTop:10},children:[(0,wo.jsx)(Ll,{style:{marginRight:30},children:(0,wo.jsx)(jN,{value:T,onChange:()=>{P(!T),d("")}})}),(0,wo.jsx)(Ll,{style:{width:75},children:(0,wo.jsx)(_N,{multiplierCB:T,value:c,onChange:function(e){const t=e;t&&!t.match(/^\d{1,}(\.\d{0,4})?$/)||d(t)}})})]})]})]})}),(0,wo.jsx)(Ll,{style:{flexDirection:"row",marginTop:5},children:(0,wo.jsx)(Ll,{style:{alignSelf:"flex-end",flexDirection:"row",alignItems:"center"},children:(0,wo.jsxs)(Bl,{primary:!0,disabled:0===b.length,loading:"importing"===f,onClick:async function(){p("importing");let e,n=[];for(let t of b){t=S?yN(t,S):t;let r="qfx"===w||"ofx"===w?t.date:uN(t.date,R);if(null==r){e=`Unable to parse date ${t.date||"(empty)"} with given date format`;break}let{amount:o}=mN(t,C,O,c);if(null==o){e=`Transaction on ${t.date} has no amount`;break}let{inflow:i,outflow:a,...l}=t;n.push({...l,date:r,amount:$r(o)})}if(e)return p(null),void g({parsed:!1,message:e});if("ofx"!==w&&"qfx"!==w){s({[`parse-date-${A}-${w}`]:R})}"csv"===w&&(s({[`csv-mappings-${A}`]:JSON.stringify(S)}),s({[`csv-delimiter-${A}`]:D})),"csv"!==w&&"qif"!==w||s({[`flip-amount-${A}-${w}`]:O});let r=await a(A,n);r&&await l(),M&&M(r),t.onClose()},children:["Import ",b.length," transactions"]})})})]})}));class EN extends h.Component{constructor(){super(...arguments),this.state={hoveredBackup:null},this.onHover=e=>{this.setState({hoveredBackup:e})}}render(){const{backups:e,onSelect:t}=this.props,{hoveredBackup:n}=this.state;return(0,wo.jsx)(Ll,{style:{flex:1,maxHeight:200,overflow:"auto"},onMouseLeave:()=>this.onHover(null),children:e.map(((e,r)=>(0,wo.jsx)(qw,{collapsed:0!==r,focused:n===e.id,onMouseEnter:()=>this.onHover(e.id),onClick:()=>t(e.id),style:{cursor:"pointer"},children:(0,wo.jsx)(Vw,{width:"flex",value:e.date?e.date:"Revert to Latest",valueStyle:{paddingLeft:20}})},e.id)))})}}var TN=function(e){let{budgetId:t,backups:n,backupDisabled:r,actions:o,modalProps:i}=e;const a=n.find((e=>e.isLatest)),l=n.filter((e=>!e.isLatest));return(0,wo.jsx)(ks,{title:"Load Backup",padding:0,...i,style:{flex:0},children:()=>(0,wo.jsxs)(Ll,{style:{marginBottom:30},children:[(0,wo.jsx)(Ll,{style:{margin:20,marginTop:0,marginBottom:15,lineHeight:1.5},children:a?(0,wo.jsxs)(Ms,{children:[(0,wo.jsxs)(Ms,{style:{marginBottom:10},children:[(0,wo.jsx)(ql,{style:{fontWeight:600},children:"You are currently working from a backup."})," ","You can load a different backup or revert to the original version below."]}),(0,wo.jsx)(zl,{primary:!0,onClick:()=>o.loadBackup(t,a.id),children:"Revert to original version"})]}):(0,wo.jsxs)(Ll,{style:{alignItems:"flex-start"},children:[(0,wo.jsxs)(Ms,{style:{marginBottom:10},children:["Select a backup to load. After loading a backup, you will have a chance to revert to the current version in this screen."," ",(0,wo.jsx)(ql,{style:{fontWeight:600},children:"If you use a backup, you will have to setup all your devices to sync from the new budget."})]}),(0,wo.jsx)(zl,{primary:!0,disabled:r,onClick:()=>o.makeBackup(),children:"Backup Now"})]})}),0===l.length?(0,wo.jsx)(Ms,{style:{color:go.n6,marginLeft:20},children:"No backups available"}):(0,wo.jsx)(EN,{backups:l,onSelect:e=>o.loadBackup(t,e)})]})})};function PN(){return"true"===String({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_ACTUAL_VERSION:"23.5.0",REACT_APP_BACKEND_WORKER_HASH:"e2ee9d65fbc7d1214a04",REACT_APP_RELEASE_TYPE:""}.REACT_APP_NETLIFY)||!1}function AN(e){let{modalProps:t,payeeId:n}=e,[r,o]=(0,h.useState)(!0),i=Yd();if(PN()&&"/payees"!==i.pathname)throw new Error(`Possibly invalid use of ManageRulesModal, add the current url \`${i.pathname}\` to the allowlist if you\u2019re confident the modal can never appear on top of the \`/rules\` page.`);return(0,wo.jsx)(ks,{title:"Rules",padding:0,loading:r,...t,style:[t.style,{flex:1,maxWidth:"90%",maxHeight:"90%"}],children:()=>(0,wo.jsx)(Pk,{isModal:!0,payeeId:n,setLoading:o})})}const MN=e=>{let{icon:t,color:n,backgroundColor:r,style:o,children:i}=e;return(0,wo.jsxs)(Ll,{style:[{color:n,fontSize:13,...mo.shadow,borderRadius:4,backgroundColor:r,padding:10,flexDirection:"row","& a, & a:active, & a:visited":{color:go.b3}},o],children:[(0,wo.jsx)(Ll,{style:{paddingLeft:2,paddingTop:".11em",alignSelf:"stretch",flexShrink:0,marginRight:5},children:(0,wo.jsx)(t,{width:13,style:{color:n,marginTop:2}})}),(0,wo.jsx)(ql,{style:{zIndex:1,lineHeight:1.5},children:i})]})},DN=e=>{let{style:t,children:n}=e;return(0,wo.jsx)(MN,{icon:BR,color:go.n4,backgroundColor:"transparent",style:[t,{boxShadow:"none",padding:5}],children:n})},IN=e=>{let{style:t,children:n}=e;return(0,wo.jsx)(MN,{icon:zP,color:go.y2,backgroundColor:go.y10,style:t,children:n})},RN=e=>{let{style:t,children:n}=e;return(0,wo.jsx)(MN,{icon:zP,color:go.r2,backgroundColor:go.r10,style:t,children:n})};let NN={color:go.p5};function LN(e){let{history:t,modalProps:n,payeeIds:r,targetPayeeId:o}=e,{payees:i,modalStack:a}=xe((e=>({payees:e.queries.payees,modalStack:e.modals.modalStack}))),l=!!a.find((e=>"edit-rule"===e.name)),s=ge(),[u,c]=(0,h.useState)(!0),d=(0,h.useRef)(null);(0,h.useEffect)((()=>{if(d.current){let e=d.current,t=e.scrollTop;e.scrollTop=t+1,e.scrollTop=t}}),[d.current,!0]);let[f]=(0,h.useState)((()=>r.map((e=>i.find((t=>t.id===e)))))),p=i.find((e=>e.id===o));if(!p)return null;async function y(){let e;if(await qe("payees-merge",{targetId:p.id,mergeIds:f.map((e=>e.id))}),u&&!l){e=await qe("rule-add-payee-rename",{fromNames:f.map((e=>e.name)),to:p.id})}return n.onClose(),e}async function g(){let e=await y();if(e){let t=await qe("rule-get",{id:e});s(Lt("edit-rule",{rule:t}))}}return(0,wo.jsx)(ks,{title:"Merge payee?",padding:0,showHeader:!1,...n,style:n.style,children:()=>(0,wo.jsx)(Ll,{style:{padding:20,maxWidth:500},children:(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)($s,{style:{marginBottom:10,fontWeight:500},children:1===f.length?(0,wo.jsxs)(wo.Fragment,{children:["The payee ",(0,wo.jsx)(ql,{style:NN,children:f[0].name})," ","is not used by transactions any more. Would like to merge it with ",(0,wo.jsx)(ql,{style:NN,children:p.name}),"?"]}):(0,wo.jsxs)(wo.Fragment,{children:["The following payees are not used by transactions any more. Would like to merge them with"," ",(0,wo.jsx)(ql,{style:NN,children:p.name}),"?",(0,wo.jsx)("ul",{ref:d,style:{margin:0,marginTop:10,maxHeight:140,overflow:"auto"},children:f.map((e=>(0,wo.jsx)("li",{children:(0,wo.jsx)(ql,{style:NN,children:e.name})},e.id)))})]})}),(0,wo.jsx)(DN,{children:"Merging will remove the payee and transfer any existing rules to the new payee. If checked below, a rule will be created to do this rename while importing transactions."}),!l&&(0,wo.jsxs)("label",{style:{fontSize:13,marginTop:10,color:go.n4,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,wo.jsx)("input",{type:"checkbox",checked:u,onChange:e=>c(e.target.checked)}),(0,wo.jsxs)(ql,{style:{marginLeft:3},children:["Automatically rename"," ",1===f.length?"this payee":"these payees"," in the future"]})]}),(0,wo.jsxs)(Ss,{style:{marginTop:20},focusButton:!0,children:[(0,wo.jsx)(zl,{primary:!0,style:{marginRight:10},onClick:y,type:"button",children:"Merge"}),!l&&(0,wo.jsx)(zl,{style:{marginRight:10},onClick:g,type:"button",children:"Merge and edit rule"}),(0,wo.jsx)(zl,{style:{marginRight:10},onClick:()=>n.onBack(),type:"button",children:"Do nothing"})]})]})})})}const FN=[{id:"AT",name:"Austria"},{id:"BE",name:"Belgium"},{id:"BG",name:"Bulgaria"},{id:"HR",name:"Croatia"},{id:"CY",name:"Cyprus"},{id:"CZ",name:"Czechia"},{id:"DK",name:"Denmark"},{id:"EE",name:"Estonia"},{id:"FI",name:"Finland"},{id:"FR",name:"France"},{id:"DE",name:"Germany"},{id:"GR",name:"Greece"},{id:"HU",name:"Hungary"},{id:"IS",name:"Iceland"},{id:"IE",name:"Ireland"},{id:"IT",name:"Italy"},{id:"LV",name:"Latvia"},{id:"LI",name:"Liechtenstein"},{id:"LT",name:"Lithuania"},{id:"LU",name:"Luxembourg"},{id:"MT",name:"Malta"},{id:"NL",name:"Netherlands"},{id:"NO",name:"Norway"},{id:"PL",name:"Poland"},{id:"PT",name:"Portugal"},{id:"RO",name:"Romania"},{id:"SK",name:"Slovakia"},{id:"SI",name:"Slovenia"},{id:"ES",name:"Spain"},{id:"SE",name:"Sweden"},{id:"GB",name:"United Kingdom"}];function BN(e){return(0,wo.jsx)(RN,{style:{alignSelf:"center"},children:"timeout"===e?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function zN(e){let{modalProps:t,onMoveExternal:n,onSuccess:r,onClose:o}=e,[i,a]=(0,h.useState)(null),[l,s]=(0,h.useState)(!1),[u,c]=(0,h.useState)(),[d,f]=(0,h.useState)(),[p,y]=(0,h.useState)(null),g=(0,h.useRef)(null);const{data:m,isLoading:v,isError:b}=function(e){const[t,n]=(0,h.useState)([]),[r,o]=(0,h.useState)(!1),[i,a]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{!async function(){if(a(!1),!e)return n([]),void o(!1);o(!0);const{data:t,error:r}=await Ge("nordigen-get-banks",e);r?(a(!0),n([])):n(t),o(!1)}()}),[n,o,e]),{data:t,isLoading:r,isError:i}}(d),{configured:x,isLoading:w}=IR();async function j(){y(null),a("browser");let e=await n({institutionId:u});if(e.error)return y(e.error),void a(null);g.current=e.data,a(null),s(!0)}async function S(){a("accounts"),await r(g.current),a(null)}return(0,wo.jsx)(ks,{title:"Link Your Bank",...t,onClose:function(){o&&o(),t.onClose()},style:{flex:0},children:()=>(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)($s,{style:{fontSize:15},children:"To link your bank account, you will be redirected to a new page where Nordigen will ask to connect to your bank. Nordigen will not be able to withdraw funds from your accounts."}),p&&BN(p),i||w?(0,wo.jsxs)(Ll,{style:{alignItems:"center",marginTop:15},children:[(0,wo.jsx)(ko,{color:go.n1,style:{width:20,height:20}}),(0,wo.jsx)(Ll,{style:{marginTop:10,color:go.n4},children:w?"Checking Nordigen configuration..":"browser"===i?"Waiting on Nordigen...":"accounts"===i?"Loading accounts...":null}),"browser"===i&&(0,wo.jsx)(Is,{onClick:j,style:{marginTop:10},children:"(Account linking not opening in a new tab? Click here)"})]}):l?(0,wo.jsx)(zl,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,backgroundColor:go.g4,borderColor:go.g4},onClick:S,children:"Success! Click to continue \u2192"}):x?(0,wo.jsxs)(Ll,{style:{gap:10},children:[(0,wo.jsxs)(eu,{children:[(0,wo.jsx)(Js,{title:"Choose your country:",htmlFor:"country-field"}),(0,wo.jsx)(GC,{strict:!0,highlightFirst:!0,disabled:w,suggestions:FN,onSelect:f,value:d,inputProps:{id:"country-field",placeholder:"(please select)"}})]}),b?(0,wo.jsx)(RN,{children:"Failed loading available banks: Nordigen access credentials might be misconfigured. Please set them up again."}):d&&(v?"Loading banks...":(0,wo.jsxs)(eu,{children:[(0,wo.jsx)(Js,{title:"Choose your bank:",htmlFor:"bank-field"}),(0,wo.jsx)(GC,{focused:!0,strict:!0,highlightFirst:!0,suggestions:m,onSelect:c,value:u,inputProps:{id:"bank-field",placeholder:"(please select)"}})]})),(0,wo.jsxs)(IN,{children:["By enabling bank-sync, you will be granting Nordigen (a third party service) read-only access to your entire account\u2019s transaction history. This service is not affiliated with Actual in any way. Make sure you\u2019ve read and understand Nordigen\u2019s"," ",(0,wo.jsx)("a",{href:"https://nordigen.com/en/company/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})," ","and"," ",(0,wo.jsx)("a",{href:"https://nordigen.com/en/company/privacy-policy-end-user/",target:"_blank",rel:"noopener noreferrer",children:"End User Privacy Policy"})," ","before proceeding."]}),(0,wo.jsx)(zl,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600},onClick:j,disabled:!u||!d,children:"Link bank in browser \u2192"})]}):(0,wo.jsxs)($s,{style:{color:go.r5},children:["Nordigen integration has not been configured so linking accounts is not available."," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Accounts/connecting-your-bank/",target:"_blank",rel:"noopener noreferrer",children:"Learn more."})]})]})})}var UN=e=>{let{modalProps:t,onSuccess:n}=e;const[r,o]=(0,h.useState)(""),[i,a]=(0,h.useState)(""),[l,s]=(0,h.useState)(!0),[u,c]=(0,h.useState)(!1);return(0,wo.jsxs)(ks,{title:"Set-up Nordigen",size:{width:300},...t,children:[(0,wo.jsxs)(Ll,{style:{display:"flex",gap:10},children:[(0,wo.jsxs)(ql,{children:["In order to enable bank-sync via Nordigen (only for EU banks) you will need to create access credentials. This can be done by creating an account with"," ",(0,wo.jsx)("a",{href:"https://nordigen.com/",target:"_blank",rel:"noopener noreferrer",children:"Nordigen"}),"."]}),(0,wo.jsxs)(eu,{children:[(0,wo.jsx)(Js,{title:"Secret ID:",htmlFor:"secret-id-field"}),(0,wo.jsx)(Vl,{id:"secret-id-field",type:"password",value:r,onUpdate:o,onChange:()=>s(!0)})]}),(0,wo.jsxs)(eu,{children:[(0,wo.jsx)(Js,{title:"Secret Key:",htmlFor:"secret-key-field"}),(0,wo.jsx)(Vl,{id:"secret-key-field",type:"password",value:i,onUpdate:a,onChange:()=>s(!0)})]}),!l&&(0,wo.jsx)(RN,{children:"It is required to provide both the secret id and secret key."})]}),(0,wo.jsx)(Ss,{children:(0,wo.jsx)(Bl,{loading:u,primary:!0,onClick:async()=>{r&&i?(c(!0),await Promise.all([qe("secret-set",{name:"nordigen_secretId",value:r}),qe("secret-set",{name:"nordigen_secretKey",value:i})]),n(),t.onClose(),c(!1)):s(!1)},children:"Save and continue"})})]})};function WN(e){return(0,wo.jsx)(RN,{style:{alignSelf:"center"},children:"timeout"===e?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function HN(e){let{modalProps:t,onMoveExternal:n,onSuccess:r,onClose:o}=e,[i,a]=(0,h.useState)(null),[l,s]=(0,h.useState)(!1),[u,c]=(0,h.useState)(null),d=(0,h.useRef)(null);async function f(){c(null),a("browser");let e=await n();if(e.error)return c(e.error),void a(null);d.current=e.data,a(null),s(!0)}async function p(){a("accounts"),await r(d.current),a(null)}return(0,wo.jsx)(ks,{title:"Link Your Bank",...t,onClose:function(){o&&o(),t.onClose()},style:{flex:0},children:()=>(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)($s,{style:{fontSize:15},children:"To link your bank account, you will be moved to your browser for enhanced security. Click below and Actual will automatically resume when you have given your bank\u2019s credentials."}),u&&WN(u),i?(0,wo.jsxs)(Ll,{style:{alignItems:"center",marginTop:15},children:[(0,wo.jsx)(ko,{color:go.n1,style:{width:20,height:20}}),(0,wo.jsx)(Ll,{style:{marginTop:10,color:go.n4},children:"browser"===i?"Waiting on browser...":"accounts"===i?"Loading accounts...":null})]}):l?(0,wo.jsx)(zl,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,backgroundColor:go.g4,borderColor:go.g4},onClick:p,children:"Success! Click to continue \u2192"}):(0,wo.jsx)(zl,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:f,children:"Link bank in browser \u2192"}),(0,wo.jsx)("div",{style:{marginTop:i?30:35},children:(0,wo.jsx)(ql,{style:{color:go.n5,fontWeight:600},children:"Why not link it in the app?"})}),(0,wo.jsx)(ql,{style:{marginTop:10,color:go.n5,fontSize:13,"& a, & a:visited":{color:go.n5}},children:"Typing your bank\u2019s username and password is one of the most security-sensitive things you can do, and the browser is the most secure app in the world. Why not use it to make sure your information is safe? [TODO: Link to docs article]"}),(0,wo.jsx)(Ss,{style:{marginTop:10},children:(0,wo.jsx)(zl,{onClick:()=>t.onBack(),children:"Back"})})]})})}const KN={id:"new",name:"Create new account"};function $N(e){let{modalProps:t,requisitionId:n,externalAccounts:r,localAccounts:o,actions:i}=e;const[a,l]=(0,h.useState)((()=>Object.fromEntries(o.filter((e=>e.account_id)).map((e=>[e.account_id,e.id])))));async function s(){const e=Object.values(a);o.filter((e=>e.account_id)).filter((t=>!e.includes(t.id))).forEach((e=>i.unlinkAccount(e.id))),Object.entries(a).forEach((e=>{let[t,o]=e;const a=r.find((e=>e.account_id===t));a&&i.linkAccount(n,a,o!==KN.id?o:void 0)})),i.closeModal()}const u=o.filter((e=>!Object.values(a).includes(e.id)));function c(e,t){l((n=>{const r={...n};return t?r[e.account_id]=t:delete r[e.account_id],r}))}return(0,wo.jsx)(ks,{title:"Link Accounts",...t,style:{width:800},children:()=>(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(ql,{style:{marginBottom:10},children:"We found the following accounts. Select which ones you want to add:"}),(0,wo.jsxs)(Ll,{style:{flex:"unset",height:300,border:"1px solid "+go.border},children:[(0,wo.jsx)(oj,{headers:[{name:"Bank Account To Sync",width:200},{name:"Account in Actual",width:"flex"},{name:"Actions",width:"flex"}]}),(0,wo.jsx)(sj,{items:r,style:{backgroundColor:go.n11},getItemKey:e=>e,renderItem:e=>{let{key:t,item:n}=e;return(0,wo.jsx)(Ll,{children:(0,wo.jsx)(VN,{externalAccount:n,chosenAccount:a[n.account_id]===KN.id?KN:o.find((e=>a[n.account_id]===e.id)),unlinkedAccounts:u,onSetLinkedAccount:c})},t)}})]}),(0,wo.jsx)(Ll,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:10},children:(0,wo.jsx)(zl,{primary:!0,onClick:s,disabled:!Object.keys(a).length,children:"Link accounts"})})]})})}function VN(e){let{externalAccount:t,chosenAccount:n,unlinkedAccounts:r,onSetLinkedAccount:o}=e;const[i,a]=(0,h.useState)(null),l=[...r,(null===n||void 0===n?void 0:n.id)!==KN.id&&n,KN].filter(Boolean);return(0,wo.jsxs)(qw,{style:{backgroundColor:"white"},children:[(0,wo.jsx)($w,{width:200,children:t.name}),(0,wo.jsx)($w,{width:"flex",truncate:"account"!==i,onClick:()=>a("account"),children:"account"===i?(0,wo.jsx)(GC,{focused:!0,strict:!0,highlightFirst:!0,suggestions:l,onSelect:e=>{o(t,e)},inputProps:{onBlur:()=>a(null)},value:null===n||void 0===n?void 0:n.id}):null===n||void 0===n?void 0:n.name}),(0,wo.jsx)($w,{width:"flex",children:n?(0,wo.jsx)(zl,{onClick:()=>{o(t,null)},style:{float:"right"},children:"Remove bank-sync"}):(0,wo.jsx)(zl,{primary:!0,onClick:()=>{a("account")},style:{float:"right"},children:"Setup bank-sync"})})]})}var qN=de((e=>({modalStack:e.modals.modalStack,isHidden:e.modals.isHidden,accounts:e.queries.accounts,categoryGroups:e.queries.categories.grouped,categories:e.queries.categories.list,payees:e.queries.payees,budgetId:e.prefs.local&&e.prefs.local.id})),(t=>({actions:Q(e,t)})))((function(e){let{history:t,modalStack:n,isHidden:r,accounts:o,categoryGroups:i,categories:a,payees:l,budgetId:s,actions:u}=e;const c=Ox("goalTemplatesEnabled"),d=$x();return n.map(((e,l)=>{let{name:f,options:p={}}=e;const h={onClose:u.popModal,onBack:u.popModal,showBack:l>0,isCurrent:l===n.length-1,isHidden:r,stackIndex:l};let y=Wo("/"+f);return(0,wo.jsxs)(Mi,{location:y,children:[(0,wo.jsx)(_i,{path:"/import-transactions",children:(0,wo.jsx)(ON,{modalProps:h,options:p})}),(0,wo.jsx)(_i,{path:"/add-account",children:(0,wo.jsx)(RR,{modalProps:h,actions:u,syncServerStatus:d})}),(0,wo.jsx)(_i,{path:"/add-local-account",children:(0,wo.jsx)(LR,{modalProps:h,actions:u,history:t})}),(0,wo.jsx)(_i,{path:"/close-account",children:(0,wo.jsx)(TR,{modalProps:h,account:p.account,balance:p.balance,canDelete:p.canDelete,accounts:o.filter((e=>0===e.closed)),categoryGroups:i,actions:u})}),(0,wo.jsx)(_i,{path:"/select-linked-accounts",children:(0,wo.jsx)($N,{modalProps:h,externalAccounts:p.accounts,requisitionId:p.requisitionId,localAccounts:o.filter((e=>0===e.closed)),upgradingAccountId:p.upgradingAccountId,actions:u})}),(0,wo.jsx)(_i,{path:"/configure-linked-accounts",children:(0,wo.jsx)(MR,{modalProps:h,institution:p.institution,publicToken:p.publicToken,accounts:p.accounts,upgradingId:p.upgradingId,actions:u})}),(0,wo.jsx)(_i,{path:"/confirm-category-delete",render:()=>{const{category:e,group:t,onDelete:n}=p;return(0,wo.jsx)(DR,{modalProps:h,actions:u,category:a.find((t=>t.id===e)),group:i.find((e=>e.id===t)),categoryGroups:i,onDelete:n})}}),(0,wo.jsx)(_i,{path:"/load-backup",render:()=>(0,wo.jsx)(dD,{initialState:{backups:[]},didMount:async e=>{let{setState:t}=e;t({backups:await qe("backups-get",{id:s})}),Ye("backups-updated",(e=>{t({backups:e})}))},willUnmount:()=>{Qe("backups-updated")},children:e=>{let{state:t}=e;return(0,wo.jsx)(TN,{budgetId:s,modalProps:h,actions:u,backups:t.backups})}})}),(0,wo.jsx)(_i,{path:"/manage-rules",render:()=>(0,wo.jsx)(AN,{history:t,modalProps:h,payeeId:p.payeeId})}),(0,wo.jsx)(_i,{path:"/edit-rule",render:()=>(0,wo.jsx)(aN,{history:t,modalProps:h,defaultRule:p.rule,onSave:p.onSave})}),(0,wo.jsx)(_i,{path:"/merge-unused-payees",render:()=>(0,wo.jsx)(LN,{history:t,modalProps:h,payeeIds:p.payeeIds,targetPayeeId:p.targetPayeeId})}),(0,wo.jsx)(_i,{path:"/plaid-external-msg",render:()=>(0,wo.jsx)(HN,{modalProps:h,actions:u,onMoveExternal:p.onMoveExternal,onClose:()=>{p.onClose&&p.onClose(),qe("poll-web-token-stop")},onSuccess:p.onSuccess})}),(0,wo.jsx)(_i,{path:"/nordigen-init",render:()=>(0,wo.jsx)(UN,{modalProps:h,onSuccess:p.onSuccess})}),(0,wo.jsx)(_i,{path:"/nordigen-external-msg",render:()=>(0,wo.jsx)(zN,{modalProps:h,actions:u,onMoveExternal:p.onMoveExternal,onClose:()=>{p.onClose&&p.onClose(),qe("nordigen-poll-web-token-stop")},onSuccess:p.onSuccess})}),(0,wo.jsx)(_i,{path:"/create-encryption-key",render:()=>(0,wo.jsx)(NR,{modalProps:h,actions:u,options:p},f)}),(0,wo.jsx)(_i,{path:"/fix-encryption-key",render:()=>(0,wo.jsx)(lN,{modalProps:h,actions:u,options:p},f)}),(0,wo.jsx)(_i,{path:"/edit-field",render:()=>(0,wo.jsx)(FR,{modalProps:h,actions:u,name:p.name,onSubmit:p.onSubmit},f)}),(0,wo.jsx)(_i,{path:"/budget-summary",children:(0,wo.jsx)(QD,{modalProps:h,month:p.month,actions:u,isGoalTemplatesEnabled:c},f)})]},f)}))}));function GN(){return window.close(),(0,wo.jsx)(ks,{isCurrent:!0,showClose:!1,title:"Account sync",children:()=>(0,wo.jsxs)(Ll,{style:{maxWidth:500},children:[(0,wo.jsx)($s,{children:"Please wait..."}),(0,wo.jsx)($s,{children:"The window should close automatically. If nothing happend you can close this window or tab."})]})})}function YN(e){let{notification:t,onRemove:n}=e,{type:r,title:o,message:i,pre:a,messageActions:l,sticky:s,internal:u,button:c}=t,[d,f]=(0,h.useState)(!1),[p,y]=(0,h.useState)(!1);(0,h.useEffect)((()=>{"error"===r&&u&&console.error("Internal error:",u),s||setTimeout(n,6500)}),[]);let g="message"===r,m="error"===r,v=(0,h.useMemo)((()=>function(e,t,n,r){return(0,wo.jsx)(Os,{spacing:2,children:e.split(/\n\n/).map(((e,o)=>{let i=e.split(/(\[[^\]]*\]\([^)]*\))/g);return(0,wo.jsx)(ql,{style:{lineHeight:"1.4em"},children:i.map(((e,o)=>{let i=e.match(/\[([^\]]*)\]\(([^)]*)\)/);if(i){let[e,a,l]=i;if("#"===l[0]){let e=l.slice(1);return(0,wo.jsx)("a",{href:"#",onClick:async o=>{o.preventDefault(),t[e]&&(n(!0),await t[e](),r())},children:a})}return(0,wo.jsx)(Ns,{asAnchor:!0,href:i[2],children:i[1]},o)}return(0,wo.jsx)(ql,{children:e},o)}))},o)}))})}(i,l,y,n)),[i,l]);return(0,wo.jsxs)(Ll,{style:{marginTop:10,color:g?go.g3:m?go.r3:go.y2},children:[(0,wo.jsxs)(Os,{align:"center",direction:"row",style:{padding:"14px 14px",fontSize:14,backgroundColor:g?go.g11:m?go.r11:go.y10,borderTop:`3px solid ${g?go.g5:m?go.r5:go.y4}`,...mo.shadowLarge,maxWidth:550,"& a":{color:"currentColor"}},children:[(0,wo.jsxs)(Os,{align:"flex-start",children:[o&&(0,wo.jsx)(Ll,{style:{fontWeight:700,marginBottom:10},children:o}),(0,wo.jsx)(Ll,{children:v}),a?a.split("\n\n").map(((e,t)=>(0,wo.jsx)(Ll,{style:{whiteSpace:"pre-wrap",fontFamily:"monospace",fontSize:12,backgroundColor:"rgba(0, 0, 0, .05)",padding:10,borderRadius:4},children:e},t))):null,c&&(0,wo.jsx)(Bl,{bare:!0,loading:d,onClick:async()=>{f(!0),await c.action(),n(),f(!1)},style:{backgroundColor:"transparent",border:`1px solid ${g?go.g5:m?go.r4:go.y3}`,color:"currentColor",fontSize:14,flexShrink:0,"&:hover, &:active":{backgroundColor:g?go.g9:m?go.r10:go.y9}},children:c.title})]}),s&&(0,wo.jsx)(zl,{bare:!0,style:{flexShrink:0,color:"currentColor"},onClick:n,children:(0,wo.jsx)(ws,{style:{width:9,height:9,color:"currentColor"}})})]}),p&&(0,wo.jsx)(Ll,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(250, 250, 250, .75)",alignItems:"center",justifyContent:"center"},children:(0,wo.jsx)(ko,{color:"currentColor",style:{width:20,height:20,color:"currentColor"}})})]})}var QN=de((e=>({notifications:e.notifications.notifications})),(t=>Q(e,t)))((function(e){let{notifications:t,removeNotification:n,style:r}=e;return(0,wo.jsx)(Ll,{style:[{position:"fixed",bottom:20,right:13,zIndex:1e4},r],children:t.map((e=>(0,wo.jsx)(YN,{notification:e,onRemove:()=>{e.onClose&&e.onClose(),n(e.id)}},e.id)))})}));var XN=e=>(0,wo.jsx)("svg",{...e,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M24 29h5.333M8 29H2.667M16 21l-8 8M16 21l8 8M16 2.667v18.666M16 2.667 8 9.333M16 2.667l8 6.666",fill:"none",stroke:"currentColor",strokeWidth:3.5,strokeMiterlimit:10,strokeLinecap:"round"})});let ZN=Qr((e=>Ar(e)));function JN(e,t,n){return 1===e?t:n}function eL(e){let{ruleCount:t,focused:n,onEdit:r,onClick:o}=e;return(0,wo.jsx)(Vw,{name:"rule-count",width:"auto",focused:n,style:{padding:"0 10px"},plain:!0,children:(0,wo.jsxs)(tj,{style:{borderRadius:4,padding:"3px 6px",backgroundColor:go.g9,border:"1px solid "+go.g9,color:go.g1,fontSize:12},onEdit:r,onSelect:o,onFocus:r,children:[(0,wo.jsx)(ql,{style:{paddingRight:5},children:t>0?(0,wo.jsxs)(wo.Fragment,{children:[t," associated ",JN(t,"rule","rules")]}):(0,wo.jsx)(wo.Fragment,{children:"Create rule"})}),(0,wo.jsx)(oM,{style:{width:8,height:8,color:go.g1}})]})})}let tL=h.memo((e=>{let{style:t,payee:n,ruleCount:r,categoryGroups:o,selected:i,highlighted:a,hovered:l,editing:s,focusedField:u,onViewRules:c,onCreateRule:d,onHover:f,onEdit:p,onUpdate:h,ruleActions:y}=e,{id:g}=n,m=Ix(),v=i?go.b8:go.border,b=l||"select"===u;return(0,wo.jsxs)(qw,{borderColor:v,backgroundColor:i?go.b9:b?go.hover:"white",highlighted:a,style:[{alignItems:"stretch"},t,{backgroundColor:l?go.hover:null},i&&{backgroundColor:go.b9,zIndex:100}],"data-focus-key":n.id,onMouseEnter:()=>f&&f(n.id),children:[(0,wo.jsx)(nj,{exposed:null==n.transfer_acct&&(l||i||s),focused:"select"===u,selected:i,onSelect:()=>{m({type:"select",id:n.id})}}),(0,wo.jsx)(Xw,{value:(n.transfer_acct?"Transfer: ":"")+n.name,valueStyle:!i&&n.transfer_acct&&{color:go.n7},exposed:"name"===u,width:"flex",onUpdate:e=>!n.transfer_acct&&h(g,"name",e),onExpose:()=>p(g,"name"),inputProps:{readOnly:!!n.transfer_acct}}),(0,wo.jsx)(eL,{ruleCount:r,focused:"rule-count"===u,onEdit:()=>p(g,"rule-count"),onClick:()=>r>0?c(n.id):d(n.id)})]})}));const nL=h.forwardRef(((e,t)=>{let{payees:n,ruleCounts:r,navigator:o,categoryGroups:i,highlightedRows:a,ruleActions:l,onUpdate:s,onViewRules:u,onCreateRule:c}=e,[d,f]=(0,h.useState)(null),p=Rx();(0,h.useLayoutEffect)((()=>{let e=[...p][0];t.current.scrollTo(e,"center"),o.onEdit(e,"select")}),[]);let y=(0,h.useCallback)((e=>{f(e)}),[]);return(0,wo.jsx)(Ll,{style:[{flex:1}],onMouseLeave:()=>f(null),children:(0,wo.jsx)(sj,{ref:t,items:n,navigator:o,renderItem:e=>{let{item:t,editing:n,focusedField:o,onEdit:l}=e;return(0,wo.jsx)(tL,{payee:t,ruleCount:r.get(t.id)||0,categoryGroups:i,selected:p.has(t.id),highlighted:a&&a.has(t.id),editing:n,focusedField:o,hovered:d===t.id,onHover:y,onEdit:l,onUpdate:s,onViewRules:u,onCreateRule:c})}})})}));function rL(){let e=go.border,t=Ix(),n=Rx();return(0,wo.jsx)(Ll,{children:(0,wo.jsxs)(oj,{borderColor:e,style:{backgroundColor:"white",color:go.n4,zIndex:200,userSelect:"none"},collapsed:!0,version:"v2",children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,selected:n.size>0,onSelect:()=>t({type:"select-all"})}),(0,wo.jsx)(Vw,{value:"Name",width:"flex"})]})})}function oL(e){let{text:t,style:n}=e;return(0,wo.jsx)(Ll,{style:[{textAlign:"center",color:go.n7,fontStyle:"italic",fontSize:13,marginTop:5},n],children:t})}function iL(e){let{payeesById:t,selectedPayees:n,onDelete:r,onMerge:o,onClose:i}=e,a=[...n].some((e=>null==t[e]||t[e].transfer_acct));return(0,wo.jsx)(Ps,{position:"bottom",width:250,style:{padding:0},onClose:i,children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{switch(i(),e){case"delete":r();break;case"merge":o()}},footer:(0,wo.jsx)(Ll,{style:{padding:3,fontSize:11,fontStyle:"italic",color:go.n7},children:[...n].slice(0,4).map((e=>t[e].name)).join(", ")+(n.size>4?", and more":"")}),items:[{icon:ws,name:"delete",text:"Delete",disabled:a},{icon:XN,iconSize:9,name:"merge",text:"Merge",disabled:a||n.size<2},Hs.line]})})}const aL=h.forwardRef(((e,t)=>{let{modalProps:n,payees:r,ruleCounts:o,categoryGroups:i,initialSelectedIds:a,ruleActions:l,onBatchChange:s,onViewRules:u,onCreateRule:c,...d}=e,[f,p]=(0,h.useState)(null),[y,g]=(0,h.useState)(""),m=(0,h.useRef)(null),v=(0,h.useRef)(null),b=(0,h.useRef)(!1),x=(0,h.useMemo)((()=>""===y?r:r.filter((e=>e.name.toLowerCase().includes(y.toLowerCase())))),[r,y]),w=Ax("payees",x,a);function j(e){y!==e&&(m.current&&m.current.setRowAnimation(!1),g(e),b.current=!0)}function S(e){j(""),v.current=e}(0,h.useEffect)((()=>{b.current&&(setTimeout((()=>{m.current&&m.current.setRowAnimation(!0)}),0),b.current=!1)})),(0,h.useImperativeHandle)(t,(()=>({selectRows:(e,t)=>{T.onEdit(null),w.dispatch({type:"select-all",ids:e}),p(null),t&&e.length>0&&S(e[0])},highlightRow:e=>{T.onEdit(null),p(new Set([e])),S(e)}}))),(0,h.useEffect)((()=>{f&&p(null)}),[f]),(0,h.useLayoutEffect)((()=>{v.current&&(m.current.scrollTo(v.current),v.current=null)}));let k=(e=>{const t=(0,h.useRef)(),n=(0,h.useCallback)((function(){return t.current(...arguments)}),[]);return(0,h.useLayoutEffect)((()=>{t.current=e})),n})(((e,t,n)=>{r.find((t=>t.id===e))[t]!==n&&s({updated:[{id:e,[t]:n}]})})),C=(0,h.useCallback)((()=>x.filter((e=>null==e.transfer_acct)).map((e=>e.id))),[x]);function _(){s({deleted:[...w.items].map((e=>({id:e})))}),w.dispatch({type:"select-none"})}async function O(){let e=[...w.items];await d.onMerge(e),T.onEdit(e[0],"name"),w.dispatch({type:"select-none"}),S(e[0])}let E=0===w.items.size,T=uj(x,(e=>["select","name","rule-count"].filter((t=>"select"!==t||null==e.transfer_acct)))),P=ZN(r);return(0,wo.jsxs)(Ll,{style:{height:"100%"},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",padding:"0 10px 5px"},children:[(0,wo.jsx)(dD,{initialState:{menuOpen:!1},children:e=>{let{state:t,setState:n}=e;return(0,wo.jsxs)(Ll,{children:[(0,wo.jsxs)(zl,{bare:!0,style:{marginRight:10},disabled:E,onClick:()=>n({menuOpen:!0}),children:[E?"No payees selected":w.items.size+" "+JN(w.items.size,"payee","payees"),(0,wo.jsx)(Nl,{width:8,height:8,style:{marginLeft:5}})]}),t.menuOpen&&(0,wo.jsx)(iL,{payeesById:P,selectedPayees:w.items,onClose:()=>n({menuOpen:!1}),onDelete:_,onMerge:O})]})}}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(Vl,{placeholder:"Filter payees...",value:y,onChange:e=>{j(e.target.value),T.onEdit(null)},style:{width:350,borderColor:"transparent",backgroundColor:go.n11,":focus":{backgroundColor:"white","::placeholder":{color:go.n8}}}})]}),(0,wo.jsx)(Nx,{instance:w,fetchAllIds:C,children:(0,wo.jsxs)(Ll,{style:{flex:1,border:"1px solid "+go.border,borderRadius:4,overflow:"hidden"},children:[(0,wo.jsx)(rL,{}),0===x.length?(0,wo.jsx)(oL,{text:"No payees",style:{marginTop:15}}):(0,wo.jsx)(nL,{ref:m,payees:x,ruleCounts:o,categoryGroups:i,highlightedRows:f,navigator:T,onUpdate:k,onViewRules:u,onCreateRule:c})]})})]})}));var lL=de((e=>({initialPayees:e.queries.payees,lastUndoState:e.app.lastUndoState,categoryGroups:e.queries.categories.grouped})),e)((function(e){let{modalProps:t,initialSelectedIds:n,lastUndoState:r,initialPayees:o,categoryGroups:i,initiallyLoadPayees:a,getPayees:l,setLastUndoState:s,pushModal:u}=e,[c,d]=(0,h.useState)(o),[f,p]=(0,h.useState)({value:new Map}),y=(0,h.useRef)();async function g(){let e=await qe("payees-get-rule-counts");e=new Map(Object.entries(e)),p({value:e})}async function m(e){let{tables:t,messages:n,meta:r,url:o}=e;(t.includes("payees")||t.includes("payee_mapping"))&&(d(await l()),(r&&r.targetId||n.find((e=>"rules"===e.dataset)))&&g(),s(null))}return(0,h.useEffect)((()=>{!async function(){let e=await a();await new Promise((e=>setTimeout(e,100))),e&&d(e),g()}();let e=Ye("sync-event",(async e=>{let{type:t,tables:n}=e;"applied"===t&&n.includes("rules")&&g()}));return()=>{e()}}),[]),(0,h.useEffect)((()=>(r.current&&m(r.current,!0),Ye("undo-event",m))),[]),(0,wo.jsx)(aL,{ref:y,modalProps:t,payees:c,ruleCounts:f.value,categoryGroups:i,initialSelectedIds:n,lastUndoState:r,onBatchChange:e=>{qe("payees-batch-change",e),d(Er(e,c))},onMerge:async e=>{let[t,...n]=e;await qe("payees-merge",{targetId:t,mergeIds:n});let r=c.filter((e=>!n.includes(e.id)));n.forEach((e=>{let n=f.value.get(e)||0;f.value.set(t,(f.value.get(t)||0)+n)})),d(r),p({value:f.value})},onViewRules:function(e){u("manage-rules",{payeeId:e})},onCreateRule:function(e){u("edit-rule",{rule:{stage:null,conditionsOp:"and",conditions:[{field:"payee",op:"is",value:e,type:"id"}],actions:[{op:"set",field:"category",value:null,type:"id"}]}})}})}));function sL(){let e=Ni();return(0,wo.jsx)(oT,{title:"Payees",children:(0,wo.jsx)(lL,{initialSelectedIds:e.state&&e.state.selectedPayee?[e.state.selectedPayee]:null})})}function uL(e){Lf(1,arguments);var t=zf(e);return t.setHours(0,0,0,0),t}var cL=864e5;function dL(e,t){Lf(2,arguments);var n=uL(e),r=uL(t),o=n.getTime()-bp(n),i=r.getTime()-bp(r);return Math.round((o-i)/cL)}var fL=function(e){let{amount:t}=e;return(0,wo.jsxs)(Ms,{style:[mo.smallText,{color:t<0?go.r5:go.g5}],children:[t>=0?"+":"",zr(t)]})};function pL(e){return e.slice(0,7)}function hL(e){return e}async function yL(e,t){let n=await Promise.all(e.map((e=>pr(e).then((e=>{let{data:t}=e;return t})))));t(n)}function gL(e,t,n){const r={};return e.forEach((e=>{r[n?n(e[t]):e[t]]=e})),r}function mL(e,t,n){return async(r,o)=>{function i(r){let o=fr("transactions").filter({$and:[{date:{$transform:"$month",$gte:e}},{date:{$transform:"$month",$lte:t}}],"account.offbudget":!1,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]});return n?o.groupBy({$month:"$date"}).select([{date:{$month:"$date"}},{amount:{$sum:"$amount"}}]):o.groupBy("date").select(["date",{amount:{$sum:"$amount"}}])}return yL([fr("transactions").filter({date:{$transform:"$month",$lt:e},"account.offbudget":!1}).calculate({$sum:"$amount"}),i().filter({amount:{$gt:0}}),i().filter({amount:{$lt:0}})],(r=>{o(function(e,t,n,r){let[o,i,a]=e;const l=r?lh(ch(t),ch(n)):function(e,t){return sh(e,t,!0)}(t,n),s=gL(i,"date",r?pL:hL),u=gL(a,"date",r?pL:hL);let c=o,d=0,f=0;const p=l.reduce(((e,t)=>{let n=0,o=0;s[t]&&(n=s[t].amount),u[t]&&(o=u[t].amount),d+=o,f+=n,c+=n+o;const i=lk(t),a=(0,wo.jsxs)("div",{children:[(0,wo.jsx)("div",{style:{marginBottom:10},children:(0,wo.jsx)("strong",{children:Hp(i,r?"MMMM yyyy":"MMMM d, yyyy")})}),(0,wo.jsxs)("div",{style:{lineHeight:1.5},children:[(0,wo.jsx)(Ks,{left:"Income:",right:zr(n)}),(0,wo.jsx)(Ks,{left:"Expenses:",right:zr(o)}),(0,wo.jsx)(Ks,{left:"Change:",right:(0,wo.jsx)("strong",{children:zr(n+o)})}),(0,wo.jsx)(Ks,{left:"Balance:",right:zr(c)})]})]});return e.income.push({x:i,y:Vr(n)}),e.expenses.push({x:i,y:Vr(o)}),e.balances.push({x:i,y:Vr(c),premadeLabel:a,amount:c}),e}),{expenses:[],income:[],balances:[]}),{balances:h}=p;return{graphData:p,balance:h[h.length-1].amount,totalExpenses:d,totalIncome:f,totalChange:h[h.length-1].amount-h[0].amount}}(r,e,t,n))}))}}var vL=n(5322),bL=n.n(vL),xL=n(6608),wL=n.n(xL),jL=n(1324),SL=n.n(jL),kL=n(4082),CL=n.n(kL);function _L(e){return function(e){if(Array.isArray(e))return OL(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return OL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OL(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EL(e){return Array.isArray(e)&&e.length>0}function TL(e){return Array.isArray(e)&&e.some((function(e){return"string"===typeof e}))}function PL(e){return Array.isArray(e)&&e.some((function(e){return e instanceof Date}))}function AL(e){return EL(e)&&e.every(Array.isArray)}function ML(e){return e.filter((function(e){return void 0!==e}))}function DL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=e.concat(n);return PL(o)?new Date(Math.max.apply(Math,_L(o))):Math.max.apply(Math,_L(o))}function IL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=e.concat(n);return PL(o)?new Date(Math.min.apply(Math,_L(o))):Math.min.apply(Math,_L(o))}var RL=n(8034),NL=n.n(RL),LL=n(4008),FL=n.n(LL);function BL(e,t){return(e.key||t).toString()}function zL(e){return e.reduce((function(e,t,n){return e[BL(t,n)]=t,e}),{})}function UL(e,t){var n=!1,r=NL()(e).reduce((function(e,r){return r in t||(n=!0,e[r]=!0),e}),{});return n&&r}function WL(e){return e.type&&e.type.getData?e.type.getData(e.props):e.props&&e.props.data||!1}function HL(e,t){var n=!1,r=!1,o=function(e,t){if(!t||e.type!==t.type)return{};var o=function(e,t){var n=e&&zL(e),r=t&&zL(t);return{entering:n&&UL(r,n),exiting:r&&UL(n,r)}}(WL(e),WL(t))||{},i=o.entering,a=o.exiting;return n=n||!!a,r=r||!!i,{entering:i||!1,exiting:a||!1}},i=function(e,t){return e.map((function(n,r){return n&&n.props&&n.props.children&&t[r]?i(h.Children.toArray(e[r].props.children),h.Children.toArray(t[r].props.children)):o(n,t[r])}))},a=i(h.Children.toArray(e),h.Children.toArray(t));return{nodesWillExit:n,nodesWillEnter:r,childrenTransitions:a,nodesShouldEnter:!1}}function KL(e,t,n){var r=t&&t.nodesWillExit,o=t&&t.nodesWillEnter,i=t&&t.nodesShouldEnter,a=t&&t.nodesShouldLoad,l=t&&t.nodesDoneLoad,s=t&&t.childrenTransitions||[],u={enter:e.animate&&e.animate.onEnter&&e.animate.onEnter.duration,exit:e.animate&&e.animate.onExit&&e.animate.onExit.duration,load:e.animate&&e.animate.onLoad&&e.animate.onLoad.duration,move:e.animate&&e.animate.duration},c=function(e,t,r){return a?function(e,t,n){if((e=wL()({},e,{onEnd:n}))&&e.onLoad&&!e.onLoad.duration)return{animate:e,data:t};var r=e.onLoad&&e.onLoad.after?e.onLoad.after:FL();return{animate:e,data:t=t.map((function(e,n){return wL()({},e,r(e,n,t))}))}}(r,t,(function(){n({nodesShouldLoad:!1,nodesDoneLoad:!0})})):function(e,t,n,r){if((e=wL()({},e,{onEnd:r}))&&e.onLoad&&!e.onLoad.duration)return{animate:e,data:n};var o=e.onLoad&&e.onLoad.before?e.onLoad.before:FL();return{animate:e,data:n=n.map((function(e,t){return wL()({},e,o(e,t,n))})),clipWidth:0}}(r,0,t,(function(){n({nodesDoneLoad:!0})}))},d=function(e,t,r,o){return function(e,t,n,r,o){var i=e&&e.onExit;if(e=wL()({},e,i),r){e.onEnd=o;var a=e.onExit&&e.onExit.before?e.onExit.before:FL();n=n.map((function(e,t){var o=(e.key||t).toString();return r[o]?wL()({},e,a(e,t,n)):e}))}return{animate:e,data:n}}(o,0,r,e,(function(){n({nodesWillExit:!1})}))},f=function(e,t,r,o){return i?function(e,t,n,r){var o=e&&e.onEnter;if(e=wL()({},e,o),n){e.onEnd=r;var i=e.onEnter&&e.onEnter.after?e.onEnter.after:FL();t=t.map((function(e,r){var o=BL(e,r);return n[o]?wL()({},e,i(e,r,t)):e}))}return{animate:e,data:t}}(o,r,e,(function(){n({nodesWillEnter:!1})})):function(e,t,n,r,o){if(r){var i=(e=wL()({},e,{onEnd:o})).onEnter&&e.onEnter.before?e.onEnter.before:FL();n=n.map((function(e,t){var o=(e.key||t).toString();return r[o]?wL()({},e,i(e,t,n)):e}))}return{animate:e,data:n}}(o,0,r,e,(function(){n({nodesShouldEnter:!0})}))},p=function(e,t){var n=e.props.animate;if(!e.type)return{};var r=e.props&&e.props.polar&&e.type.defaultPolarTransitions||e.type.defaultTransitions;if(r){var o=n[t]&&n[t].duration;return void 0!==o?o:r[t]&&r[t].duration}return{}};return function(n,a){var h=WL(n)||[],y=SL()({},e.animate,n.props.animate),g=n.props.polar&&n.type.defaultPolarTransitions||n.type.defaultTransitions;y.onExit=SL()({},y.onExit,g&&g.onExit),y.onEnter=SL()({},y.onEnter,g&&g.onEnter),y.onLoad=SL()({},y.onLoad,g&&g.onLoad);var m=s[a]||s[0];if(!l){var v={duration:void 0!==u.load?u.load:p(n,"onLoad")};return c(0,h,wL()({},y,v))}if(r){var b=m&&m.exiting,x=void 0!==u.exit?u.exit:p(n,"onExit"),w=b?{duration:x}:{delay:x};return d(b,0,h,wL()({},y,w))}if(o){var j=m&&m.entering,S=void 0!==u.enter?u.enter:p(n,"onEnter"),k=void 0!==u.move?u.move:n.props.animate&&n.props.animate.duration,C={duration:i&&j?S:k};return f(j,0,h,wL()({},y,C))}return!t&&y&&y.onExit?function(e,t){var n=e.onEnter&&e.onEnter.after?e.onEnter.after:FL();return{data:t.map((function(e,r){return wL()({},e,n(e,r,t))}))}}(y,h):{animate:y,data:h}}}function $L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function VL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$L(Object(n),!0).forEach((function(t){qL(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qL(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(s){l=!0,o=s}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return YL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YL(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var QL={nodesShouldLoad:!1,nodesDoneLoad:!1,animating:!0},XL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:QL,t=GL(h.useState(e),2),n=t[0],r=t[1],o=h.useCallback((function(e){r((function(t){return VL(VL({},t),e)}))}),[r]),i=h.useCallback((function(e,t,r){if(null===e||void 0===e||!e.animate)return t.props.animate;var i=e.animate&&e.animate.getTransitions,a=function(){var e=n&&n.childrenTransitions;return e=AL(e)?e[r]:e,SL()({childrenTransitions:e},n)}(),l=e.animate&&e.animate.parentState||a;if(!i){var s=KL(e,a,(function(e){return o(e)}));i=function(e){return s(e,r)}}return SL()({getTransitions:i,parentState:l},e.animate,t.props.animate)}),[n,o]),a=h.useCallback((function(e,t){if(null!==e&&void 0!==e&&e.animate)if(e.animate.parentState){var n=e.animate.parentState.nodesWillExit?e:null,r=SL()({oldProps:n,nextProps:t},e.animate.parentState);o(r)}else{var i=h.Children.toArray(e.children),a=h.Children.toArray(t.children),l=function(e){var t=function(e){return e.type&&e.type.continuous};return Array.isArray(e)?CL()(e,t):t(e)},s=!e.polar&&CL()(i,(function(e){return l(e)||e.props.children&&l(e.props.children)})),u=HL(i,a),c=u.nodesWillExit,d=u.nodesWillEnter,f=u.childrenTransitions,p=u.nodesShouldEnter;o({nodesWillExit:c,nodesWillEnter:d,nodesShouldEnter:p,childrenTransitions:AL(f)?f[0]:f,oldProps:c?e:void 0,nextProps:t,continuous:s})}}),[o]),l=h.useCallback((function(e){return n&&n.nodesWillExit&&n.oldProps||e}),[n]);return{state:n,setState:o,getAnimationProps:i,setAnimationState:a,getProps:l}},ZL=n(5510),JL=n.n(ZL),eF=n(3686),tF=n.n(eF),nF=n(6405),rF=n.n(nF);function oF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function iF(e){var t=function(e){return void 0!==e},n=e._x,r=e._x1,o=e._x0,i=e._voronoiX,a=e._y,l=e._y1,s=e._y0,u=e._voronoiY,c=t(r)?r:n,d=t(l)?l:a,f={x:t(i)?i:c,x0:t(o)?o:n,y:t(u)?u:d,y0:t(s)?s:a};return SL()({},f,e)}function aF(e,t){var n=e.scale,r=e.polar,o=e.horizontal,i=iF(t),a=e.origin||{x:0,y:0},l=o?n.y(i.y):n.x(i.x),s=o?n.y(i.y0):n.x(i.x0),u=o?n.x(i.x):n.y(i.y),c=o?n.x(i.x0):n.y(i.y0);return{x:r?u*Math.cos(l)+a.x:l,x0:r?c*Math.cos(s)+a.x:s,y:r?-u*Math.sin(l)+a.y:u,y0:r?-c*Math.sin(s)+a.x:c}}function lF(e){var t=e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"padding"],n="number"===typeof t?t:0,r="object"===typeof t?t:{};return{top:r.top||n,bottom:r.bottom||n,left:r.left||n,right:r.right||n}}function sF(e){return"tooltip"===(e&&e.type&&e.type.role)}function uF(e,t){var n=e.theme,r=void 0===n?{}:n,o=e.labelComponent,i=r[t]&&r[t].style||{};if(!sF(o))return i;var a=r.tooltip&&r.tooltip.style||{},l=SL()({},a,i.labels);return SL()({},{labels:l},i)}function cF(e,t){var n="100%",r="100%";if(!e)return SL()({parent:{height:r,width:n}},t);var o=e.data,i=e.labels,a=e.parent,l=t&&t.parent||{},s=t&&t.labels||{},u=t&&t.data||{};return{parent:SL()({},a,l,{width:n,height:r}),labels:SL()({},i,s),data:SL()({},o,u)}}function dF(e,t){return rF()(e)?e(t):e}function fF(e,t){return t.disableInlineStyles?{}:e&&NL()(e).some((function(t){return rF()(e[t])}))?NL()(e).reduce((function(n,r){return n[r]=dF(e[r],t),n}),{}):e}function pF(e){return"number"===typeof e?e*(Math.PI/180):e}function hF(e){return"number"===typeof e?e/(Math.PI/180):e}function yF(e){var t=lF(e),n=t.left,r=t.right,o=t.top,i=t.bottom,a=e.width,l=e.height;return Math.min(a-n-r,l-o-i)/2}function gF(e){var t=e.width,n=e.height,r=lF(e),o=r.top,i=r.bottom,a=r.left,l=r.right,s=Math.min(t-a-l,n-o-i)/2,u=t/2+a-l,c=n/2+o-i;return{x:u+s>t?s+a-l:u,y:c+s>n?s+o-i:c}}function mF(e,t){return e.range&&e.range[t]?e.range[t]:e.range&&Array.isArray(e.range)?e.range:e.polar?function(e,t){return"x"===t?[pF(e.startAngle||0),pF(e.endAngle||360)]:[e.innerRadius||0,yF(e)]}(e,t):function(e,t){var n="x"!==t,r=lF(e);return n?[e.height-r.bottom,r.top]:[r.left,e.width-r.right]}(e,t)}function vF(e){return rF()(e)?e:null===e||void 0===e?function(e){return e}:tF()(e)}function bF(e,t,n){var r=oF(e.theme&&e.theme[n]?e.theme[n]:{},["style"]),o=function(e){if(void 0!==e.horizontal||!e.children)return e.horizontal;var t=function(e){return e.reduce((function(e,n){var r=n.props||{};return e||r.horizontal||!r.children?e=e||r.horizontal:t(h.Children.toArray(r.children))}),!1)};return t(h.Children.toArray(e.children))}(e),i=void 0===o?{}:{horizontal:o};return SL()(i,e,r,t)}function xF(e,t){return t?"x"===e?"y":"x":e}function wF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(e,t){return e.concat(t)},i=["data","domain","categories","polar","startAngle","endAngle","minDomain","maxDomain","horizontal"],a=function(e,l,s){return e.reduce((function(e,r,u){var c=r.type&&r.type.role,d=r.props.name||"".concat(c,"-").concat(l[u]);if(r.props&&r.props.children){var f=wL()({},r.props,JL()(n,i)),p=r.type&&"stack"===r.type.role&&rF()(r.type.getChildren)?r.type.getChildren(f):h.Children.toArray(r.props.children).map((function(e){var t=wL()({},e.props,JL()(f,i));return h.cloneElement(e,t)})),y=p.map((function(e,t){return"".concat(d,"-").concat(t)})),g=a(p,y,r);e=o(e,g)}else{var m=t(r,d,s);m&&(e=o(e,m))}return e}),r)},l=e.map((function(e,t){return t}));return a(e,l)}function jF(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(s){l=!0,o=s}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return SF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SF(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function CF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _F={startsWith:["data-","aria-"],exactMatch:[]},OF=function(e){return!(!function(e){var t=!1;return _F.startsWith.forEach((function(n){new RegExp("\\b(".concat(n,")(\\w|-)+"),"g").test(e)&&(t=!0)})),t}(e)&&!function(e){return _F.exactMatch.includes(e)}(e))},EF=function(e,t){return"function"===typeof e?e(t):e},TF=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kF(Object(n),!0).forEach((function(t){CF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return Object.fromEntries(Object.entries(t).filter((function(e){var t=jF(e,1)[0];return OF(t)})).map((function(t){var n=jF(t,2),r=n[0],o=n[1];return[r,EF(o,e)]})))},PF=function(e,t){return h.cloneElement(e,TF(t))},AF=n(4222),MF=n.n(AF),DF=n(3809),IF=n.n(DF),RF=n(3172),NF=n.n(RF),LF=n(4564),FF=n.n(LF),BF=n(3978),zF=n.n(BF),UF=n(8901),WF=n.n(UF),HF=n(2853),KF=n.n(HF),$F=n(6366),VF=n.n($F),qF=n(8649),GF=n.n(qF),YF=n(9546),QF=n.n(YF),XF=n(2783),ZF=n.n(XF),JF=n(3329),eB=n.n(JF),tB=n(3129),nB=n.n(tB),rB=n(4209),oB=n.n(rB),iB=n(5876),aB=n.n(iB),lB=n(4154),sB=n.n(lB),uB=n(6568),cB=n.n(uB),dB=n(9945),fB=n.n(dB);function pB(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function hB(e,t){switch(arguments.length){case 0:break;case 1:"function"===typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"===typeof t?this.interpolator(t):this.range(t)}return this}class yB extends Map{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xB;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(mB(this,e))}has(e){return super.has(mB(this,e))}set(e,t){return super.set(vB(this,e),t)}delete(e){return super.delete(bB(this,e))}}class gB extends Set{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xB;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const n of e)this.add(n)}has(e){return super.has(mB(this,e))}add(e){return super.add(vB(this,e))}delete(e){return super.delete(bB(this,e))}}function mB(e,t){let{_intern:n,_key:r}=e;const o=r(t);return n.has(o)?n.get(o):t}function vB(e,t){let{_intern:n,_key:r}=e;const o=r(t);return n.has(o)?n.get(o):(n.set(o,t),t)}function bB(e,t){let{_intern:n,_key:r}=e;const o=r(t);return n.has(o)&&(t=n.get(o),n.delete(o)),t}function xB(e){return null!==e&&"object"===typeof e?e.valueOf():e}const wB=Symbol("implicit");function jB(){var e=new yB,t=[],n=[],r=wB;function o(o){let i=e.get(o);if(void 0===i){if(r!==wB)return r;e.set(o,i=t.push(o)-1)}return n[i%n.length]}return o.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new yB;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return o},o.range=function(e){return arguments.length?(n=Array.from(e),o):n.slice()},o.unknown=function(e){return arguments.length?(r=e,o):r},o.copy=function(){return jB(t,n).unknown(r)},pB.apply(o,arguments),o}function SB(){var e,t,n=jB().unknown(void 0),r=n.domain,o=n.range,i=0,a=1,l=!1,s=0,u=0,c=.5;function d(){var n=r().length,d=a<i,f=d?a:i,p=d?i:a;e=(p-f)/Math.max(1,n-s+2*u),l&&(e=Math.floor(e)),f+=(p-f-e*(n-s))*c,t=e*(1-s),l&&(f=Math.round(f),t=Math.round(t));var h=function(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),i=new Array(o);++r<o;)i[r]=e+r*n;return i}(n).map((function(t){return f+e*t}));return o(d?h.reverse():h)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([i,a]=e,i=+i,a=+a,d()):[i,a]},n.rangeRound=function(e){return[i,a]=e,i=+i,a=+a,l=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(l=!!e,d()):l},n.padding=function(e){return arguments.length?(s=Math.min(1,u=+e),d()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),d()):s},n.paddingOuter=function(e){return arguments.length?(u=+e,d()):u},n.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),d()):c},n.copy=function(){return SB(r(),[i,a]).round(l).paddingInner(s).paddingOuter(u).align(c)},pB.apply(d(),arguments)}function kB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return kB(t())},e}function CB(){return kB(SB.apply(null,arguments).paddingInner(1))}var _B=Math.sqrt(50),OB=Math.sqrt(10),EB=Math.sqrt(2);function TB(e,t,n){var r,o,i,a,l=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(a=PB(e,t,n))||!isFinite(a))return[];if(a>0){let n=Math.round(e/a),r=Math.round(t/a);for(n*a<e&&++n,r*a>t&&--r,i=new Array(o=r-n+1);++l<o;)i[l]=(n+l)*a}else{a=-a;let n=Math.round(e*a),r=Math.round(t*a);for(n/a<e&&++n,r/a>t&&--r,i=new Array(o=r-n+1);++l<o;)i[l]=(n+l)/a}return r&&i.reverse(),i}function PB(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=_B?10:i>=OB?5:i>=EB?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=_B?10:i>=OB?5:i>=EB?2:1)}function AB(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=_B?o*=10:i>=OB?o*=5:i>=EB&&(o*=2),t<e?-o:o}function MB(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function DB(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function IB(e){let t,n,r;function o(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(o<i){if(0!==t(r,r))return i;do{const t=o+i>>>1;n(e[t],r)<0?o=t+1:i=t}while(o<i)}return o}return 2!==e.length?(t=MB,n=(t,n)=>MB(e(t),n),r=(t,n)=>e(t)-n):(t=e===MB||e===DB?e:RB,n=e,r=e),{left:o,center:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=o(e,t,n,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length)-1);return i>n&&r(e[i-1],t)>-r(e[i],t)?i-1:i},right:function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;if(o<i){if(0!==t(r,r))return i;do{const t=o+i>>>1;n(e[t],r)<=0?o=t+1:i=t}while(o<i)}return o}}}function RB(){return 0}function NB(e){return null===e?NaN:+e}const LB=IB(MB),FB=LB.right;LB.left,IB(NB).center;var BB=FB;function zB(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function UB(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function WB(){}var HB=.7,KB=1/HB,$B="\\s*([+-]?\\d+)\\s*",VB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GB=/^#([0-9a-f]{3,8})$/,YB=new RegExp(`^rgb\\(${$B},${$B},${$B}\\)$`),QB=new RegExp(`^rgb\\(${qB},${qB},${qB}\\)$`),XB=new RegExp(`^rgba\\(${$B},${$B},${$B},${VB}\\)$`),ZB=new RegExp(`^rgba\\(${qB},${qB},${qB},${VB}\\)$`),JB=new RegExp(`^hsl\\(${VB},${qB},${qB}\\)$`),ez=new RegExp(`^hsla\\(${VB},${qB},${qB},${VB}\\)$`),tz={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 nz(){return this.rgb().formatHex()}function rz(){return this.rgb().formatRgb()}function oz(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=GB.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?iz(t):3===n?new sz(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?az(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?az(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=YB.exec(e))?new sz(t[1],t[2],t[3],1):(t=QB.exec(e))?new sz(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=XB.exec(e))?az(t[1],t[2],t[3],t[4]):(t=ZB.exec(e))?az(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=JB.exec(e))?hz(t[1],t[2]/100,t[3]/100,1):(t=ez.exec(e))?hz(t[1],t[2]/100,t[3]/100,t[4]):tz.hasOwnProperty(e)?iz(tz[e]):"transparent"===e?new sz(NaN,NaN,NaN,0):null}function iz(e){return new sz(e>>16&255,e>>8&255,255&e,1)}function az(e,t,n,r){return r<=0&&(e=t=n=NaN),new sz(e,t,n,r)}function lz(e,t,n,r){return 1===arguments.length?function(e){return e instanceof WB||(e=oz(e)),e?new sz((e=e.rgb()).r,e.g,e.b,e.opacity):new sz}(e):new sz(e,t,n,null==r?1:r)}function sz(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function uz(){return`#${pz(this.r)}${pz(this.g)}${pz(this.b)}`}function cz(){const e=dz(this.opacity);return`${1===e?"rgb(":"rgba("}${fz(this.r)}, ${fz(this.g)}, ${fz(this.b)}${1===e?")":`, ${e})`}`}function dz(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fz(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pz(e){return((e=fz(e))<16?"0":"")+e.toString(16)}function hz(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gz(e,t,n,r)}function yz(e){if(e instanceof gz)return new gz(e.h,e.s,e.l,e.opacity);if(e instanceof WB||(e=oz(e)),!e)return new gz;if(e instanceof gz)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(n-r)/l+6*(n<r):n===i?(r-t)/l+2:(t-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new gz(a,l,s,e.opacity)}function gz(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function mz(e){return(e=(e||0)%360)<0?e+360:e}function vz(e){return Math.max(0,Math.min(1,e||0))}function bz(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function xz(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}zB(WB,oz,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:nz,formatHex:nz,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yz(this).formatHsl()},formatRgb:rz,toString:rz}),zB(sz,lz,UB(WB,{brighter(e){return e=null==e?KB:Math.pow(KB,e),new sz(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?HB:Math.pow(HB,e),new sz(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sz(fz(this.r),fz(this.g),fz(this.b),dz(this.opacity))},displayable(){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:uz,formatHex:uz,formatHex8:function(){return`#${pz(this.r)}${pz(this.g)}${pz(this.b)}${pz(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:cz,toString:cz})),zB(gz,(function(e,t,n,r){return 1===arguments.length?yz(e):new gz(e,t,n,null==r?1:r)}),UB(WB,{brighter(e){return e=null==e?KB:Math.pow(KB,e),new gz(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?HB:Math.pow(HB,e),new gz(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new sz(bz(e>=240?e-240:e+120,o,r),bz(e,o,r),bz(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new gz(mz(this.h),vz(this.s),vz(this.l),dz(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=dz(this.opacity);return`${1===e?"hsl(":"hsla("}${mz(this.h)}, ${100*vz(this.s)}%, ${100*vz(this.l)}%${1===e?")":`, ${e})`}`}}));var wz=e=>()=>e;function jz(e,t){return function(n){return e+n*t}}function Sz(e){return 1===(e=+e)?kz:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):wz(isNaN(t)?n:t)}}function kz(e,t){var n=t-e;return n?jz(e,n):wz(isNaN(e)?t:e)}var Cz=function e(t){var n=Sz(t);function r(e,t){var r=n((e=lz(e)).r,(t=lz(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=kz(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function _z(e){return function(t){var n,r,o=t.length,i=new Array(o),a=new Array(o),l=new Array(o);for(n=0;n<o;++n)r=lz(t[n]),i[n]=r.r||0,a[n]=r.g||0,l[n]=r.b||0;return i=e(i),a=e(a),l=e(l),r.opacity=1,function(e){return r.r=i(e),r.g=a(e),r.b=l(e),r+""}}}_z((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,l=r<t-1?e[r+2]:2*i-o;return xz((n-r/t)*t,a,o,i,l)}})),_z((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],a=e[(r+1)%t],l=e[(r+2)%t];return xz((n-r/t)*t,o,i,a,l)}}));function Oz(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=new Array(o),a=new Array(r);for(n=0;n<o;++n)i[n]=Rz(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}function Ez(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Tz(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pz(e,t){var n,r={},o={};for(n in null!==e&&"object"===typeof e||(e={}),null!==t&&"object"===typeof t||(t={}),t)n in e?r[n]=Rz(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}var Az=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mz=new RegExp(Az.source,"g");function Dz(e,t){var n,r,o,i=Az.lastIndex=Mz.lastIndex=0,a=-1,l=[],s=[];for(e+="",t+="";(n=Az.exec(e))&&(r=Mz.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:Tz(n,r)})),i=Mz.lastIndex;return i<t.length&&(o=t.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(e){return function(t){return e(t)+""}}(s[0].x):function(e){return function(){return e}}(t):(t=s.length,function(e){for(var n,r=0;r<t;++r)l[(n=s[r]).i]=n.x(e);return l.join("")})}function Iz(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}}function Rz(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?wz(t):("number"===o?Tz:"string"===o?(n=oz(t))?(t=n,Cz):Dz:t instanceof oz?Cz:t instanceof Date?Ez:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?Oz:"function"!==typeof t.valueOf&&"function"!==typeof t.toString||isNaN(t)?Pz:Tz:Iz))(e,t)}function Nz(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Lz(e){return+e}var Fz=[0,1];function Bz(e){return e}function zz(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function Uz(e,t,n){var r=e[0],o=e[1],i=t[0],a=t[1];return o<r?(r=zz(o,r),i=n(a,i)):(r=zz(r,o),i=n(i,a)),function(e){return i(r(e))}}function Wz(e,t,n){var r=Math.min(e.length,t.length)-1,o=new Array(r),i=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)o[a]=zz(e[a],e[a+1]),i[a]=n(t[a],t[a+1]);return function(t){var n=BB(e,t,1,r)-1;return i[n](o[n](t))}}function Hz(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kz(){var e,t,n,r,o,i,a=Fz,l=Fz,s=Rz,u=Bz;function c(){var e=Math.min(a.length,l.length);return u!==Bz&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Wz:Uz,o=i=null,d}function d(t){return null==t||isNaN(t=+t)?n:(o||(o=r(a.map(e),l,s)))(e(u(t)))}return d.invert=function(n){return u(t((i||(i=r(l,a.map(e),Tz)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,Lz),c()):a.slice()},d.range=function(e){return arguments.length?(l=Array.from(e),c()):l.slice()},d.rangeRound=function(e){return l=Array.from(e),s=Nz,c()},d.clamp=function(e){return arguments.length?(u=!!e||Bz,c()):u!==Bz},d.interpolate=function(e){return arguments.length?(s=e,c()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}function $z(){return Kz()(Bz,Bz)}var Vz,qz=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gz(e){if(!(t=qz.exec(e)))throw new Error("invalid format: "+e);var t;return new Yz({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Yz(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Qz(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Xz(e){return(e=Qz(Math.abs(e)))?e[1]:NaN}function Zz(e,t){var n=Qz(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Gz.prototype=Yz.prototype,Yz.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Jz={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Zz(100*e,t),r:Zz,s:function(e,t){var n=Qz(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(Vz=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Qz(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function eU(e){return e}var tU,nU,rU,oU=Array.prototype.map,iU=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function aU(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?eU:(t=oU.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,i=[],a=0,l=t[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(e.substring(o-=l,o+l)),!((s+=l+1)>r));)l=t[a=(a+1)%t.length];return i.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",l=void 0===e.numerals?eU:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(oU.call(e.numerals,String)),s=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"\u2212":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=Gz(e)).fill,n=e.align,d=e.sign,f=e.symbol,p=e.zero,h=e.width,y=e.comma,g=e.precision,m=e.trim,v=e.type;"n"===v?(y=!0,v="g"):Jz[v]||(void 0===g&&(g=12),m=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===f?o:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?i:/[%p]/.test(v)?s:"",w=Jz[v],j=/[defgprs%]/.test(v);function S(e){var o,i,s,f=b,S=x;if("c"===v)S=w(e)+S,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),m&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),k&&0===+e&&"+"!==d&&(k=!1),f=(k?"("===d?d:u:"-"===d||"("===d?"":d)+f,S=("s"===v?iU[8+Vz/3]:"")+S+(k&&"("===d?")":""),j)for(o=-1,i=e.length;++o<i;)if(48>(s=e.charCodeAt(o))||s>57){S=(46===s?a+e.slice(o+1):e.slice(o))+S,e=e.slice(0,o);break}}y&&!p&&(e=r(e,1/0));var C=f.length+e.length+S.length,_=C<h?new Array(h-C+1).join(t):"";switch(y&&p&&(e=r(_+e,_.length?h-S.length:1/0),_=""),n){case"<":e=f+e+S+_;break;case"=":e=f+_+e+S;break;case"^":e=_.slice(0,C=_.length>>1)+f+e+S+_.slice(C);break;default:e=_+f+e+S}return l(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),S.toString=function(){return e+""},S}return{format:d,formatPrefix:function(e,t){var n=d(((e=Gz(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Xz(t)/3))),o=Math.pow(10,-r),i=iU[8+r/3];return function(e){return n(o*e)+i}}}}function lU(e,t,n,r){var o,i=AB(e,t,n);switch((r=Gz(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xz(t)/3)))-Xz(Math.abs(e)))}(i,a))||(r.precision=o),rU(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xz(t)-Xz(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-Xz(Math.abs(e)))}(i))||(r.precision=o-2*("%"===r.type))}return nU(r)}function sU(e){var t=e.domain;return e.ticks=function(e){var n=t();return TB(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return lU(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,i=t(),a=0,l=i.length-1,s=i[a],u=i[l],c=10;for(u<s&&(o=s,s=u,u=o,o=a,a=l,l=o);c-- >0;){if((o=PB(s,u,n))===r)return i[a]=s,i[l]=u,t(i);if(o>0)s=Math.floor(s/o)*o,u=Math.ceil(u/o)*o;else{if(!(o<0))break;s=Math.ceil(s*o)/o,u=Math.floor(u*o)/o}r=o}return e},e}function uU(){var e=$z();return e.copy=function(){return Hz(e,uU())},pB.apply(e,arguments),sU(e)}function cU(e){var t;function n(e){return null==e||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Lz),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return cU(e).unknown(t)},e=arguments.length?Array.from(e,Lz):[0,1],sU(n)}function dU(e,t){var n,r=0,o=(e=e.slice()).length-1,i=e[r],a=e[o];return a<i&&(n=r,r=o,o=n,n=i,i=a,a=n),e[r]=t.floor(i),e[o]=t.ceil(a),e}function fU(e){return Math.log(e)}function pU(e){return Math.exp(e)}function hU(e){return-Math.log(-e)}function yU(e){return-Math.exp(-e)}function gU(e){return isFinite(e)?+("1e"+e):e<0?0:e}function mU(e){return(t,n)=>-e(-t,n)}function vU(e){const t=e(fU,pU),n=t.domain;let r,o,i=10;function a(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(i),o=function(e){return 10===e?gU:e===Math.E?Math.exp:t=>Math.pow(e,t)}(i),n()[0]<0?(r=mU(r),o=mU(o),e(hU,yU)):e(fU,pU),t}return t.base=function(e){return arguments.length?(i=+e,a()):i},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],l=t[t.length-1];const s=l<a;s&&([a,l]=[l,a]);let u,c,d=r(a),f=r(l);const p=null==e?10:+e;let h=[];if(!(i%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),a>0){for(;d<=f;++d)for(u=1;u<i;++u)if(c=d<0?u/o(-d):u*o(d),!(c<a)){if(c>l)break;h.push(c)}}else for(;d<=f;++d)for(u=i-1;u>=1;--u)if(c=d>0?u/o(-d):u*o(d),!(c<a)){if(c>l)break;h.push(c)}2*h.length<p&&(h=TB(a,l,p))}else h=TB(d,f,Math.min(f-d,p)).map(o);return s?h.reverse():h},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===i?"s":","),"function"!==typeof n&&(i%1||null!=(n=Gz(n)).precision||(n.trim=!0),n=nU(n)),e===1/0)return n;const a=Math.max(1,i*e/t.ticks().length);return e=>{let t=e/o(Math.round(r(e)));return t*i<i-.5&&(t*=i),t<=a?n(e):""}},t.nice=()=>n(dU(n(),{floor:e=>o(Math.floor(r(e))),ceil:e=>o(Math.ceil(r(e)))})),t}function bU(){const e=vU(Kz()).domain([1,10]);return e.copy=()=>Hz(e,bU()).base(e.base()),pB.apply(e,arguments),e}function xU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function wU(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jU(e){var t=1,n=e(xU(t),wU(t));return n.constant=function(n){return arguments.length?e(xU(t=+n),wU(t)):t},sU(n)}function SU(){var e=jU(Kz());return e.copy=function(){return Hz(e,SU()).constant(e.constant())},pB.apply(e,arguments)}function kU(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function CU(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function _U(e){return e<0?-e*e:e*e}function OU(e){var t=e(Bz,Bz),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(Bz,Bz):.5===n?e(CU,_U):e(kU(n),kU(1/n)):n},sU(t)}function EU(){var e=OU(Kz());return e.copy=function(){return Hz(e,EU()).exponent(e.exponent())},pB.apply(e,arguments),e}function TU(){return EU.apply(null,arguments).exponent(.5)}function PU(e){return Math.sign(e)*e*e}function AU(){var e,t=$z(),n=[0,1],r=!1;function o(n){var o=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(n));return isNaN(o)?e:r?Math.round(o):o}return o.invert=function(e){return t.invert(PU(e))},o.domain=function(e){return arguments.length?(t.domain(e),o):t.domain()},o.range=function(e){return arguments.length?(t.range((n=Array.from(e,Lz)).map(PU)),o):n.slice()},o.rangeRound=function(e){return o.range(e).round(!0)},o.round=function(e){return arguments.length?(r=!!e,o):r},o.clamp=function(e){return arguments.length?(t.clamp(e),o):t.clamp()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return AU(t.domain(),n).round(r).clamp(t.clamp()).unknown(e)},pB.apply(o,arguments),sU(o)}function MU(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n<r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function DU(e,t){let n;if(void 0===t)for(const r of e)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function IU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:MB;if(e===MB)return RU;if("function"!==typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}function RU(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function NU(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,o=arguments.length>4?arguments[4]:void 0;if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(o=void 0===o?RU:IU(o);r>n;){if(r-n>600){const i=r-n+1,a=t-n+1,l=Math.log(i),s=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*s*(i-s)/i)*(a-i/2<0?-1:1);NU(e,t,Math.max(n,Math.floor(t-a*s/i+u)),Math.min(r,Math.floor(t+(i-a)*s/i+u)),o)}const i=e[t];let a=n,l=r;for(LU(e,n,t),o(e[r],i)>0&&LU(e,n,r);a<l;){for(LU(e,a,l),++a,--l;o(e[a],i)<0;)++a;for(;o(e[l],i)>0;)--l}0===o(e[n],i)?LU(e,n,l):(++l,LU(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function LU(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function FU(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let n of e)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return DU(e);if(t>=1)return MU(e);var r,o=(r-1)*t,i=Math.floor(o),a=MU(NU(e,i).subarray(0,i+1));return a+(DU(e.subarray(i+1))-a)*(o-i)}}function BU(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NB;if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),a=+n(e[i],i,e);return a+(+n(e[i+1],i+1,e)-a)*(o-i)}}function zU(){var e,t=[],n=[],r=[];function o(){var e=0,o=Math.max(1,n.length);for(r=new Array(o-1);++e<o;)r[e-1]=BU(t,e/o);return i}function i(t){return null==t||isNaN(t=+t)?e:n[BB(r,t)]}return i.invertExtent=function(e){var o=n.indexOf(e);return o<0?[NaN,NaN]:[o>0?r[o-1]:t[0],o<r.length?r[o]:t[t.length-1]]},i.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let n of e)null==n||isNaN(n=+n)||t.push(n);return t.sort(MB),o()},i.range=function(e){return arguments.length?(n=Array.from(e),o()):n.slice()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.quantiles=function(){return r.slice()},i.copy=function(){return zU().domain(t).range(n).unknown(e)},pB.apply(i,arguments)}function UU(){var e,t=0,n=1,r=1,o=[.5],i=[0,1];function a(t){return null!=t&&t<=t?i[BB(o,t,0,r)]:e}function l(){var e=-1;for(o=new Array(r);++e<r;)o[e]=((e+1)*n-(e-r)*t)/(r+1);return a}return a.domain=function(e){return arguments.length?([t,n]=e,t=+t,n=+n,l()):[t,n]},a.range=function(e){return arguments.length?(r=(i=Array.from(e)).length-1,l()):i.slice()},a.invertExtent=function(e){var a=i.indexOf(e);return a<0?[NaN,NaN]:a<1?[t,o[0]]:a>=r?[o[r-1],n]:[o[a-1],o[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return o.slice()},a.copy=function(){return UU().domain([t,n]).range(i).unknown(e)},pB.apply(sU(a),arguments)}function WU(){var e,t=[.5],n=[0,1],r=1;function o(o){return null!=o&&o<=o?n[BB(t,o,0,r)]:e}return o.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),o):t.slice()},o.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),o):n.slice()},o.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return WU().domain(t).range(n).unknown(e)},pB.apply(o,arguments)}tU=aU({thousands:",",grouping:[3],currency:["$",""]}),nU=tU.format,rU=tU.formatPrefix;const HU=1e3,KU=60*HU,$U=60*KU,VU=24*$U,qU=7*VU,GU=30*VU,YU=365*VU,QU=new Date,XU=new Date;function ZU(e,t,n,r){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,i)=>{const a=[];if(n=o.ceil(n),i=null==i?1:Math.floor(i),!(n<r)||!(i>0))return a;let l;do{a.push(l=new Date(+n)),t(n,i),e(n)}while(l<n&&n<r);return a},o.filter=n=>ZU((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})),n&&(o.count=(t,r)=>(QU.setTime(+t),XU.setTime(+r),e(QU),e(XU),Math.floor(n(QU,XU))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(r?t=>r(t)%e===0:t=>o.count(0,t)%e===0):o:null)),o}const JU=ZU((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));JU.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?ZU((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):JU:null);JU.range;const eW=ZU((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*HU)}),((e,t)=>(t-e)/HU),(e=>e.getUTCSeconds())),tW=(eW.range,ZU((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*HU)}),((e,t)=>{e.setTime(+e+t*KU)}),((e,t)=>(t-e)/KU),(e=>e.getMinutes()))),nW=(tW.range,ZU((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*KU)}),((e,t)=>(t-e)/KU),(e=>e.getUTCMinutes()))),rW=(nW.range,ZU((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*HU-e.getMinutes()*KU)}),((e,t)=>{e.setTime(+e+t*$U)}),((e,t)=>(t-e)/$U),(e=>e.getHours()))),oW=(rW.range,ZU((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*$U)}),((e,t)=>(t-e)/$U),(e=>e.getUTCHours()))),iW=(oW.range,ZU((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*KU)/VU),(e=>e.getDate()-1))),aW=(iW.range,ZU((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/VU),(e=>e.getUTCDate()-1))),lW=(aW.range,ZU((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/VU),(e=>Math.floor(e/VU))));lW.range;function sW(e){return ZU((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*KU)/qU))}const uW=sW(0),cW=sW(1),dW=sW(2),fW=sW(3),pW=sW(4),hW=sW(5),yW=sW(6);uW.range,cW.range,dW.range,fW.range,pW.range,hW.range,yW.range;function gW(e){return ZU((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/qU))}const mW=gW(0),vW=gW(1),bW=gW(2),xW=gW(3),wW=gW(4),jW=gW(5),SW=gW(6),kW=(mW.range,vW.range,bW.range,xW.range,wW.range,jW.range,SW.range,ZU((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()))),CW=(kW.range,ZU((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),_W=(CW.range,ZU((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));_W.every=e=>isFinite(e=Math.floor(e))&&e>0?ZU((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null;_W.range;const OW=ZU((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));OW.every=e=>isFinite(e=Math.floor(e))&&e>0?ZU((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null;OW.range;function EW(e,t,n,r,o,i){const a=[[eW,1,HU],[eW,5,5*HU],[eW,15,15*HU],[eW,30,30*HU],[i,1,KU],[i,5,5*KU],[i,15,15*KU],[i,30,30*KU],[o,1,$U],[o,3,3*$U],[o,6,6*$U],[o,12,12*$U],[r,1,VU],[r,2,2*VU],[n,1,qU],[t,1,GU],[t,3,3*GU],[e,1,YU]];function l(t,n,r){const o=Math.abs(n-t)/r,i=IB((e=>{let[,,t]=e;return t})).right(a,o);if(i===a.length)return e.every(AB(t/YU,n/YU,r));if(0===i)return JU.every(Math.max(AB(t,n,r),1));const[l,s]=a[o/a[i-1][2]<a[i][2]/o?i-1:i];return l.every(s)}return[function(e,t,n){const r=t<e;r&&([e,t]=[t,e]);const o=n&&"function"===typeof n.range?n:l(e,t,n),i=o?o.range(e,+t+1):[];return r?i.reverse():i},l]}const[TW,PW]=EW(OW,CW,mW,lW,oW,nW),[AW,MW]=EW(_W,kW,uW,iW,rW,tW);function DW(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function IW(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function RW(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var NW,LW,FW,BW={"-":"",_:" ",0:"0"},zW=/^\s*\d+/,UW=/^%/,WW=/[\\^$*+?|[\]().{}]/g;function HW(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i<n?new Array(n-i+1).join(t)+o:o)}function KW(e){return e.replace(WW,"\\$&")}function $W(e){return new RegExp("^(?:"+e.map(KW).join("|")+")","i")}function VW(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function qW(e,t,n){var r=zW.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function GW(e,t,n){var r=zW.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function YW(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function QW(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function XW(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ZW(e,t,n){var r=zW.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function JW(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function eH(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function tH(e,t,n){var r=zW.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function nH(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function rH(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function oH(e,t,n){var r=zW.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function iH(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function aH(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function lH(e,t,n){var r=zW.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function sH(e,t,n){var r=zW.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function uH(e,t,n){var r=zW.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function cH(e,t,n){var r=UW.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dH(e,t,n){var r=zW.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function fH(e,t,n){var r=zW.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function pH(e,t){return HW(e.getDate(),t,2)}function hH(e,t){return HW(e.getHours(),t,2)}function yH(e,t){return HW(e.getHours()%12||12,t,2)}function gH(e,t){return HW(1+iW.count(_W(e),e),t,3)}function mH(e,t){return HW(e.getMilliseconds(),t,3)}function vH(e,t){return mH(e,t)+"000"}function bH(e,t){return HW(e.getMonth()+1,t,2)}function xH(e,t){return HW(e.getMinutes(),t,2)}function wH(e,t){return HW(e.getSeconds(),t,2)}function jH(e){var t=e.getDay();return 0===t?7:t}function SH(e,t){return HW(uW.count(_W(e)-1,e),t,2)}function kH(e){var t=e.getDay();return t>=4||0===t?pW(e):pW.ceil(e)}function CH(e,t){return e=kH(e),HW(pW.count(_W(e),e)+(4===_W(e).getDay()),t,2)}function _H(e){return e.getDay()}function OH(e,t){return HW(cW.count(_W(e)-1,e),t,2)}function EH(e,t){return HW(e.getFullYear()%100,t,2)}function TH(e,t){return HW((e=kH(e)).getFullYear()%100,t,2)}function PH(e,t){return HW(e.getFullYear()%1e4,t,4)}function AH(e,t){var n=e.getDay();return HW((e=n>=4||0===n?pW(e):pW.ceil(e)).getFullYear()%1e4,t,4)}function MH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+HW(t/60|0,"0",2)+HW(t%60,"0",2)}function DH(e,t){return HW(e.getUTCDate(),t,2)}function IH(e,t){return HW(e.getUTCHours(),t,2)}function RH(e,t){return HW(e.getUTCHours()%12||12,t,2)}function NH(e,t){return HW(1+aW.count(OW(e),e),t,3)}function LH(e,t){return HW(e.getUTCMilliseconds(),t,3)}function FH(e,t){return LH(e,t)+"000"}function BH(e,t){return HW(e.getUTCMonth()+1,t,2)}function zH(e,t){return HW(e.getUTCMinutes(),t,2)}function UH(e,t){return HW(e.getUTCSeconds(),t,2)}function WH(e){var t=e.getUTCDay();return 0===t?7:t}function HH(e,t){return HW(mW.count(OW(e)-1,e),t,2)}function KH(e){var t=e.getUTCDay();return t>=4||0===t?wW(e):wW.ceil(e)}function $H(e,t){return e=KH(e),HW(wW.count(OW(e),e)+(4===OW(e).getUTCDay()),t,2)}function VH(e){return e.getUTCDay()}function qH(e,t){return HW(vW.count(OW(e)-1,e),t,2)}function GH(e,t){return HW(e.getUTCFullYear()%100,t,2)}function YH(e,t){return HW((e=KH(e)).getUTCFullYear()%100,t,2)}function QH(e,t){return HW(e.getUTCFullYear()%1e4,t,4)}function XH(e,t){var n=e.getUTCDay();return HW((e=n>=4||0===n?wW(e):wW.ceil(e)).getUTCFullYear()%1e4,t,4)}function ZH(){return"+0000"}function JH(){return"%"}function eK(e){return+e}function tK(e){return Math.floor(+e/1e3)}function nK(e){return new Date(e)}function rK(e){return e instanceof Date?+e:+new Date(+e)}function oK(e,t,n,r,o,i,a,l,s,u){var c=$z(),d=c.invert,f=c.domain,p=u(".%L"),h=u(":%S"),y=u("%I:%M"),g=u("%I %p"),m=u("%a %d"),v=u("%b %d"),b=u("%B"),x=u("%Y");function w(e){return(s(e)<e?p:l(e)<e?h:a(e)<e?y:i(e)<e?g:r(e)<e?o(e)<e?m:v:n(e)<e?b:x)(e)}return c.invert=function(e){return new Date(d(e))},c.domain=function(e){return arguments.length?f(Array.from(e,rK)):f().map(nK)},c.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?w:u(t)},c.nice=function(e){var n=f();return e&&"function"===typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(dU(n,e)):c},c.copy=function(){return Hz(c,oK(e,t,n,r,o,i,a,l,s,u))},c}function iK(){return pB.apply(oK(AW,MW,_W,kW,uW,iW,rW,tW,eW,LW).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function aK(){return pB.apply(oK(TW,PW,OW,CW,mW,aW,oW,nW,eW,FW).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function lK(){var e,t,n,r,o,i=0,a=1,l=Bz,s=!1;function u(t){return null==t||isNaN(t=+t)?o:l(0===n?.5:(t=(r(t)-e)*n,s?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,r;return arguments.length?([n,r]=t,l=e(n,r),u):[l(0),l(1)]}}return u.domain=function(o){return arguments.length?([i,a]=o,e=r(i=+i),t=r(a=+a),n=e===t?0:1/(t-e),u):[i,a]},u.clamp=function(e){return arguments.length?(s=!!e,u):s},u.interpolator=function(e){return arguments.length?(l=e,u):l},u.range=c(Rz),u.rangeRound=c(Nz),u.unknown=function(e){return arguments.length?(o=e,u):o},function(o){return r=o,e=o(i),t=o(a),n=e===t?0:1/(t-e),u}}function sK(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function uK(){var e=sU(lK()(Bz));return e.copy=function(){return sK(e,uK())},hB.apply(e,arguments)}function cK(){var e=vU(lK()).domain([1,10]);return e.copy=function(){return sK(e,cK()).base(e.base())},hB.apply(e,arguments)}function dK(){var e=jU(lK());return e.copy=function(){return sK(e,dK()).constant(e.constant())},hB.apply(e,arguments)}function fK(){var e=OU(lK());return e.copy=function(){return sK(e,fK()).exponent(e.exponent())},hB.apply(e,arguments)}function pK(){return fK.apply(null,arguments).exponent(.5)}function hK(){var e=[],t=Bz;function n(n){if(null!=n&&!isNaN(n=+n))return t((BB(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(MB),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map(((n,r)=>t(r/(e.length-1))))},n.quantiles=function(t){return Array.from({length:t+1},((n,r)=>FU(e,r/t)))},n.copy=function(){return hK(t).domain(e)},hB.apply(n,arguments)}function yK(){var e,t,n,r,o,i,a,l=0,s=.5,u=1,c=1,d=Bz,f=!1;function p(e){return isNaN(e=+e)?a:(e=.5+((e=+i(e))-t)*(c*e<c*t?r:o),d(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var n,r,o;return arguments.length?([n,r,o]=t,d=function(e,t){void 0===t&&(t=e,e=Rz);for(var n=0,r=t.length-1,o=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(o,o=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return i[t](e-t)}}(e,[n,r,o]),p):[d(0),d(.5),d(1)]}}return p.domain=function(a){return arguments.length?([l,s,u]=a,e=i(l=+l),t=i(s=+s),n=i(u=+u),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),c=t<e?-1:1,p):[l,s,u]},p.clamp=function(e){return arguments.length?(f=!!e,p):f},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=h(Rz),p.rangeRound=h(Nz),p.unknown=function(e){return arguments.length?(a=e,p):a},function(a){return i=a,e=a(l),t=a(s),n=a(u),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),c=t<e?-1:1,p}}function gK(){var e=sU(yK()(Bz));return e.copy=function(){return sK(e,gK())},hB.apply(e,arguments)}function mK(){var e=vU(yK()).domain([.1,1,10]);return e.copy=function(){return sK(e,mK()).base(e.base())},hB.apply(e,arguments)}function vK(){var e=jU(yK());return e.copy=function(){return sK(e,vK()).constant(e.constant())},hB.apply(e,arguments)}function bK(){var e=OU(yK());return e.copy=function(){return sK(e,bK()).exponent(e.exponent())},hB.apply(e,arguments)}function xK(){return bK.apply(null,arguments).exponent(.5)}!function(e){NW=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,i=e.days,a=e.shortDays,l=e.months,s=e.shortMonths,u=$W(o),c=VW(o),d=$W(i),f=VW(i),p=$W(a),h=VW(a),y=$W(l),g=VW(l),m=$W(s),v=VW(s),b={a:function(e){return a[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:pH,e:pH,f:vH,g:TH,G:AH,H:hH,I:yH,j:gH,L:mH,m:bH,M:xH,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:eK,s:tK,S:wH,u:jH,U:SH,V:CH,w:_H,W:OH,x:null,X:null,y:EH,Y:PH,Z:MH,"%":JH},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:DH,e:DH,f:FH,g:YH,G:XH,H:IH,I:RH,j:NH,L:LH,m:BH,M:zH,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:eK,s:tK,S:UH,u:WH,U:HH,V:$H,w:VH,W:qH,x:null,X:null,y:GH,Y:QH,Z:ZH,"%":JH},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:rH,e:rH,f:uH,g:JW,G:ZW,H:iH,I:iH,j:oH,L:sH,m:nH,M:aH,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:tH,Q:dH,s:fH,S:lH,u:GW,U:YW,V:QW,w:qW,W:XW,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:JW,Y:ZW,Z:eH,"%":cH};function j(e,t){return function(n){var r,o,i,a=[],l=-1,s=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++l<u;)37===e.charCodeAt(l)&&(a.push(e.slice(s,l)),null!=(o=BW[r=e.charAt(++l)])?r=e.charAt(++l):o="e"===r?" ":"0",(i=t[r])&&(r=i(n,o)),a.push(r),s=l+1);return a.push(e.slice(s,l)),a.join("")}}function S(e,t){return function(n){var r,o,i=RW(1900,void 0,1);if(k(i,e,n+="",0)!=n.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(r=IW(RW(i.y,0,1))).getUTCDay(),r=o>4||0===o?vW.ceil(r):vW(r),r=aW.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=DW(RW(i.y,0,1))).getDay(),r=o>4||0===o?cW.ceil(r):cW(r),r=iW.offset(r,7*(i.V-1)),i.y=r.getFullYear(),i.m=r.getMonth(),i.d=r.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?IW(RW(i.y,0,1)).getUTCDay():DW(RW(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,IW(i)):DW(i)}}function k(e,t,n,r){for(var o,i,a=0,l=t.length,s=n.length;a<l;){if(r>=s)return-1;if(37===(o=t.charCodeAt(a++))){if(o=t.charAt(a++),!(i=w[o in BW?t.charAt(a++):o])||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}return b.x=j(n,b),b.X=j(r,b),b.c=j(t,b),x.x=j(n,x),x.X=j(r,x),x.c=j(t,x),{format:function(e){var t=j(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=j(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}(e),LW=NW.format,NW.parse,FW=NW.utcFormat,NW.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var wK=["linear","time","log","sqrt"];function jK(e){return"function"===typeof e?rF()(e.copy)&&rF()(e.domain)&&rF()(e.range):"string"===typeof e&&VF()(wK,e)}function SK(e,t){return!!e.scale&&(!e.scale.x&&!e.scale.y||!!e.scale[t])}function kK(e,t){if(!e.data)return"linear";var n=vF(e[t]);return PL(e.data.map((function(e){var r=MF()(n(e))?n(e)[t]:n(e);return void 0!==r?r:e[t]})))?"time":"linear"}function CK(e){if(jK(e)){var t=function(e){return"scale".concat(function(e){return e&&e[0].toUpperCase()+e.slice(1)}(e))}(e);return i[t]()}return uU()}function _K(e,t){var n=OK(e,t);if(n)return"string"===typeof n?CK(n):n;var r=function(e,t){var n;if(e.domain&&e.domain[t]?n=e.domain[t]:e.domain&&Array.isArray(e.domain)&&(n=e.domain),n)return PL(n)?"time":"linear"}(e,t)||kK(e,t);return CK(r)}function OK(e,t){if(SK(e,t)){var n=e.scale[t]||e.scale;return jK(n)?rF()(n)?n:CK(n):void 0}}function EK(e,t){return function(e,t){if(SK(e,t)){var n=e.scale[t]||e.scale;return"string"===typeof n?n:PK(n)}}(e,t)||kK(e,t)}var TK=[{name:"quantile",method:"quantiles"},{name:"log",method:"base"}];function PK(e){if("string"===typeof e)return e;var t=TK.filter((function(t){return void 0!==e[t.method]}))[0];return t?t.name:void 0}var AK="@@__IMMUTABLE_ITERABLE__@@",MK="@@__IMMUTABLE_RECORD__@@",DK="@@__IMMUTABLE_LIST__@@";function IK(e){return!(!e||!e[AK])}function RK(e){return IK(e)||function(e){return!(!e||!e[MK])}(e)}function NK(e,t){return IK(e)?e.reduce((function(e,n,r){return t&&t[r]&&(n=NK(n)),e[r]=n,e}),function(e){return!(!e||!e[DK])}(e)?[]:{}):e}function LK(e){return function(e){if(Array.isArray(e))return FK(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return FK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FK(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function FK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BK(e){return RK(e)?NK(e,{errorX:!0,errorY:!0}):e}function zK(e){return IK(e)?e.size:e.length}function UK(e,t){var n=(MF()(e.domain)?e.domain[t]:e.domain)||_K(e,t).domain(),r=e.samples||1,o=Math.max.apply(Math,LK(n)),i=Math.min.apply(Math,LK(n)),a=(o-i)/r,l=QF()(i,o,a);return fB()(l)===o?l:l.concat(o)}function WK(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"ascending";if(!t)return e;"x"!==t&&"y"!==t||(t="_".concat(t));var r="ascending"===n?"asc":"desc";return GF()(e,t,r)}function HK(e,t){var n=1/Number.MAX_SAFE_INTEGER,r={x:EK(t,"x"),y:EK(t,"y")};if("log"!==r.x&&"log"!==r.y)return e;var o=function(e,t){return"log"!==r[t]||0!==e["_".concat(t)]};return e.map((function(e){return o(e,"x")&&o(e,"y")&&o(e,"y0")?e:function(e){var t=o(e,"x")?e._x:n,r=o(e,"y")?e._y:n,i=o(e,"y0")?e._y0:n;return wL()({},e,{_x:t,_y:r,_y0:i})}(e)}))}function KK(e,t){var n=!!e.eventKey,r=function(e){return rF()(e)?e:null===e||void 0===e?function(){}:tF()(e)}(e.eventKey);return t.map((function(e,t){if(void 0!==e.eventKey)return e;if(n){var o=r(e,t);return void 0!==o?wL()({eventKey:o},e):e}return e}))}function $K(e,t){var n=YK(e,t),r=QK(e,t),o=function(e,t){var n=Array.isArray(e.data)||IK(e.data);if(!n)return[];var r=void 0===e[t]?t:e[t],o=vF(r),i=e.data.reduce((function(e,t){return e.push(BK(t)),e}),[]),a=WK(i,e.sortKey,e.sortOrder);return a.reduce((function(e,t){return t=BK(t),e.push(o(t)),e}),[]).filter((function(e){return"string"===typeof e})).reduce((function(e,t){return void 0!==t&&null!==t&&-1===e.indexOf(t)&&e.push(t),e}),[])}(e,t),i=zF()([].concat(LK(n),LK(r),LK(o)));return 0===i.length?null:i.reduce((function(e,t,n){return e[t]=n+1,e}),{})}function VK(e,t,n){if(!(Array.isArray(e)||IK(e))||zK(e)<1)return[];var r=["x","y","y0"];n=Array.isArray(n)?n:r;var o,i=n.reduce((function(e,n){var r;return e[n]=vF(void 0!==t[r=n]?t[r]:r),e}),{}),a=cB()(n,r)&&"_x"===t.x&&"_y"===t.y&&"_y0"===t.y0;!1===a&&(o={x:-1!==n.indexOf("x")?$K(t,"x"):void 0,y:-1!==n.indexOf("y")?$K(t,"y"):void 0,y0:-1!==n.indexOf("y0")?$K(t,"y"):void 0});var l=a?e:e.reduce((function(e,t,r){var a={x:r,y:t=BK(t)},l=n.reduce((function(e,n){var r=i[n](t),l=void 0!==r?r:a[n];return void 0!==l&&("string"===typeof l&&o[n]?(e["".concat(n,"Name")]=l,e["_".concat(n)]=o[n][l]):e["_".concat(n)]=l),e}),{}),s=wL()({},l,t);return bL()(s)||e.push(s),e}),[]),s=HK(WK(l,t.sortKey,t.sortOrder),t);return KK(t,s)}function qK(e,t){return e.categories&&!Array.isArray(e.categories)?e.categories[t]:e.categories}function GK(e){return e.data?VK(e.data,e):VK(function(e){var t=UK(e,"x"),n=UK(e,"y"),r=t.map((function(e,t){return{x:e,y:n[t]}}));return r}(e),e)}function YK(e,t){var n=e.tickValues,r=e.tickFormat;return(n&&(Array.isArray(n)||n[t])?n[t]||n:r&&Array.isArray(r)?r:[]).filter((function(e){return"string"===typeof e}))}function QK(e,t){if(!e.categories)return[];var n=qK(e,t),r=n&&n.filter((function(e){return"string"===typeof e}));return r?ML(r):[]}function XK(e){var t=function(e){return e&&e.type?e.type.role:""},n=t(e);if("portal"===n){var r=h.Children.toArray(e.props.children);n=r.length?t(r[0]):""}return VF()(["area","bar","boxplot","candlestick","errorbar","group","histogram","line","pie","scatter","stack","voronoi"],n)}function ZK(e){return function(e){if(Array.isArray(e))return JK(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return JK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JK(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function JK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function e$(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"min",r=function(e){return"max"===n?Math.max.apply(Math,ZK(e)):Math.min.apply(Math,ZK(e))},o="max"===n?-1/0:1/0,i=!1,a=WF()(e).reduce((function(e,n){var o=void 0!==n["_".concat(t,"0")]?n["_".concat(t,"0")]:n["_".concat(t)],a=void 0!==n["_".concat(t,"1")]?n["_".concat(t,"1")]:n["_".concat(t)],l=r([o,a]);return i=i||o instanceof Date||a instanceof Date,r([e,l])}),o);return i?new Date(a):a}function t$(e,t,n){if(!t.domainPadding)return e;var r=c$(t,n),o=u$(t,n),i=function(e,t){var n=function(e){return Array.isArray(e)?{left:e[0],right:e[1]}:{left:e,right:e}};return MF()(e.domainPadding)?n(e.domainPadding[t]):n(e.domainPadding)}(t,n);if(!i.left&&!i.right)return e;var a=IL(e),l=DL(e),s=mF(t,xF(n,t.horizontal)),u=Math.abs(s[0]-s[1]),c=Math.max(u-i.left-i.right,1),d=Math.abs(l.valueOf()-a.valueOf())/c*u,f=d*i.left/u,p=d*i.right/u,h={min:a.valueOf()-f,max:l.valueOf()+p},y=MF()(t.singleQuadrantDomainPadding)?t.singleQuadrantDomainPadding[n]:t.singleQuadrantDomainPadding,g=function(e,t){return"min"===t&&a>=0&&e<=0||"max"===t&&l<=0&&e>=0?0:e};if((a>=0&&h.min<=0||l<=0&&h.max>=0)&&!1!==y){var m={left:Math.abs(l-a)*i.left/u,right:Math.abs(l-a)*i.right/u},v={min:g(a.valueOf()-m.left,"min"),max:g(l.valueOf()+m.right,"max")},b={left:Math.abs(v.max-v.min)*i.left/u,right:Math.abs(v.max-v.min)*i.right/u};h={min:g(a.valueOf()-b.left,"min"),max:g(l.valueOf()+b.right,"max")}}var x={min:void 0!==r?r:h.min,max:void 0!==o?o:h.max};return a instanceof Date||l instanceof Date?a$(new Date(x.min),new Date(x.max)):a$(x.min,x.max)}function n$(e,t){return e=rF()(e)?e:i$,t=rF()(t)?t:r$,function(n,r){var o=l$(n,r);if(o)return t(o,n,r);var i=qK(n,r),a=i?function(e,t,n){n=n||qK(e,t);var r=e.polar,o=e.startAngle,i=void 0===o?0:o,a=e.endAngle,l=void 0===a?360:a;if(!n)return;var s=c$(e,t),u=u$(e,t),c=TL(n)?QK(e,t):[],d=0===c.length?null:c.reduce((function(e,t,n){return e[t]=n+1,e}),{}),f=d?n.map((function(e){return d[e]})):n,p=void 0!==s?s:IL(f),h=void 0!==u?u:DL(f),y=a$(p,h);return r&&"x"===t&&360===Math.abs(i-l)?d$(y,f):y}(n,r,i):e(n,r);return a?t(a,n,r):void 0}}function r$(e,t,n){return function(e,t,n){return"log"!==EK(t,n)?e:function(e){var t=e[0]<0||e[1]<0?-1/Number.MAX_SAFE_INTEGER:1/Number.MAX_SAFE_INTEGER;return[0===e[0]?t:e[0],0===e[1]?t:e[1]]}(e)}(t$(e,t,n),t,n)}function o$(e,t){return n$()(e,t)}function i$(e,t,n){n=n||GK(e);var r=e.polar,o=e.startAngle,i=void 0===o?0:o,a=e.endAngle,l=void 0===a?360:a,s=c$(e,t),u=u$(e,t);if(n.length<1)return void 0!==s&&void 0!==u?a$(s,u):void 0;var c=a$(void 0!==s?s:e$(n,t,"min"),void 0!==u?u:e$(n,t,"max"));return r&&"x"===t&&360===Math.abs(i-l)?d$(c,function(e,t){var n="_".concat(t);return WF()(e).map((function(e){return e[n]&&void 0!==e[n][1]?e[n][1]:e[n]}))}(n,t)):c}function a$(e,t){return Number(e)===Number(t)?function(e){var t=0===e?2*Math.pow(10,-10):Math.pow(10,-10),n=e instanceof Date?new Date(Number(e)-1):Number(e)-t,r=e instanceof Date?new Date(Number(e)+1):Number(e)+t;return 0===e?[0,r]:[n,r]}(t):[e,t]}function l$(e,t){var n=c$(e,t),r=u$(e,t);return MF()(e.domain)&&e.domain[t]?e.domain[t]:Array.isArray(e.domain)?e.domain:void 0!==n&&void 0!==r?a$(n,r):void 0}function s$(e,t){var n=l$(e,t);if(n)return n;var r=GK(e),o=r.reduce((function(e,t){return t._y0<e?t._y0:e}),1/0);return n$((function(){return i$(e,t,r)}),(function(n){return r$(function(n){if("x"===t)return n;var r=o!==1/0?o:0,i=u$(e,t),a=c$(e,t),l=void 0!==i?i:DL(n,r);return a$(void 0!==a?a:IL(n,r),l)}(n),e,t)}))(e,t)}function u$(e,t){return MF()(e.maxDomain)&&void 0!==e.maxDomain[t]?e.maxDomain[t]:"number"===typeof e.maxDomain||nB()(e.maxDomain)?e.maxDomain:void 0}function c$(e,t){return MF()(e.minDomain)&&void 0!==e.minDomain[t]?e.minDomain[t]:"number"===typeof e.minDomain||nB()(e.minDomain)?e.minDomain:void 0}function d$(e,t){var n=oB()(t.sort((function(e,t){return e-t}))),r=n[1]-n[0];return[e[0],e[1]+r]}function f$(e){var t=function(e){return e&&e.type?e.type.role:""},n=t(e);if("portal"===n){var r=h.Children.toArray(e.props.children);n=r.length?t(r[0]):""}return VF()(["area","axis","bar","boxplot","candlestick","errorbar","group","histogram","line","pie","scatter","stack","voronoi"],n)}function p$(e){return function(e){if(Array.isArray(e))return h$(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return h$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h$(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y$(e){return e.dependentAxis?"y":"x"}function g$(e,t){t=t||FL();var n=function(e){return e.reduce((function(e,r){return r.type&&"axis"===r.type.role&&t(r)?e.concat(r):r.props&&r.props.children?e.concat(n(h.Children.toArray(r.props.children))):e}),[])};return n(e)}function m$(e,t){return g$(e,(function(e){return e.type.getAxis(e.props)===t}))[0]}function v$(e,t){var n=function(e){return e.reduce((function(e,r){return r.type&&"axis"===r.type.role&&function(e){return"dependent"===t?e.props.dependentAxis:!e.props.dependentAxis}(r)||r.props&&r.props.children&&n(h.Children.toArray(r.props.children)).length>0?e.concat(r):e}),[])};return n(e)}function b$(e){var t=function(e){var t=Math.min.apply(Math,p$(e)),n=Math.max.apply(Math,p$(e));return n<0?n:Math.max(0,t)};return{x:PL(e.x)?new Date(Math.min.apply(Math,p$(e.x))):t(e.x),y:PL(e.y)?new Date(Math.min.apply(Math,p$(e.y))):t(e.y)}}function x$(e,t){return PL(t)?"positive":e<=0&&Math.max.apply(Math,p$(t))<=0?"negative":"positive"}function w$(e){return{top:!1,bottom:!1,left:!0,right:!0}[e.orientation||(e.dependentAxis?"left":"bottom")]}function j$(e){return void 0!==e.tickValues&&TL(e.tickValues)}function S$(e){var t,n=y$(e),r=e.stringMap&&e.stringMap[n],o=Array.isArray(e.categories)?e.categories:e.categories&&e.categories[n],i=o&&(EL(t=o)&&t.every((function(e){return"string"===typeof e})))?o.map((function(e){return r[e]})):void 0,a=r&&IF()(r);return i&&0!==i.length?i:a}function k$(e){var t=e.tickValues,n=e.tickFormat,r=y$(e),o=e.stringMap&&e.stringMap[r],i=t;o&&(i=S$(e)),t&&TL(t)&&(i=o?t.map((function(e){return o[e]})):QF()(1,t.length+1));var a=i?zF()(i):function(){if(n&&Array.isArray(n))return TL(n)?n.map((function(e,t){return t})):n}();return Array.isArray(a)&&a.length?function(t){var n=[],o=e.domain&&e.domain[r]||e.domain;if(t)return t.forEach((function(e,t){Array.isArray(o)?e>=IL(o)&&e<=DL(o)&&n.push({value:e,index:t}):n.push({value:e,index:t})})),n}(a):void 0}function C$(e,t){var n=e.tickFormat,r=y$(e),o=e.stringMap&&e.stringMap[r];if(!n){var i=function(e){var t=e.tickValues,n=y$(e),r=e.stringMap&&e.stringMap[n],o=t&&!PL(t)?function(e){return e}:void 0;if(!r)return j$(e)?function(e,n){return t[n]}:o;var i=r&&ZF()(r),a=GF()(IF()(r),(function(e){return e})),l=a.map((function(e){return i[e]})),s=[""].concat(p$(l),[""]);return function(e){return s[e]}}(e),a=t.tickFormat&&rF()(t.tickFormat)?t.tickFormat():function(e){return e};return i||a}if(n&&Array.isArray(n)){var l=k$(e),s=null===l||void 0===l?void 0:l.map((function(e){return e.index})),u=n.filter((function(e,t){return null===s||void 0===s?void 0:s.includes(t)}));return function(e,t){return u[t]}}if(n&&rF()(n)){return o?function(t,n,r){var i=ZF()(o),a=r.map((function(e){return i[e]}));return e.tickFormat(i[t],n,a)}:n}return function(e){return e}}function _$(e,t){if(!t||!Array.isArray(e)||e.length<=t)return e;var n=Math.floor(e.length/t);return e.filter((function(e,t){return t%n===0}))}function O$(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.tickCount,o=k$(e),i=o?o.map((function(e){return e.value})):void 0;if(i)return _$(i,r);if(t.ticks&&rF()(t.ticks)){var a=r||5,l=t.ticks(a),s=_$(Array.isArray(l)&&l.length?l:t.domain(),r);if(n){var u=VF()(s,0)?KF()(s,0):s;return u.length?u:s}return s}return t.domain()}function E$(e,t){var n=e.polar,r=e.startAngle,o=void 0===r?0:r,i=e.endAngle,a=void 0===i?360:i,l=k$(e),s=l?l.map((function(e){return e.value})):void 0;if(Array.isArray(s)){var u=c$(e,t),c=u$(e,t),d=j$(e),f=s.map((function(e){return Number(e)})),p=d?1:IL(f),h=d?s.length:DL(f),y=a$(void 0!==u?u:p,void 0!==c?c:h),g=n&&"x"===t&&360===Math.abs(o-a)?d$(y,f):y;return w$(e)&&!n&&g.reverse(),g}}function T$(e,t){var n=y$(e);if(!t||t===n)return n$(E$)(e,n)}function P$(e,t){if(e.axisValue){var n="x"===t?"y":"x",r=eB()(e.scale)&&rF()(e.scale[n])?e.scale[n]:void 0;if(r){var o="x"===t?"y":"x",i=eB()(e.stringMap)&&e.stringMap[o];return r(i&&"string"===typeof e.axisValue?i[e.axisValue]:e.axisValue)}}}function A$(e,t){if(!eB()(e.theme))return bF(e,t,"axis");var n="axis";if(e.dependentAxis&&e.theme.dependentAxis?n="dependentAxis":!e.dependentAxis&&e.theme.independentAxis&&(n="independentAxis"),"axis"===n)return bF(e,t,"axis");var r=SL()({},e.theme[n],e.theme.axis),o=wL()({},e.theme,{axis:r});return bF(wL()({},e,{theme:o}),t,"axis")}var M$=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length>0)return n.reduce((function(e,t){return[e,M$(t)].join(" ")}),M$(e)).trim();if(void 0===e||null===e||"string"===typeof e)return e;var o=[];for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];o.push("".concat(i,"(").concat(a,")"))}return o.join(" ").trim()};var D$=n(9693),I$=n.n(D$);function R$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N$(e){return function(e){if(Array.isArray(e))return L$(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return L$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L$(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var F$=/^onGlobal(.*)$/;function B$(e,t,n,r){var o=this,i=function(e){var r=function(){var r=e.reduce((function(e,n){return void 0!==n.target?(Array.isArray(n.target)?VF()(n.target,t):"".concat(n.target)==="".concat(t))?e.concat(n):e:e.concat(n)}),[]);return void 0!==n&&"parent"!==t?r.filter((function(e){var t=e.eventKey,r=function(e){return!e||"".concat(e)==="".concat(n)};return Array.isArray(t)?t.some((function(e){return r(e)})):r(t)})):r}();return Array.isArray(r)&&r.reduce((function(e,t){return t?wL()(e,t.eventHandlers):e}),{})},a=function(){var t;return Array.isArray(o.componentEvents)?Array.isArray(e.events)?(t=o.componentEvents).concat.apply(t,N$(e.events)):o.componentEvents:e.events}(),l=a&&rF()(r)?r(i(a),t):void 0;if(!e.sharedEvents)return l;var s=e.sharedEvents.getEvents,u=e.sharedEvents.events&&s(i(e.sharedEvents.events),t);return wL()({},u,l)}function z$(e,t,n,r){var o=this;if(bL()(e))return{};r=r||this.baseProps;var i=function(e,t){var n=e.childName,i=e.target,a=e.key,l="props"===t?r:o.state||{},s=void 0!==n&&null!==n&&l[n]?l[n]:l;return"parent"===a?s.parent:s[a]&&s[a][i]},a=function(e,a){var l="parent"===t?e.childName:e.childName||n,s=e.target||t,u=function(t,n){var a=o.state||{};if(!rF()(e.mutation))return a;var l=i({childName:n,key:t,target:s},"props"),u=i({childName:n,key:t,target:s},"state"),c=e.mutation(wL()({},l,u),r),d=a[n]||{},f=function(e){return c?function(e){return"parent"===s?wL()(e,R$({},t,wL()(e[t],c))):wL()(e,R$({},t,wL()(e[t],R$({},s,c))))}(e):function(e){return e[t]&&e[t][s]&&delete e[t][s],e[t]&&!NL()(e[t]).length&&delete e[t],e}(e)};return void 0!==n&&null!==n?wL()(a,R$({},n,f(d))):f(a)},c=function(t){var n=function(t){return"parent"===s?"parent":"all"===e.eventKey?r[t]?KF()(NL()(r[t]),"parent"):KF()(NL()(r),"parent"):void 0===e.eventKey&&"parent"===a?r[t]?NL()(r[t]):NL()(r):void 0!==e.eventKey?e.eventKey:a}(t);return Array.isArray(n)?n.reduce((function(e,n){return wL()(e,u(n,t))}),{}):u(n,t)},d="all"===l?KF()(NL()(r),"parent"):l;return Array.isArray(d)?d.reduce((function(e,t){return wL()(e,c(t))}),{}):c(d)},l=function(t,n,r,i){var l=e[i](t,n,r,o);if(!bL()(l)){var s=function(e){var t=function(e){return rF()(e.callback)&&e.callback},n=(Array.isArray(e)?e.map((function(e){return t(e)})):[t(e)]).filter((function(e){return!1!==e}));return n.length?function(){return n.forEach((function(e){return e()}))}:void 0}(l);o.setState(function(e,t){return Array.isArray(e)?e.reduce((function(e,n){return wL()({},e,a(n,t))}),{}):a(e,t)}(l,r),s)}};return NL()(e).reduce((function(e,t){return e[t]=l,e}),{})}function U$(e,t,n){return e?NL()(e).reduce((function(r,o){return r[o]=function(r){return e[o](r,n,t,o)},r}),{}):{}}function W$(e,t,n){var r=this.state||{};return n?r[n]&&r[n][e]&&r[n][e][t]:"parent"===e?r[e]&&r[e][t]||r[e]:r[e]&&r[e][t]}function H$(e,t,n,r){return t=t||{},n=n||{},NL()(t).reduce((function(o,i){var a=n[i]||{},l=t[i]||{};if("parent"===i){var s=K$(e,l,a,{eventKey:i,target:"parent"});o[i]=void 0!==s?wL()({},a,s):a}else{var u=zF()(NL()(l).concat(NL()(a)));o[i]=u.reduce((function(t,n){var o={eventKey:i,target:n,childName:r},s=K$(e,l[n],a[n],o);return t[n]=void 0!==s?wL()({},a[n],s):a[n],I$()(t,(function(e){return!bL()(e)}))}),{})}return I$()(o,(function(e){return!bL()(e)}))}),{})}function K$(e,t,n,r){var o=function(e,t){if("string"===typeof e[t])return"all"===e[t]||e[t]===r[t];if(Array.isArray(e[t])){var n=e[t].map((function(e){return"".concat(e)}));return VF()(n,r[t])}return!1},i=e=Array.isArray(e)?e:[e];r.childName&&(i=e.filter((function(e){return o(e,"childName")})));var a=i.filter((function(e){return o(e,"target")}));if(!bL()(a)){var l=a.filter((function(e){return o(e,"eventKey")}));if(!bL()(l))return l.reduce((function(e,r){var o=(r&&rF()(r.mutation)?r.mutation:function(){})(wL()({},t,n));return wL()({},e,o)}),{})}}function $$(e,t){var n=Array.isArray(t)&&t.reduce((function(t,n){var r,o=e[n],i=o&&o.type&&o.type.defaultEvents,a=rF()(i)?i(o.props):i;return t=Array.isArray(a)?(r=t).concat.apply(r,N$(a)):t}),[]);return n&&n.length?n:void 0}function V$(e){var t=e.match(F$);return t&&t[1]&&t[1].toLowerCase()}var q$=function(e){return I$()(e,(function(e,t){return F$.test(t)}))},G$=function(e){return aB()(e,(function(e,t){return F$.test(t)}))},Y$=function(e){return wL()(e,{nativeEvent:e})};function Q$(e){0}function X$(e){return function(e){if(Array.isArray(e))return Z$(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return Z$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z$(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J$(Object(n),!0).forEach((function(t){tV(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nV(e,t){var n={polar:e.polar,startAngle:e.startAngle,endAngle:e.endAngle,categories:e.categories,minDomain:e.minDomain,maxDomain:e.maxDomain},r=0,o=t?t.slice(0):h.Children.toArray(e.children);n=function(e){var t=e.children,n=e.props,r=e.childComponents,o=e.parentProps,i=t.some((function(e){return e.type&&"histogram"===e.type.role})),a=i&&t.length&&t.every((function(e){return e.type&&"histogram"===e.type.role}));if(i&&!a&&Q$(),!a)return o;var l=n.bins||r[0].props.bins;if(!Array.isArray(l)){var s=t.reduce((function(e,t){var n=vF(t.props.x||"x");return e.concat(t.props.data.map((function(e){return{x:n(e)}})))}),[]);l=(0,t[0].type.getFormattedData)({data:s,bins:l}).reduce((function(e,t,n){var r=t.x0,o=t.x1;return 0===n?e.concat([r,o]):e.concat(o)}),[])}return eV(eV({},o),{},{bins:l})}({children:o,props:e,childComponents:t,parentProps:n});var i=o.filter((function(e){return e.type&&"stack"===e.type.role})).length,a=wF(o,(function(e,t,o){var i,a=wL()({},e.props,n);return XK(e)?(i=e.type&&rF()(e.type.getData)?(e=o?h.cloneElement(e,o.props):e).type.getData(a):GK(a),r+=1,i.map((function(e,t){return wL()({_stack:r,_group:t},e)}))):null}),e,[],(function(e,t){return e.concat(NF()(t,"_group"))})),l=i?"_group":"_stack";return IF()(FF()(a,l))}function rV(e,t,n){var r=e.datasets,o=mF(e,e.horizontal?"y":"x"),i=Math.abs(o[1]-o[0]);n=void 0!==n?n:Array.isArray(r[0])&&r[0].length||1;var a=(t=t||r.length)*n;return Math.round(.5*i/a)}function oV(e,t,n){n=n||h.Children.toArray(e.children);var r,o=l$(e,t),i=function(e,t,n){if(!e.polar&&"x"===t){var r=n.filter((function(e){return e.type&&e.type.role&&"group"===e.type.role}));if(!(r.length<1)){var o=r[0].props,i=o.offset,a=o.children;if(i){var l=Array.isArray(a)&&a[0];if(l){var s=l.props.barWidth,u=l.props.data&&l.props.data.length||1;if(l&&"stack"===l.type.role){var c=l.props.children&&l.props.children[0];if(!c)return;s=c.props.barWidth,u=l.props.children.length}var d=s||rV(e,a.length,u);return{x:d*a.length/2+(i-d*((a.length-1)/2))}}}}}}(e,t,n);if(o)r=o;else{var a=c$(e,t),l=u$(e,t),s=(e.data||e.y)&&GK(e),u=s?i$(e,t,s):[],c=function(e,t,n){var r=n?n.slice(0):h.Children.toArray(e.children),o=e.data?GK(e):void 0,i=e.polar,a=e.startAngle,l=e.endAngle,s=e.categories,u=e.minDomain,c=e.maxDomain,d={horizontal:e.horizontal,polar:i,startAngle:a,endAngle:l,minDomain:u,maxDomain:c,categories:s},f=o?wL()(d,{data:o}):d,p=wF(r,(function(e){var n=wL()({},e.props,f);return f$(e)?e.type&&rF()(e.type.getDomain)?e.props&&e.type.getDomain(n,t):o$(n,t):null}),e);return[0===p.length?0:IL(p),0===p.length?1:DL(p)]}(e,t,n);r=a$(a||IL([].concat(X$(u),X$(c))),l||DL([].concat(X$(u),X$(c))))}return r$(r,wL()({domainPadding:i},e),t)}function iV(e,t,n){if(e.data)return _K(e,t);var r=n?n.slice(0):h.Children.toArray(e.children),o=zF()(wF(r,(function(n){return EK(wL()({},n.props,{horizontal:e.horizontal}),t)}),e));return o.length>1?CK("linear"):CK(o[0])}function aV(e){var t=$$(e,["groupComponent","containerComponent","labelComponent"]),n=e.events;return Array.isArray(t)&&(n=Array.isArray(e.events)?t.concat.apply(t,X$(e.events)):t),n||[]}function lV(e,t,n){var r=n.style,o=n.role,i=e.props.style||{};if(Array.isArray(i))return i;var a=e.type&&e.type.role,l="stack"===a?void 0:function(e,t,n){var r=e.style,o=e.colorScale,i=e.color;if(r&&r.data&&r.data.fill)return r.data.fill;if(o=t.props&&t.props.colorScale?t.props.colorScale:o,i=t.props&&t.props.color?t.props.color:i,o||i){var a=Array.isArray(o)?o:function(e){var t={grayscale:["#cccccc","#969696","#636363","#252525"],qualitative:["#334D5C","#45B29D","#EFC94C","#E27A3F","#DF5A49","#4F7DA1","#55DBC1","#EFDA97","#E2A37F","#DF948A"],heatmap:["#428517","#77D200","#D6D305","#EC8E19","#C92B05"],warm:["#940031","#C43343","#DC5429","#FF821D","#FFAF55"],cool:["#2746B9","#0B69D4","#2794DB","#31BB76","#60E83B"],red:["#FCAE91","#FB6A4A","#DE2D26","#A50F15","#750B0E"],blue:["#002C61","#004B8F","#006BC9","#3795E5","#65B4F4"],green:["#354722","#466631","#649146","#8AB25C","#A9C97E"]};return e?t[e]:t.grayscale}(o);return i||a[n%a.length]}}(n,e,t),s="line"===a?{fill:"none",stroke:l}:{fill:l},u="stack"===o?{}:{width:rV(n)},c=SL()({},i.data,wL()({},u,r.data,s)),d=SL()({},i.labels,r.labels);return{parent:r.parent,data:c,labels:d}}function sV(e,t,n){var r=MF()(e.categories)?e.categories[t]:e.categories,o=m$(n,t),i=o?YK(o.props,t):[],a=r||function(e,t){return wF(e.slice(0),(function(e){var n=e.props||{};if(!f$(e)||!n.categories)return null;var r=n.categories&&!Array.isArray(n.categories)?n.categories[t]:n.props.categories,o=r&&r.filter((function(e){return"string"===typeof e}));return o?ML(o):[]}))}(n,t);return zF()(WF()([].concat(X$(a),X$(i))))}function uV(e,t){var n=sV(e,"x",t=t||h.Children.toArray(e.children)),r=sV(e,"y",t),o=function(e){return wF(e.slice(0),(function(e){var t=e.props||{};return XK(e)?(e.type&&rF()(e.type.getData)?e.type.getData(t):GK(t)).map((function(e){return{x:e.xName,y:e.yName}})):null}),{},{x:[],y:[]},(function(e,t){var n=Array.isArray(t)?t.map((function(e){return e.x})).filter(Boolean):t.x,r=Array.isArray(t)?t.map((function(e){return e.y})).filter(Boolean):t.y;return{x:void 0!==n?e.x.concat(n):e.x,y:void 0!==r?e.y.concat(r):e.y}}))}(t);return{x:zF()(WF()([].concat(X$(n),X$(o.x)))),y:zF()(WF()([].concat(X$(r),X$(o.y))))}}function cV(e,t,n){var r=e.categories&&!Array.isArray(e.categories)?e.categories.x:e.categories,o=e.categories&&!Array.isArray(e.categories)?e.categories.y:e.categories,i=!r||!o?n||uV(e,t):{},a=r||i.x,l=o||i.y;return{x:a.length>0?a:void 0,y:l.length>0?l:void 0}}function dV(e){var t=h.useRef();return h.useEffect((function(){t.current=e})),t.current}var fV=n(1314),pV=n.n(fV),hV=n(3139),yV=n.n(hV);var gV=function(e){var t=function(t){return function(n,r,o){var i=n[r];if(void 0===i||null===i)return t?new Error("Required `".concat(r,"` was not specified in `").concat(o,"`.")):null;for(var a=arguments.length,l=new Array(a>3?a-3:0),s=3;s<a;s++)l[s-3]=arguments[s];return e.apply(void 0,[n,r,o].concat(l))}};return Object.assign(t(!1),{isRequired:t(!0)})},mV=function(){return null},vV=function(){},bV=function(e){return void 0===e?vV:null===e?mV:e.constructor},xV=function(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).slice(8,-1)};function wV(e,t){return function(n,r,o){var i=n[r];return null!==i&&void 0!==i&&Q$('"'.concat(r,'" property of "').concat(o,'" has been deprecated ').concat(t)),oi().checkPropTypes(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},r,e),n,r,o),null}}function jV(e){return gV((function(t,n,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.reduce((function(e,o){return e||o.apply(void 0,[t,n,r].concat(i))}),null)}))}var SV=gV((function(e,t,n){var r=e[t];return"number"!==typeof r||r<0?new Error("`".concat(t,"` in `").concat(n,"` must be a non-negative number.")):null})),kV=gV((function(e,t,n){var r=e[t];return"number"!==typeof r||r%1!==0?new Error("`".concat(t,"` in `").concat(n,"` must be an integer.")):null})),CV=gV((function(e,t,n){var r=e[t];return"number"!==typeof r||r<=0?new Error("`".concat(t,"` in `").concat(n,"` must be a number greater than zero.")):null})),_V=gV((function(e,t,n){var r=e[t];return Array.isArray(r)&&2===r.length&&r[1]!==r[0]?null:new Error("`".concat(t,"` in `").concat(n,"` must be an array of two unique numeric values."))})),OV=gV((function(e,t,n){return jK(e[t])?null:new Error("`".concat(t,"` in `").concat(n,"` must be a d3 scale."))})),EV=gV((function(e,t,n){var r=e[t];if(!Array.isArray(r))return new Error("`".concat(t,"` in `").concat(n,"` must be an array."));if(r.length<2)return null;var o=bV(r[0]),i=yV()(r,(function(e){return o!==bV(e)}));if(i){var a=xV(r[0]),l=xV(i);return new Error("Expected `".concat(t,"` in `").concat(n,"` to be a ")+"homogeneous array, but found types `".concat(a,"` and ")+"`".concat(l,"`."))}return null})),TV=(gV((function(e,t){return e[t]&&Array.isArray(e[t])&&e[t].length!==e.data.length?new Error("Length of data and ".concat(t," arrays must match.")):null})),gV((function(e,t,n){return e[t]&&!pV()(e[t])?new Error("`".concat(t,"` in `").concat(n,"` must be a regular expression.")):null}))),PV={dataProps:{categories:oi().oneOfType([oi().arrayOf(oi().string),oi().shape({x:oi().arrayOf(oi().string),y:oi().arrayOf(oi().string)})]),data:oi().oneOfType([oi().array,oi().object]),dataComponent:oi().element,disableInlineStyles:oi().bool,labelComponent:oi().element,labels:oi().oneOfType([oi().func,oi().array]),samples:SV,sortKey:oi().oneOfType([oi().func,jV([kV,SV]),oi().string,oi().arrayOf(oi().string.isRequired)]),sortOrder:oi().oneOf(["ascending","descending"]),style:oi().shape({parent:oi().object,data:oi().object,labels:oi().object}),x:oi().oneOfType([oi().func,jV([kV,SV]),oi().string,oi().arrayOf(oi().string.isRequired)]),y:oi().oneOfType([oi().func,jV([kV,SV]),oi().string,oi().arrayOf(oi().string.isRequired)]),y0:oi().oneOfType([oi().func,jV([kV,SV]),oi().string,oi().arrayOf(oi().string.isRequired)])},baseProps:{animate:oi().oneOfType([oi().bool,oi().object]),containerComponent:oi().element,domain:oi().oneOfType([_V,oi().shape({x:_V,y:_V})]),maxDomain:oi().oneOfType([oi().number,oi().instanceOf(Date),oi().shape({x:oi().oneOfType([oi().number,oi().instanceOf(Date)]),y:oi().oneOfType([oi().number,oi().instanceOf(Date)])})]),minDomain:oi().oneOfType([oi().number,oi().instanceOf(Date),oi().shape({x:oi().oneOfType([oi().number,oi().instanceOf(Date)]),y:oi().oneOfType([oi().number,oi().instanceOf(Date)])})]),domainPadding:oi().oneOfType([oi().shape({x:oi().oneOfType([oi().number,oi().arrayOf(oi().number)]),y:oi().oneOfType([oi().number,oi().arrayOf(oi().number)])}),oi().number,oi().arrayOf(oi().number)]),eventKey:oi().oneOfType([oi().func,jV([kV,SV]),oi().string]),events:oi().arrayOf(oi().shape({target:oi().oneOf(["data","labels","parent"]),eventKey:oi().oneOfType([oi().array,jV([kV,SV]),oi().string]),eventHandlers:oi().object})),externalEventMutations:oi().arrayOf(oi().shape({callback:oi().func,childName:oi().oneOfType([oi().string,oi().array]),eventKey:oi().oneOfType([oi().array,jV([kV,SV]),oi().string]),mutation:oi().func,target:oi().oneOfType([oi().string,oi().array])})),groupComponent:oi().element,height:SV,name:oi().string,origin:oi().shape({x:oi().number,y:oi().number}),padding:oi().oneOfType([oi().number,oi().shape({top:oi().number,bottom:oi().number,left:oi().number,right:oi().number})]),polar:oi().bool,range:oi().oneOfType([_V,oi().shape({x:_V.isRequired,y:_V.isRequired})]),scale:oi().oneOfType([OV,oi().shape({x:OV.isRequired,y:OV.isRequired})]),sharedEvents:oi().shape({events:oi().array,getEventState:oi().func}),singleQuadrantDomainPadding:oi().oneOfType([oi().bool,oi().shape({x:oi().oneOfType([oi().bool]),y:oi().oneOfType([oi().bool])})]),standalone:oi().bool,theme:oi().object,width:SV},primitiveProps:{active:oi().bool,ariaLabel:oi().oneOfType([oi().string,oi().func]),className:oi().string,clipPath:oi().string,data:oi().oneOfType([oi().array,oi().object]),desc:oi().oneOfType([oi().string,oi().func]),disableInlineStyles:oi().bool,events:oi().object,id:oi().oneOfType([oi().number,oi().string,oi().func]),index:oi().oneOfType([oi().number,oi().string]),origin:oi().shape({x:oi().number,y:oi().number}),polar:oi().bool,role:oi().string,scale:oi().oneOfType([OV,oi().shape({x:OV,y:OV})]),shapeRendering:oi().string,style:oi().object,tabIndex:oi().oneOfType([oi().number,oi().func]),transform:oi().string}},AV=["desc"];function MV(){return MV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MV.apply(this,arguments)}function DV(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var IV=function(e){var t=e.desc,n=DV(e,AV);return t?h.createElement("rect",MV({vectorEffect:"non-scaling-stroke"},n),h.createElement("desc",null,t)):h.createElement("rect",MV({vectorEffect:"non-scaling-stroke"},n))},RV=["desc"];function NV(){return NV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NV.apply(this,arguments)}function LV(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var FV=function(e){var t=e.desc,n=LV(e,RV);return t?h.createElement("circle",NV({vectorEffect:"non-scaling-stroke"},n),h.createElement("desc",null,t)):h.createElement("circle",NV({vectorEffect:"non-scaling-stroke"},n))};function BV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BV(Object(n),!0).forEach((function(t){UV(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function UV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var WV=function(e){return e=function(e){var t=dF(e.id,e);return wL()({},e,{id:t})}(e),e.polar?h.cloneElement(e.circleComponent,zV(zV({},e.events),{},{style:e.style,role:e.role,shapeRendering:e.shapeRendering,cx:e.x,cy:e.y,r:e.height,className:e.className})):h.cloneElement(e.rectComponent,zV(zV({},e.events),{},{style:e.style,role:e.role,shapeRendering:e.shapeRendering,x:e.x,y:e.y,rx:e.rx,ry:e.ry,width:e.width,height:e.height,className:e.className}))};WV.propTypes=zV(zV({},PV.primitiveProps),{},{circleComponent:oi().element,height:oi().number,rectComponent:oi().element,rx:oi().number,ry:oi().number,width:oi().number,x:oi().number,y:oi().number}),WV.defaultProps={circleComponent:h.createElement(FV,null),rectComponent:h.createElement(IV,null),role:"presentation",shapeRendering:"auto"};var HV=n(5603),KV=n.n(HV);function $V(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function VV(e,t){return VV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VV(e,t)}function qV(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=GV(e);if(t){var o=GV(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function GV(e){return GV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GV(e)}var YV=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VV(e,t)}(i,e);var t,n,r,o=qV(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).map=void 0,t.index=void 0,t.portalRegister=function(){return++t.index},t.portalUpdate=function(e,n){t.map[e]=n,t.forceUpdate()},t.portalDeregister=function(e){delete t.map[e],t.forceUpdate()},t.map={},t.index=1,t}return t=i,n=[{key:"getChildren",value:function(){var e=this;return NL()(this.map).map((function(t){var n=e.map[t];return n?h.cloneElement(n,{key:t}):n}))}},{key:"render",value:function(){return h.createElement("svg",this.props,this.getChildren())}}],n&&$V(t.prototype,n),r&&$V(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);YV.displayName="Portal",YV.propTypes={className:oi().string,height:SV,style:oi().object,viewBox:oi().string,width:SV};var QV=h.createContext({});QV.displayName="PortalContext";var XV,ZV,JV=0,eq=0,tq=0,nq=1e3,rq=0,oq=0,iq=0,aq="object"===typeof performance&&performance.now?performance:Date,lq="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sq(){return oq||(lq(uq),oq=aq.now()+iq)}function uq(){oq=0}function cq(){this._call=this._time=this._next=null}function dq(e,t,n){var r=new cq;return r.restart(e,t,n),r}function fq(){oq=(rq=aq.now())+iq,JV=eq=0;try{!function(){sq(),++JV;for(var e,t=XV;t;)(e=oq-t._time)>=0&&t._call.call(void 0,e),t=t._next;--JV}()}finally{JV=0,function(){var e,t,n=XV,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:XV=t);ZV=e,hq(r)}(),oq=0}}function pq(){var e=aq.now(),t=e-rq;t>nq&&(iq-=t,rq=e)}function hq(e){JV||(eq&&(eq=clearTimeout(eq)),e-oq>24?(e<1/0&&(eq=setTimeout(fq,e-aq.now()-iq)),tq&&(tq=clearInterval(tq))):(tq||(rq=aq.now(),tq=setInterval(pq,nq)),JV=1,lq(fq)))}function yq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}cq.prototype=dq.prototype={constructor:cq,restart:function(e,t,n){if("function"!==typeof e)throw new TypeError("callback is not a function");n=(null==n?sq():+n)+(null==t?0:+t),this._next||ZV===this||(ZV?ZV._next=this:XV=this,ZV=this),this._call=e,this._time=n,hq()},stop:function(){this._call&&(this._call=null,this._time=1/0,hq())}};var gq=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldAnimate=void 0,this.subscribers=void 0,this.activeSubscriptions=void 0,this.timer=void 0,this.loop=function(){t.subscribers.forEach((function(e){e.callback(sq()-e.startTime,e.duration)}))},this.shouldAnimate=!0,this.subscribers=[],this.timer=null,this.activeSubscriptions=0}var t,n,r;return t=e,n=[{key:"bypassAnimation",value:function(){this.shouldAnimate=!1}},{key:"resumeAnimation",value:function(){this.shouldAnimate=!0}},{key:"start",value:function(){this.timer||(this.timer=dq(this.loop))}},{key:"stop",value:function(){this.timer&&(this.timer.stop(),this.timer=null)}},{key:"subscribe",value:function(e,t){t=this.shouldAnimate?t:0;var n=this.subscribers.push({startTime:sq(),callback:e,duration:t});return this.activeSubscriptions++,this.start(),n}},{key:"unsubscribe",value:function(e){null!==e&&this.subscribers[e-1]&&(delete this.subscribers[e-1],this.activeSubscriptions--),0===this.activeSubscriptions&&this.stop()}}],n&&yq(t.prototype,n),r&&yq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),mq=h.createContext({transitionTimer:new gq,animationTimer:new gq});mq.displayName="TimerContext";var vq=mq;function bq(){return bq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bq.apply(this,arguments)}function xq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xq(Object(n),!0).forEach((function(t){jq(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xq(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jq(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kq(e,t){return kq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kq(e,t)}function Cq(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=_q(e);if(t){var o=_q(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function _q(e){return _q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_q(e)}var Oq=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kq(e,t)}(i,e);var t,n,r,o=Cq(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).containerId=void 0,t.portalRef=void 0,t.containerRef=void 0,t.shouldHandleWheel=void 0,t.savePortalRef=function(e){return t.portalRef=e,e},t.portalUpdate=function(e,n){return t.portalRef.portalUpdate(e,n)},t.portalRegister=function(){return t.portalRef.portalRegister()},t.portalDeregister=function(e){return t.portalRef.portalDeregister(e)},t.saveContainerRef=function(e){return rF()(t.props.containerRef)&&t.props.containerRef(e),t.containerRef=e,e},t.handleWheel=function(e){return e.preventDefault()},t.containerId=eB()(e)&&void 0!==e.containerId?e.containerId:KV()("victory-container-"),t.shouldHandleWheel=!!(e&&e.events&&e.events.onWheel),t}return t=i,n=[{key:"componentDidMount",value:function(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.addEventListener("wheel",this.handleWheel)}},{key:"componentWillUnmount",value:function(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.removeEventListener("wheel",this.handleWheel)}},{key:"getIdForElement",value:function(e){return"".concat(this.containerId,"-").concat(e)}},{key:"getChildren",value:function(e){return e.children}},{key:"getOUIAProps",value:function(e){var t=e.ouiaId,n=e.ouiaSafe,r=e.ouiaType;return wq(wq(wq({},t&&{"data-ouia-component-id":t}),r&&{"data-ouia-component-type":r}),void 0!==n&&{"data-ouia-safe":n})}},{key:"renderContainer",value:function(e,t,n){var r=e.title,o=e.desc,i=e.portalComponent,a=e.className,l=e.width,s=e.height,u=e.portalZIndex,c=e.responsive,d=this.getChildren(e),f=c?{width:"100%",height:"100%"}:{width:l,height:s},p=wL()({pointerEvents:"none",touchAction:"none",position:"relative"},f),y=wL()({zIndex:u,position:"absolute",top:0,left:0},f),g=wL()({pointerEvents:"all"},f),m=wL()({overflow:"visible"},f),v={width:l,height:s,viewBox:t.viewBox,preserveAspectRatio:t.preserveAspectRatio,style:m};return h.createElement(QV.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},h.createElement("div",bq({style:SL()({},n,p),className:a,ref:this.saveContainerRef},this.getOUIAProps(e)),h.createElement("svg",bq({},t,{style:g}),r?h.createElement("title",{id:this.getIdForElement("title")},r):null,o?h.createElement("desc",{id:this.getIdForElement("desc")},o):null,d),h.createElement("div",{style:y},h.cloneElement(i,wq(wq({},v),{},{ref:this.savePortalRef})))))}},{key:"render",value:function(){var e=this.props,t=e.width,n=e.height,r=e.responsive,o=e.events,i=e.title,a=e.desc,l=e.tabIndex,s=e.preserveAspectRatio,u=e.role,c=r?this.props.style:oF(this.props.style,["height","width"]),d=TF(this.props),f=wL()(wq({width:t,height:n,tabIndex:l,role:u,"aria-labelledby":[i&&this.getIdForElement("title"),this.props["aria-labelledby"]].filter(Boolean).join(" ")||void 0,"aria-describedby":[a&&this.getIdForElement("desc"),this.props["aria-describedby"]].filter(Boolean).join(" ")||void 0,viewBox:r?"0 0 ".concat(t," ").concat(n):void 0,preserveAspectRatio:r?s:void 0},d),o);return this.renderContainer(this.props,f,c)}}],n&&Sq(t.prototype,n),r&&Sq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);Oq.displayName="VictoryContainer",Oq.role="container",Oq.propTypes={"aria-describedby":oi().string,"aria-labelledby":oi().string,children:oi().oneOfType([oi().arrayOf(oi().node),oi().node]),className:oi().string,containerId:oi().oneOfType([oi().number,oi().string]),containerRef:oi().func,desc:oi().string,events:oi().object,height:SV,name:oi().string,origin:oi().shape({x:SV,y:SV}),ouiaId:oi().oneOfType([oi().number,oi().string]),ouiaSafe:oi().bool,ouiaType:oi().string,polar:oi().bool,portalComponent:oi().element,portalZIndex:kV,preserveAspectRatio:oi().string,responsive:oi().bool,role:oi().string,style:oi().object,tabIndex:oi().number,theme:oi().object,title:oi().string,width:SV},Oq.defaultProps={className:"VictoryContainer",portalComponent:h.createElement(YV,null),portalZIndex:99,responsive:!0,role:"img"},Oq.contextType=vq;var Eq=["#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0"],Tq="#252525",Pq="#969696",Aq={width:450,height:300,padding:50,colorScale:Eq},Mq={fontFamily:"'Gill Sans', 'Seravek', 'Trebuchet MS', sans-serif",fontSize:14,letterSpacing:"normal",padding:10,fill:Tq,stroke:"transparent"},Dq=wL()({textAnchor:"middle"},Mq),Iq={area:wL()({style:{data:{fill:Tq},labels:Mq}},Aq),axis:wL()({style:{axis:{fill:"transparent",stroke:Tq,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:wL()({},Dq,{padding:25}),grid:{fill:"none",stroke:"none",pointerEvents:"painted"},ticks:{fill:"transparent",size:1,stroke:"transparent"},tickLabels:Mq}},Aq),bar:wL()({style:{data:{fill:Tq,padding:8,strokeWidth:0},labels:Mq}},Aq),boxplot:wL()({style:{max:{padding:8,stroke:Tq,strokeWidth:1},maxLabels:wL()({},Mq,{padding:3}),median:{padding:8,stroke:Tq,strokeWidth:1},medianLabels:wL()({},Mq,{padding:3}),min:{padding:8,stroke:Tq,strokeWidth:1},minLabels:wL()({},Mq,{padding:3}),q1:{padding:8,fill:Pq},q1Labels:wL()({},Mq,{padding:3}),q3:{padding:8,fill:Pq},q3Labels:wL()({},Mq,{padding:3})},boxWidth:20},Aq),candlestick:wL()({style:{data:{stroke:Tq,strokeWidth:1},labels:wL()({},Mq,{padding:5})},candleColors:{positive:"#ffffff",negative:Tq}},Aq),chart:Aq,errorbar:wL()({borderWidth:8,style:{data:{fill:"transparent",stroke:Tq,strokeWidth:2},labels:Mq}},Aq),group:wL()({colorScale:Eq},Aq),histogram:wL()({style:{data:{fill:Pq,stroke:Tq,strokeWidth:2},labels:Mq}},Aq),legend:{colorScale:Eq,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:Mq,title:wL()({},Mq,{padding:5})}},line:wL()({style:{data:{fill:"transparent",stroke:Tq,strokeWidth:2},labels:Mq}},Aq),pie:{style:{data:{padding:10,stroke:"transparent",strokeWidth:1},labels:wL()({},Mq,{padding:20})},colorScale:Eq,width:400,height:400,padding:50},scatter:wL()({style:{data:{fill:Tq,stroke:"transparent",strokeWidth:0},labels:Mq}},Aq),stack:wL()({colorScale:Eq},Aq),tooltip:{style:wL()({},Mq,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:Tq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:wL()({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:wL()({},Mq,{padding:5,pointerEvents:"none"}),flyout:{stroke:Tq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},Aq)},Rq=["#F4511E","#FFF59D","#DCE775","#8BC34A","#00796B","#006064"],Nq="#ECEFF1",Lq="#90A4AE",Fq="#455A64",Bq="#212121",zq={width:350,height:350,padding:50},Uq={fontFamily:"'Helvetica Neue', 'Helvetica', sans-serif",fontSize:12,letterSpacing:"normal",padding:8,fill:Fq,stroke:"transparent",strokeWidth:0},Wq=wL()({textAnchor:"middle"},Uq),Hq="round",Kq="round",$q={grayscale:Iq,material:{area:wL()({style:{data:{fill:Bq},labels:Uq}},zq),axis:wL()({style:{axis:{fill:"transparent",stroke:Lq,strokeWidth:2,strokeLinecap:Hq,strokeLinejoin:Kq},axisLabel:wL()({},Wq,{padding:8,stroke:"transparent"}),grid:{fill:"none",stroke:Nq,strokeDasharray:"10, 5",strokeLinecap:Hq,strokeLinejoin:Kq,pointerEvents:"painted"},ticks:{fill:"transparent",size:5,stroke:Lq,strokeWidth:1,strokeLinecap:Hq,strokeLinejoin:Kq},tickLabels:wL()({},Uq,{fill:Fq})}},zq),polarDependentAxis:wL()({style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}}),bar:wL()({style:{data:{fill:Fq,padding:8,strokeWidth:0},labels:Uq}},zq),boxplot:wL()({style:{max:{padding:8,stroke:Fq,strokeWidth:1},maxLabels:wL()({},Uq,{padding:3}),median:{padding:8,stroke:Fq,strokeWidth:1},medianLabels:wL()({},Uq,{padding:3}),min:{padding:8,stroke:Fq,strokeWidth:1},minLabels:wL()({},Uq,{padding:3}),q1:{padding:8,fill:Fq},q1Labels:wL()({},Uq,{padding:3}),q3:{padding:8,fill:Fq},q3Labels:wL()({},Uq,{padding:3})},boxWidth:20},zq),candlestick:wL()({style:{data:{stroke:Fq},labels:wL()({},Uq,{padding:5})},candleColors:{positive:"#ffffff",negative:Fq}},zq),chart:zq,errorbar:wL()({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:Fq,strokeWidth:2},labels:Uq}},zq),group:wL()({colorScale:Rq},zq),histogram:wL()({style:{data:{fill:Fq,stroke:Bq,strokeWidth:2},labels:Uq}},zq),legend:{colorScale:Rq,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:Uq,title:wL()({},Uq,{padding:5})}},line:wL()({style:{data:{fill:"transparent",opacity:1,stroke:Fq,strokeWidth:2},labels:Uq}},zq),pie:wL()({colorScale:Rq,style:{data:{padding:8,stroke:Nq,strokeWidth:1},labels:wL()({},Uq,{padding:20})}},zq),scatter:wL()({style:{data:{fill:Fq,opacity:1,stroke:"transparent",strokeWidth:0},labels:Uq}},zq),stack:wL()({colorScale:Rq},zq),tooltip:{style:wL()({},Uq,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:Bq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:wL()({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:wL()({},Uq,{padding:5,pointerEvents:"none"}),flyout:{stroke:Bq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},zq)}},Vq=n(9010),qq=n.n(Vq),Gq=n(4256),Yq=n.n(Gq),Qq=n(1320),Xq=n.n(Qq),Zq=n(2211),Jq=n.n(Zq);function eG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(s){l=!0,o=s}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||nG(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tG(e){return function(e){if(Array.isArray(e))return rG(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nG(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nG(e,t){if(e){if("string"===typeof e)return rG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rG(e,t):void 0}}function rG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iG(e,t){return iG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iG(e,t)}function aG(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=sG(e);if(t){var o=sG(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return lG(e)}(this,n)}}function lG(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sG(e){return sG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sG(e)}var uG=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iG(e,t)}(i,e);var t,n,r,o=aG(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).state=t.state||{},t.getScopedEvents=z$.bind(lG(t)),t.getEventState=W$.bind(lG(t)),t.baseProps=t.getBaseProps(e),t.sharedEventsCache={},t.globalEvents={},t.prevGlobalEventKeys=[],t.boundGlobalEvents={},t}return t=i,n=[{key:"shouldComponentUpdate",value:function(e){if(!Xq()(this.props,e)){this.baseProps=this.getBaseProps(e);var t=this.getExternalMutations(e,this.baseProps);this.applyExternalMutations(e,t)}return!0}},{key:"componentDidMount",value:function(){var e=this,t=NL()(this.globalEvents);t.forEach((function(t){return e.addGlobalListener(t)})),this.prevGlobalEventKeys=t}},{key:"componentDidUpdate",value:function(){var e=this,t=NL()(this.globalEvents);qq()(this.prevGlobalEventKeys,t).forEach((function(t){return e.removeGlobalListener(t)})),qq()(t,this.prevGlobalEventKeys).forEach((function(t){return e.addGlobalListener(t)})),this.prevGlobalEventKeys=t}},{key:"componentWillUnmount",value:function(){var e=this;this.prevGlobalEventKeys.forEach((function(t){return e.removeGlobalListener(t)}))}},{key:"addGlobalListener",value:function(e){var t=this,n=function(n){var r=t.globalEvents[e];return r&&r(Y$(n))};this.boundGlobalEvents[e]=n,window.addEventListener(V$(e),n)}},{key:"removeGlobalListener",value:function(e){window.removeEventListener(V$(e),this.boundGlobalEvents[e])}},{key:"getAllEvents",value:function(e){var t=$$(e,["container","groupComponent"]);return Array.isArray(t)?Array.isArray(e.events)?t.concat.apply(t,tG(e.events)):t:e.events}},{key:"applyExternalMutations",value:function(e,t){if(!bL()(t)){var n=e.externalEventMutations.reduce((function(e,t){return e=rF()(t.callback)?e.concat(t.callback):e}),[]),r=n.length?function(){n.forEach((function(e){return e()}))}:void 0;this.setState(t,r)}}},{key:"getExternalMutations",value:function(e,t){return bL()(e.externalEventMutations)?void 0:function(e,t,n,r){return t=t||{},n=n||{},r.reduce((function(r,o){var i=n[o],a=H$(e,t[o],n[o],o);return r[o]=a||i,I$()(r,(function(e){return!bL()(e)}))}),{})}(e.externalEventMutations,t,this.state,NL()(t))}},{key:"cacheSharedEvents",value:function(e,t,n){this.sharedEventsCache[e]=[t,n]}},{key:"getCachedSharedEvents",value:function(e,t){var n=eG(this.sharedEventsCache[e]||[],2),r=n[0],o=n[1];if(r&&Xq()(t,o))return r}},{key:"getBaseProps",value:function(e){var t=e.container,n=h.Children.toArray(this.props.children),r=this.getBasePropsFromChildren(n),o=t?t.props:{};return wL()({},r,{parent:o})}},{key:"getBasePropsFromChildren",value:function(e){var t=wF(e,(function(e,t){if(e.type&&rF()(e.type.getBaseProps)){var n=e.props&&e.type.getBaseProps(e.props);return n?[[t,n]]:null}return null}));return Yq()(t)}},{key:"getNewChildren",value:function(e,t){var n=this,r=e.events,o=e.eventKey,i=function(e,a){return e.reduce((function(e,l,s){if(l.props.children){var u=h.Children.toArray(l.props.children),c=a.slice(s,s+u.length),d=h.cloneElement(l,l.props,i(u,c));return e.concat(d)}if("parent"!==a[s]&&l.type&&rF()(l.type.getBaseProps)){var f=l.props.name||a[s],p=Array.isArray(r)&&r.filter((function(e){return"parent"!==e.target&&(Array.isArray(e.childName)?e.childName.indexOf(f)>-1:e.childName===f||"all"===e.childName)})),y=[f,t,p,Jq()(n.state[f])],g=n.getCachedSharedEvents(f,y)||{events:p,getEvents:function(e,r){return n.getScopedEvents(e,r,f,t)},getEventState:function(e,t){return n.getEventState(e,t,f)}};return n.cacheSharedEvents(f,g,y),e.concat(h.cloneElement(l,wL()({key:"events-".concat(f),sharedEvents:g,eventKey:o,name:f},l.props)))}return e.concat(l)}),[])},a=NL()(t),l=h.Children.toArray(e.children);return i(l,a)}},{key:"getContainer",value:function(e,t,n){var r=this,o=this.getNewChildren(e,t),i=Array.isArray(n)&&n.filter((function(e){return"parent"===e.target})),a=i.length>0?{events:i,getEvents:function(e,n){return r.getScopedEvents(e,n,null,t)},getEventState:this.getEventState}:null,l=e.container||e.groupComponent,s=l.type&&l.type.role,u=l.props||{},c=B$.bind(this),d=a&&c({sharedEvents:a},"parent"),f=SL()({},this.getEventState("parent","parent"),u,t.parent,{children:o}),p=SL()({},U$(d,"parent",f),u.events);this.globalEvents=q$(p);var y=G$(p);return"container"===s?h.cloneElement(l,wL()({},f,{events:y})):h.cloneElement(l,y,o)}},{key:"render",value:function(){var e=this.getAllEvents(this.props);return e?this.getContainer(this.props,this.baseProps,e):h.cloneElement(this.props.container,{children:this.props.children})}}],n&&oG(t.prototype,n),r&&oG(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function cG(e){return function(e){if(Array.isArray(e))return dG(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return dG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dG(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}uG.displayName="VictorySharedEvents",uG.role="shared-event-wrapper",uG.propTypes={children:oi().oneOfType([oi().arrayOf(oi().node),oi().node]),container:oi().node,eventKey:oi().oneOfType([oi().array,oi().func,jV([kV,SV]),oi().string]),events:oi().arrayOf(oi().shape({childName:oi().oneOfType([oi().string,oi().array]),eventHandlers:oi().object,eventKey:oi().oneOfType([oi().array,oi().func,jV([kV,SV]),oi().string]),target:oi().string})),externalEventMutations:oi().arrayOf(oi().shape({callback:oi().func,childName:oi().oneOfType([oi().string,oi().array]),eventKey:oi().oneOfType([oi().array,jV([kV,SV]),oi().string]),mutation:oi().func,target:oi().oneOfType([oi().string,oi().array])})),groupComponent:oi().node},uG.defaultProps={groupComponent:h.createElement("g",null)},uG.contextType=vq;var fG={"American Typewriter":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.25,.4203125,.3296875,.6,.6375,.8015625,.8203125,.1875,.45625,.45625,.6375,.5,.2734375,.309375,.2734375,.4390625,.6375,.6375,.6375,.6375,.6375,.6375,.6375,.6375,.6375,.6375,.2734375,.2734375,.5,.5,.5,.6,.6921875,.7640625,.6921875,.6375,.728125,.6734375,.6203125,.7109375,.784375,.3828125,.6421875,.7859375,.6375,.9484375,.7640625,.65625,.6375,.65625,.7296875,.6203125,.6375,.7109375,.740625,.940625,.784375,.7578125,.6203125,.4375,.5,.4375,.5,.5,.4921875,.5734375,.5890625,.5109375,.6,.528125,.43125,.5578125,.6375,.3109375,.40625,.6234375,.309375,.928125,.6375,.546875,.6,.58125,.4921875,.4921875,.4,.6203125,.625,.825,.6375,.640625,.528125,.5,.5,.5,.6671875],avg:.5793421052631578},Arial:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.278125,.278125,.35625,.55625,.55625,.890625,.6671875,.1921875,.334375,.334375,.390625,.584375,.278125,.334375,.278125,.278125,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.278125,.278125,.584375,.584375,.584375,.55625,1.015625,.6703125,.6671875,.7234375,.7234375,.6671875,.6109375,.778125,.7234375,.278125,.5,.6671875,.55625,.834375,.7234375,.778125,.6671875,.778125,.7234375,.6671875,.6109375,.7234375,.6671875,.9453125,.6671875,.6671875,.6109375,.278125,.278125,.278125,.4703125,.584375,.334375,.55625,.55625,.5,.55625,.55625,.3125,.55625,.55625,.2234375,.2703125,.5,.2234375,.834375,.55625,.55625,.55625,.55625,.346875,.5,.278125,.55625,.5,.7234375,.5,.5,.5,.334375,.2609375,.334375,.584375],avg:.528733552631579},"Arial Black":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.33125,.334375,.5,.6609375,.6671875,1,.890625,.278125,.390625,.390625,.55625,.6609375,.334375,.334375,.334375,.28125,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.334375,.334375,.6609375,.6609375,.6609375,.6109375,.7453125,.78125,.778125,.778125,.778125,.7234375,.6671875,.834375,.834375,.390625,.6671875,.834375,.6671875,.9453125,.834375,.834375,.7234375,.834375,.78125,.7234375,.7234375,.834375,.7796875,1.003125,.78125,.78125,.7234375,.390625,.28125,.390625,.6609375,.5125,.334375,.6671875,.6671875,.6671875,.6671875,.6671875,.41875,.6671875,.6671875,.334375,.384375,.6671875,.334375,1,.6671875,.6671875,.6671875,.6671875,.4703125,.6109375,.4453125,.6671875,.6140625,.946875,.6671875,.615625,.55625,.390625,.278125,.390625,.6609375],avg:.6213157894736842},Baskerville:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.25,.25,.40625,.6671875,.490625,.875,.7015625,.178125,.2453125,.246875,.4171875,.6671875,.25,.3125,.25,.521875,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.25,.25,.6671875,.6671875,.6671875,.396875,.9171875,.684375,.615625,.71875,.7609375,.625,.553125,.771875,.803125,.3546875,.515625,.78125,.6046875,.928125,.75,.8234375,.5625,.96875,.7296875,.5421875,.6984375,.771875,.7296875,.9484375,.771875,.678125,.6359375,.3640625,.521875,.3640625,.46875,.5125,.334375,.46875,.521875,.428125,.521875,.4375,.3890625,.4765625,.53125,.25,.359375,.4640625,.240625,.803125,.53125,.5,.521875,.521875,.365625,.334375,.2921875,.521875,.4640625,.678125,.4796875,.465625,.428125,.4796875,.5109375,.4796875,.6671875],avg:.5323519736842108},Courier:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.5984375,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6078125,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.61875,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.615625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6140625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625],avg:.6020559210526316},"Courier New":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.5984375,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625],avg:.6015296052631579},cursive:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.1921875,.24375,.40625,.5671875,.3984375,.721875,.909375,.2328125,.434375,.365625,.4734375,.5578125,.19375,.3484375,.19375,.7734375,.503125,.4171875,.5453125,.45,.6046875,.4703125,.5984375,.55625,.503125,.5546875,.20625,.2,.5625,.5546875,.546875,.403125,.70625,.734375,.7078125,.64375,.85,.753125,.75,.6484375,1.0765625,.44375,.5359375,.8359375,.653125,1.0109375,1.1515625,.6796875,.6984375,1.0625,.8234375,.5125,.9234375,.8546875,.70625,.9109375,.7421875,.715625,.6015625,.4640625,.3359375,.4109375,.5421875,.5421875,.4328125,.5125,.5,.3859375,.7375,.359375,.75625,.540625,.5328125,.3203125,.5296875,.5015625,.484375,.7890625,.5640625,.4203125,.703125,.471875,.4734375,.35,.4125,.5640625,.471875,.6484375,.5296875,.575,.4140625,.415625,.20625,.3796875,.5421875],avg:.5604440789473684},fantasy:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.215625,.2625,.3265625,.6109375,.534375,.7625,.7828125,.2,.4359375,.4359375,.3765625,.5109375,.2796875,.4609375,.2796875,.5296875,.6640625,.253125,.521875,.4765625,.6640625,.490625,.528125,.5546875,.496875,.5421875,.2796875,.2796875,.5625,.4609375,.5625,.4828125,.609375,.740625,.7234375,.740625,.8265625,.7234375,.6171875,.7359375,.765625,.240625,.5453125,.715625,.6078125,.8640625,.653125,.9125,.6484375,.946875,.6921875,.653125,.6953125,.8015625,.58125,.784375,.671875,.6265625,.690625,.4359375,.5296875,.4359375,.53125,.5,.2875,.5375,.603125,.4984375,.60625,.53125,.434375,.6421875,.56875,.209375,.4671875,.5484375,.2203125,.709375,.55,.5984375,.6140625,.5765625,.40625,.4734375,.3734375,.559375,.4421875,.6421875,.4890625,.578125,.4484375,.2546875,.2203125,.2546875,.55],avg:.536496710526316},Geneva:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.3328125,.3046875,.5,.6671875,.6671875,.90625,.728125,.3046875,.446875,.446875,.5078125,.6671875,.3046875,.3796875,.3046875,.5390625,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.6671875,.3046875,.3046875,.6671875,.6671875,.6671875,.56875,.871875,.728125,.6375,.6515625,.7015625,.5765625,.5546875,.675,.690625,.2421875,.4921875,.6640625,.584375,.7890625,.709375,.7359375,.584375,.78125,.60625,.60625,.640625,.6671875,.728125,.946875,.6109375,.6109375,.5765625,.446875,.5390625,.446875,.6671875,.6671875,.5921875,.5546875,.6109375,.546875,.603125,.5765625,.390625,.6109375,.584375,.2359375,.334375,.5390625,.2359375,.8953125,.584375,.60625,.603125,.603125,.3875,.509375,.44375,.584375,.565625,.78125,.53125,.571875,.5546875,.4515625,.246875,.4515625,.6671875],avg:.5762664473684211},Georgia:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2421875,.33125,.4125,.64375,.6109375,.81875,.7109375,.215625,.375,.375,.4734375,.64375,.2703125,.375,.2703125,.46875,.6140625,.4296875,.559375,.553125,.565625,.5296875,.5671875,.503125,.596875,.5671875,.3125,.3125,.64375,.64375,.64375,.4796875,.9296875,.715625,.6546875,.6421875,.75,.6546875,.6,.7265625,.815625,.390625,.51875,.7203125,.6046875,.928125,.7671875,.7453125,.6109375,.7453125,.7234375,.5625,.61875,.7578125,.70625,.99375,.7125,.6640625,.6015625,.375,.46875,.375,.64375,.65,.5,.5046875,.56875,.4546875,.575,.484375,.39375,.509375,.5828125,.29375,.3671875,.546875,.2875,.88125,.5921875,.5390625,.571875,.5640625,.4109375,.4328125,.3453125,.5765625,.5203125,.75625,.50625,.5171875,.4453125,.43125,.375,.43125,.64375],avg:.5551809210526316},"Gill Sans":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2765625,.271875,.3546875,.584375,.5421875,.6765625,.625,.1890625,.3234375,.3234375,.4171875,.584375,.2203125,.3234375,.2203125,.28125,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.2203125,.2296875,.584375,.584375,.584375,.334375,1.0109375,.6671875,.5640625,.709375,.75,.5,.4703125,.740625,.7296875,.25,.3125,.65625,.490625,.78125,.78125,.8234375,.5109375,.8234375,.6046875,.459375,.6046875,.709375,.6046875,1.0421875,.709375,.6046875,.646875,.334375,.28125,.334375,.4703125,.5828125,.334375,.428125,.5,.4390625,.5109375,.4796875,.296875,.428125,.5,.2203125,.2265625,.5,.2203125,.771875,.5,.553125,.5,.5,.3984375,.3859375,.334375,.5,.4390625,.7203125,.5,.4390625,.4171875,.334375,.2609375,.334375,.584375],avg:.4933717105263159},Helvetica:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2796875,.2765625,.3546875,.5546875,.5546875,.8890625,.665625,.190625,.3328125,.3328125,.3890625,.5828125,.2765625,.3328125,.2765625,.3015625,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.5546875,.2765625,.2765625,.584375,.5828125,.584375,.5546875,1.0140625,.665625,.665625,.721875,.721875,.665625,.609375,.7765625,.721875,.2765625,.5,.665625,.5546875,.8328125,.721875,.7765625,.665625,.7765625,.721875,.665625,.609375,.721875,.665625,.94375,.665625,.665625,.609375,.2765625,.3546875,.2765625,.4765625,.5546875,.3328125,.5546875,.5546875,.5,.5546875,.5546875,.2765625,.5546875,.5546875,.221875,.240625,.5,.221875,.8328125,.5546875,.5546875,.5546875,.5546875,.3328125,.5,.2765625,.5546875,.5,.721875,.5,.5,.5,.3546875,.259375,.353125,.5890625],avg:.5279276315789471},"Helvetica Neue":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.278125,.259375,.4265625,.55625,.55625,1,.6453125,.278125,.2703125,.26875,.353125,.6,.278125,.3890625,.278125,.36875,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.278125,.278125,.6,.6,.6,.55625,.8,.6625,.6859375,.7234375,.7046875,.6125,.575,.759375,.7234375,.259375,.5203125,.6703125,.55625,.871875,.7234375,.7609375,.6484375,.7609375,.6859375,.6484375,.575,.7234375,.6140625,.9265625,.6125,.6484375,.6125,.259375,.36875,.259375,.6,.5,.25625,.5375,.59375,.5375,.59375,.5375,.2984375,.575,.55625,.2234375,.2375,.5203125,.2234375,.853125,.55625,.575,.59375,.59375,.334375,.5,.315625,.55625,.5,.759375,.51875,.5,.48125,.334375,.2234375,.334375,.6],avg:.5279440789473684},"Hoefler Text":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2359375,.2234375,.3921875,.7125,.49375,.8859375,.771875,.2125,.3078125,.309375,.375,.4234375,.234375,.3125,.234375,.3,.5828125,.365625,.434375,.3921875,.5234375,.3984375,.5125,.4328125,.46875,.5125,.234375,.234375,.515625,.4234375,.515625,.340625,.7609375,.7359375,.6359375,.721875,.8125,.6375,.5875,.8078125,.853125,.4296875,.503125,.78125,.609375,.9609375,.8515625,.8140625,.6125,.8140625,.71875,.49375,.7125,.76875,.771875,1.125,.7765625,.7734375,.65625,.321875,.3078125,.321875,.3546875,.5,.3375,.446875,.5359375,.45,.5296875,.4546875,.425,.4921875,.54375,.2671875,.240625,.5390625,.25,.815625,.5375,.5234375,.5390625,.5421875,.365625,.36875,.35625,.5171875,.5015625,.75,.5,.509375,.44375,.2421875,.14375,.2421875,.35],avg:.5116447368421051},Montserrat:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2625,.2609375,.3734375,.696875,.615625,.8296875,.6703125,.203125,.3296875,.3296875,.3875,.575,.2125,.3828125,.2125,.3953125,.6625,.3625,.56875,.5640625,.6625,.5671875,.609375,.5890625,.6390625,.609375,.2125,.2125,.575,.575,.575,.5671875,1.034375,.7171875,.7546875,.7203125,.8265625,.6703125,.634375,.7734375,.8140625,.303125,.5078125,.7125,.5890625,.95625,.8140625,.8390625,.71875,.8390625,.7234375,.615625,.575,.7921875,.6984375,1.1125,.65625,.6359375,.6515625,.31875,.396875,.31875,.5765625,.5,.6,.590625,.678125,.5640625,.678125,.6046875,.375,.6875,.678125,.2703125,.365625,.6015625,.2703125,1.0625,.678125,.628125,.678125,.678125,.4015625,.4890625,.40625,.6734375,.5421875,.8796875,.534375,.5671875,.5125,.334375,.2953125,.334375,.575],avg:.571792763157895},monospace:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.5984375,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6078125,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.61875,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.615625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6140625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625,.6015625],avg:.6020559210526316},Overpass:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2296875,.2765625,.4203125,.68125,.584375,.8515625,.7015625,.2203125,.3453125,.3453125,.53125,.63125,.2234375,.3953125,.2234375,.509375,.65,.4046875,.6171875,.60625,.6484375,.60625,.6015625,.5375,.615625,.6015625,.2234375,.2234375,.63125,.63125,.63125,.5015625,.8203125,.696875,.6671875,.65,.6859375,.6015625,.559375,.690625,.7078125,.2953125,.565625,.678125,.58125,.8046875,.7109375,.740625,.6421875,.740625,.6765625,.6046875,.590625,.696875,.6640625,.853125,.65,.6671875,.6625,.3734375,.509375,.3734375,.63125,.5125,.4,.5328125,.5625,.51875,.5625,.546875,.3359375,.5625,.565625,.25625,.3203125,.55,.265625,.85,.565625,.5671875,.5625,.5625,.4046875,.4765625,.3796875,.565625,.521875,.7265625,.53125,.5390625,.5125,.3671875,.275,.3671875,.63125],avg:.5430756578947369},Palatino:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.25,.278125,.371875,.60625,.5,.840625,.778125,.209375,.334375,.334375,.390625,.60625,.2578125,.334375,.25,.60625,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.25,.25,.60625,.60625,.60625,.4453125,.7484375,.778125,.6109375,.709375,.775,.6109375,.55625,.7640625,.8328125,.3375,.346875,.7265625,.6109375,.946875,.83125,.7875,.6046875,.7875,.66875,.525,.6140625,.778125,.7234375,1,.6671875,.6671875,.6671875,.334375,.60625,.334375,.60625,.5,.334375,.5,.565625,.4453125,.6109375,.4796875,.340625,.55625,.5828125,.2921875,.2671875,.5640625,.2921875,.8828125,.5828125,.546875,.6015625,.5609375,.3953125,.425,.3265625,.603125,.565625,.834375,.5171875,.55625,.5,.334375,.60625,.334375,.60625],avg:.5408552631578947},RedHatText:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2328125,.2203125,.35625,.6890625,.55,.7390625,.6703125,.2140625,.4015625,.4015625,.4546875,.53125,.2203125,.45625,.2203125,.515625,.6609375,.3078125,.5484375,.5875,.61875,.5703125,.6203125,.559375,.6140625,.6203125,.2203125,.2234375,.465625,.534375,.465625,.5125,.7671875,.6609375,.6703125,.7265625,.728125,.6203125,.6109375,.8,.73125,.253125,.6,.6125,.6078125,.8625,.7390625,.8109375,.6546875,.809375,.6484375,.6234375,.6171875,.7125,.6609375,.8984375,.6546875,.646875,.60625,.3625,.5203125,.3625,.540625,.4609375,.5234375,.5265625,.584375,.509375,.5828125,.5578125,.3703125,.5828125,.553125,.2234375,.24375,.4890625,.2234375,.8453125,.553125,.58125,.584375,.5828125,.353125,.453125,.378125,.553125,.5015625,.6984375,.4875,.4984375,.459375,.3953125,.2921875,.3953125,.58125],avg:.5341940789473685},"sans-serif":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.278125,.278125,.35625,.55625,.55625,.890625,.6671875,.1921875,.334375,.334375,.390625,.584375,.278125,.334375,.278125,.303125,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.55625,.278125,.278125,.5859375,.584375,.5859375,.55625,1.015625,.6671875,.6671875,.7234375,.7234375,.6671875,.6109375,.778125,.7234375,.278125,.5,.6671875,.55625,.834375,.7234375,.778125,.6671875,.778125,.7234375,.6671875,.6109375,.7234375,.6671875,.9453125,.6671875,.6671875,.6109375,.278125,.35625,.278125,.478125,.55625,.334375,.55625,.55625,.5,.55625,.55625,.278125,.55625,.55625,.2234375,.2421875,.5,.2234375,.834375,.55625,.55625,.55625,.55625,.334375,.5,.278125,.55625,.5,.7234375,.5,.5,.5,.35625,.2609375,.3546875,.590625],avg:.5293256578947368},Seravek:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.215625,.296875,.4171875,.6734375,.4953125,.9125,.740625,.2421875,.3375,.3375,.409375,.60625,.2609375,.35625,.25625,.41875,.5921875,.3515625,.475,.4875,.5375,.509375,.5484375,.4546875,.5421875,.5484375,.25625,.2546875,.5875,.6171875,.5875,.4578125,.8140625,.6765625,.5703125,.6109375,.684375,.5109375,.4953125,.678125,.6859375,.2625,.2625,.5859375,.4734375,.846875,.709375,.740625,.509375,.740625,.584375,.5015625,.528125,.675,.5953125,.9453125,.596875,.540625,.540625,.359375,.4203125,.359375,.5109375,.421875,.4046875,.5015625,.5421875,.446875,.5453125,.484375,.38125,.5140625,.5546875,.240625,.2640625,.490625,.2765625,.8625,.5546875,.546875,.5453125,.5453125,.3625,.41875,.3890625,.5453125,.4703125,.7546875,.4921875,.4609375,.453125,.4015625,.2640625,.4015625,.58125],avg:.5044078947368421},serif:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2484375,.334375,.409375,.5,.5,.834375,.778125,.18125,.334375,.334375,.5,.5640625,.25,.334375,.25,.278125,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.278125,.278125,.5640625,.5640625,.5640625,.4453125,.921875,.7234375,.6671875,.6671875,.7234375,.6109375,.55625,.7234375,.7234375,.334375,.390625,.7234375,.6109375,.890625,.7234375,.7234375,.55625,.7234375,.6671875,.55625,.6109375,.7234375,.7234375,.9453125,.7234375,.7234375,.6109375,.334375,.340625,.334375,.4703125,.5,.3453125,.4453125,.5,.4453125,.5,.4453125,.3828125,.5,.5,.278125,.3359375,.5,.278125,.778125,.5,.5,.5,.5,.3375,.390625,.2796875,.5,.5,.7234375,.5,.5,.4453125,.48125,.2015625,.48125,.5421875],avg:.5126315789473684},Tahoma:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.3109375,.3328125,.4015625,.728125,.546875,.9765625,.70625,.2109375,.3828125,.3828125,.546875,.728125,.303125,.3640625,.303125,.3953125,.546875,.546875,.546875,.546875,.546875,.546875,.546875,.546875,.546875,.546875,.3546875,.3546875,.728125,.728125,.728125,.475,.909375,.6109375,.590625,.6015625,.6796875,.5625,.521875,.66875,.6765625,.3734375,.4171875,.6046875,.4984375,.771875,.66875,.7078125,.5515625,.7078125,.6375,.5578125,.5875,.65625,.60625,.903125,.58125,.5890625,.559375,.3828125,.39375,.3828125,.728125,.5625,.546875,.525,.553125,.4625,.553125,.5265625,.3546875,.553125,.5578125,.2296875,.328125,.51875,.2296875,.840625,.5578125,.54375,.553125,.553125,.3609375,.446875,.3359375,.5578125,.4984375,.7421875,.4953125,.4984375,.4453125,.48125,.3828125,.48125,.728125],avg:.5384374999999998},"Times New Roman":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2484375,.334375,.409375,.5,.5,.834375,.778125,.18125,.334375,.334375,.5,.5640625,.25,.334375,.25,.28125,.5,.5,.5,.5,.5,.5,.5,.5,.5,.5,.278125,.278125,.5640625,.5640625,.5640625,.4453125,.921875,.7234375,.6671875,.6671875,.7234375,.6109375,.55625,.7234375,.7234375,.334375,.390625,.73125,.6109375,.890625,.7375,.7234375,.55625,.7234375,.6765625,.55625,.6109375,.7234375,.7234375,.9453125,.7234375,.7234375,.6109375,.334375,.28125,.334375,.4703125,.51875,.334375,.4453125,.503125,.4453125,.503125,.4453125,.4359375,.5,.5,.278125,.35625,.50625,.278125,.778125,.5,.5,.5046875,.5,.340625,.390625,.2796875,.5,.5,.7234375,.5,.5,.4453125,.48125,.2015625,.48125,.5421875],avg:.5134375},"Trebuchet MS":{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.3015625,.3671875,.325,.53125,.525,.6015625,.70625,.1609375,.3671875,.3671875,.3671875,.525,.3671875,.3671875,.3671875,.525,.525,.525,.525,.525,.525,.525,.525,.525,.525,.525,.3671875,.3671875,.525,.525,.525,.3671875,.771875,.590625,.5671875,.5984375,.6140625,.5359375,.525,.6765625,.6546875,.2796875,.4765625,.5765625,.5078125,.7109375,.6390625,.675,.5578125,.7421875,.5828125,.48125,.58125,.6484375,.5875,.853125,.5578125,.5703125,.5515625,.3671875,.3578125,.3671875,.525,.53125,.525,.5265625,.5578125,.4953125,.5578125,.546875,.375,.503125,.546875,.2859375,.3671875,.5046875,.2953125,.83125,.546875,.5375,.5578125,.5578125,.3890625,.40625,.396875,.546875,.490625,.7453125,.5015625,.49375,.475,.3671875,.525,.3671875,.525],avg:.5085197368421052},Verdana:{widths:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.35,.39375,.459375,.81875,.6359375,1.0765625,.759375,.26875,.4546875,.4546875,.6359375,.81875,.3640625,.4546875,.3640625,.4703125,.6359375,.6359375,.6359375,.6359375,.6359375,.6359375,.6359375,.6359375,.6359375,.6359375,.4546875,.4546875,.81875,.81875,.81875,.546875,1,.684375,.6859375,.6984375,.771875,.6328125,.575,.7765625,.7515625,.421875,.4546875,.69375,.5578125,.84375,.7484375,.7875,.603125,.7875,.7,.684375,.6171875,.7328125,.684375,.9890625,.6859375,.615625,.6859375,.4546875,.46875,.4546875,.81875,.6421875,.6359375,.6015625,.6234375,.521875,.6234375,.596875,.384375,.6234375,.6328125,.275,.3765625,.5921875,.275,.9734375,.6328125,.6078125,.6234375,.6234375,.43125,.521875,.3953125,.6328125,.5921875,.81875,.5921875,.5921875,.5265625,.6359375,.4546875,.6359375,.81875],avg:.6171875000000003}},pG={mm:3.8,sm:38,pt:1.33,pc:16,in:96,px:1},hG={em:1,ex:.5},yG=1.05,gG=1.15,mG={lineHeight:1,letterSpacing:"0px",fontSize:0,angle:0,fontFamily:""},vG=function(e){return Array.isArray(e)?e:e.toString().split(/\r\n|\r|\n/g)},bG=function(e,t,n){var r=function(e){return e*Math.PI/180}(n);return Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t)},xG=function(e,t){var n,r=null===(n=e.match(/[a-zA-Z%]+/))||void 0===n?void 0:n[0],o=Number(e.match(/[0-9.,]+/));return r?pG.hasOwnProperty(r)?o*pG[r]:hG.hasOwnProperty(r)?(t?o*t:o*mG.fontSize)*hG[r]:o:o||0},wG=function(e,t){var n=Array.isArray(e)?e[t]:e,r=SL()({},n,mG);return wL()({},r,{fontFamily:r.fontFamily,letterSpacing:"number"===typeof r.letterSpacing?r.letterSpacing:xG(String(r.letterSpacing),r.fontSize),fontSize:"number"===typeof r.fontSize?r.fontSize:xG(String(r.fontSize))})},jG=function(e,t){if(void 0===e||""===e||null===e)return 0;var n=vG(e).map((function(e,n){var r=e.toString().length,o=wG(t,n),i=o.fontSize,a=o.letterSpacing,l=function(e){var t=e.split(",").map((function(e){return e.replace(/'|"/g,"")})),n=t.find((function(e){return fG[e]}))||"Helvetica";return fG[n]}(o.fontFamily),s=e.toString().split("").map((function(e){return e.charCodeAt(0)<l.widths.length?l.widths[e.charCodeAt(0)]:l.avg})).reduce((function(e,t){return t+e}),0)*i;return s+a*Math.max(r-1,0)}));return Math.max.apply(Math,cG(n))},SG=function(e,t){var n=Array.isArray(t)?t[0]&&t[0].angle:t&&t.angle,r=function(e,t){return void 0===e||""===e||null===e?0:vG(e).reduce((function(e,n,r){var o=wG(t,r),i=n.toString().match(/[(A-Z)(0-9)]/)?o.fontSize*gG:o.fontSize;return e+o.lineHeight*i}),0)}(e,t),o=jG(e,t);return{width:n?bG(o,r,n):o,height:(n?bG(r,o,n):r)*yG}},kG=function(e,t){return SG(e,t)},CG=["desc"];function _G(){return _G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_G.apply(this,arguments)}function OG(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var EG=function(e){var t=e.desc,n=OG(e,CG);return t?h.createElement("line",_G({vectorEffect:"non-scaling-stroke"},n),h.createElement("desc",null,t)):h.createElement("line",_G({vectorEffect:"non-scaling-stroke"},n))};function TG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function PG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TG(Object(n),!0).forEach((function(t){AG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AG(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var MG=function(e){return e=function(e){var t=dF(e.ariaLabel,e),n=dF(e.desc,e),r=dF(e.id,e),o=fF(wL()({stroke:"black"},e.style),e),i=dF(e.tabIndex,e);return wL()({},e,{ariaLabel:t,desc:n,id:r,style:o,tabIndex:i})}(e),h.cloneElement(e.lineComponent,PG(PG({},e.events),{},{"aria-label":e.ariaLabel,style:e.style,desc:e.desc,tabIndex:e.tabIndex,className:e.className,role:e.role,shapeRendering:e.shapeRendering,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,transform:e.transform,clipPath:e.clipPath}))};function DG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function IG(e,t){return IG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IG(e,t)}function RG(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=NG(e);if(t){var o=NG(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function NG(e){return NG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},NG(e)}MG.propTypes=PG(PG({},PV.primitiveProps),{},{datum:oi().any,lineComponent:oi().element,x1:oi().number,x2:oi().number,y1:oi().number,y2:oi().number}),MG.defaultProps={lineComponent:h.createElement(EG,null),role:"presentation",shapeRendering:"auto"};var LG=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IG(e,t)}(i,e);var t,n,r,o=RG(i);function i(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.call.apply(o,[this].concat(n))).checkedContext=void 0,e.renderInPlace=void 0,e.element=void 0,e.portalKey=void 0,e}return t=i,(n=[{key:"componentDidMount",value:function(){this.checkedContext||("function"!==typeof this.context.portalUpdate&&(Q$(),this.renderInPlace=!0),this.checkedContext=!0),this.forceUpdate()}},{key:"componentDidUpdate",value:function(){this.renderInPlace||(this.portalKey=this.portalKey||this.context.portalRegister(),this.context.portalUpdate(this.portalKey,this.element))}},{key:"componentWillUnmount",value:function(){this.context&&this.context.portalDeregister&&this.context.portalDeregister(this.portalKey)}},{key:"renderPortal",value:function(e){return this.renderInPlace?e:(this.element=e,null)}},{key:"render",value:function(){var e=Array.isArray(this.props.children)?this.props.children[0]:this.props.children,t=this.props.groupComponent,n=e&&e.props||{},r=n.groupComponent?{groupComponent:t,standalone:!1}:{},o=SL()(r,n,oF(this.props,["children","groupComponent"])),i=e&&h.cloneElement(e,o);return this.renderPortal(i)}}])&&DG(t.prototype,n),r&&DG(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);LG.displayName="VictoryPortal",LG.role="portal",LG.propTypes={children:oi().node,groupComponent:oi().element},LG.defaultProps={groupComponent:h.createElement("g",null)},LG.contextType=QV;var FG=["children","title","desc"];function BG(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var zG=function(e){var t=e.children,n=e.title,r=e.desc,o=BG(e,FG);return h.createElement("text",o,n&&h.createElement("title",null,n),r&&h.createElement("desc",null,r),t)};zG.propTypes={children:oi().node,desc:oi().string,title:oi().string};var UG=function(e){return h.createElement("tspan",e)};function WG(e,t){if(e.polar)return{};var n=function(e,t){t=t||{};var n=e.horizontal,r=dF((e.style.labels||{}).padding,e)||0,o=t._y<0?-1:1;return{x:n?o*r:0,y:n?0:-1*o*r}}(e,t);return{dx:n.x,dy:n.y}}function HG(e,t){var n=e.polar,r=aF(e,t),o=r.x,i=r.y;if(!n)return{x:o,y:i};var a=function(e,t){var n=e.style,r=YG(e,t),o=dF((n.labels||{}).padding,e)||0,i=pF(r);return{x:o*Math.cos(i),y:-o*Math.sin(i)}}(e,t);return{x:o+a.x,y:i+a.y}}function KG(e){var t=e.labelComponent,n=e.labelPlacement,r=e.polar?"perpendicular":"vertical";return n||(t.props&&t.props.labelPlacement||r)}function $G(e,t,n){return void 0!==(t=t||{}).label?t.label:Array.isArray(e.labels)?e.labels[n]:e.labels}function VG(e,t){var n=KG(e);return"perpendicular"===n||"vertical"===n&&(90===t||270===t)?"middle":t<=90||t>270?"start":"end"}function qG(e,t){var n=KG(e),r=function(e){return e<45||e>315?"right":e>=45&&e<=135?"top":e>135&&e<225?"left":"bottom"}(t);return"parallel"===n||"left"===r||"right"===r?"middle":"top"===r?"end":"start"}function GG(e,t){var n=e.labelPlacement,r=e.datum;if(!n||"vertical"===n)return 0;var o=void 0!==t?t%360:YG(e,r),i=0;return 0===o||180===o?i=90:o>0&&o<180?i=90-o:o>180&&o<360&&(i=270-o),i+(o>90&&o<180||o>270?1:-1)*("perpendicular"===n?0:90)}function YG(e,t){var n=iF(t).x;return hF(e.scale.x(n))%360}function QG(e,t){var n=e.scale,r=e.data,o=e.style,i=e.horizontal,a=e.polar,l=e.width,s=e.height,u=e.theme,c=e.labelComponent,d=e.disableInlineStyles,f=r[t],p=YG(e,f),h=a?VG(e,p):function(e,t){t=t||{};var n=e.style,r=e.horizontal,o=t._y>=0?1:-1,i=n&&n.labels||{};return t.verticalAnchor||i.verticalAnchor?t.verticalAnchor||i.verticalAnchor:r?o>=0?"start":"end":"middle"}(e,f),y=a?qG(e,p):function(e,t){var n=(t=t||{})._y>=0?1:-1,r=e.style&&e.style.labels||{};return t.verticalAnchor||r.verticalAnchor?t.verticalAnchor||r.verticalAnchor:e.horizontal?"middle":n>=0?"end":"start"}(e,f),g=function(e,t){t=t||{};var n=e.style&&e.style.labels||{};return void 0===t.angle?n.angle:t.angle}(e,f),m=$G(e,f,t),v=KG(e),b=HG(e,f),x=b.x,w=b.y,j=WG(e,f),S={angle:g,data:r,datum:f,disableInlineStyles:d,horizontal:i,index:t,polar:a,scale:n,labelPlacement:v,text:m,textAnchor:h,verticalAnchor:y,x:x,y:w,dx:j.dx,dy:j.dy,width:l,height:s,style:o.labels};if(!sF(c))return S;var k=u&&u.tooltip||{};return SL()({},S,oF(k,["style"]))}function XG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ZG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XG(Object(n),!0).forEach((function(t){JG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function JG(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eY(e){return function(e){if(Array.isArray(e))return tY(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return tY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tY(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nY={fill:"#252525",fontSize:14,fontFamily:"'Gill Sans', 'Gill Sans MT', 'Ser\xadavek', 'Trebuchet MS', sans-serif",stroke:"transparent"},rY=function(e,t){return e.datum?aF(e,e.datum)[t]:0},oY=function(e){var t=e&&e.fontSize;if("number"===typeof t)return t;if(void 0===t||null===t)return nY.fontSize;if("string"===typeof t){var n=Number(t.replace("px",""));return isNaN(n)?(Q$(),nY.fontSize):n}return nY.fontSize},iY=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Array.isArray(e)?e[t]||e[0]:e},aY=function(e){var t=e.backgroundStyle,n=e.backgroundPadding;return Array.isArray(t)&&!bL()(t)||Array.isArray(n)&&!bL()(n)},lY=function(e,t){var n=e.direction,r=e.textAnchor,o=e.x,i=e.dx;if("rtl"===n)return o-t;switch(r){case"middle":return Math.round(o-t/2);case"end":return Math.round(o-t);default:return o+(i||0)}},sY=function(e,t){var n=e.verticalAnchor,r=e.y,o=e.originalDy,i=r+(void 0===o?0:o);switch(n){case"start":return Math.floor(i);case"end":return Math.ceil(i-t);default:return Math.floor(i-t/2)}},uY=function(e,t){return aY(e)?function(e,t){var n=e.dy,r=e.dx,o=e.transform,i=e.backgroundStyle,a=e.backgroundPadding,l=e.backgroundComponent,s=e.inline,u=e.y,c=t.map((function(e,o){var i=iY(t,o-1),l=e.textSize,c=e.fontSize*e.lineHeight,d=Math.ceil(c),f=iY(a,o),p=iY(a,o-1),h=s&&r||0,y=o&&!s?i.fontSize*i.lineHeight+p.top+p.bottom:n-.5*c-(e.fontSize-e.capHeight);return{textHeight:d,labelSize:l,heightWithPadding:d+f.top+f.bottom,widthWithPadding:l.width+f.left+f.right+h,y:u,fontSize:e.fontSize,dy:y}}));return c.map((function(t,n){var r=lY(e,t.labelSize.width),d=c.slice(0,n+1).reduce((function(e,t){return e+t.dy}),u),f=iY(a,n),p=t.heightWithPadding,y=s?function(e,t,n){var r=e.textAnchor,o=t.map((function(e){return e.widthWithPadding})),i=-o.reduce((function(e,t){return e+t}),0)/2;switch(r){case"start":return o.reduce((function(e,t,r){return r<n?e+t:e}),0);case"end":return o.reduce((function(e,t,r){return r>n?e-t:e}),0);default:return o.reduce((function(e,t,r){return r===n?e+t/2:e+(r<n?t:0)}),i)}}(e,c,n)+r-f.left:r,g=s?sY(e,p)-f.top:d,m={key:"tspan-background-".concat(n),height:p,style:iY(i,n),width:t.widthWithPadding,transform:o,x:y-f.left,y:g};return h.cloneElement(l,SL()({},l.props,m))}))}(e,t):function(e,t){var n=e.dx,r=void 0===n?0:n,o=e.transform,i=e.backgroundComponent,a=e.backgroundStyle,l=e.inline,s=e.backgroundPadding,u=e.capHeight,c=t.map((function(e){return e.textSize})),d=l?Math.max.apply(Math,eY(c.map((function(e){return e.height})))):c.reduce((function(e,n,r){var o=r?0:u/2;return e+n.height*(t[r].lineHeight-o)}),0),f=l?c.reduce((function(e,t,n){var o=n?r:0;return e+t.width+o}),0):Math.max.apply(Math,eY(c.map((function(e){return e.width})))),p=lY(e,f),y=sY(e,d),g={key:"background",height:d+s.top+s.bottom,style:a,transform:o,width:f+s.left+s.right,x:l?p-s.left:p+r-s.left,y:y};return h.cloneElement(i,SL()({},i.props,g))}(e,t)},cY=function(e,t,n){var r=t.inline,o=iY(e,n);return n&&!r?function(e,t,n){var r=iY(e,t),o=iY(e,t-1),i=o.fontSize*o.lineHeight,a=r.fontSize*r.lineHeight,l=o.fontSize-o.capHeight,s=r.fontSize-r.capHeight,u=i-o.fontSize/2+r.fontSize/2-i/2+a/2-s/2+l/2;return aY(n)?u+r.backgroundPadding.top+o.backgroundPadding.bottom:u}(e,n,t):r?0===n?o.backgroundPadding.top:void 0:o.backgroundPadding.top},dY=function(e){var t=function(e,t){if(void 0!==e&&null!==e){if(Array.isArray(e))return e.map((function(e){return dF(e,t)}));var n=dF(e,t);if(void 0!==n&&null!==n)return Array.isArray(n)?n:"".concat(n).split("\n")}}(e.text,e),n=function(e,t){if(t.disableInlineStyles){var n=fF(e,t);return{fontSize:oY(n)}}var r=function(e){var n=fF(e=e?SL()({},e,nY):nY,t);return wL()({},n,{fontSize:oY(n)})};return Array.isArray(e)&&!bL()(e)?e.map((function(e){return r(e)})):r(e)}(e.style,wL()({},e,{text:t})),r=function(e,t){if(e)return Array.isArray(e)&&!bL()(e)?e.map((function(e){return fF(e,t)})):fF(e,t)}(e.backgroundStyle,wL()({},e,{text:t,style:n})),o=function(e){return e.backgroundPadding&&Array.isArray(e.backgroundPadding)?e.backgroundPadding.map((function(t){return lF({padding:dF(t,e)})})):lF({padding:dF(e.backgroundPadding,e)})}(wL()({},e,{text:t,style:n,backgroundStyle:r})),i=dF(e.id,e);return wL()({},e,{backgroundStyle:r,backgroundPadding:o,style:n,text:t,id:i})},fY=function(e){var t=dF(e.ariaLabel,e),n=iY(e.style),r=function(e){var t=dF(e.lineHeight,e);return Array.isArray(t)&&bL()(t)?[1]:t}(e),o=e.direction?dF(e.direction,e):"inherit",i=e.textAnchor?dF(e.textAnchor,e):n.textAnchor||"start",a=e.verticalAnchor?dF(e.verticalAnchor,e):n.verticalAnchor||"middle",l=e.dx?dF(e.dx,e):0,s=function(e,t,n){var r=e.dy?dF(e.dy,e):0,o=e.inline?1:e.text.length,i=dF(e.capHeight,e),a=t?dF(t,e):"middle",l=eY(Array(o).keys()).map((function(t){return iY(e.style,t).fontSize})),s=eY(Array(o).keys()).map((function(e){return iY(n,e)}));if("start"===a)return r+(i/2+s[0]/2)*l[0];if(e.inline)return"end"===a?r+(i/2-s[0]/2)*l[0]:r+i/2*l[0];if(1===o)return"end"===a?r+(i/2+(.5-o)*s[0])*l[0]:r+(i/2+(.5-o/2)*s[0])*l[0];var u=eY(Array(o).keys()).reduce((function(e,t){return e+(i/2+(.5-o)*s[t])*l[t]/o}),0);return"end"===a?r+u:r+u/2+i/2*s[o-1]*l[o-1]}(e,a,r),u=void 0!==e.x?e.x:rY(e,"x"),c=void 0!==e.y?e.y:rY(e,"y"),d=function(e,t,n){var r=e.polar,o=iY(e.style),i=r?GG(e):0,a=void 0===o.angle?dF(e.angle,e):o.angle,l=void 0===a?i:a,s=e.transform||o.transform,u=s&&dF(s,e);return u||l?M$(u,l&&{rotate:[l,t,n]}):void 0}(e,u,c);return wL()({},e,{ariaLabel:t,lineHeight:r,direction:o,textAnchor:i,verticalAnchor:a,dx:l,dy:s,originalDy:e.dy,transform:d,x:u,y:c})},pY=function(e){if(null===(e=dY(e)).text||void 0===e.text)return null;var t=fY(e),n=t.text,r=t.style,o=t.capHeight,i=t.backgroundPadding,a=t.lineHeight,l=n.map((function(e,t){var n=iY(r,t),l=xG("".concat(o,"em"),n.fontSize),s=iY(a,t);return{style:n,fontSize:n.fontSize||nY.fontSize,capHeight:l,text:e,textSize:kG(e,n),lineHeight:s,backgroundPadding:iY(i,t)}})),s=function(e,t){var n=e.ariaLabel,r=e.inline,o=e.className,i=e.title,a=e.events,l=e.direction,s=e.text,u=e.textAnchor,c=e.dx,d=e.dy,f=e.transform,p=e.x,y=e.y,g=e.desc,m=e.id,v=e.tabIndex,b=e.tspanComponent,x=e.textComponent,w=TF(e),j=ZG(ZG({"aria-label":n,key:"text"},a),{},{direction:l,dx:c,x:p,y:y+d,transform:f,className:o,title:i,desc:dF(g,e),tabIndex:dF(v,e),id:m},w),S=s.map((function(n,o){var i=t[o].style,a={key:"".concat(m,"-key-").concat(o),x:r?void 0:p,dx:r?c+t[o].backgroundPadding.left:c,dy:cY(t,e,o),textAnchor:i.textAnchor||u,style:i,children:n};return h.cloneElement(b,a)}));return h.cloneElement(x,j,S)}(t,l);if(e.backgroundStyle){var u=[uY(t,l),s],c=h.cloneElement(e.groupComponent,{},u);return e.renderInPortal?h.createElement(LG,null,c):c}return e.renderInPortal?h.createElement(LG,null,s):s};pY.displayName="VictoryLabel",pY.role="label",pY.defaultStyles=nY,pY.propTypes={active:oi().bool,angle:oi().oneOfType([oi().string,oi().number,oi().func]),ariaLabel:oi().oneOfType([oi().string,oi().func]),backgroundComponent:oi().element,backgroundPadding:oi().oneOfType([oi().number,oi().object,oi().array]),backgroundStyle:oi().oneOfType([oi().object,oi().array]),capHeight:oi().oneOfType([oi().string,SV,oi().func]),className:oi().string,data:oi().array,datum:oi().any,desc:oi().oneOfType([oi().string,oi().func]),direction:oi().oneOf(["rtl","ltr","inherit"]),dx:oi().oneOfType([oi().number,oi().string,oi().func]),dy:oi().oneOfType([oi().number,oi().string,oi().func]),events:oi().object,groupComponent:oi().element,id:oi().oneOfType([oi().number,oi().string,oi().func]),index:oi().oneOfType([oi().number,oi().string]),inline:oi().bool,labelPlacement:oi().oneOf(["parallel","perpendicular","vertical"]),lineHeight:oi().oneOfType([oi().string,SV,oi().func,oi().array]),origin:oi().shape({x:SV.isRequired,y:SV.isRequired}),polar:oi().bool,renderInPortal:oi().bool,scale:oi().shape({x:OV,y:OV}),style:oi().oneOfType([oi().object,oi().array]),tabIndex:oi().oneOfType([oi().number,oi().func]),text:oi().oneOfType([oi().string,oi().number,oi().func,oi().array]),textAnchor:oi().oneOfType([oi().oneOf(["start","middle","end","inherit"]),oi().func]),textComponent:oi().element,title:oi().string,transform:oi().oneOfType([oi().string,oi().object,oi().func]),tspanComponent:oi().element,verticalAnchor:oi().oneOfType([oi().oneOf(["start","middle","end"]),oi().func]),x:oi().oneOfType([oi().number,oi().string]),y:oi().oneOfType([oi().number,oi().string])},pY.defaultProps={backgroundComponent:h.createElement(IV,null),groupComponent:h.createElement("g",null),direction:"inherit",textComponent:h.createElement(zG,null),tspanComponent:h.createElement(UG,null),capHeight:.71,lineHeight:1};var hY=n(2185),yY=n.n(hY);const gY=e=>+e;function mY(e){return e*e}function vY(e){return e*(2-e)}function bY(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function xY(e){return e*e*e}function wY(e){return--e*e*e+1}function jY(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var SY=function e(t){function n(e){return Math.pow(e,t)}return t=+t,n.exponent=e,n}(3),kY=function e(t){function n(e){return 1-Math.pow(1-e,t)}return t=+t,n.exponent=e,n}(3),CY=function e(t){function n(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,n.exponent=e,n}(3),_Y=Math.PI,OY=_Y/2;function EY(e){return 1===+e?1:1-Math.cos(e*OY)}function TY(e){return Math.sin(e*OY)}function PY(e){return(1-Math.cos(_Y*e))/2}function AY(e){return 1.0009775171065494*(Math.pow(2,-10*e)-.0009765625)}function MY(e){return AY(1-+e)}function DY(e){return 1-AY(e)}function IY(e){return((e*=2)<=1?AY(1-e):2-AY(e-1))/2}function RY(e){return 1-Math.sqrt(1-e*e)}function NY(e){return Math.sqrt(1- --e*e)}function LY(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var FY=4/11,BY=6/11,zY=8/11,UY=3/4,WY=9/11,HY=10/11,KY=15/16,$Y=21/22,VY=63/64,qY=1/FY/FY;function GY(e){return 1-YY(1-e)}function YY(e){return(e=+e)<FY?qY*e*e:e<zY?qY*(e-=BY)*e+UY:e<HY?qY*(e-=WY)*e+KY:qY*(e-=$Y)*e+VY}function QY(e){return((e*=2)<=1?1-YY(1-e):YY(e-1)+1)/2}var XY=1.70158,ZY=function e(t){function n(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,n.overshoot=e,n}(XY),JY=function e(t){function n(e){return--e*e*((e+1)*t+e)+1}return t=+t,n.overshoot=e,n}(XY),eQ=function e(t){function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,n.overshoot=e,n}(XY),tQ=2*Math.PI,nQ=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=tQ);function o(e){return t*AY(- --e)*Math.sin((r-e)/n)}return o.amplitude=function(t){return e(t,n*tQ)},o.period=function(n){return e(t,n)},o}(1,.3),rQ=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=tQ);function o(e){return 1-t*AY(e=+e)*Math.sin((e+r)/n)}return o.amplitude=function(t){return e(t,n*tQ)},o.period=function(n){return e(t,n)},o}(1,.3),oQ=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=tQ);function o(e){return((e=2*e-1)<0?t*AY(-e)*Math.sin((r-e)/n):2-t*AY(e)*Math.sin((r+e)/n))/2}return o.amplitude=function(t){return e(t,n*tQ)},o.period=function(n){return e(t,n)},o}(1,.3),iQ=function(e){if(null!==e)switch(typeof e){case"undefined":case"boolean":return!1;case"number":return!isNaN(e)&&e!==Number.POSITIVE_INFINITY&&e!==Number.NEGATIVE_INFINITY;case"string":case"function":return!0;case"object":return e instanceof Date||Array.isArray(e)||MF()(e)}return!1},aQ=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return function(r){return r<n?e:t}},lQ=function(e,t){return function(n){return n>=1?t:function(){return Rz("function"===typeof e?e.apply(this,arguments):e,"function"===typeof t?t.apply(this,arguments):t)(n)}}},sQ=function(e,t){var n,r,o,i=function(e){return Array.isArray(e)?GF()(e,"key"):e},a={},l={};for(n in null!==e&&"object"===typeof e||(e={}),null!==t&&"object"===typeof t||(t={}),t)n in e?a[n]=(r=i(e[n]),o=i(t[n]),r!==o&&iQ(r)&&iQ(o)?"function"===typeof r||"function"===typeof o?lQ(r,o):"object"===typeof r&&MF()(r)||"object"===typeof o&&MF()(o)?sQ(r,o):Rz(r,o):aQ(r,o)):l[n]=t[n];return function(e){for(n in a)l[n]=a[n](e);return l}},uQ=function(e,t){return e!==t&&iQ(e)&&iQ(t)?"function"===typeof e||"function"===typeof t?lQ(e,t):MF()(e)||MF()(t)?sQ(e,t):"string"===typeof e||"string"===typeof t?function(e,t){var n=function(e){return"string"===typeof e?e.replace(/,/g,""):e};return Rz(n(e),n(t))}(e,t):Rz(e,t):aQ(e,t)};function cQ(e){return function(e){if(Array.isArray(e))return dQ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return dQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dQ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fQ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pQ(e,t){return pQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pQ(e,t)}function hQ(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=yQ(e);if(t){var o=yQ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function yQ(e){return yQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yQ(e)}var gQ=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pQ(e,t)}(i,e);var t,n,r,o=hQ(i);function i(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e,t)).interpolator=void 0,n.queue=void 0,n.ease=void 0,n.timer=void 0,n.loopID=void 0,n.functionToBeRunEachFrame=function(e,t){var r=(t=void 0!==t?t:n.props.duration)?e/t:1;if(r>=1)return n.setState({data:n.interpolator(1),animationInfo:{progress:1,animating:!1,terminating:!0}}),n.loopID&&n.timer.unsubscribe(n.loopID),n.queue.shift(),void n.traverseQueue();n.setState({data:n.interpolator(n.ease(r)),animationInfo:{progress:r,animating:r<1}})},n.state={data:Array.isArray(n.props.data)?n.props.data[0]:n.props.data,animationInfo:{progress:0,animating:!1}},n.interpolator=null,n.queue=Array.isArray(n.props.data)?n.props.data.slice(1):[],n.ease=a[n.toNewName(n.props.easing)],n.timer=n.context.animationTimer,n}return t=i,n=[{key:"componentDidMount",value:function(){this.queue.length&&this.traverseQueue()}},{key:"componentDidUpdate",value:function(e){if(!Xq()(this.props,e))if(this.interpolator&&this.state.animationInfo&&this.state.animationInfo.progress<1)this.setState({data:this.interpolator(1),animationInfo:{progress:1,animating:!1,terminating:!0}});else{var t;this.timer.unsubscribe(this.loopID),Array.isArray(this.props.data)?(t=this.queue).push.apply(t,cQ(this.props.data)):(this.queue.length=0,this.queue.push(this.props.data)),this.traverseQueue()}}},{key:"componentWillUnmount",value:function(){this.loopID?this.timer.unsubscribe(this.loopID):this.timer.stop()}},{key:"toNewName",value:function(e){return"ease".concat(function(e){return e&&e[0].toUpperCase()+e.slice(1)}(e))}},{key:"traverseQueue",value:function(){var e=this;if(this.queue.length){var t=this.queue[0];this.interpolator=uQ(this.state.data,t),this.props.delay?setTimeout((function(){e.loopID=e.timer.subscribe(e.functionToBeRunEachFrame,e.props.duration)}),this.props.delay):this.loopID=this.timer.subscribe(this.functionToBeRunEachFrame,this.props.duration)}else this.props.onEnd&&this.props.onEnd()}},{key:"render",value:function(){return this.props.children(this.state.data,this.state.animationInfo)}}],n&&fQ(t.prototype,n),r&&fQ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function mQ(){return mQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mQ.apply(this,arguments)}function vQ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bQ(e,t){return bQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bQ(e,t)}function xQ(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=wQ(e);if(t){var o=wQ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function wQ(e){return wQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wQ(e)}gQ.displayName="VictoryAnimation",gQ.propTypes={children:oi().func,data:oi().oneOfType([oi().object,oi().array]),delay:oi().number,duration:oi().number,easing:oi().oneOf(["back","backIn","backOut","backInOut","bounce","bounceIn","bounceOut","bounceInOut","circle","circleIn","circleOut","circleInOut","linear","linearIn","linearOut","linearInOut","cubic","cubicIn","cubicOut","cubicInOut","elastic","elasticIn","elasticOut","elasticInOut","exp","expIn","expOut","expInOut","poly","polyIn","polyOut","polyInOut","quad","quadIn","quadOut","quadInOut","sin","sinIn","sinOut","sinInOut"]),onEnd:oi().func},gQ.defaultProps={data:{},delay:0,duration:1e3,easing:"quadInOut"},gQ.contextType=vq;var jQ=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bQ(e,t)}(i,e);var t,n,r,o=xQ(i);function i(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e,t)).continuous=void 0,n.timer=void 0,n.transitionProps=void 0,n.state={nodesShouldLoad:!1,nodesDoneLoad:!1};var r=n.props.children,a=r.props.polar;return n.continuous=!a&&r.type&&!0===r.type.continuous,n.timer=n.context.transitionTimer,n}return t=i,n=[{key:"componentDidMount",value:function(){this.setState({nodesShouldLoad:!0})}},{key:"shouldComponentUpdate",value:function(e){var t=this;return Xq()(this.props,e)||(this.timer.bypassAnimation(),this.setState(this.getTransitionState(this.props,e),(function(){return t.timer.resumeAnimation()}))),!0}},{key:"componentWillUnmount",value:function(){this.timer.stop()}},{key:"getTransitionState",value:function(e,t){var n=e.animate;if(!n)return{};if(n.parentState)return{oldProps:n.parentState.nodesWillExit?e:null,nextProps:t};var r=HL(h.Children.toArray(e.children),h.Children.toArray(t.children)),o=r.nodesWillExit;return{nodesWillExit:o,nodesWillEnter:r.nodesWillEnter,childrenTransitions:r.childrenTransitions,nodesShouldEnter:r.nodesShouldEnter,oldProps:o?e:null,nextProps:t}}},{key:"getDomainFromChildren",value:function(e,t){var n=function(e){return e.reduce((function(e,r){if(r.type&&rF()(r.type.getDomain)){var o=r.props&&r.type.getDomain(r.props,t);return o?e.concat(o):e}return r.props&&r.props.children?e.concat(n(h.Children.toArray(r.props.children))):e}),[])},r=h.Children.toArray(e.children)[0],o=r.props||{},i=Array.isArray(o.domain)?o.domain:o.domain&&o.domain[t];if(!o.children&&i)return i;var a=n([r]);return 0===a.length?[0,1]:[IL(a),DL(a)]}},{key:"pickProps",value:function(){return this.state&&this.state.nodesWillExit&&this.state.oldProps||this.props}},{key:"pickDomainProps",value:function(e){var t,n=null===(t=e.animate)||void 0===t?void 0:t.parentState;return n&&n.nodesWillExit?(this.continuous||n.continuous)&&(n.nextProps||this.state.nextProps)||e:this.continuous&&this.state.nodesWillExit&&this.state.nextProps||e}},{key:"getClipWidth",value:function(e,t){var n=this.transitionProps?this.transitionProps.clipWidth:void 0;return void 0!==n?n:function(){var n=mF(t.props,"x");return n?Math.abs(n[1]-n[0]):e.width}()}},{key:"render",value:function(){var e,t=this,n=this.pickProps(),r=null!==(e=this.props.animate)&&void 0!==e&&e.getTransitions?this.props.animate.getTransitions:KL(n,this.state,(function(e){return t.setState(e)})),o=h.Children.toArray(n.children)[0],i=r(o);this.transitionProps=i;var a={x:this.getDomainFromChildren(this.pickDomainProps(n),"x"),y:this.getDomainFromChildren(n,"y")},l=this.getClipWidth(n,o),s=SL()({domain:a,clipWidth:l},i,o.props),u=(n.animationWhitelist||[]).concat(["clipWidth"]),c=u.length?JL()(s,u):s;return h.createElement(gQ,mQ({},s.animate,{data:c}),(function(e){if(o.props.groupComponent){var n=t.continuous?h.cloneElement(o.props.groupComponent,{clipWidth:e.clipWidth||0}):o.props.groupComponent;return h.cloneElement(o,SL()({animate:null,animating:!0,groupComponent:n},e,s))}return h.cloneElement(o,SL()({animate:null,animating:!0},e,s))}))}}],n&&vQ(t.prototype,n),r&&vQ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function SQ(e){return function(e){if(Array.isArray(e))return kQ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return kQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kQ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CQ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _Q(e,t){return _Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_Q(e,t)}function OQ(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=TQ(e);if(t){var o=TQ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return EQ(e)}(this,n)}}function EQ(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TQ(e){return TQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},TQ(e)}jQ.displayName="VictoryTransition",jQ.propTypes={animate:oi().oneOfType([oi().bool,oi().object]),animationWhitelist:oi().array,children:oi().node},jQ.contextType=vq;var PQ=function(e){return!yY()(e._x)&&!yY()(e._y)},AQ=[{name:"parent",index:"parent"},{name:"data"},{name:"labels"}];function MQ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(n){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_Q(e,t)}(l,n);var r,o,i,a=OQ(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).state={},t.getEventState=W$.bind(EQ(t)),t.getScopedEvents=z$.bind(EQ(t)),t.getEvents=function(e,n,r){return B$.call(EQ(t),e,n,r,t.getScopedEvents)},t.externalMutations=t.getExternalMutations(t.props),t.calculatedState=t.getStateChanges(t.props),t.globalEvents={},t.prevGlobalEventKeys=[],t.boundGlobalEvents={},t.cacheValues(t.getCalculatedValues(e)),t}return r=l,o=[{key:"shouldComponentUpdate",value:function(e){var t=this.getExternalMutations(e),n=this.props.animating||this.props.animate,r=!Xq()(t,this.externalMutations);if(n||r)return this.cacheValues(this.getCalculatedValues(e)),this.externalMutations=t,this.applyExternalMutations(e,t),!0;var o=this.getStateChanges(e);return Xq()(this.calculatedState,o)?!Xq()(this.props,e)&&(this.cacheValues(this.getCalculatedValues(e)),!0):(this.cacheValues(this.getCalculatedValues(e)),!0)}},{key:"componentDidMount",value:function(){var e=this,t=NL()(this.globalEvents);t.forEach((function(t){return e.addGlobalListener(t)})),this.prevGlobalEventKeys=t}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.getStateChanges(e);this.calculatedState=n;var r=NL()(this.globalEvents);qq()(this.prevGlobalEventKeys,r).forEach((function(e){return t.removeGlobalListener(e)})),qq()(r,this.prevGlobalEventKeys).forEach((function(e){return t.addGlobalListener(e)})),this.prevGlobalEventKeys=r}},{key:"componentWillUnmount",value:function(){var e=this;this.prevGlobalEventKeys.forEach((function(t){return e.removeGlobalListener(t)}))}},{key:"addGlobalListener",value:function(e){var t=this,n=function(n){var r=t.globalEvents[e];return r&&r(Y$(n))};this.boundGlobalEvents[e]=n,window.addEventListener(V$(e),n)}},{key:"removeGlobalListener",value:function(e){window.removeEventListener(V$(e),this.boundGlobalEvents[e])}},{key:"getStateChanges",value:function(e){var n=this;if(!this.hasEvents)return{};var r=function(e,t){var r=SL()({},n.getEventState(e,t),n.getSharedEventState(e,t));return bL()(r)?void 0:r},o=(t.components||AQ).map((function(t){if(e.standalone||"parent"!==t.name)return void 0!==t.index?r(t.index,t.name):n.dataKeys.map((function(e){return r(e,t.name)})).filter(Boolean)})).filter(Boolean);return o}},{key:"applyExternalMutations",value:function(e,t){if(!bL()(t)){var n=e.externalEventMutations.reduce((function(e,t){return e=rF()(t.callback)?e.concat(t.callback):e}),[]),r=n.length?function(){n.forEach((function(e){return e()}))}:void 0;this.setState(t,r)}}},{key:"getCalculatedValues",value:function(t){var n=t.sharedEvents,r=$$(t,e.expectedComponents),o=n&&rF()(n.getEventState)?n.getEventState:function(){},i=this.getBaseProps(t,o),a=NL()(i).filter((function(e){return"parent"!==e}));return{componentEvents:r,getSharedEventState:o,baseProps:i,dataKeys:a,hasEvents:t.events||t.sharedEvents||r,events:this.getAllEvents(t)}}},{key:"getExternalMutations",value:function(e){var t=e.sharedEvents,n=e.externalEventMutations;return bL()(n)||t?void 0:H$(n,this.baseProps,this.state)}},{key:"cacheValues",value:function(e){var t=this;NL()(e).forEach((function(n){t[n]=e[n]}))}},{key:"getBaseProps",value:function(t,n){var r=(n=n||this.getSharedEventState.bind(this))("parent","parent"),o=this.getEventState("parent","parent"),i=SL()({},o,r),a=i.parentControlledProps,l=a?JL()(i,a):{},s=SL()({},l,t);return"function"===typeof e.getBaseProps?e.getBaseProps(s):{}}},{key:"getAllEvents",value:function(e){var t;return Array.isArray(this.componentEvents)?Array.isArray(e.events)?(t=this.componentEvents).concat.apply(t,SQ(e.events)):this.componentEvents:e.events}},{key:"getComponentProps",value:function(t,n,r){var o=this.props.name||e.role,i=this.dataKeys&&this.dataKeys[r]||r,a="".concat(o,"-").concat(n,"-").concat(i),l=this.baseProps[i]&&this.baseProps[i][n]||this.baseProps[i];if(l||this.hasEvents){if(this.hasEvents){var s=this.getEvents(this.props,n,i),u=SL()({index:r,key:a},this.getEventState(i,n),this.getSharedEventState(i,n),t.props,l,{id:a}),c=SL()({},U$(s,i,u),u.events);return wL()({},u,{events:c})}return SL()({index:r,key:a},t.props,l,{id:a})}}},{key:"renderContainer",value:function(e,t){var n=e.type&&"container"===e.type.role?this.getComponentProps(e,"parent","parent"):{};return n.events&&(this.globalEvents=q$(n.events),n.events=G$(n.events)),h.cloneElement(e,n,t)}},{key:"animateComponent",value:function(e,t){var n,r="object"===typeof e.animate&&(null===(n=e.animate)||void 0===n?void 0:n.animationWhitelist)||t,o=this.constructor;return h.createElement(jQ,{animate:e.animate,animationWhitelist:r},h.createElement(o,e))}},{key:"renderContinuousData",value:function(e){var t=this,n=e.dataComponent,r=e.labelComponent,o=e.groupComponent,i=KF()(this.dataKeys,"all").reduce((function(e,n){var o=t.getComponentProps(r,"labels",n);return o&&void 0!==o.text&&null!==o.text&&(e=e.concat(h.cloneElement(r,o))),e}),[]),a=this.getComponentProps(n,"data","all"),l=[h.cloneElement(n,a)].concat(SQ(i));return this.renderContainer(o,l)}},{key:"renderData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:PQ,r=e.dataComponent,o=e.labelComponent,i=e.groupComponent,a=this.dataKeys.reduce((function(e,o,i){var a=t.getComponentProps(r,"data",i);return n(a.datum)&&e.push(h.cloneElement(r,a)),e}),[]),l=this.dataKeys.map((function(e,n){var r=t.getComponentProps(o,"labels",n);if(void 0!==r.text&&null!==r.text)return h.cloneElement(o,r)})).filter(Boolean),s=[].concat(SQ(a),SQ(l));return this.renderContainer(i,s)}}],o&&CQ(r.prototype,o),i&&CQ(r,i),Object.defineProperty(r,"prototype",{writable:!1}),l}(e);return n}function DQ(e){return function(e){if(Array.isArray(e))return IQ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return IQ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IQ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var NQ={top:-1,left:-1,right:1,bottom:1},LQ=function(e){return null!==e&&void 0!==e},FQ=function(e,t){var n=e.style||{};t=t||{};return{parent:SL()(n.parent,t.parent,{height:"100%",width:"100%"}),axis:SL()({},n.axis,t.axis),axisLabel:SL()({},n.axisLabel,t.axisLabel),grid:SL()({},n.grid,t.grid),ticks:SL()({},n.ticks,t.ticks),tickLabels:SL()({},n.tickLabels,t.tickLabels)}},BQ=function(e,t,n){var r=e.position,o=e.transform;return{x1:o.x,y1:o.y,x2:o.x+r.x2,y2:o.y+r.y2,style:t,datum:n}},zQ=function(e,t,n,r,o){var i=e.position,a=e.transform;return{style:t,x:a.x+i.x,y:a.y+i.y,verticalAnchor:n.verticalAnchor,textAnchor:n.textAnchor,angle:t.angle,text:o,datum:r}},UQ=function(e,t,n){var r=e.edge,o=e.transform;return{x1:o.x,y1:o.y,x2:r.x+o.x,y2:r.y+o.y,style:t,datum:n}},WQ=function(e,t,n){var r=t||"positive";return n?{positive:{x:"left",y:"bottom"},negative:{x:"right",y:"top"}}[r][e]:{positive:{x:"bottom",y:"left"},negative:{x:"top",y:"right"}}[r][e]},HQ=function(e,t,n){var r=t.orientation,o=P$(e,t.axis);return{top:{x:0,y:void 0!==o?o:n.y},bottom:{x:0,y:void 0!==o?o:e.height-n.y},left:{x:void 0!==o?o:n.x,y:0},right:{x:void 0!==o?o:e.width-n.x,y:0}}[r]},KQ=function(e,t,n){var r=e.tickStyle,o=e.labelStyle,i=r.size||0,a=i+(r.padding||0)+(o.padding||0),l=NQ[t];return{x:n?l*a:0,x2:n?l*i:0,y:n?0:l*a,y2:n?0:l*i}},$Q=function(e,t,n){return{x:n?t.x:e+t.x,y:n?e+t.y:t.y}},VQ=function(e,t){var n=t.orientation,r=t.padding,o=t.isVertical,i=-NQ[n];return{x:o?i*(e.width-(r.left+r.right)):0,y:o?0:i*(e.height-(r.top+r.bottom))}},qQ=function(e,t){var n=e.padding,r=e.orientation,o=e.crossAxis,i="right"===r?n.right:n.left,a="top"===r?n.top:n.bottom;return{x:o?t.x-i:0,y:o?t.y-a:0}},GQ=function(e,t){var n;return n=t.domain.x&&t.domain.y?e.horizontal?function(e,t){var n=t.scale,r=t.origin,o=t.orientation,i=t.orientations,a=t.domain,l=t.padding,s=l.top,u=l.bottom,c=l.left,d=l.right,f="bottom"===o||"top"===o?o:i.x,p="left"===o||"right"===o?o:i.y,h={x:"bottom"===f?u:s,y:"left"===p?c:d},y="left"===p?0:e.width,g="bottom"===f?e.height:0,m=r.x===a.x[0]||r.x===a.x[1]?0:n.x(r.x),v=r.y===a.y[0]||r.y===a.y[1]?0:n.y(r.y),b=m?Math.abs(g-m):h.x,x=v?Math.abs(y-v):h.y;return{x:LQ(e.offsetX)?e.offsetX:x,y:LQ(e.offsetY)?e.offsetY:b}}(e,t):function(e,t){var n=t.scale,r=t.origin,o=t.orientation,i=t.orientations,a=t.domain,l=t.padding,s=l.top,u=l.bottom,c=l.left,d=l.right,f="bottom"===o||"top"===o?o:i.x,p="left"===o||"right"===o?o:i.y,h={x:"left"===p?c:d,y:"bottom"===f?u:s},y="left"===p?0:e.width,g="bottom"===f?e.height:0,m=r.x===a.x[0]||r.x===a.x[1]?0:n.x(r.x),v=r.y===a.y[0]||r.y===a.y[1]?0:n.y(r.y),b=m?Math.abs(y-m):h.x,x=v?Math.abs(g-v):h.y;return{x:LQ(e.offsetX)?e.offsetX:b,y:LQ(e.offsetY)?e.offsetY:x}}(e,t):function(e,t){var n=t.style,r=t.scale,o=t.orientation,i=t.padding,a=t.axis,l=t.ticks,s=t.stringTicks,u=t.isVertical,c=t.labelPadding,d=e.polar,f=e.horizontal,p={scale:RQ({},a,r),polar:d,horizontal:f,ticks:l,stringTicks:s},h="right"===o?i.right:i.left,y="top"===o?i.top:i.bottom,g=null!==e.offsetX&&void 0!==e.offsetX?e.offsetX:h,m=null!==e.offsetY&&void 0!==e.offsetY?e.offsetY:y,v=n.axisLabel.fontSize||14,b=l.map((function(t,r){var o=s?e.tickValues[t-1]:t;return fF(n.ticks,wL()({},p,{tick:o,index:r})).size||0})),x=v+2*Math.max.apply(Math,DQ(b))+c,w=1.2*v;return{x:null!==g&&void 0!==g?g:u?x:w,y:null!==m&&void 0!==m?m:u?w:x}}(e,t),{globalTransform:HQ(e,t,n),gridOffset:qQ(t,n),gridEdge:VQ(e,t)}},YQ=function(e){var t=function(e){var t=e.theme,n=e.dependentAxis,r=t&&t.axis&&t.axis.style,o=n?"dependentAxis":"independentAxis",i=t&&t[o]&&t[o].style;return r&&i?["axis","axisLabel","grid","parent","tickLabels","ticks"].reduce((function(e,t){return e[t]=SL()({},i[t],r[t]),e}),{}):i||r}(e),n=FQ(e,t),r=lF(e),o=function(e,t){var n=t.axisLabel||{};if(void 0!==n.padding&&null!==n.padding)return n.padding;var r=w$(e),o=n.fontSize||14;return e.label?o*(r?2.3:1.6):0}(e,n),i=j$(e)?e.tickValues:void 0,a=y$(e),l=T$(e),s=function(e){var t=y$(e),n=function(e,t){var n=e.orientation,r=e.horizontal;return n?{top:"x",bottom:"x",left:"y",right:"y"}[n]:r?"x"===t?"y":"x":t}(e,t),r=_K(e,t),o=e.domain&&e.domain[t]||T$(e)||r.domain();return r.range(mF(e,n)),r.domain(o),r}(e),u="x"===a?l:void 0,c="y"===a?l:void 0,d="x"===a?s:void 0,f="y"===a?s:void 0,p=!(!1===e.crossAxis||!0===e.standalone),h=O$(e,s,p),y=C$(e,s),g={x:mF(e,"x"),y:mF(e,"y")},m={x:e.domain&&e.domain.x?e.domain.x:u,y:e.domain&&e.domain.y?e.domain.y:c},v={x:e.domain&&e.domain.x?_K(e,"x").domain(e.domain.x).range(e.horizontal?g.y:g.x):d,y:e.domain&&e.domain.y?_K(e,"y").domain(e.domain.y).range(e.horizontal?g.x:g.y):f},b=m.x&&m.y?b$(m):void 0,x=b?{x:x$(b.x,m.x),y:x$(b.y,m.y)}:void 0,w=x?{x:WQ("x",x.y,e.horizontal),y:WQ("y",x.x,e.horizontal)}:void 0,j=w?e.orientation||w[a]:function(e){if(e.orientation)return e.orientation;var t={dependent:e.horizontal?"bottom":"left",independent:e.horizontal?"left":"bottom"};return e.dependentAxis?t.dependent:t.independent}(e),S=w$(Object.assign({},e,{orientation:j})),k=function(e,t){var n={top:"end",left:"end",right:"start",bottom:"start"}[e];return{textAnchor:t?n:"middle",verticalAnchor:t?"middle":n}}(j,S);return{anchors:k,axis:a,crossAxis:p,domain:m,isVertical:S,labelPadding:o,orientation:j,orientations:w,origin:b,padding:r,scale:v,stringTicks:i,style:n,tickFormat:y,ticks:h}},QQ=function(e,t){e=A$(e,t);var n=YQ(e),r=n.axis,o=n.style,i=n.orientation,a=n.isVertical,l=n.scale,s=n.ticks,u=n.tickFormat,c=n.anchors,d=n.domain,f=n.stringTicks,p="x"===r?"y":"x",h=e,y=h.width,g=h.height,m=h.standalone,v=h.theme,b=h.polar,x=h.padding,w=h.horizontal,j=GQ(e,n),S=j.globalTransform,k=j.gridOffset,C=j.gridEdge,_={scale:RQ({},r,l[r]),polar:b,horizontal:w,ticks:s,stringTicks:f},O=function(e,t,n){var r=t.style,o=t.padding,i=t.isVertical,a=e.width,l=e.height;return{style:r.axis,x1:i?n.x:o.left+n.x,x2:i?n.x:a-o.right+n.x,y1:i?o.top+n.y:n.y,y2:i?l-o.bottom+n.y:n.y}}(e,n,S),E=function(e,t,n){var r=t.style,o=t.orientation,i=t.padding,a=t.labelPadding,l=t.isVertical,s=NQ[o],u=i.left+i.right,c=i.top+i.bottom,d=s<0?"end":"start",f=r.axisLabel,p=l?-90:0;return{x:l?n.x+s*a:(e.width-u)/2+i.left+n.x,y:l?(e.height-c)/2+i.top+n.y:s*a+n.y,verticalAnchor:f.verticalAnchor||d,textAnchor:f.textAnchor||"middle",angle:void 0===f.angle?p:f.angle,style:f,text:e.label}}(e,n,S),T={parent:wL()({style:o.parent,ticks:s,standalone:m,theme:v,width:y,height:g,padding:x,domain:d},_)},P={dimension:p,range:RQ({},p,mF(e,p)),scale:e.scale&&e.scale[p]?RQ({},p,e.scale[p]):void 0};return s.reduce((function(e,t,n){var d,p,h,y=f?f[n]:t,g=u(t,n,s),m=function(e,t){return{tickStyle:fF(e.ticks,t),labelStyle:fF(e.tickLabels,t),gridStyle:fF(e.grid,t)}}(o,wL()({},_,{tick:y,tickValue:t,index:n,text:g})),v={position:KQ(m,i,a),transform:$Q(null===(d=l[r])||void 0===d?void 0:d.call(l,t),S,a)},b={edge:C,transform:{x:a?-k.x+S.x:(null===(p=l[r])||void 0===p?void 0:p.call(l,t))+S.x,y:a?(null===(h=l[r])||void 0===h?void 0:h.call(l,t))+S.y:k.y+S.y}};return e[n]={axis:wL()({dimension:r},_,O),axisLabel:wL()({},_,E),ticks:wL()({},_,BQ(v,m.tickStyle,t)),tickLabels:wL()({},_,zQ(v,m.labelStyle,c,t,g)),grid:wL()({},_,P,UQ(b,m.gridStyle,t))},e}),T)};function XQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ZQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XQ(Object(n),!0).forEach((function(t){JQ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XQ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function JQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eX(e){return function(e){if(Array.isArray(e))return tX(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return tX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tX(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rX(e,t){return rX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rX(e,t)}function oX(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=iX(e);if(t){var o=iX(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function iX(e){return iX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iX(e)}var aX={width:450,height:300,padding:50},lX=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rX(e,t)}(i,e);var t,n,r,o=oX(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,n=[{key:"renderLine",value:function(e){var t=e.axisComponent,n=this.getComponentProps(t,"axis",0);return h.cloneElement(t,n)}},{key:"renderLabel",value:function(e){var t=e.axisLabelComponent;if(!e.label)return null;var n=this.getComponentProps(t,"axisLabel",0);return h.cloneElement(t,n)}},{key:"renderGridAndTicks",value:function(e){var t=this,n=e.tickComponent,r=e.tickLabelComponent,o=e.gridComponent,i=e.name,a=function(e){var t=e.style,n=void 0===t?{}:t,r=e.events,o=void 0===r?{}:r;return"transparent"!==n.stroke&&"none"!==n.stroke&&0!==n.strokeWidth||!bL()(o)};return this.dataKeys.map((function(l,s){var u=t.getComponentProps(n,"ticks",s),c=h.cloneElement(n,u),d=a(c.props)?c:void 0,f=t.getComponentProps(o,"grid",s),p=h.cloneElement(o,f),y=a(p.props)?p:void 0,g=t.getComponentProps(r,"tickLabels",s),m=[y,d,h.cloneElement(r,g)].filter(Boolean);return h.cloneElement(e.groupComponent,{key:"".concat(i,"-tick-group-").concat(l)},m)}))}},{key:"fixLabelOverlap",value:function(e,t){var n=w$(t),r=n?t.height:t.width,o=function(e){return e.type&&"label"===e.type.role},i=e.map((function(e){return e.props.children})).reduce((function(e,t){return e.concat(t)}),[]).filter(o).map((function(e){return e.props})),a=i.reduce((function(e,t){var r=function(e){return"object"===typeof e?wL()({},{top:0,right:0,bottom:0,left:0},e):{top:e,right:e,bottom:e,left:e}}(t.style.padding),o=kG(t.text,{angle:t.angle,fontSize:t.style.fontSize,letterSpacing:t.style.letterSpacing,fontFamily:t.style.fontFamily});return e+(n?o.height+r.top+r.bottom:o.width+r.right+r.left)}),0),l=Math.floor(r*e.length/a),s=Math.ceil(e.length/l)||1,u=function(e){return e.props.children.filter(o).reduce((function(e,t){return(n?t.props.y:t.props.x)||0}),0)},c=e.sort((function(e,t){return n?u(t)-u(e):u(e)-u(t)}));return c.filter((function(e,t){return t%s===0}))}},{key:"shouldAnimate",value:function(){return!!this.props.animate}},{key:"render",value:function(){var e=sX.animationWhitelist,t=A$(this.props,aX),n=TF(this.props);if(this.shouldAnimate())return this.animateComponent(t,e);var r=this.renderGridAndTicks(t),o=t.fixLabelOverlap?this.fixLabelOverlap(r,t):r,i=[this.renderLine(t),this.renderLabel(t)].concat(eX(o)),a=h.cloneElement(t.containerComponent,n);return t.standalone?this.renderContainer(a,i):h.cloneElement(t.groupComponent,n,i)}}],n&&nX(t.prototype,n),r&&nX(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);lX.animationWhitelist=["style","domain","range","tickCount","tickValues","offsetX","offsetY","padding","width","height"],lX.displayName="VictoryAxis",lX.role="axis",lX.defaultTransitions={onExit:{duration:500},onEnter:{duration:500}},lX.propTypes=ZQ(ZQ({},PV.baseProps),{},{axisComponent:oi().element,axisLabelComponent:oi().element,axisValue:oi().oneOfType([oi().number,oi().string,oi().object]),categories:oi().oneOfType([oi().arrayOf(oi().string),oi().shape({x:oi().arrayOf(oi().string),y:oi().arrayOf(oi().string)})]),crossAxis:oi().bool,dependentAxis:oi().bool,events:oi().arrayOf(oi().shape({target:oi().oneOf(["axis","axisLabel","grid","ticks","tickLabels"]),eventKey:oi().oneOfType([oi().array,jV([kV,SV]),oi().string]),eventHandlers:oi().object})),fixLabelOverlap:oi().bool,gridComponent:oi().element,groupComponent:oi().element,invertAxis:oi().bool,label:oi().any,offsetX:oi().number,offsetY:oi().number,orientation:oi().oneOf(["top","bottom","left","right"]),origin:oi().shape({x:oi().number,y:oi().number}),stringMap:oi().object,style:oi().shape({parent:oi().object,axis:oi().object,axisLabel:oi().object,grid:oi().object,ticks:oi().object,tickLabels:oi().object}),tickComponent:oi().element,tickCount:jV([kV,CV]),tickFormat:oi().oneOfType([oi().func,EV]),tickLabelComponent:oi().element,tickValues:EV}),lX.defaultProps={axisComponent:h.createElement(MG,null),axisLabelComponent:h.createElement(pY,null),tickLabelComponent:h.createElement(pY,null),tickComponent:h.createElement(MG,null),gridComponent:h.createElement(MG,null),standalone:!0,theme:$q.grayscale,containerComponent:h.createElement(Oq,null),groupComponent:h.createElement("g",{role:"presentation"}),fixLabelOverlap:!1},lX.getDomain=T$,lX.getAxis=y$,lX.getStyles=function(e){return FQ(e)},lX.getBaseProps=function(e){return QQ(e,aX)},lX.expectedComponents=["axisComponent","axisLabelComponent","groupComponent","containerComponent","tickComponent","tickLabelComponent","gridComponent"];var sX=MQ(lX,{components:[{name:"axis",index:0},{name:"axisLabel",index:0},{name:"grid"},{name:"parent",index:"parent"},{name:"ticks"},{name:"tickLabels"}]}),uX=["desc"];function cX(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var dX=function(e){var t=e.desc,n=cX(e,uX);return t?h.createElement("path",n,h.createElement("desc",null,t)):h.createElement("path",n)};function fX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fX(Object(n),!0).forEach((function(t){hX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yX=function(e){var t=e.cx,n=e.cy,r=e.r,o=e.startAngle,i=e.endAngle,a=e.closedPath,l=Math.abs(i-o)/2+o,s=t+r*Math.cos(pF(o)),u=n-r*Math.sin(pF(o)),c=t+r*Math.cos(pF(l)),d=n-r*Math.sin(pF(l)),f=t+r*Math.cos(pF(i)),p=n-r*Math.sin(pF(i)),h=l-o<=180?0:1,y=i-l<=180?0:1,g=a?" M ".concat(t,", ").concat(n," L ").concat(s,", ").concat(u):"M ".concat(s,", ").concat(u),m="A ".concat(r,", ").concat(r,", 0, ").concat(h,", 0, ").concat(c,", ").concat(d),v="A ".concat(r,", ").concat(r,", 0, ").concat(y,", 0, ").concat(f,", ").concat(p),b=a?"Z":"";return"".concat(g," ").concat(m," ").concat(v," ").concat(b)},gX=function(e){return e=function(e){var t=dF(e.ariaLabel,e),n=dF(e.desc,e),r=dF(e.id,e),o=fF(wL()({stroke:"black",fill:"none"},e.style),e),i=dF(e.tabIndex,e);return wL()({},e,{ariaLabel:t,desc:n,id:r,style:o,tabIndex:i})}(e),h.cloneElement(e.pathComponent,pX(pX({},e.events),{},{"aria-label":e.ariaLabel,d:yX(e),style:e.style,desc:e.desc,tabIndex:e.tabIndex,className:e.className,role:e.role,shapeRendering:e.shapeRendering,transform:e.transform,clipPath:e.clipPath}))};gX.propTypes=pX(pX({},PV.primitiveProps),{},{closedPath:oi().bool,cx:oi().number,cy:oi().number,datum:oi().any,endAngle:oi().number,pathComponent:oi().element,r:oi().number,startAngle:oi().number}),gX.defaultProps={pathComponent:h.createElement(dX,null),role:"presentation",shapeRendering:"auto"};var mX=function(e,t,n){return"x"===n?e*Math.cos(t):-e*Math.sin(t)},vX=function(e){var t=e.dependentAxis?"radial":"angular",n="angular"===t?"radial":"angular";return e.horizontal?n:t},bX=function(e,t){return{tickStyle:fF(e.ticks,t),labelStyle:fF(e.tickLabels,t),gridStyle:fF(e.grid,t)}},xX=function(e){var t=lF(e),n=t.left,r=t.right,o=t.top,i=t.bottom,a=e.width,l=e.height;return Math.min(a-n-r,l-o-i)/2},wX=function(e,t){if(e.range&&e.range[t])return e.range[t];if(e.range&&Array.isArray(e.range))return e.range;if("angular"===vX(e))return[pF(e.startAngle),pF(e.endAngle)];var n=xX(e);return[e.innerRadius||0,n]},jX=function(e){var t=y$(e),n=_K(e,t),r=T$(e,t)||n.domain(),o=wX(e,t);return n.range(o),n.domain(r),n},SX=function(e,t){if(e.disableInlineStyles)return{};var n=e.style||{};t=t||{};return{parent:SL()({height:"auto",width:"100%"},n.parent,t.parent),axis:SL()({},n.axis,t.axis),axisLabel:SL()({},n.axisLabel,t.axisLabel),grid:SL()({},n.grid,t.grid),ticks:SL()({},n.ticks,t.ticks),tickLabels:SL()({},n.tickLabels,t.tickLabels)}},kX=function(e){var t=e.axisAngle,n=e.startAngle,r=e.dependentAxis,o=P$(e,y$(e));return void 0!==o&&r?hF(o):void 0===t?n:t},CX=function(e,t,n,r){var o=t.axisType,i=t.radius,a=t.scale,l=t.style,s=t.stringTicks,u=t.ticks,c=t.tickFormat,d=t.origin,f=c(n,r,u),p=s?s[r]:n,h=bX(l,{tick:p,tickValue:n,index:r,ticks:u,stringTicks:s,radius:i,scale:a,axisType:o,text:f}).tickStyle,y="radial"===o?kX(e):void 0,g=h.padding||h.size||0,m=pF(90-y),v="angular"===o?a(n):pF(-1*y),b="angular"===o?i:a(n);return"angular"===o?{index:r,datum:p,style:h,x1:mX(b,v,"x")+d.x,y1:mX(b,v,"y")+d.y,x2:mX(b+g,v,"x")+d.x,y2:mX(b+g,v,"y")+d.y}:{index:r,datum:p,style:h,x1:b*Math.cos(v)+Math.cos(m)*g+d.x,x2:b*Math.cos(v)-Math.cos(m)*g+d.x,y1:b*Math.sin(v)+Math.sin(m)*g+d.y,y2:b*Math.sin(v)-Math.sin(m)*g+d.y}},_X=function(e,t,n,r){var o=t.axisType,i=t.radius,a=t.tickFormat,l=t.style,s=t.scale,u=t.ticks,c=t.stringTicks,d=t.origin,f=a(n,r,u),p=c?c[r]:n,h=bX(l,{text:f,tick:p,tickValue:n,index:r,ticks:u,stringTicks:c,radius:i,scale:s,axisType:o}).labelStyle,y=e.tickLabelComponent,g=y.props&&y.props.labelPlacement?y.props.labelPlacement:e.labelPlacement,m=h.padding||0,v="radial"===o?kX(e):void 0,b="angular"===o?hF(s(n)):v+0,x=void 0===h.angle?GG(wL()({},e,{labelPlacement:g}),b):h.angle,w="angular"===o?i+m:s(n);return{index:r,datum:p,style:h,angle:x,textAnchor:h.textAnchor||VG(wL()({},e,{labelPlacement:g}),b),text:f,x:w*Math.cos(pF(b))+d.x,y:-w*Math.sin(pF(b))+d.y}},OX=function(e,t,n,r){var o=t.axisType,i=t.radius,a=t.style,l=t.scale,s=t.stringTicks,u=t.ticks,c=t.tickFormat,d=t.origin,f=c(n,r,u),p=e.startAngle,h=e.endAngle,y=e.innerRadius,g=void 0===y?0:y,m=s?s[r]:n,v=bX(a,{tick:m,tickValue:n,index:r,ticks:u,stringTicks:s,radius:i,scale:l,axisType:o,text:f}).gridStyle,b=l(n);return"angular"===o?{index:r,datum:m,style:v,x1:mX(i,b,"x")+d.x,y1:mX(i,b,"y")+d.y,x2:mX(g,b,"x")+d.x,y2:mX(g,b,"y")+d.y}:{style:v,index:r,datum:m,cx:d.x,cy:d.y,r:l(n),startAngle:p,endAngle:h}},EX=function(e){var t=function(e){var t=e.theme,n=void 0===t?{}:t,r=e.dependentAxis,o=n.polarAxis&&n.polarAxis.style||n.axis&&n.axis.style,i=r?"polarDependentAxis":"polarIndependentAxis",a=r?"dependentAxis":"independentAxis",l=n[i]&&n[i].style||n[a]&&n[a].style;return o&&l?["axis","axisLabel","grid","parent","tickLabels","ticks"].reduce((function(e,t){return e[t]=SL()({},l[t],o[t]),e}),{}):l||o}(e=wL()({polar:!0},e)),n=SX(e,t),r=lF(e),o=y$(e),i=vX(e),a=j$(e)?e.tickValues:void 0,l=T$(e,o),s=wX(e,o),u=jX(e),c=O$(e,u),d="angular"===i?function(e,t){return NF()(e,(function(e){return t(e)%(2*Math.PI)}))}(c,u):c;return{axis:o,style:n,padding:r,stringTicks:a,axisType:i,scale:u,ticks:d,tickFormat:C$(e,u),domain:l,range:s,radius:xX(e),origin:gF(e)}},TX=function(e,t){e=A$(e,t);var n=EX(e),r=n.style,o=n.scale,i=n.ticks,a=n.domain,l=e,s=l.width,u=l.height,c=l.standalone,d=l.theme,f=l.name,p=function(e,t){var n=t.style,r=t.axisType,o=t.radius,i=(t.scale,t.origin),a=e.startAngle,l=e.endAngle,s=e.innerRadius,u=void 0===s?0:s,c="radial"===r?pF(kX(e)):void 0;return"radial"===r?{style:n.axis,x1:mX(u,c,"x")+i.x,x2:mX(o,c,"x")+i.x,y1:mX(u,c,"y")+i.y,y2:mX(o,c,"y")+i.y}:{style:n.axis,cx:i.x,cy:i.y,r:o,startAngle:a,endAngle:l}}(e,n),h=function(e,t){var n=t.axisType,r=t.radius,o=t.style,i=(t.scale,t.origin),a=e.axisLabelComponent;if("radial"!==n)return{};var l=a.props&&a.props.labelPlacement?a.props.labelPlacement:e.labelPlacement,s=o&&o.axisLabel||{},u="radial"===n?kX(e):void 0,c=void 0===s.angle?GG(wL()({},e,{labelPlacement:l}),u):s.angle,d=r+(s.padding||0);return{style:s,angle:c,textAnchor:s.textAnchor||VG(wL()({},e,{labelPlacement:l}),u),verticalAnchor:s.verticalAnchor||qG(wL()({},e,{labelPlacement:l}),u),text:e.label,x:mX(d,pF(u),"x")+i.x,y:mX(d,pF(u),"y")+i.y}}(e,n),y={parent:{style:r.parent,ticks:i,scale:o,width:s,height:u,domain:a,standalone:c,theme:d,name:f}};return i.reduce((function(t,r,o){return t[o]={axis:p,axisLabel:h,ticks:CX(e,n,r,o),tickLabels:_X(e,n,r,o),grid:OX(e,n,r,o)},t}),y)};function PX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function AX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PX(Object(n),!0).forEach((function(t){MX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function MX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DX(e){return function(e){if(Array.isArray(e))return IX(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return IX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IX(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NX(e,t){return NX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NX(e,t)}function LX(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=FX(e);if(t){var o=FX(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function FX(e){return FX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},FX(e)}var BX={width:450,height:300,padding:50},zX=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NX(e,t)}(i,e);var t,n,r,o=LX(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,n=[{key:"renderAxisLine",value:function(e){var t=e.dependentAxis?e.axisComponent:e.circularAxisComponent,n=this.getComponentProps(t,"axis",0);return h.cloneElement(t,n)}},{key:"renderLabel",value:function(e){var t=e.axisLabelComponent,n=e.dependentAxis;if(!e.label||!n)return null;var r=this.getComponentProps(t,"axisLabel",0);return h.cloneElement(t,r)}},{key:"renderAxis",value:function(e){var t=this,n=e.tickComponent,r=e.tickLabelComponent,o=e.name,i=function(e){var t=e.style,n=void 0===t?{}:t,r=e.events,o=void 0===r?{}:r;return"transparent"!==n.stroke&&"none"!==n.stroke&&0!==n.strokeWidth||!bL()(o)},a="radial"===(e.dependentAxis?"radial":"angular")?e.circularGridComponent:e.gridComponent,l=this.dataKeys.map((function(e,r){var a=wL()({key:"".concat(o,"-tick-").concat(e)},t.getComponentProps(n,"ticks",r)),l=h.cloneElement(n,a);return i(l.props)?l:void 0})).filter(Boolean),s=this.dataKeys.map((function(e,n){var r=wL()({key:"".concat(o,"-grid-").concat(e)},t.getComponentProps(a,"grid",n)),l=h.cloneElement(a,r);return i(l.props)?l:void 0})).filter(Boolean),u=this.dataKeys.map((function(e,n){var i=wL()({key:"".concat(o,"-tick-").concat(e)},t.getComponentProps(r,"tickLabels",n));return h.cloneElement(r,i)})),c=[this.renderAxisLine(e),this.renderLabel(e)].concat(DX(l),DX(s),DX(u));return this.renderGroup(e,c)}},{key:"renderGroup",value:function(e,t){var n=e.groupComponent;return h.cloneElement(n,{},t)}},{key:"shouldAnimate",value:function(){return!!this.props.animate}},{key:"render",value:function(){var e=i.animationWhitelist,t=A$(this.props,BX);if(this.shouldAnimate())return this.animateComponent(t,e);var n=this.renderAxis(t);return t.standalone?this.renderContainer(t.containerComponent,n):n}}],n&&RX(t.prototype,n),r&&RX(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);zX.animationWhitelist=["style","domain","range","tickCount","tickValues","padding","width","height"],zX.displayName="VictoryAxis",zX.role="axis",zX.defaultTransitions={onExit:{duration:500},onEnter:{duration:500}},zX.propTypes=AX(AX({},PV.baseProps),{},{axisAngle:oi().number,axisComponent:oi().element,axisLabelComponent:oi().element,axisValue:oi().oneOfType([oi().number,oi().string,oi().object]),categories:oi().oneOfType([oi().arrayOf(oi().string),oi().shape({x:oi().arrayOf(oi().string),y:oi().arrayOf(oi().string)})]),circularAxisComponent:oi().element,circularGridComponent:oi().element,containerComponent:oi().element,dependentAxis:oi().bool,disableInlineStyles:oi().bool,endAngle:oi().number,events:oi().arrayOf(oi().shape({target:oi().oneOf(["axis","axisLabel","grid","ticks","tickLabels"]),eventKey:oi().oneOfType([oi().array,jV([kV,SV]),oi().string]),eventHandlers:oi().object})),gridComponent:oi().element,innerRadius:SV,labelPlacement:oi().oneOf(["parallel","perpendicular","vertical"]),startAngle:oi().number,stringMap:oi().object,style:oi().shape({parent:oi().object,axis:oi().object,axisLabel:oi().object,grid:oi().object,ticks:oi().object,tickLabels:oi().object}),tickComponent:oi().element,tickCount:jV([kV,CV]),tickFormat:oi().oneOfType([oi().func,EV]),tickLabelComponent:oi().element,tickValues:EV}),zX.defaultProps={axisComponent:h.createElement(MG,null),axisLabelComponent:h.createElement(pY,null),circularAxisComponent:h.createElement(gX,null),circularGridComponent:h.createElement(gX,null),containerComponent:h.createElement(Oq,null),endAngle:360,gridComponent:h.createElement(MG,null),groupComponent:h.createElement("g",{role:"presentation"}),labelPlacement:"parallel",startAngle:0,standalone:!0,theme:$q.grayscale,tickComponent:h.createElement(MG,null),tickLabelComponent:h.createElement(pY,null)},zX.getDomain=T$,zX.getAxis=y$,zX.getScale=jX,zX.getStyles=function(e){return SX(e,BX.style)},zX.getBaseProps=function(e){return TX(e,BX)},zX.expectedComponents=["axisComponent","circularAxisComponent","groupComponent","containerComponent","tickComponent","tickLabelComponent","gridComponent","circularGridComponent"];var UX=MQ(zX,{components:[{name:"axis",index:0},{name:"axisLabel",index:0},{name:"grid"},{name:"parent",index:"parent"},{name:"ticks"},{name:"tickLabels"}]});function WX(e){return function(e){if(Array.isArray(e))return HX(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return HX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HX(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var KX={width:450,height:300,padding:50};function $X(e,t){var n=function(e){var t=e.style&&e.style.parent;return{parent:SL()({},t,{height:"100%",width:"100%",userSelect:"none"})}}(e),r=e=bF(e,KX,"chart"),o=r.horizontal,i=r.polar,a=uV(e,t),l=cV(e,t,a),s=YX(e,t,a),u={x:GX(wL()({},e,{categories:l}),"x",t),y:GX(wL()({},e,{categories:l}),"y",t)},c={x:mF(e,"x"),y:mF(e,"y")},d={x:OK(e,"x")||iV(e,"x"),y:OK(e,"y")||iV(e,"y")};return{categories:l,domain:u,range:c,horizontal:o,scale:{x:d.x.domain(u.x).range(o?c.y:c.x),y:d.y.domain(u.y).range(o?c.x:c.y)},stringMap:s,style:n,origin:i?gF(e):b$(u),padding:lF(e)}}function VX(e,t,n){t=t||qX(e);var r=(n=n||$X(e,t)).style.parent,o=e.height,i=e.polar,a=e.theme,l=e.width,s=n,u=s.origin,c=s.horizontal,d=e.name||"chart";return t.map((function(t,s){var f=t.type&&t.type.role,p=Array.isArray(t.props.style)?t.props.style:SL()({},t.props.style,{parent:r}),y=function(e,t,n){var r=g$([e]);return r.length>0?function(e,t,n){var r=n.domain,o=n.scale,i=n.stringMap,a=n.categories;return{stringMap:i,horizontal:n.horizontal,categories:a,startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,domain:r,scale:o}}(r[0],t,n):{categories:n.categories,domain:n.domain,range:n.range,scale:n.scale,stringMap:n.stringMap,horizontal:n.horizontal}}(t,e,n),g=t.props.name||"".concat(d,"-").concat(f,"-").concat(s),m=SL()({horizontal:c,height:o,polar:i,theme:a,width:l,style:p,name:g,origin:i?u:void 0,padding:n.padding,key:"".concat(g,"-key-").concat(s),standalone:!1},y);return h.cloneElement(t,m)}))}var qX=function(e,t){var n=h.Children.toArray(e.children),r=WX(n);if(0===n.length)r.push(t.independent,t.dependent);else{var o={dependent:v$(n,"dependent"),independent:v$(n,"independent")};0===o.dependent.length&&0===o.independent.length&&(r=e.prependDefaultAxes?[t.independent,t.dependent].concat(r):r.concat([t.independent,t.dependent]))}return r},GX=function(e,t,n){var r=oV(e,t,n=n||h.Children.toArray(e.children)),o=m$(n,t);return o&&o.props&&o.props.invertAxis?r.concat().reverse():r},YX=function(e,t,n){var r=n.x&&0!==n.x.length?n.x.reduce((function(e,t,n){return e[t]=n+1,e}),{}):null,o=n.y&&0!==n.y.length?n.y.reduce((function(e,t,n){return e[t]=n+1,e}),{}):null;return{x:r,y:o}};function QX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function XX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?QX(Object(n),!0).forEach((function(t){ZX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ZX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var JX={width:450,height:300,padding:50},eZ=function(e){var t=XL(),n=t.getAnimationProps,r=t.setAnimationState,o=(0,t.getProps)(e),i=bF(o,JX,"chart"),a=i.desc,l=i.eventKey,s=i.containerComponent,u=i.standalone,c=i.groupComponent,d=i.externalEventMutations,f=i.width,p=i.height,y=i.theme,g=i.polar,m=i.name,v=i.title,b=o.polar?i.defaultPolarAxes:i.defaultAxes,x=h.useMemo((function(){return qX(i,b)}),[i,b]),w=h.useMemo((function(){return $X(i,x)}),[i,x]),j=w.domain,S=w.scale,k=w.style,C=w.origin,_=w.horizontal,O=h.useMemo((function(){var e=VX(o,x,w).map((function(e,t){var r=wL()({animate:n(o,e,t)},e.props);return h.cloneElement(e,r)}));if(o.style&&o.style.background){var t=function(e,t){var n=e.backgroundComponent,r=e.polar?t.range.y[1]:t.range.y[0]-t.range.y[1],o=t.range.x[1]-t.range.x[0],i=e.horizontal?t.scale.y.range()[0]:t.scale.x.range()[0],a=e.horizontal?t.scale.x.range()[1]:t.scale.y.range()[1],l=e.polar?t.origin.x:i,s=e.polar?t.origin.y:a,u=e.name||"chart",c={height:r,polar:e.polar,scale:t.scale,style:e.style.background,x:l,y:s,key:"".concat(u,"-background"),width:o};return h.cloneElement(n,SL()({},n.props,c))}(o,w);e.unshift(t)}return e}),[n,x,o,w]),E=h.useMemo((function(){return u?{desc:a,domain:j,width:f,height:p,horizontal:_,name:m,origin:g?C:void 0,polar:g,theme:y,title:v,scale:S,standalone:u,style:k.parent}:{}}),[a,j,p,_,m,C,g,S,u,k,v,y,f]),T=h.useMemo((function(){if(u){var t=SL()({},s.props,E,TF(e));return h.cloneElement(s,t)}return c}),[c,u,s,E,e]),P=h.useMemo((function(){return aV(o)}),[o]),A=dV(e);return h.useEffect((function(){return function(){e.animate&&r(A,e)}}),[r,A,e]),bL()(P)?h.cloneElement(T,T.props,O):h.createElement(uG,{container:T,eventKey:l,events:P,externalEventMutations:d},O)};eZ.propTypes=XX(XX({},PV.baseProps),{},{backgroundComponent:oi().element,children:oi().oneOfType([oi().arrayOf(oi().node),oi().node]),defaultAxes:oi().shape({independent:oi().element,dependent:oi().element}),defaultPolarAxes:oi().shape({independent:oi().element,dependent:oi().element}),endAngle:oi().number,innerRadius:SV,prependDefaultAxes:oi().bool,startAngle:oi().number}),eZ.defaultProps={backgroundComponent:h.createElement(WV,null),containerComponent:h.createElement(Oq,null),defaultAxes:{independent:h.createElement(sX,null),dependent:h.createElement(sX,{dependentAxis:!0})},defaultPolarAxes:{independent:h.createElement(UX,null),dependent:h.createElement(UX,{dependentAxis:!0})},groupComponent:h.createElement("g",null),standalone:!0,theme:$q.grayscale};var tZ=h.memo(eZ,Xq());function nZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nZ(Object(n),!0).forEach((function(t){oZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}tZ.displayName="VictoryChart",tZ.expectedComponents=["groupComponent","containerComponent"];var iZ=function(e){var t=e.orientation||"top";return"left"===t||"right"===t?function(e){var t=e.pointerWidth,n=e.cornerRadius,r=e.orientation,o=e.width,i=e.height,a=e.center,l="left"===r?1:-1,s=e.x+(e.dx||0),u=e.y+(e.dy||0),c=MF()(a)&&a.x,d=MF()(a)&&a.y,f=c-l*(o/2),p=c+l*(o/2),h=d+i/2,y=d-i/2,g=l*(s-f)>0?0:e.pointerLength,m="left"===r?"0 0 0":"0 0 1",v="".concat(n," ").concat(n," ").concat(m);return"M ".concat(f,", ").concat(d-t/2,"\n L ").concat(g?s:f,", ").concat(g?u:d+t/2,"\n L ").concat(f,", ").concat(d+t/2,"\n L ").concat(f,", ").concat(h-n,"\n A ").concat(v," ").concat(f+l*n,", ").concat(h,"\n L ").concat(p-l*n,", ").concat(h,"\n A ").concat(v," ").concat(p,", ").concat(h-n,"\n L ").concat(p,", ").concat(y+n,"\n A ").concat(v," ").concat(p-l*n,", ").concat(y,"\n L ").concat(f+l*n,", ").concat(y,"\n A ").concat(v," ").concat(f,", ").concat(y+n,"\n z")}(e):function(e){var t=e.pointerWidth,n=e.cornerRadius,r=e.orientation,o=e.width,i=e.height,a=e.center,l="bottom"===r?1:-1,s=e.x+(e.dx||0),u=e.y+(e.dy||0),c=MF()(a)&&a.x,d=MF()(a)&&a.y,f=d+l*(i/2),p=d-l*(i/2),h=c+o/2,y=c-o/2,g=l*(u-f)<0?0:e.pointerLength,m="bottom"===r?"0 0 0":"0 0 1",v="".concat(n," ").concat(n," ").concat(m);return"M ".concat(c-t/2,", ").concat(f,"\n L ").concat(g?s:c+t/2,", ").concat(g?u:f,"\n L ").concat(c+t/2,", ").concat(f,"\n L ").concat(h-n,", ").concat(f,"\n A ").concat(v," ").concat(h,", ").concat(f-l*n,"\n L ").concat(h,", ").concat(p+l*n,"\n A ").concat(v," ").concat(h-n,", ").concat(p,"\n L ").concat(y+n,", ").concat(p,"\n A ").concat(v," ").concat(y,", ").concat(p+l*n,"\n L ").concat(y,", ").concat(f-l*n,"\n A ").concat(v," ").concat(y+n,", ").concat(f,"\n z")}(e)},aZ=function(e){e=function(e){var t=dF(e.id,e),n=fF(e.style,e);return wL()({},e,{id:t,style:n})}(e);var t=TF(e);return h.cloneElement(e.pathComponent,rZ(rZ(rZ({},e.events),t),{},{style:e.style,d:iZ(e),className:e.className,shapeRendering:e.shapeRendering,role:e.role,transform:e.transform,clipPath:e.clipPath}))};aZ.propTypes=rZ(rZ({},PV.primitiveProps),{},{center:oi().shape({x:oi().number,y:oi().number}),cornerRadius:oi().number,datum:oi().object,dx:oi().number,dy:oi().number,height:oi().number,orientation:oi().oneOf(["top","bottom","left","right"]),pathComponent:oi().element,pointerLength:oi().number,pointerWidth:oi().number,width:oi().number,x:oi().number,y:oi().number}),aZ.defaultProps={pathComponent:h.createElement(dX,null),role:"presentation",shapeRendering:"auto"};var lZ=aZ;function sZ(e){return function(e){if(Array.isArray(e))return uZ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return uZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uZ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dZ(e,t){return dZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dZ(e,t)}function fZ(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=pZ(e);if(t){var o=pZ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function pZ(e){return pZ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pZ(e)}var hZ={cornerRadius:5,pointerLength:10,pointerWidth:10},yZ=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dZ(e,t)}(i,e);var t,n,r,o=fZ(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).id=void 0===e.id?KV()("tooltip-"):e.id,t}return t=i,n=[{key:"getDefaultOrientation",value:function(e){var t=e.datum,n=e.horizontal;if(!e.polar){var r=n?"right":"top",o=n?"left":"bottom";return t&&t.y<0?o:r}return this.getPolarOrientation(e,t)}},{key:"getPolarOrientation",value:function(e,t){var n=YG(e,t),r=e.labelPlacement||"vertical";return" vertical"===r?this.getVerticalOrientations(n):"parallel"===r?n<90||n>270?"right":"left":n>180?"bottom":"top"}},{key:"getVerticalOrientations",value:function(e){return e<45||e>315?"right":e>=45&&e<=135?"top":e>135&&e<225?"left":"bottom"}},{key:"getStyles",value:function(e){var t=e.theme||$q.grayscale,n=t&&t.tooltip&&t.tooltip.style?t.tooltip.style:{},r=Array.isArray(e.style)?e.style.map((function(e){return SL()({},e,n)})):SL()({},e.style,n),o=t&&t.tooltip&&t.tooltip.flyoutStyle?t.tooltip.flyoutStyle:{},i=e.flyoutStyle?SL()({},e.flyoutStyle,o):o,a=Array.isArray(r)?r.map((function(t){return fF(t,e)})):fF(r,e);return{style:a,flyoutStyle:fF(i,wL()({},e,{style:a}))}}},{key:"getEvaluatedProps",value:function(e){var t=e.cornerRadius,n=e.centerOffset,r=e.dx,o=e.dy,i=dF(e.active,e),a=dF(e.text,wL()({},e,{active:i})),l=this.getStyles(wL()({},e,{active:i,text:a})),s=l.style,u=l.flyoutStyle,c=dF(e.orientation,wL()({},e,{active:i,text:a,style:s,flyoutStyle:u}))||this.getDefaultOrientation(e),d=lF({padding:dF(e.flyoutPadding,wL()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c}))||this.getLabelPadding(s)}),f=dF(e.pointerWidth,wL()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c})),p=dF(e.pointerLength,wL()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c})),h=kG(a,s),y=this.getDimensions(wL()({},e,{style:s,flyoutStyle:u,active:i,text:a,orientation:c,flyoutPadding:d,pointerWidth:f,pointerLength:p}),h),g=y.flyoutHeight,m=y.flyoutWidth,v=wL()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c,flyoutHeight:g,flyoutWidth:m,flyoutPadding:d,pointerWidth:f,pointerLength:p}),b=MF()(n)&&void 0!==n.x?dF(n.x,v):0,x=MF()(n)&&void 0!==n.y?dF(n.y,v):0;return wL()({},v,{centerOffset:{x:b,y:x},dx:void 0!==r?dF(r,v):0,dy:void 0!==o?dF(o,v):0,cornerRadius:dF(t,v)})}},{key:"getCalculatedValues",value:function(e){var t=e.style,n=e.text,r=e.flyoutStyle,o={height:e.flyoutHeight,width:e.flyoutWidth};return{style:t,flyoutStyle:r,labelSize:kG(n,t),flyoutDimensions:o,flyoutCenter:this.getFlyoutCenter(e,o),transform:this.getTransform(e)}}},{key:"getTransform",value:function(e){var t=e.x,n=e.y,r=(e.style||{}).angle||e.angle||this.getDefaultAngle(e);return r?"rotate(".concat(r," ").concat(t," ").concat(n,")"):void 0}},{key:"getDefaultAngle",value:function(e){var t=e.polar,n=e.labelPlacement,r=e.orientation,o=e.datum;if(!t||!n||"vertical"===n)return 0;var i,a=YG(e,o);return 0===a||180===a?i="top"===r&&180===a?270:90:a>0&&a<180?i=90-a:a>180&&a<360&&(i=270-a),i+(a>90&&a<180||a>270?1:-1)*("perpendicular"===n?0:90)}},{key:"constrainTooltip",value:function(e,t,n){var r=e.x,o=e.y,i=n.width,a=n.height,l=[0,t.width],s=[0,t.height],u=[r-i/2,r+i/2],c=[o-a/2,o+a/2],d=[u[0]<l[0]?l[0]-u[0]:0,u[1]>l[1]?u[1]-l[1]:0],f=[c[0]<s[0]?s[0]-c[0]:0,c[1]>s[1]?c[1]-s[1]:0];return{x:Math.round(r+d[0]-d[1]),y:Math.round(o+f[0]-f[1])}}},{key:"getFlyoutCenter",value:function(e,t){var n=e.x,r=e.y,o=e.dx,i=e.dy,a=e.pointerLength,l=e.orientation,s=e.constrainToVisibleArea,u=e.centerOffset,c=t.height,d=t.width,f="left"===l?-1:1,p="bottom"===l?-1:1,h={x:"left"===l||"right"===l?n+f*(a+d/2+f*o):n+o,y:"top"===l||"bottom"===l?r-p*(a+c/2-p*i):r+i},y=MF()(e.center)&&void 0!==e.center.x?e.center.x:h.x,g=MF()(e.center)&&void 0!==e.center.y?e.center.y:h.y,m={x:y+u.x,y:g+u.y};return s?this.constrainTooltip(m,e,t):m}},{key:"getLabelPadding",value:function(e){if(!e)return 0;var t=Array.isArray(e)?e.map((function(e){return e.padding})):[e.padding];return Math.max.apply(Math,sZ(t).concat([0]))}},{key:"getDimensions",value:function(e,t){var n=e.orientation,r=e.pointerLength,o=e.pointerWidth,i=e.flyoutHeight,a=e.flyoutWidth,l=e.flyoutPadding,s=dF(e.cornerRadius,e);return{flyoutHeight:i?dF(i,e):function(){var e=t.height+l.top+l.bottom,r="top"===n||"bottom"===n?2*s:2*s+o;return Math.max(r,e)}(),flyoutWidth:a?dF(a,e):function(){var e=t.width+l.left+l.right,o="left"===n||"right"===n?2*s+r:2*s;return Math.max(o,e)}()}}},{key:"getLabelProps",value:function(e,t){var n=t.flyoutCenter,r=t.style,o=t.labelSize,i=t.dy,a=void 0===i?0:i,l=t.dx,s=void 0===l?0:l,u=e.text,c=e.datum,d=e.activePoints,f=e.labelComponent,p=e.index,h=e.flyoutPadding,y=(Array.isArray(r)&&r.length?r[0].textAnchor:r.textAnchor)||"middle";return SL()({},f.props,{key:"".concat(this.id,"-label-").concat(p),text:u,datum:c,activePoints:d,textAnchor:y,dy:a,dx:s,style:r,x:function(){if(!y||"middle"===y)return n.x;var e="end"===y?-1:1;return n.x-e*(o.width/2)}()+(h.left-h.right)/2,y:n.y+(h.top-h.bottom)/2,verticalAnchor:"middle",angle:r.angle})}},{key:"getPointerOrientation",value:function(e,t,n){var r=t.y+n.height/2,o=t.y-n.height/2,i=t.x-n.width/2,a=t.x+n.width/2,l=[{side:"top",val:o>e.y?o-e.y:-1},{side:"bottom",val:r<e.y?e.y-r:-1},{side:"right",val:a<e.x?e.x-a:-1},{side:"left",val:i>e.x?i-e.x:-1}];return GF()(l,"val","desc")[0].side}},{key:"getFlyoutProps",value:function(e,t){var n=t.flyoutDimensions,r=t.flyoutStyle,o=t.flyoutCenter,i=e.x,a=e.y,l=e.dx,s=e.dy,u=e.datum,c=e.activePoints,d=e.index,f=e.pointerLength,p=e.pointerWidth,h=e.cornerRadius,y=e.events,g=e.flyoutComponent,m=dF(e.pointerOrientation,e);return SL()({},g.props,{x:i,y:a,dx:l,dy:s,datum:u,activePoints:c,index:d,pointerLength:f,pointerWidth:p,cornerRadius:h,events:y,orientation:m||this.getPointerOrientation({x:i,y:a},o,n),key:"".concat(this.id,"-tooltip-").concat(d),width:n.width,height:n.height,style:r,center:o})}},{key:"renderTooltip",value:function(e){var t=dF(e.active,e),n=e.renderInPortal;if(!t)return n?h.createElement(LG,null,null):null;var r=this.getEvaluatedProps(e),o=r.flyoutComponent,i=r.labelComponent,a=r.groupComponent,l=this.getCalculatedValues(r),s=[h.cloneElement(o,this.getFlyoutProps(r,l)),h.cloneElement(i,this.getLabelProps(r,l))],u=h.cloneElement(a,{role:"presentation",transform:l.transform},s);return n?h.createElement(LG,null,u):u}},{key:"render",value:function(){var e=bF(this.props,hZ,"tooltip");return this.renderTooltip(e)}}],n&&cZ(t.prototype,n),r&&cZ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);yZ.displayName="VictoryTooltip",yZ.role="tooltip",yZ.propTypes={activateData:oi().bool,active:oi().oneOfType([oi().bool,oi().func]),activePoints:oi().array,angle:oi().number,center:oi().shape({x:SV,y:SV}),centerOffset:oi().shape({x:oi().oneOfType([oi().number,oi().func]),y:oi().oneOfType([oi().number,oi().func])}),constrainToVisibleArea:oi().bool,cornerRadius:oi().oneOfType([SV,oi().func]),data:oi().array,datum:oi().object,dx:oi().oneOfType([oi().number,oi().func]),dy:oi().oneOfType([oi().number,oi().func]),events:oi().object,flyoutComponent:oi().element,flyoutHeight:oi().oneOfType([SV,oi().func]),flyoutPadding:oi().oneOfType([oi().func,oi().number,oi().shape({top:oi().number,bottom:oi().number,left:oi().number,right:oi().number})]),flyoutStyle:oi().object,flyoutWidth:oi().oneOfType([SV,oi().func]),groupComponent:oi().element,height:oi().number,horizontal:oi().bool,id:oi().oneOfType([oi().number,oi().string]),index:oi().oneOfType([oi().number,oi().string]),labelComponent:oi().element,orientation:oi().oneOfType([oi().oneOf(["top","bottom","left","right"]),oi().func]),pointerLength:oi().oneOfType([SV,oi().func]),pointerOrientation:oi().oneOfType([oi().oneOf(["top","bottom","left","right"]),oi().func]),pointerWidth:oi().oneOfType([SV,oi().func]),polar:oi().bool,renderInPortal:oi().bool,scale:oi().shape({x:OV,y:OV}),style:oi().oneOfType([oi().object,oi().array]),text:oi().oneOfType([oi().string,oi().number,oi().func,oi().array]),theme:oi().object,width:oi().number,x:oi().number,y:oi().number},yZ.defaultProps={active:!1,renderInPortal:!0,labelComponent:h.createElement(pY,null),flyoutComponent:h.createElement(lZ,null),groupComponent:h.createElement("g",null)},yZ.defaultEvents=function(e){var t=e.activateData?[{target:"labels",mutation:function(){return{active:!0}}},{target:"data",mutation:function(){return{active:!0}}}]:[{target:"labels",mutation:function(){return{active:!0}}}],n=e.activateData?[{target:"labels",mutation:function(){return{active:void 0}}},{target:"data",mutation:function(){return{active:void 0}}}]:[{target:"labels",mutation:function(){return{active:void 0}}}];return[{target:"data",eventHandlers:{onMouseOver:function(){return t},onFocus:function(){return t},onTouchStart:function(){return t},onMouseOut:function(){return n},onBlur:function(){return n},onTouchEnd:function(){return n}}}]};var gZ=n(8133),mZ=n.n(gZ),vZ=n(3806),bZ=n.n(vZ);function xZ(e,t,n){var r=t.a,o=t.d,i=t.e,a=t.f;return"y"===n?o*e+a:r*e+i}function wZ(e){return!(!e||void 0===e.identifier)}function jZ(e){if(!wZ(e.nativeEvent)){var t=function(e){return"svg"===e.nodeName?e:e.parentNode?t(e.parentNode):e};return t(e.target)}}var SZ=n(6813);function kZ(e){return function(e){if(Array.isArray(e))return CZ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return CZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CZ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _Z={withinBounds:function(e,t){var n=e.width,r=e.height,o=e.polar,i=e.origin,a=e.scale,l=lF(e,"voronoiPadding"),s=t.x,u=t.y;if(o){var c=Math.pow(s-i.x,2)+Math.pow(u-i.y,2),d=Math.max.apply(Math,kZ(a.y.range()));return c<Math.pow(d,2)}return s>=l.left&&s<=n-l.right&&u>=l.top&&u<=r-l.bottom},getDatasets:function(e){var t={x:IL(e.domain.x),y:IL(e.domain.y)},n=h.Children.toArray(e.children),r=function(n,r,o){var i=o&&o.type&&o.type.continuous,a=o?o.props&&o.props.style:e.style;return n.map((function(n,o){var l=iF(n),s=l.x,u=l.y,c=l.y0,d=l.x0,f=(Number(s)+Number(d))/2,p=(Number(u)+Number(c))/2;return wL()({_voronoiX:"y"===e.voronoiDimension?t.x:f,_voronoiY:"x"===e.voronoiDimension?t.y:p,eventKey:o,childName:r,continuous:i,style:a},n)}))};if(e.data)return r(e.data);var o=function(e){var t=GK(e);return Array.isArray(t)&&t.length>0?t:void 0};return wF(n,(function(t,n){var i=(t.props||{}).name||n,a=e.voronoiBlacklist||[],l=a.filter(mZ()),s=a.filter(pV()).some((function(e){return e.test(i)}));if(!XK(t)||VF()(l,i)||s)return null;var u=(t.type&&rF()(t.type.getData)?t.type.getData:o)(t.props);return u?r(u,i,t):null}),e)},findPoints:function(e,t){return e.filter((function(e){return t._voronoiX===e._voronoiX&&t._voronoiY===e._voronoiY}))},withinRadius:function(e,t,n){if(!e)return!1;if(!n)return!0;var r=t.x,o=t.y;return Math.pow(r-e[0],2)+Math.pow(o-e[1],2)<Math.pow(n,2)},getVoronoiPoints:function(e,t){var n=this.getDatasets(e),r=n.map((function(t){var n=aF(e,t);return[n.x,n.y]})),o=SZ.Z.from(r).find(t.x,t.y);return{points:this.withinRadius(r[o],t,e.radius)?this.findPoints(n,n[o]):[],index:o}},getActiveMutations:function(e,t){var n=t.childName,r=t.continuous,o=e.activateData,i=e.activateLabels,a=e.labels;if(!o&&!i)return[];var l=o?["data"]:[],s=a&&!i?l:l.concat("labels");return bL()(s)?[]:s.map((function(e){var o=!0===r&&"data"===e?"all":t.eventKey;return{childName:n,eventKey:o,target:e,mutation:function(){return{active:!0}}}}))},getInactiveMutations:function(e,t){var n=t.childName,r=t.continuous,o=e.activateData,i=e.activateLabels,a=e.labels;if(!o&&!i)return[];var l=o?["data"]:[],s=a&&!i?l:l.concat("labels");return bL()(s)?[]:s.map((function(e){var o=r&&"data"===e?"all":t.eventKey;return{childName:n,eventKey:o,target:e,mutation:function(){return null}}}))},getParentMutation:function(e,t,n,r){return[{target:"parent",eventKey:"parent",mutation:function(){return{activePoints:e,mousePosition:t,parentSVG:n,vIndex:r}}}]},onActivated:function(e,t){rF()(e.onActivated)&&e.onActivated(t,e)},onDeactivated:function(e,t){rF()(e.onDeactivated)&&e.onDeactivated(t,e)},onMouseLeave:function(e,t){var n,r=this,o=t.activePoints||[];this.onDeactivated(t,o);var i=o.length?o.map((function(e){return r.getInactiveMutations(t,e)})):[];return(n=this.getParentMutation([])).concat.apply(n,kZ(i))},onMouseMove:function(e,t){var n=this,r=t.activePoints||[],o=t.parentSVG||jZ(e),i=function(e,t){if(wZ(e.nativeEvent))return{x:e.nativeEvent.locationX,y:e.nativeEvent.locationY};var n=function(e){return e.changedTouches&&e.changedTouches.length>0}(e)?e.changedTouches[0]:e,r=function(e){return e.getScreenCTM().inverse()}(t=t||jZ(n));return{x:xZ(n.clientX,r,"x"),y:xZ(n.clientY,r,"y")}}(e,o);if(!this.withinBounds(t,i)){var a;this.onDeactivated(t,r);var l=r.length?r.map((function(e){return n.getInactiveMutations(t,e)})):[];return(a=this.getParentMutation([],i,o)).concat.apply(a,kZ(l))}var s=this.getVoronoiPoints(t,i),u=s.points,c=void 0===u?[]:u,d=s.index,f=this.getParentMutation(c,i,o,d);if(r.length&&Xq()(c,r))return f;this.onActivated(t,c),this.onDeactivated(t,r);var p=c.length?c.map((function(e){return n.getActiveMutations(t,e)})):[],h=r.length?r.map((function(e){return n.getInactiveMutations(t,e)})):[];return f.concat.apply(f,kZ(h).concat(kZ(p)))}},OZ={onMouseLeave:_Z.onMouseLeave.bind(_Z),onMouseMove:bZ()(_Z.onMouseMove.bind(_Z),32,{leading:!0,trailing:!1})},EZ=["childName","eventKey","style","continuous"];function TZ(e){return function(e){if(Array.isArray(e))return PZ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return PZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PZ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function AZ(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function MZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function DZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MZ(Object(n),!0).forEach((function(t){IZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function IZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RZ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NZ(e,t){return NZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NZ(e,t)}function LZ(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=FZ(e);if(t){var o=FZ(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function FZ(e){return FZ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},FZ(e)}var BZ=function(e){var t;return t=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NZ(e,t)}(i,e);var t,n,r,o=LZ(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,n=[{key:"getDimension",value:function(e){var t=e.horizontal,n=e.voronoiDimension;return t&&n?"x"===n?"y":"x":n}},{key:"getPoint",value:function(e){return JL()(e,["_x","_x1","_x0","_y","_y1","_y0"])}},{key:"getLabelPosition",value:function(e,t,n){var r=e.mousePosition,o=e.mouseFollowTooltips,i=this.getDimension(e),a=aF(e,this.getPoint(n[0])),l=o?r:void 0;if(!i||n.length<2)return DZ(DZ({},a),{},{center:SL()({},t.center,l)});var s="y"===i?r.x:a.x,u="x"===i?r.y:a.y;return l=o?r:{x:s,y:u},{x:s,y:u,center:SL()({},t.center,l)}}},{key:"getStyle",value:function(e,t,n){var r=e.labels,o=e.labelComponent,i=e.theme,a=o.props||{},l=i&&i.voronoi&&i.voronoi.style?i.voronoi.style:{},s="flyout"===n?a.flyoutStyle:a.style;return t.reduce((function(e,t,o){var i=SL()({},a,{datum:t,active:!0}),u=rF()(r)?r(i):void 0,c=void 0!==u?"".concat(u).split("\n"):[],d=t.style&&t.style[n]||{},f=Array.isArray(s)?s[o]:s,p=fF(SL()({},f,d,l[n]),i),h=c.length?c.map((function(){return p})):[p];return e=e.concat(h)}),[])}},{key:"getDefaultLabelProps",value:function(e,t){var n=e.voronoiDimension,r=e.horizontal,o=e.mouseFollowTooltips,i=this.getPoint(t[0]),a=n&&t.length>1,l=void 0!==i._y1?i._y1:i._y;return{orientation:o?void 0:r?l<0?"left":"right":l<0?"bottom":"top",pointerLength:a?0:void 0,constrainToVisibleArea:!(!a&&!o)||void 0}}},{key:"getLabelProps",value:function(e,t){var n=e.labels,r=e.scale,o=e.labelComponent,i=e.theme,a=e.width,l=e.height,s=o.props||{},u=t.reduce((function(e,t){var r=SL()({},s,{datum:t,active:!0}),o=rF()(n)?n(r):null;return null===o||void 0===o?e:e=e.concat("".concat(o).split("\n"))}),[]),c=t[0],d=c.childName,f=c.eventKey,p=(c.style,c.continuous,AZ(c,EZ)),h=e.name===d?d:"".concat(e.name,"-").concat(d),y=SL()({key:"".concat(h,"-").concat(f,"-voronoi-tooltip"),id:"".concat(h,"-").concat(f,"-voronoi-tooltip"),active:!0,renderInPortal:!1,activePoints:t,datum:p,scale:r,theme:i},s,{text:u,width:a,height:l,style:this.getStyle(e,t,"labels"),flyoutStyle:this.getStyle(e,t,"flyout")[0]},this.getDefaultLabelProps(e,t)),g=this.getLabelPosition(e,y,t);return SL()({},g,y)}},{key:"getTooltip",value:function(e){var t=e.labels,n=e.activePoints,r=e.labelComponent;if(!t)return null;if(Array.isArray(n)&&n.length){var o=this.getLabelProps(e,n),i=o.text;return(Array.isArray(i)?i.filter(Boolean).length:i)?h.cloneElement(r,o):null}return null}},{key:"getChildren",value:function(e){return[].concat(TZ(h.Children.toArray(e.children)),[this.getTooltip(e)])}}],n&&RZ(t.prototype,n),r&&RZ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(e),t.displayName="VictoryVoronoiContainer",t.propTypes=DZ(DZ({},Oq.propTypes),{},{activateData:oi().bool,activateLabels:oi().bool,disable:oi().bool,labelComponent:oi().element,labels:oi().func,mouseFollowTooltips:oi().bool,onActivated:oi().func,onDeactivated:oi().func,radius:oi().number,voronoiBlacklist:oi().arrayOf(oi().oneOfType([oi().string,TV])),voronoiDimension:oi().oneOf(["x","y"]),voronoiPadding:oi().oneOfType([oi().number,oi().shape({top:oi().number,bottom:oi().number,left:oi().number,right:oi().number})])}),t.defaultProps=DZ(DZ({},Oq.defaultProps),{},{activateData:!0,activateLabels:!0,labelComponent:h.createElement(yZ,null),voronoiPadding:5}),t.defaultEvents=function(e){return[{target:"parent",eventHandlers:{onMouseLeave:function(t,n){return e.disable?{}:OZ.onMouseLeave(t,n)},onTouchCancel:function(t,n){return e.disable?{}:OZ.onMouseLeave(t,n)},onMouseMove:function(t,n){return e.disable?{}:OZ.onMouseMove(t,n)},onTouchMove:function(t,n){return e.disable?{}:OZ.onMouseMove(t,n)}}},{target:"data",eventHandlers:e.disable?{}:{onMouseOver:function(){return null},onMouseOut:function(){return null},onMouseMove:function(){return null}}}]},t}(Oq);function zZ(e){return function(e){if(Array.isArray(e))return HZ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||WZ(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UZ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(s){l=!0,o=s}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||WZ(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function WZ(e,t){if(e){if("string"===typeof e)return HZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HZ(e,t):void 0}}function HZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function KZ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?KZ(Object(n),!0).forEach((function(t){VZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function VZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qZ={width:450,height:300,padding:50,offset:0};function GZ(e,t){var n="group",r=function(e,t,n){return cF(t,e&&e[n]&&e[n].style?e[n].style:{})}((e=bF(e,qZ,n)).theme,e.style,n),o=e,i=o.offset,a=o.colorScale,l=o.color,s=o.polar,u=o.horizontal,c=e.categories||cV(e,t,null),d=e.datasets||nV(e,null),f={x:oV(wL()({},e,{categories:c}),"x",t),y:oV(wL()({},e,{categories:c}),"y",t)},p=e.range||{x:mF(e,"x"),y:mF(e,"y")},h={x:OK(e,"x")||iV(e,"x"),y:OK(e,"y")||iV(e,"y")};return{datasets:d,categories:c,range:p,domain:f,horizontal:u,scale:{x:h.x.domain(f.x).range(e.horizontal?p.y:p.x),y:h.y.domain(f.y).range(e.horizontal?p.x:p.y)},style:r,colorScale:a,color:l,offset:i,origin:s?e.origin:gF(e),padding:lF(e)}}var YZ=function(e){var t=e.children,n=h.Children.toArray(t).map((function(e){return $Z($Z({},e),{},{props:oF(e.props,["sharedEvents"])})}));return e.children=n,e};function QZ(e,t,n,r){var o=(("stack"===r?t.datasets[0].length:t.datasets.length)-1)/2,i=function(e,t,n){if(!e.offset)return 0;var r=xF(t,e.horizontal),o=n.domain[t],i=n.range[r];return(Math.max.apply(Math,zZ(o))-Math.min.apply(Math,zZ(o)))/(Math.max.apply(Math,zZ(i))-Math.min.apply(Math,zZ(i)))*e.offset}(e,"x",t);return(n-o)*i}function XZ(e,t,n,r){var o=(("stack"===r?t.datasets[0].length:t.datasets.length)-1)/2,i=function(e,t){var n=t.range,r=Math.abs(n.x[1]-n.x[0]),o=Math.max.apply(Math,zZ(n.y));return e.offset/(2*Math.PI*o)*r}(e,t);return(n-o)*i}function ZZ(e,t){var n=t.type&&t.type.role,r=t.props.colorScale||e.colorScale;if("group"===n||"stack"===n)return e.theme&&e.theme.group?r||e.theme.group.colorScale:r}function JZ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=e.data||e.y?GK(e):t,o=n||0;return r.map((function(e){var t=e._x instanceof Date?new Date(e._x.getTime()+o):e._x+o;return wL()({},e,{_x1:t})}))}function eJ(e,t,n){e=bF(e,qZ,"stack"),t=t||h.Children.toArray(e.children);var r=(n=n||GZ(e,t)).datasets,o=e,i=o.labelComponent,a=o.polar,l=function(e,t){var n=t.categories,r=t.domain,o=t.range,i=t.scale,a=t.horizontal,l=t.origin,s=t.padding,u=e.width;return{height:e.height,width:u,theme:e.theme,polar:e.polar,origin:l,categories:n,domain:r,range:o,scale:i,horizontal:a,padding:s,standalone:!1}}(e,n),s=e.name||"group";return t.map((function(t,o){var u=t.type&&t.type.role,c=a?XZ(e,n,o,u):QZ(e,n,o,u),d="voronoi"===u||"tooltip"===u||"label"===u?t.props.style:lV(t,o,n),f=e.labels?function(e,t,n){if(e.labels)return Math.floor(t.length/2)===n?e.labels:void 0}(e,r,o):t.props.labels,p=t.props.name||"".concat(s,"-").concat(u,"-").concat(o);return h.cloneElement(t,wL()({labels:f,style:d,key:"".concat(p,"-key-").concat(o),name:p,data:JZ(e,r[o],c),colorScale:ZZ(e,t),labelComponent:i||t.props.labelComponent,xOffset:c},l))}))}function tJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tJ(Object(n),!0).forEach((function(t){rJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oJ={width:450,height:300,padding:50,offset:0},iJ=function(e){var t=null===lJ||void 0===lJ?void 0:lJ.role,n=XL(),r=n.getAnimationProps,o=n.setAnimationState,i=(0,n.getProps)(e),a=bF(i,oJ,t),l=a.eventKey,s=a.containerComponent,u=a.standalone,c=a.groupComponent,d=a.externalEventMutations,f=a.width,p=a.height,y=a.theme,g=a.polar,m=a.horizontal,v=a.name,b=h.Children.toArray(a.children),x=function(e){var t=YZ(e),n=UZ(h.useState(t),2),r=n[0],o=n[1];return h.useEffect((function(){Xq()(t,r)||o(t)}),[r,o,t]),h.useMemo((function(){return GZ(r,r.children)}),[r])}(a),w=x.domain,j=x.scale,S=x.style,k=x.origin,C=h.useMemo((function(){return eJ(i,b,x).map((function(e,t){var n=wL()({animate:r(i,e,t)},e.props);return h.cloneElement(e,n)}))}),[i,b,x,r]),_=h.useMemo((function(){return u?{domain:w,scale:j,width:f,height:p,standalone:u,theme:y,style:S.parent,horizontal:m,polar:g,origin:k,name:v}:{}}),[u,w,j,f,p,y,S,m,g,k,v]),O=h.useMemo((function(){return TF(e)}),[e]),E=h.useMemo((function(){if(u){var e=SL()({},s.props,_,O);return h.cloneElement(s,e)}return h.cloneElement(c,O)}),[c,u,s,_,O]),T=h.useMemo((function(){return aV(i)}),[i]),P=dV(e);return h.useEffect((function(){return function(){e.animate&&o(P,i)}}),[o,P,e,i]),bL()(T)?h.cloneElement(E,E.props,C):h.createElement(uG,{container:E,eventKey:l,events:T,externalEventMutations:d},C)};iJ.propTypes=nJ(nJ(nJ({},PV.baseProps),PV.dataProps),{},{children:oi().oneOfType([oi().arrayOf(oi().node),oi().node]),horizontal:oi().bool,offset:oi().number}),iJ.defaultProps={containerComponent:h.createElement(Oq,null),groupComponent:h.createElement("g",null),samples:50,sortOrder:"ascending",standalone:!0,theme:$q.grayscale};var aJ={role:"group",expectedComponents:["groupComponent","containerComponent","labelComponent"],getChildren:eJ},lJ=Object.assign(h.memo(iJ,Xq()),aJ);lJ.displayName="VictoryGroup";var sJ=function(e){var t=e.polar,n=uF(e,"bar"),r=e.disableInlineStyles?{}:cF(e.style,n),o=e.range||{x:mF(e,"x"),y:mF(e,"y")},i={x:s$(e,"x"),y:s$(e,"y")},a={x:_K(e,"x").domain(i.x).range(e.horizontal?o.y:o.x),y:_K(e,"y").domain(i.y).range(e.horizontal?o.x:o.y)},l=t?e.origin||gF(e):void 0,s=GK(e);return s=function(e,t,n){var r=function(e){return void 0!==e},o=IL(t.x),i=DL(t.x),a=IL(t.y),l=DL(t.y),s=function(e){return function(t){return r(t)&&t<e}},u=function(e){return function(t){return r(t)&&t>e}},c=s(o),d=s(a),f=u(i),p=u(l);return e.map((function(e){var t=e._x,o=e._y,i=e._y0,s=e._y1;(c(t)||f(t))&&(t=null);var u=r(i)?i:n,h=r(s)?s:o;return r(h)?(r(u)||!d(h)&&!p(h)||(o=null),(d(u)&&d(h)||p(u)&&p(h))&&(o=i=s=null),d(u)&&!d(h)&&(i=a),p(u)&&!p(h)&&(i=l),wL()({},e,aB()({_x:t,_y:o,_y0:i,_y1:s},sB()))):e}))}(s,i,0),{style:r,data:s,scale:a,domain:i,origin:l}},uJ=function(e,t){var n=bF(e,t,"bar"),r=e=wL()({},n,sJ(n)),o=r.alignment,i=r.barRatio,a=r.cornerRadius,l=r.data,s=r.disableInlineStyles,u=r.domain,c=r.events,d=r.height,f=r.horizontal,p=r.origin,h=r.padding,y=r.polar,g=r.scale,m=r.sharedEvents,v=r.standalone,b=r.style,x=r.theme,w=r.width,j=r.labels,S=r.name,k=r.barWidth,C=r.getPath,_={parent:{horizontal:f,domain:u,scale:g,width:w,height:d,data:l,standalone:v,name:S,theme:x,polar:y,origin:p,padding:h,style:b.parent}};return l.reduce((function(t,n,r){var u=yY()(n.eventKey)?r:n.eventKey,h=function(e,t){var n=function(n){var r="log"===PK(e.scale[n])?1/Number.MAX_SAFE_INTEGER:0,o=IL(e.domain[n]),i=DL(e.domain[n]);return o<0&&i<=0?r=i:o>=0&&i>0&&(r=o),t["_".concat(n)]instanceof Date?new Date(r):r},r=void 0!==t._y0?t._y0:n("y"),o=void 0!==t._x0?t._x0:n("x");return aF(e,wL()({},t,{_y0:r,_x0:o}))}(e,n),v=h.x,x=h.y,S=h.y0,_=h.x0,O={alignment:o,barRatio:i,barWidth:k,cornerRadius:a,data:l,datum:n,disableInlineStyles:s,getPath:C,horizontal:f,index:r,polar:y,origin:p,scale:g,style:b.data,width:w,height:d,x:v,y:x,y0:S,x0:_};t[u]={data:O};var E=$G(e,n,r);return(void 0!==E&&null!==E||j&&(c||m))&&(t[u].labels=QG(e,r)),t}),_)},cJ=function(e,t){var n={topLeft:0,topRight:0,bottomLeft:0,bottomRight:0};return e?MF()(e)?function(e,t){var n={topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},r=function(r,o){yY()(e[r])?yY()(e[o])||(n[r]=dF(e[o],t)):n[r]=dF(e[r],t)};return r("topLeft","top"),r("topRight","top"),r("bottomLeft","bottom"),r("bottomRight","bottom"),n}(e,t):(n.topLeft=dF(e,t),n.topRight=dF(e,t),n):n};function dJ(e){return function(){return e}}const fJ=Math.abs,pJ=Math.atan2,hJ=Math.cos,yJ=Math.max,gJ=Math.min,mJ=Math.sin,vJ=Math.sqrt,bJ=1e-12,xJ=Math.PI,wJ=xJ/2,jJ=2*xJ;function SJ(e){return e>=1?wJ:e<=-1?-wJ:Math.asin(e)}const kJ=Math.PI,CJ=2*kJ,_J=1e-6,OJ=CJ-_J;function EJ(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class TJ{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?EJ:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return EJ;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,o,i){this._append`C${+e},${+t},${+n},${+r},${this._x1=+o},${this._y1=+i}`}arcTo(e,t,n,r,o){if(e=+e,t=+t,n=+n,r=+r,(o=+o)<0)throw new Error(`negative radius: ${o}`);let i=this._x1,a=this._y1,l=n-e,s=r-t,u=i-e,c=a-t,d=u*u+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>_J)if(Math.abs(c*l-s*u)>_J&&o){let f=n-i,p=r-a,h=l*l+s*s,y=f*f+p*p,g=Math.sqrt(h),m=Math.sqrt(d),v=o*Math.tan((kJ-Math.acos((h+d-y)/(2*g*m)))/2),b=v/m,x=v/g;Math.abs(b-1)>_J&&this._append`L${e+b*u},${t+b*c}`,this._append`A${o},${o},0,0,${+(c*f>u*p)},${this._x1=e+x*l},${this._y1=t+x*s}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,o,i){if(e=+e,t=+t,i=!!i,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),l=n*Math.sin(r),s=e+a,u=t+l,c=1^i,d=i?r-o:o-r;null===this._x1?this._append`M${s},${u}`:(Math.abs(this._x1-s)>_J||Math.abs(this._y1-u)>_J)&&this._append`L${s},${u}`,n&&(d<0&&(d=d%CJ+CJ),d>OJ?this._append`A${n},${n},0,1,${c},${e-a},${t-l}A${n},${n},0,1,${c},${this._x1=s},${this._y1=u}`:d>_J&&this._append`A${n},${n},0,${+(d>=kJ)},${c},${this._x1=e+n*Math.cos(o)},${this._y1=t+n*Math.sin(o)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function PJ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new TJ(t)}function AJ(e){return e.innerRadius}function MJ(e){return e.outerRadius}function DJ(e){return e.startAngle}function IJ(e){return e.endAngle}function RJ(e){return e&&e.padAngle}function NJ(e,t,n,r,o,i,a){var l=e-n,s=t-r,u=(a?i:-i)/vJ(l*l+s*s),c=u*s,d=-u*l,f=e+c,p=t+d,h=n+c,y=r+d,g=(f+h)/2,m=(p+y)/2,v=h-f,b=y-p,x=v*v+b*b,w=o-i,j=f*y-h*p,S=(b<0?-1:1)*vJ(yJ(0,w*w*x-j*j)),k=(j*b-v*S)/x,C=(-j*v-b*S)/x,_=(j*b+v*S)/x,O=(-j*v+b*S)/x,E=k-g,T=C-m,P=_-g,A=O-m;return E*E+T*T>P*P+A*A&&(k=_,C=O),{cx:k,cy:C,x01:-c,y01:-d,x11:k*(o/w-1),y11:C*(o/w-1)}}function LJ(){var e=AJ,t=MJ,n=dJ(0),r=null,o=DJ,i=IJ,a=RJ,l=null,s=PJ(u);function u(){var u,c,d,f=+e.apply(this,arguments),p=+t.apply(this,arguments),h=o.apply(this,arguments)-wJ,y=i.apply(this,arguments)-wJ,g=fJ(y-h),m=y>h;if(l||(l=u=s()),p<f&&(c=p,p=f,f=c),p>bJ)if(g>jJ-bJ)l.moveTo(p*hJ(h),p*mJ(h)),l.arc(0,0,p,h,y,!m),f>bJ&&(l.moveTo(f*hJ(y),f*mJ(y)),l.arc(0,0,f,y,h,m));else{var v,b,x=h,w=y,j=h,S=y,k=g,C=g,_=a.apply(this,arguments)/2,O=_>bJ&&(r?+r.apply(this,arguments):vJ(f*f+p*p)),E=gJ(fJ(p-f)/2,+n.apply(this,arguments)),T=E,P=E;if(O>bJ){var A=SJ(O/f*mJ(_)),M=SJ(O/p*mJ(_));(k-=2*A)>bJ?(j+=A*=m?1:-1,S-=A):(k=0,j=S=(h+y)/2),(C-=2*M)>bJ?(x+=M*=m?1:-1,w-=M):(C=0,x=w=(h+y)/2)}var D=p*hJ(x),I=p*mJ(x),R=f*hJ(S),N=f*mJ(S);if(E>bJ){var L,F=p*hJ(w),B=p*mJ(w),z=f*hJ(j),U=f*mJ(j);if(g<xJ)if(L=function(e,t,n,r,o,i,a,l){var s=n-e,u=r-t,c=a-o,d=l-i,f=d*s-c*u;if(!(f*f<bJ))return[e+(f=(c*(t-i)-d*(e-o))/f)*s,t+f*u]}(D,I,z,U,F,B,R,N)){var W=D-L[0],H=I-L[1],K=F-L[0],$=B-L[1],V=1/mJ(((d=(W*K+H*$)/(vJ(W*W+H*H)*vJ(K*K+$*$)))>1?0:d<-1?xJ:Math.acos(d))/2),q=vJ(L[0]*L[0]+L[1]*L[1]);T=gJ(E,(f-q)/(V-1)),P=gJ(E,(p-q)/(V+1))}else T=P=0}C>bJ?P>bJ?(v=NJ(z,U,D,I,p,P,m),b=NJ(F,B,R,N,p,P,m),l.moveTo(v.cx+v.x01,v.cy+v.y01),P<E?l.arc(v.cx,v.cy,P,pJ(v.y01,v.x01),pJ(b.y01,b.x01),!m):(l.arc(v.cx,v.cy,P,pJ(v.y01,v.x01),pJ(v.y11,v.x11),!m),l.arc(0,0,p,pJ(v.cy+v.y11,v.cx+v.x11),pJ(b.cy+b.y11,b.cx+b.x11),!m),l.arc(b.cx,b.cy,P,pJ(b.y11,b.x11),pJ(b.y01,b.x01),!m))):(l.moveTo(D,I),l.arc(0,0,p,x,w,!m)):l.moveTo(D,I),f>bJ&&k>bJ?T>bJ?(v=NJ(R,N,F,B,f,-T,m),b=NJ(D,I,z,U,f,-T,m),l.lineTo(v.cx+v.x01,v.cy+v.y01),T<E?l.arc(v.cx,v.cy,T,pJ(v.y01,v.x01),pJ(b.y01,b.x01),!m):(l.arc(v.cx,v.cy,T,pJ(v.y01,v.x01),pJ(v.y11,v.x11),!m),l.arc(0,0,f,pJ(v.cy+v.y11,v.cx+v.x11),pJ(b.cy+b.y11,b.cx+b.x11),m),l.arc(b.cx,b.cy,T,pJ(b.y11,b.x11),pJ(b.y01,b.x01),!m))):l.arc(0,0,f,S,j,m):l.lineTo(R,N)}else l.moveTo(0,0);if(l.closePath(),u)return l=null,u+""||null}return u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+o.apply(this,arguments)+ +i.apply(this,arguments))/2-xJ/2;return[hJ(r)*n,mJ(r)*n]},u.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:dJ(+t),u):e},u.outerRadius=function(e){return arguments.length?(t="function"===typeof e?e:dJ(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n="function"===typeof e?e:dJ(+e),u):n},u.padRadius=function(e){return arguments.length?(r=null==e?null:"function"===typeof e?e:dJ(+e),u):r},u.startAngle=function(e){return arguments.length?(o="function"===typeof e?e:dJ(+e),u):o},u.endAngle=function(e){return arguments.length?(i="function"===typeof e?e:dJ(+e),u):i},u.padAngle=function(e){return arguments.length?(a="function"===typeof e?e:dJ(+e),u):a},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}TJ.prototype;var FJ=function(e,t){return{x:e,y:t,distance:function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},add:function(e){return FJ(this.x+e.x,this.y+e.y)},subtract:function(e){return FJ(this.x-e.x,this.y-e.y)},scalarMult:function(e){return FJ(this.x*e,this.y*e)},scalarDivide:function(e){if(0===e)throw new Error("Division by 0 error");return FJ(this.x/e,this.y/e)},equals:function(e){return this.x===e.x&&this.y===e.y}}},BJ=function(e,t){return{center:e,radius:t,hasIntersection:function(e){var t=this.center,n=e.center,r=this.radius,o=e.radius,i=t.distance(n);return!(i>r+o)&&!(i<Math.abs(r-o))},equals:function(e){var t=this.center,n=e.center;return this.radius===e.radius&&t.equals(n)},intersection:function(e){var t=this.center,n=e.center,r=this.radius,o=e.radius,i=t.distance(n);if(!this.hasIntersection(e)||this.equals(e))return[];var a=(Math.pow(r,2)-Math.pow(o,2)+Math.pow(i,2))/(2*i),l=Math.sqrt(Math.pow(r,2)-Math.pow(a,2)),s=t.add(n.subtract(t).scalarMult(a).scalarDivide(i)),u=t.x,c=t.y,d=n.x,f=n.y,p=s.x,h=s.y,y=[FJ(p-l*(f-c)/i,h+l*(d-u)/i),FJ(p+l*(f-c)/i,h-l*(d-u)/i)];return y.sort((function(e,t){return e.x-t.x})),y},solveX:function(e){var t=Math.sqrt(Math.pow(this.radius,2)-Math.pow(e-this.center.y,2));return[this.center.x-t,this.center.x+t]},solveY:function(e){var t=Math.sqrt(Math.pow(this.radius,2)-Math.pow(e-this.center.x,2));return[this.center.y-t,this.center.y+t]}}};function zJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function UJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zJ(Object(n),!0).forEach((function(t){WJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HJ(e){return function(e){if(Array.isArray(e))return KJ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return KJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KJ(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $J=function(e,t){var n=e.x,r=e.x0,o=e.y,i=e.y0,a=e.horizontal,l=e.alignment||"middle",s="middle"===l?t/2:t,u=a?-1:1;return a?{x0:r,x1:n,y0:"start"===l?o:o-u*s,y1:"end"===l?o:o+u*s}:{x0:"start"===l?n:n-u*s,x1:"end"===l?n:n+u*s,y0:i,y1:o}},VJ=function(e,t){var n=e.data,r=e.scale,o=void 0===n[t]._x1?"_x":"_x1";return r.x(n[t][o])},qJ=function(e){return-1*e+Math.PI/2},GJ=function(e,t,n){var r="".concat(t.topLeft," ").concat(t.topLeft," ").concat(n),o="".concat(t.topRight," ").concat(t.topRight," ").concat(n),i="".concat(t.bottomLeft," ").concat(t.bottomLeft," ").concat(n),a="".concat(t.bottomRight," ").concat(t.bottomRight," ").concat(n),l=["M","A ".concat(i,","),"L","A ".concat(r,","),"L","A ".concat(o,","),"L","A ".concat(a,",")].reduce((function(t,n,r){return t+="".concat(n," ").concat(e[r].x,", ").concat(e[r].y," \n")}),"");return"".concat(l," z")},YJ=function(e,t,n){var r=$J(e,t),o=r.y0>r.y1?1:-1,i=o>0?"0 0 1":"0 0 0",a=function(e,t,n){var r=e.x0,o=e.x1,i=e.y0,a=e.y1,l=function(e){var l="Left"===e,s=l?1:-1,u=l?r:o,c={x:u+s*n["bottom".concat(e)],y:i},d={x:u,y:i-t*n["bottom".concat(e)]},f={x:u,y:a+t*n["top".concat(e)]},p={x:u+s*n["top".concat(e)],y:a};if(1===t?i-n["bottom".concat(e)]<a+n["top".concat(e)]:i+n["bottom".concat(e)]>a-n["top".concat(e)]){var h=FJ(u+s*n["top".concat(e)],a+t*n["top".concat(e)]),y=BJ(h,n["top".concat(e)]),g=FJ(u+s*n["bottom".concat(e)],i-t*n["bottom".concat(e)]),m=BJ(g,n["bottom".concat(e)]),v=y.intersection(m);if(v.length>0){var b=v[l?0:1];d={x:b.x,y:b.y},f={x:b.x,y:b.y}}else if(n["top".concat(e)]>n["bottom".concat(e)]){var x=y.solveX(i)[l?0:1];c={x:x,y:i},d={x:x,y:i},f={x:x,y:i}}else{var w=m.solveX(a)[l?0:1];d={x:w,y:a},f={x:w,y:a},p={x:w,y:a}}}var j=[c,d,f,p];return l?j:j.reverse()};return l("Left").concat(l("Right"))}(r,o,n);return GJ(a,n,i)},QJ=function(e,t,n){var r=$J(e,t),o=r.x0<r.x1?1:-1,i={topRight:o>0?n.topLeft:n.bottomLeft,bottomRight:o>0?n.topRight:n.bottomRight,bottomLeft:o>0?n.bottomRight:n.topRight,topLeft:o>0?n.bottomLeft:n.topLeft},a=function(e,t,n){var r=e.y0,o=e.y1,i=e.x0<e.x1?e.x0:e.x1,a=e.x0<e.x1?e.x1:e.x0,l=function(e){var l="top"===e,s=l?-1:1,u=l?o:r,c={x:i,y:u-s*n["".concat(e,"Left")]},d={x:i+n["".concat(e,"Left")],y:u},f={x:a-n["".concat(e,"Right")],y:u},p={x:a,y:u-s*n["".concat(e,"Right")]};if(d.x>f.x){var h=FJ(i+n["".concat(e,"Left")],u-s*n["".concat(e,"Left")]),y=BJ(h,n["".concat(e,"Left")]),g=FJ(a-n["".concat(e,"Right")],u-s*n["".concat(e,"Right")]),m=BJ(g,n["".concat(e,"Right")]),v=y.intersection(m);if(v.length>0){var b=v[t>0?1:0];d={x:b.x,y:b.y},f={x:b.x,y:b.y}}else if(n["".concat(e,"Right")]>n["".concat(e,"Left")]){var x=m.solveY(i)[l?0:1];c={x:i,y:x},d={x:i,y:x},f={x:i,y:x}}else{var w=y.solveY(a)[l?0:1];p={x:a,y:w},f={x:a,y:w},d={x:a,y:w}}}return[c,d,f,p]},s=l("top"),u=l("bottom");return[u[1],u[0]].concat(HJ(s),[u[3],u[2]])}(r,o,i);return GJ(a,i,"0 0 1")},XJ=function(e,t){var n,r,o=e.datum,i=e.scale,a=e.index,l=e.alignment,s=e.style,u=i.y(o._y0||0),c=i.y(void 0!==o._y1?o._y1:o._y),d=i.x(void 0!==o._x1?o._x1:o._x);if(s.width){var f=function(e,t){var n=e.scale,r=n.y.range(),o=Math.max.apply(Math,HJ(r)),i=Math.abs(n.x.range()[1]-n.x.range()[0]);return t/(2*Math.PI*o)*i}(e,s.width),p="middle"===l?f/2:f;n="start"===l?d:d-p,r="end"===l?d:d+p}else n=function(e,t){var n=e.data,r=e.scale,o=e.alignment,i=VJ(e,t),a=Math.abs(r.x.range()[1]-r.x.range()[0]),l=0===t?VJ(e,n.length-1)-2*Math.PI:VJ(e,t-1);return 0===t&&a<2*Math.PI?r.x.range()[0]:"start"===o||"end"===o?"start"===o?l:i:(i+l)/2}(e,a),r=function(e,t){var n=e.data,r=e.scale,o=e.alignment,i=VJ(e,t),a=Math.abs(r.x.range()[1]-r.x.range()[0]),l=r.x.range()[1]===2*Math.PI?VJ(e,0)+2*Math.PI:r.x.range()[1],s=t===n.length-1?VJ(e,0)+2*Math.PI:VJ(e,t+1);return t===n.length-1&&a<2*Math.PI?l:"start"===o||"end"===o?"start"===o?i:s:(i+s)/2}(e,a);var h=function(e){return LJ().innerRadius(u).outerRadius(c).startAngle(qJ(n)).endAngle(qJ(r)).cornerRadius(t[e])()},y=function(e){var t=h("".concat(e,"Right")),n=t.match(/[A-Z]/g),r=t.split(/[A-Z]/).slice(1),o=n.indexOf("L"),i=h("".concat(e,"Left")),a=i.match(/[A-Z]/g),l=i.split(/[A-Z]/).slice(1),s=a.indexOf("L");return{rightMoves:n,rightCoords:r,rightMiddle:o,leftMoves:a,leftCoords:l,leftMiddle:s}},g=function(){var e,o,i=t.topRight,a=t.topLeft,l=c*Math.abs(r-n),s=y("top"),u=s.rightMoves,d=s.rightCoords,f=s.rightMiddle,p=s.leftMoves,h=s.leftCoords,g=s.leftMiddle;if(i===a||l<2*i+2*a)e=i>a?u:p,o=i>a?d:h;else{var m,v=function(e){return e<3},b=a>i&&v(f)?1:2;if(i>a){var x=v(f)?g:g-2;m=v(g)?g-1:x}else{var w=v(g)?1:2;m=v(f)?w:g-2}e=[].concat(HJ(u.slice(0,b)),HJ(p.slice(m))),o=[].concat(HJ(d.slice(0,b)),HJ(h.slice(m)))}var j=e.indexOf("L"),S=e.slice(0,j),k=o.slice(0,j);return S.map((function(e,t){return{command:e,coords:k[t].split(",")}}))}(),m=function(){var e,o,i=t.bottomRight,a=t.bottomLeft,l=u*Math.abs(r-n),s=y("bottom"),c=s.rightMoves,d=s.rightCoords,f=s.rightMiddle,p=s.leftMoves,h=s.leftCoords,g=s.leftMiddle;if(i===a||l<2*i+2*a)e=i>a?c:p,o=i>a?d:h;else{var m=function(e,t){return e.length-t<4},v=(i>a?m(c,f):m(p,g))?-1:-3;e=[].concat(HJ(p.slice(0,g+2)),HJ(c.slice(v))),o=[].concat(HJ(h.slice(0,g+2)),HJ(d.slice(v)))}var b=e.indexOf("L"),x=e.slice(b,-1),w=o.slice(b,-1);return x.map((function(e,t){return{command:e,coords:w[t].split(",")}}))}(),v=[].concat(HJ(g),HJ(m)).reduce((function(e,t){return e+="".concat(t.command," ").concat(t.coords.join())}),"");return"".concat(v," z")},ZJ=function(e,t,n){return e.getPath?function(e,t){return(0,e.getPath)(UJ(UJ({},e),$J(e,t)))}(e,t):e.horizontal?QJ(e,t,n):YJ(e,t,n)};function JJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function e0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JJ(Object(n),!0).forEach((function(t){t0(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function t0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n0=function(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(t.disableInlineStyles)return{};var n={fill:"black",stroke:e.fill||"black"};return fF(wL()(n,e),t)}(e.style,e),n=function(e,t){var n=t.scale,r=t.data,o=t.defaultBarWidth,i=t.style;if(e)return dF(e,t);if(i.width)return i.width;var a=n.x.range(),l=Math.abs(a[1]-a[0]),s=r.length+2,u=(t.barRatio||.5)*(r.length<2?o:l/s);return Math.max(1,u)}(e.barWidth,wL()({},e,{style:t})),r=cJ(e.cornerRadius,wL()({},e,{style:t,barWidth:n})),o=dF(e.ariaLabel,e),i=dF(e.desc,e),a=dF(e.id,e),l=dF(e.tabIndex,e);return wL()({},e,{ariaLabel:o,style:t,barWidth:n,cornerRadius:r,desc:i,id:a,tabIndex:l})},r0=function(e){var t=e=n0(e),n=t.polar,r=t.origin,o=t.style,i=t.barWidth,a=t.cornerRadius,l=n?function(e,t){return XJ(e,t)}(e,a):ZJ(e,i,a),s=n&&r?"translate(".concat(r.x,", ").concat(r.y,")"):void 0;return h.cloneElement(e.pathComponent,e0(e0({},e.events),{},{"aria-label":e.ariaLabel,style:o,d:l,className:e.className,clipPath:e.clipPath,desc:e.desc,index:e.index,role:e.role,shapeRendering:e.shapeRendering,transform:e.transform||s,tabIndex:e.tabIndex}))};r0.propTypes=e0(e0({},PV.primitiveProps),{},{alignment:oi().oneOf(["start","middle","end"]),barRatio:oi().number,barWidth:oi().oneOfType([oi().number,oi().func]),cornerRadius:oi().oneOfType([oi().number,oi().func,oi().shape({top:oi().oneOfType([oi().number,oi().func]),topLeft:oi().oneOfType([oi().number,oi().func]),topRight:oi().oneOfType([oi().number,oi().func]),bottom:oi().oneOfType([oi().number,oi().func]),bottomLeft:oi().oneOfType([oi().number,oi().func]),bottomRight:oi().oneOfType([oi().number,oi().func])})]),datum:oi().object,getPath:oi().func,horizontal:oi().bool,pathComponent:oi().element,width:oi().number,x:oi().number,y:oi().number,y0:oi().number}),r0.defaultProps={defaultBarWidth:8,pathComponent:h.createElement(dX,null),role:"presentation",shapeRendering:"auto"};var o0=r0;function i0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i0(Object(n),!0).forEach((function(t){l0(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i0(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u0(e,t){return u0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u0(e,t)}function c0(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=d0(e);if(t){var o=d0(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function d0(e){return d0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d0(e)}var f0={width:450,height:300,padding:50},p0=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u0(e,t)}(i,e);var t,n,r,o=c0(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,n=[{key:"shouldAnimate",value:function(){return!!this.props.animate}},{key:"render",value:function(){var e=i.animationWhitelist,t=i.role,n=bF(this.props,f0,t);if(this.shouldAnimate())return this.animateComponent(n,e);var r=this.renderData(n),o=n.standalone?this.renderContainer(n.containerComponent,r):r;return PF(o,n)}}],n&&s0(t.prototype,n),r&&s0(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);p0.animationWhitelist=["data","domain","height","padding","style","width"],p0.displayName="VictoryBar",p0.role="bar",p0.defaultTransitions={onLoad:{duration:2e3,before:function(){return{_y:0,_y1:0,_y0:0}},after:function(e){return{_y:e._y,_y1:e._y1,_y0:e._y0}}},onExit:{duration:500,before:function(){return{_y:0,yOffset:0}}},onEnter:{duration:500,before:function(){return{_y:0,_y1:0,_y0:0}},after:function(e){return{_y:e._y,_y1:e._y1,_y0:e._y0}}}},p0.propTypes=a0(a0(a0({},PV.baseProps),PV.dataProps),{},{alignment:oi().oneOf(["start","middle","end"]),barRatio:oi().number,barWidth:oi().oneOfType([oi().number,oi().func]),cornerRadius:oi().oneOfType([oi().number,oi().func,oi().shape({top:oi().oneOfType([oi().number,oi().func]),topLeft:oi().oneOfType([oi().number,oi().func]),topRight:oi().oneOfType([oi().number,oi().func]),bottom:oi().oneOfType([oi().number,oi().func]),bottomLeft:oi().oneOfType([oi().number,oi().func]),bottomRight:oi().oneOfType([oi().number,oi().func])})]),getPath:oi().func,horizontal:oi().bool}),p0.defaultProps={containerComponent:h.createElement(Oq,null),data:[{x:1,y:1},{x:2,y:2},{x:3,y:3},{x:4,y:4}],dataComponent:h.createElement(o0,null),groupComponent:h.createElement("g",{role:"presentation"}),labelComponent:h.createElement(pY,null),samples:50,sortOrder:"ascending",standalone:!0,theme:$q.grayscale},p0.getDomain=s$,p0.getData=GK,p0.getBaseProps=function(e){return uJ(e,f0)},p0.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];var h0=MQ(p0),y0=function(e,t){var n=bF(e,t,"line");e=wL()({},n,function(e){var t=GK(e);t.length<2&&(t=[]);var n={x:mF(e,"x"),y:mF(e,"y")},r={x:o$(e,"x"),y:o$(e,"y")},o={x:_K(e,"x").domain(r.x).range(e.horizontal?n.y:n.x),y:_K(e,"y").domain(r.y).range(e.horizontal?n.x:n.y)},i=e.polar?e.origin||gF(e):void 0,a=uF(e,"line");return{domain:r,data:t,scale:o,style:cF(e.style,a),origin:i}}(n));var r=e,o=r.data,i=r.domain,a=r.events,l=r.groupComponent,s=r.height,u=r.horizontal,c=r.interpolation,d=r.origin,f=r.padding,p=r.polar,h=r.scale,y=r.sharedEvents,g=r.standalone,m=r.style,v=r.theme,b=r.width,x=r.labels,w=r.name,j=r.disableInlineStyles,S={parent:{style:m.parent,scale:h,data:o,height:s,width:b,name:w,domain:i,standalone:g,polar:p,origin:d,padding:f,horizontal:u},all:{data:{horizontal:u,polar:p,origin:d,scale:h,data:o,interpolation:c,groupComponent:l,style:j?{}:m.data,theme:v,disableInlineStyles:j}}};return o.reduce((function(t,n,r){var o=$G(e,n,r);(void 0!==o&&null!==o||x&&(a||y))&&(t[yY()(n.eventKey)?r:n.eventKey]={labels:QG(e,r)});return t}),S)},g0=Array.prototype.slice;function m0(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}function v0(e){this._context=e}function b0(e){return new v0(e)}function x0(e){return e[0]}function w0(e){return e[1]}function j0(e,t){var n=dJ(!0),r=null,o=b0,i=null,a=PJ(l);function l(l){var s,u,c,d=(l=m0(l)).length,f=!1;for(null==r&&(i=o(c=a())),s=0;s<=d;++s)!(s<d&&n(u=l[s],s,l))===f&&((f=!f)?i.lineStart():i.lineEnd()),f&&i.point(+e(u,s,l),+t(u,s,l));if(c)return i=null,c+""||null}return e="function"===typeof e?e:void 0===e?x0:dJ(e),t="function"===typeof t?t:void 0===t?w0:dJ(t),l.x=function(t){return arguments.length?(e="function"===typeof t?t:dJ(+t),l):e},l.y=function(e){return arguments.length?(t="function"===typeof e?e:dJ(+e),l):t},l.defined=function(e){return arguments.length?(n="function"===typeof e?e:dJ(!!e),l):n},l.curve=function(e){return arguments.length?(o=e,null!=r&&(i=o(r)),l):o},l.context=function(e){return arguments.length?(null==e?r=i=null:i=o(r=e),l):r},l}function S0(e,t,n){var r=null,o=dJ(!0),i=null,a=b0,l=null,s=PJ(u);function u(u){var c,d,f,p,h,y=(u=m0(u)).length,g=!1,m=new Array(y),v=new Array(y);for(null==i&&(l=a(h=s())),c=0;c<=y;++c){if(!(c<y&&o(p=u[c],c,u))===g)if(g=!g)d=c,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=c-1;f>=d;--f)l.point(m[f],v[f]);l.lineEnd(),l.areaEnd()}g&&(m[c]=+e(p,c,u),v[c]=+t(p,c,u),l.point(r?+r(p,c,u):m[c],n?+n(p,c,u):v[c]))}if(h)return l=null,h+""||null}function c(){return j0().defined(o).curve(a).context(i)}return e="function"===typeof e?e:void 0===e?x0:dJ(+e),t="function"===typeof t?t:dJ(void 0===t?0:+t),n="function"===typeof n?n:void 0===n?w0:dJ(+n),u.x=function(t){return arguments.length?(e="function"===typeof t?t:dJ(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:dJ(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"===typeof e?e:dJ(+e),u):r},u.y=function(e){return arguments.length?(t="function"===typeof e?e:dJ(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"===typeof e?e:dJ(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:dJ(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(e){return arguments.length?(o="function"===typeof e?e:dJ(!!e),u):o},u.curve=function(e){return arguments.length?(a=e,null!=i&&(l=a(i)),u):a},u.context=function(e){return arguments.length?(null==e?i=l=null:l=a(i=e),u):i},u}function k0(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C0(e){return e}function _0(){var e=C0,t=k0,n=null,r=dJ(0),o=dJ(jJ),i=dJ(0);function a(a){var l,s,u,c,d,f=(a=m0(a)).length,p=0,h=new Array(f),y=new Array(f),g=+r.apply(this,arguments),m=Math.min(jJ,Math.max(-jJ,o.apply(this,arguments)-g)),v=Math.min(Math.abs(m)/f,i.apply(this,arguments)),b=v*(m<0?-1:1);for(l=0;l<f;++l)(d=y[h[l]=l]=+e(a[l],l,a))>0&&(p+=d);for(null!=t?h.sort((function(e,n){return t(y[e],y[n])})):null!=n&&h.sort((function(e,t){return n(a[e],a[t])})),l=0,u=p?(m-f*b)/p:0;l<f;++l,g=c)s=h[l],c=g+((d=y[s])>0?d*u:0)+b,y[s]={data:a[s],index:l,value:d,startAngle:g,endAngle:c,padAngle:v};return y}return a.value=function(t){return arguments.length?(e="function"===typeof t?t:dJ(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"===typeof e?e:dJ(+e),a):r},a.endAngle=function(e){return arguments.length?(o="function"===typeof e?e:dJ(+e),a):o},a.padAngle=function(e){return arguments.length?(i="function"===typeof e?e:dJ(+e),a):i},a}v0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var O0=T0(b0);function E0(e){this._curve=e}function T0(e){function t(t){return new E0(e(t))}return t._curve=e,t}function P0(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(T0(e)):t()._curve},e}function A0(){return P0(j0().curve(O0))}function M0(){var e=S0().curve(O0),t=e.curve,n=e.lineX0,r=e.lineX1,o=e.lineY0,i=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return P0(n())},delete e.lineX0,e.lineEndAngle=function(){return P0(r())},delete e.lineX1,e.lineInnerRadius=function(){return P0(o())},delete e.lineY0,e.lineOuterRadius=function(){return P0(i())},delete e.lineY1,e.curve=function(e){return arguments.length?t(T0(e)):t()._curve},e}function D0(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}E0.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};class I0{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}class R0{constructor(e){this._context=e}lineStart(){this._point=0}lineEnd(){}point(e,t){if(e=+e,t=+t,0===this._point)this._point=1;else{const n=D0(this._x0,this._y0),r=D0(this._x0,this._y0=(this._y0+t)/2),o=D0(e,this._y0),i=D0(e,t);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...o,...i)}this._x0=e,this._y0=t}}function N0(e){return new I0(e,!0)}function L0(e){return new I0(e,!1)}function F0(e){return new R0(e)}function B0(e){return e.source}function z0(e){return e.target}function U0(e){let t=B0,n=z0,r=x0,o=w0,i=null,a=null,l=PJ(s);function s(){let s;const u=g0.call(arguments),c=t.apply(this,u),d=n.apply(this,u);if(null==i&&(a=e(s=l())),a.lineStart(),u[0]=c,a.point(+r.apply(this,u),+o.apply(this,u)),u[0]=d,a.point(+r.apply(this,u),+o.apply(this,u)),a.lineEnd(),s)return a=null,s+""||null}return s.source=function(e){return arguments.length?(t=e,s):t},s.target=function(e){return arguments.length?(n=e,s):n},s.x=function(e){return arguments.length?(r="function"===typeof e?e:dJ(+e),s):r},s.y=function(e){return arguments.length?(o="function"===typeof e?e:dJ(+e),s):o},s.context=function(t){return arguments.length?(null==t?i=a=null:a=e(i=t),s):i},s}function W0(){return U0(N0)}function H0(){return U0(L0)}function K0(){const e=U0(F0);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const $0=vJ(3);var V0={draw(e,t){const n=.59436*vJ(t+gJ(t/28,.75)),r=n/2,o=r*$0;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-o,-r),e.lineTo(o,r),e.moveTo(-o,r),e.lineTo(o,-r)}},q0={draw(e,t){const n=vJ(t/xJ);e.moveTo(n,0),e.arc(0,0,n,0,jJ)}},G0={draw(e,t){const n=vJ(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};const Y0=vJ(1/3),Q0=2*Y0;var X0={draw(e,t){const n=vJ(t/Q0),r=n*Y0;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Z0={draw(e,t){const n=.62625*vJ(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},J0={draw(e,t){const n=.87559*vJ(t-gJ(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},e1={draw(e,t){const n=vJ(t),r=-n/2;e.rect(r,r,n,n)}},t1={draw(e,t){const n=.4431*vJ(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};const n1=mJ(xJ/10)/mJ(7*xJ/10),r1=mJ(jJ/10)*n1,o1=-hJ(jJ/10)*n1;var i1={draw(e,t){const n=vJ(.8908130915292852*t),r=r1*n,o=o1*n;e.moveTo(0,-n),e.lineTo(r,o);for(let i=1;i<5;++i){const t=jJ*i/5,a=hJ(t),l=mJ(t);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*o,l*r+a*o)}e.closePath()}};const a1=vJ(3);var l1={draw(e,t){const n=-vJ(t/(3*a1));e.moveTo(0,2*n),e.lineTo(-a1*n,-n),e.lineTo(a1*n,-n),e.closePath()}};const s1=vJ(3);var u1={draw(e,t){const n=.6824*vJ(t),r=n/2,o=n*s1/2;e.moveTo(0,-n),e.lineTo(o,r),e.lineTo(-o,r),e.closePath()}};const c1=-.5,d1=vJ(3)/2,f1=1/vJ(12),p1=3*(f1/2+1);var h1={draw(e,t){const n=vJ(t/p1),r=n/2,o=n*f1,i=r,a=n*f1+n,l=-i,s=a;e.moveTo(r,o),e.lineTo(i,a),e.lineTo(l,s),e.lineTo(c1*r-d1*o,d1*r+c1*o),e.lineTo(c1*i-d1*a,d1*i+c1*a),e.lineTo(c1*l-d1*s,d1*l+c1*s),e.lineTo(c1*r+d1*o,c1*o-d1*r),e.lineTo(c1*i+d1*a,c1*a-d1*i),e.lineTo(c1*l+d1*s,c1*s-d1*l),e.closePath()}},y1={draw(e,t){const n=.6189*vJ(t-gJ(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};const g1=[q0,G0,X0,e1,i1,l1,h1],m1=[q0,J0,y1,u1,V0,t1,Z0];function v1(e,t){let n=null,r=PJ(o);function o(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return e="function"===typeof e?e:dJ(e||q0),t="function"===typeof t?t:dJ(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"===typeof t?t:dJ(t),o):e},o.size=function(e){return arguments.length?(t="function"===typeof e?e:dJ(+e),o):t},o.context=function(e){return arguments.length?(n=null==e?null:e,o):n},o}function b1(){}function x1(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function w1(e){this._context=e}function j1(e){return new w1(e)}function S1(e){this._context=e}function k1(e){return new S1(e)}function C1(e){this._context=e}function _1(e){return new C1(e)}function O1(e,t){this._basis=new w1(e),this._beta=t}w1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:x1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:x1(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},S1.prototype={areaStart:b1,areaEnd:b1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:x1(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},C1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:x1(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},O1.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,o=e[0],i=t[0],a=e[n]-o,l=t[n]-i,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(o+r*a),this._beta*t[s]+(1-this._beta)*(i+r*l));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var E1=function e(t){function n(e){return 1===t?new w1(e):new O1(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function T1(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function P1(e,t){this._context=e,this._k=(1-t)/6}P1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:T1(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:T1(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var A1=function e(t){function n(e){return new P1(e,t)}return n.tension=function(t){return e(+t)},n}(0);function M1(e,t){this._context=e,this._k=(1-t)/6}M1.prototype={areaStart:b1,areaEnd:b1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:T1(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var D1=function e(t){function n(e){return new M1(e,t)}return n.tension=function(t){return e(+t)},n}(0);function I1(e,t){this._context=e,this._k=(1-t)/6}I1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:T1(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var R1=function e(t){function n(e){return new I1(e,t)}return n.tension=function(t){return e(+t)},n}(0);function N1(e,t,n){var r=e._x1,o=e._y1,i=e._x2,a=e._y2;if(e._l01_a>bJ){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,s=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/s,o=(o*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/s}if(e._l23_a>bJ){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);i=(i*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,o,i,a,e._x2,e._y2)}function L1(e,t){this._context=e,this._alpha=t}L1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:N1(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var F1=function e(t){function n(e){return t?new L1(e,t):new P1(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function B1(e,t){this._context=e,this._alpha=t}B1.prototype={areaStart:b1,areaEnd:b1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:N1(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var z1=function e(t){function n(e){return t?new B1(e,t):new M1(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function U1(e,t){this._context=e,this._alpha=t}U1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:N1(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var W1=function e(t){function n(e){return t?new U1(e,t):new I1(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function H1(e){this._context=e}function K1(e){return new H1(e)}function $1(e){return e<0?-1:1}function V1(e,t,n){var r=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(r||o<0&&-0),a=(n-e._y1)/(o||r<0&&-0),l=(i*o+a*r)/(r+o);return($1(i)+$1(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(l))||0}function q1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function G1(e,t,n){var r=e._x0,o=e._y0,i=e._x1,a=e._y1,l=(i-r)/3;e._context.bezierCurveTo(r+l,o+l*t,i-l,a-l*n,i,a)}function Y1(e){this._context=e}function Q1(e){this._context=new X1(e)}function X1(e){this._context=e}function Z1(e){return new Y1(e)}function J1(e){return new Q1(e)}function e5(e){this._context=e}function t5(e){var t,n,r=e.length-1,o=new Array(r),i=new Array(r),a=new Array(r);for(o[0]=0,i[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,i[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,i[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/i[t-1],i[t]-=n,a[t]-=n*a[t-1];for(o[r-1]=a[r-1]/i[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-o[t+1];return[o,i]}function n5(e){return new e5(e)}function r5(e,t){this._context=e,this._t=t}function o5(e){return new r5(e,.5)}function i5(e){return new r5(e,0)}function a5(e){return new r5(e,1)}function l5(e,t){if((o=e.length)>1)for(var n,r,o,i=1,a=e[t[0]],l=a.length;i<o;++i)for(r=a,a=e[t[i]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function s5(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function u5(e,t){return e[t]}function c5(e){const t=[];return t.key=e,t}function d5(){var e=dJ([]),t=s5,n=l5,r=u5;function o(o){var i,a,l=Array.from(e.apply(this,arguments),c5),s=l.length,u=-1;for(const e of o)for(i=0,++u;i<s;++i)(l[i][u]=[0,+r(e,l[i].key,u,o)]).data=e;for(i=0,a=m0(t(l));i<s;++i)l[a[i]].index=i;return n(l,a),l}return o.keys=function(t){return arguments.length?(e="function"===typeof t?t:dJ(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"===typeof e?e:dJ(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?s5:"function"===typeof e?e:dJ(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?l5:e,o):n},o}function f5(e,t){if((r=e.length)>0){for(var n,r,o,i=0,a=e[0].length;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}l5(e,t)}}function p5(e,t){if((l=e.length)>0)for(var n,r,o,i,a,l,s=0,u=e[t[0]].length;s<u;++s)for(i=a=0,n=0;n<l;++n)(o=(r=e[t[n]][s])[1]-r[0])>0?(r[0]=i,r[1]=i+=o):o<0?(r[1]=a,r[0]=a+=o):(r[0]=0,r[1]=o)}function h5(e,t){if((n=e.length)>0){for(var n,r=0,o=e[t[0]],i=o.length;r<i;++r){for(var a=0,l=0;a<n;++a)l+=e[a][r][1]||0;o[r][1]+=o[r][0]=-l/2}l5(e,t)}}function y5(e,t){if((o=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,o,i=0,a=1;a<r;++a){for(var l=0,s=0,u=0;l<o;++l){for(var c=e[t[l]],d=c[a][1]||0,f=(d-(c[a-1][1]||0))/2,p=0;p<l;++p){var h=e[t[p]];f+=(h[a][1]||0)-(h[a-1][1]||0)}s+=d,u+=f*d}n[a-1][1]+=n[a-1][0]=i,s&&(i-=u/s)}n[a-1][1]+=n[a-1][0]=i,l5(e,t)}}function g5(e){var t=e.map(m5);return s5(e).sort((function(e,n){return t[e]-t[n]}))}function m5(e){for(var t,n=-1,r=0,o=e.length,i=-1/0;++n<o;)(t=+e[n][1])>i&&(i=t,r=n);return r}function v5(e){var t=e.map(b5);return s5(e).sort((function(e,n){return t[e]-t[n]}))}function b5(e){for(var t,n=0,r=-1,o=e.length;++r<o;)(t=+e[r][1])&&(n+=t);return n}function x5(e){return v5(e).reverse()}function w5(e){var t,n,r=e.length,o=e.map(b5),i=g5(e),a=0,l=0,s=[],u=[];for(t=0;t<r;++t)n=i[t],a<l?(a+=o[n],s.push(n)):(l+=o[n],u.push(n));return u.reverse().concat(s)}function j5(e){return s5(e).reverse()}H1.prototype={areaStart:b1,areaEnd:b1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},Y1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:G1(this,this._t0,q1(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,G1(this,q1(this,n=V1(this,e,t)),n);break;default:G1(this,this._t0,n=V1(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(Q1.prototype=Object.create(Y1.prototype)).point=function(e,t){Y1.prototype.point.call(this,t,e)},X1.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,i){this._context.bezierCurveTo(t,e,r,n,i,o)}},e5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=t5(e),o=t5(t),i=0,a=1;a<n;++i,++a)this._context.bezierCurveTo(r[0][i],o[0][i],r[1][i],o[1][i],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},r5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var S5=function(e){var t=void 0!==e._y1?e._y1:e._y;return null!==t&&void 0!==t&&null!==e._y0},k5=function(e){return function(t){return e.x(void 0!==t._x1?t._x1:t._x)}},C5=function(e){return function(t){return e.y(void 0!==t._y1?t._y1:t._y)}},_5=function(e){return"curve".concat(function(e){return e&&e[0].toUpperCase()+e.slice(1)}(e))},O5=function(e){var t=e.interpolation;if("function"===typeof t)return t;if("string"===typeof t){var n=e.polar,r=e.openCurve,o=(void 0===r?!n:r)?_5(t):function(e){return"".concat(_5(e),"Closed")}(t);return l[o]}return b0},E5=function(e){var t=e.polar,n=e.scale,r=e.horizontal;return t?A0().defined(S5).curve(O5(e)).angle(function(e){return function(t){return-1*e.x(void 0!==t._x1?t._x1:t._x)+Math.PI/2}}(n)).radius(C5(n)):j0().defined(S5).curve(O5(e)).x(r?C5(n):k5(n)).y(r?k5(n):C5(n))};function T5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T5(Object(n),!0).forEach((function(t){A5(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M5=function(e){e=function(e){var t=dF(e.ariaLabel,e),n=dF(e.id,e),r=fF(wL()({fill:"none",stroke:"black"},e.style),e),o=dF(e.tabIndex,e);return wL()({},e,{ariaLabel:t,id:n,style:r,tabIndex:o})}(e);var t=TF(e),n=e,r=n.polar,o=n.origin,i=E5(e),a=r&&o?"translate(".concat(o.x,", ").concat(o.y,")"):void 0,l=i(e.data);return h.cloneElement(e.pathComponent,P5(P5(P5({},e.events),t),{},{"aria-label":e.ariaLabel,d:l,style:e.style,transform:e.transform||a,className:e.className,role:e.role,shapeRendering:e.shapeRendering,clipPath:e.clipPath,tabIndex:e.tabIndex}))};M5.propTypes=P5(P5({},PV.primitiveProps),{},{interpolation:oi().oneOfType([oi().string,oi().func]),openCurve:oi().bool,origin:oi().shape({x:oi().number.isRequired,y:oi().number.isRequired}),pathComponent:oi().element,polar:oi().bool}),M5.defaultProps={pathComponent:h.createElement(dX,null),role:"presentation",shapeRendering:"auto"};var D5=function(e){return h.createElement("defs",null,h.createElement("clipPath",{id:e.clipId},e.children))};function I5(e){return function(e){if(Array.isArray(e))return R5(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return R5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R5(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N5(Object(n),!0).forEach((function(t){F5(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z5(e,t){return z5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},z5(e,t)}function U5(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=W5(e);if(t){var o=W5(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function W5(e){return W5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},W5(e)}D5.propTypes={children:oi().oneOfType([oi().arrayOf(oi().node),oi().node]),clipId:oi().oneOfType([oi().number,oi().string])};var H5=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z5(e,t)}(i,e);var t,n,r,o=U5(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this,e)).clipId=void 0,t.clipId=eB()(e)&&void 0!==e.clipId?e.clipId:KV()("victory-clip-"),t}return t=i,n=[{key:"calculateAttributes",value:function(e){var t=e.polar,n=e.origin,r=e.clipWidth,o=void 0===r?0:r,i=e.clipHeight,a=void 0===i?0:i,l=e.translateX,s=void 0===l?0:l,u=e.translateY,c=void 0===u?0:u,d=lF({padding:e.clipPadding}),f=e.radius||yF(e);return{x:(t?n.x:s)-d.left,y:(t?n.y:c)-d.top,width:Math.max((t?f:o)+d.left+d.right,0),height:Math.max((t?f:a)+d.top+d.bottom,0)}}},{key:"renderClippedGroup",value:function(e,t){var n=TF(e),r=e.style,o=e.events,i=e.transform,a=e.children,l=e.className,s=e.groupComponent,u=e.tabIndex,c=this.renderClipComponent(e,t),d=wL()({className:l,style:r,transform:i,key:"clipped-group-".concat(t),clipPath:"url(#".concat(t,")")},o);return h.cloneElement(s,L5(L5({},d),{},{tabIndex:u},n),[c].concat(I5(h.Children.toArray(a))))}},{key:"renderGroup",value:function(e){var t=e.style,n=e.events,r=e.transform,o=e.children,i=e.className,a=e.groupComponent,l=e.tabIndex;return h.cloneElement(a,wL()({className:i,style:t,transform:r,"aria-label":e["aria-label"],tabIndex:l},n),o)}},{key:"renderClipComponent",value:function(e,t){var n,r=e.polar,o=e.origin,i=e.clipWidth,a=void 0===i?0:i,l=e.clipHeight,s=void 0===l?0:l,u=e.translateX,c=void 0===u?0:u,d=e.translateY,f=void 0===d?0:d,p=e.circleComponent,y=e.rectComponent,g=e.clipPathComponent,m=lF({padding:e.clipPadding}),v=m.top,b=m.bottom,x=m.left,w=m.right;if(r){var j=e.radius||yF(e),S={r:Math.max(j+x+w,j+v+b,0),cx:o.x-x,cy:o.y-v};n=h.cloneElement(p,S)}else{var k={x:c-x,y:f-v,width:Math.max(a+x+w,0),height:Math.max(s+v+b,0)};n=h.cloneElement(y,k)}return h.cloneElement(g,wL()({key:"clip-path-".concat(t)},e,{clipId:t}),n)}},{key:"getClipValue",value:function(e,t){var n={x:e.clipWidth,y:e.clipHeight};if(void 0!==n[t])return n[t];var r=mF(e,t);return r&&Math.abs(r[0]-r[1])||void 0}},{key:"getTranslateValue",value:function(e,t){var n={x:e.translateX,y:e.translateY};if(void 0!==n[t])return n[t];var r=mF(e,t);return r?Math.min.apply(Math,I5(r)):void 0}},{key:"render",value:function(){var e=this.getClipValue(this.props,"y"),t=this.getClipValue(this.props,"x");if(void 0===t||void 0===e)return this.renderGroup(this.props);var n=this.getTranslateValue(this.props,"x"),r=this.getTranslateValue(this.props,"y"),o=SL()({},this.props,{clipHeight:e,clipWidth:t,translateX:n,translateY:r});return this.renderClippedGroup(o,this.clipId)}}],n&&B5(t.prototype,n),r&&B5(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function K5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K5(Object(n),!0).forEach((function(t){V5(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function V5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G5(e,t){return G5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},G5(e,t)}function Y5(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=Q5(e);if(t){var o=Q5(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Q5(e){return Q5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Q5(e)}H5.displayName="VictoryClipContainer",H5.role="container",H5.propTypes={"aria-label":oi().string,children:oi().oneOfType([oi().arrayOf(oi().node),oi().node]),circleComponent:oi().element,className:oi().string,clipHeight:SV,clipId:oi().oneOfType([oi().number,oi().string]),clipPadding:oi().shape({top:oi().number,bottom:oi().number,left:oi().number,right:oi().number}),clipPathComponent:oi().element,clipWidth:SV,events:oi().object,groupComponent:oi().element,origin:oi().shape({x:SV,y:SV}),polar:oi().bool,radius:SV,style:oi().object,tabIndex:oi().number,transform:oi().string,translateX:oi().number,translateY:oi().number},H5.defaultProps={circleComponent:h.createElement(FV,null),rectComponent:h.createElement(IV,null),clipPathComponent:h.createElement(D5,null),groupComponent:h.createElement("g",null)};var X5={width:450,height:300,padding:50,interpolation:"linear"},Z5=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G5(e,t)}(i,e);var t,n,r,o=Y5(i);function i(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.call(this,e)}return t=i,n=[{key:"shouldAnimate",value:function(){return!!this.props.animate}},{key:"render",value:function(){var e=i.animationWhitelist,t=i.role,n=bF(this.props,X5,t);if(this.shouldAnimate())return this.animateComponent(n,e);var r=this.renderContinuousData(n),o=n.standalone?this.renderContainer(n.containerComponent,r):r;return PF(o,n)}}],n&&q5(t.prototype,n),r&&q5(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);Z5.animationWhitelist=["data","domain","height","padding","samples","style","width"],Z5.displayName="VictoryLine",Z5.role="line",Z5.defaultTransitions={onLoad:{duration:2e3},onExit:{duration:500},onEnter:{duration:500}},Z5.defaultPolarTransitions={onLoad:{duration:2e3,before:function(){return{_y:0,_y1:0,_y0:0}},after:function(e){return{_y:e._y,_y1:e._y1,_y0:e._y0}}},onExit:{duration:500,before:function(e,t,n){var r=function(e){return(0===t?n[t+1]:n[t-1])[e]};return{_x:r("_x"),_y:r("_y"),_y0:r("_y0")}}},onEnter:{duration:500,before:function(e,t,n){var r=function(e){return(0===t?n[t+1]:n[t-1])[e]};return{_x:r("_x"),_y:r("_y"),_y0:r("_y0")}},after:function(e){return{_x:e._x,_y:e._y,_y1:e._y1,_y0:e._y0}}}},Z5.continuous=!0,Z5.propTypes=$5($5($5({},PV.baseProps),PV.dataProps),{},{interpolation:oi().oneOfType([oi().oneOf(["basis","bundle","cardinal","catmullRom","linear","monotoneX","monotoneY","natural","step","stepAfter","stepBefore"]),oi().func]),label:wV(oi().string,"Use `labels` instead for individual data labels")}),Z5.defaultProps={containerComponent:h.createElement(Oq,null),dataComponent:h.createElement(M5,null),labelComponent:h.createElement(pY,{renderInPortal:!0}),groupComponent:h.createElement(H5,null),samples:50,sortKey:"x",sortOrder:"ascending",standalone:!0,theme:$q.grayscale},Z5.getDomain=o$,Z5.getData=GK,Z5.getBaseProps=function(e){return y0(e,X5)},Z5.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];var J5=MQ(Z5,{components:[{name:"parent",index:"parent"},{name:"data",index:"all"},{name:"labels"}]});const e2={fontFamily:"Inter var, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif",fontSize:13,letterSpacing:"normal",fill:go.n1,stroke:"transparent"},t2={axis:{fill:"transparent",stroke:"none"},grid:{fill:"none",stroke:"none",pointerEvents:"none"},ticks:{fill:"transparent",size:1,stroke:"none"},axisLabel:e2,tickLabels:e2};var n2={colors:{blueFadeStart:"rgba(229, 245, 255, 1)",blueFadeEnd:"rgba(229, 245, 255, 0)",redFadeStart:"rgba(255, 243, 242, 1)",redFadeEnd:"rgba(255, 243, 242, 0)",red:go.r7,blue:go.b6},area:{style:{labels:e2,data:{stroke:go.b6,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}}},axis:{style:t2},dependentAxis:{style:{...t2,grid:{...t2.grid,stroke:"rgba(0,0,0,.2)",strokeDasharray:"1,1"},tickLabels:{...e2,padding:5}}},independentAxis:{style:{...t2,axis:{...t2.axis,stroke:"rgba(0,0,0,.2)"},tickLabels:{...e2,padding:10}}},bar:{style:{labels:e2,data:{fill:go.b6,stroke:"none"}}},line:{style:{labels:e2,data:{fill:"none",stroke:go.b6,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}}},voronoi:{style:{labels:e2}},chart:{padding:{top:20,left:65,right:20,bottom:50}}};function r2(e){let{style:t,children:n}=e;const r=(0,h.useRef)(null);return(0,wo.jsxs)(Ll,{style:[{height:300,position:"relative",flexShrink:0},t],children:[(0,wo.jsx)("div",{ref:r}),(0,wo.jsx)(Iw,{children:e=>{let{width:t,height:o}=e;return(0,wo.jsx)("div",{style:{width:t,height:o},children:n(t,o,r.current)})}})]})}class o2 extends h.Component{render(){let{active:e,x:t,y:n,scale:r,datum:o,portalHost:i,offsetX:a=0,offsetY:l,position:s,light:u,forceActive:c,style:d}=this.props;const f=t-r.x.range()[0];return s||(s=o.labelPosition?o.labelPosition:f<150?"right":"left"),i&&(e||c)?(n=l?l(n):n,we.createPortal((0,wo.jsx)("div",{...(0,lo.iv)({position:"absolute",top:0,left:a,transform:"right"===s?`translate(calc(${t}px + 15px), calc(${n}px ${u?"":"- 50%"}))`:`translate(calc(${t}px - 100% - 15px), calc(${n}px ${u?"":"- 50%"}))`,zIndex:1e3,pointerEvents:"none",borderRadius:2,boxShadow:u?"none":"0 1px 6px rgba(0, 0, 0, .20)",backgroundColor:u?"transparent":go.n1,color:u?"inherit":"white",padding:10},!u&&(0,lo.bb)({position:"absolute",display:"inline-block",borderTop:"7px solid transparent",borderBottom:"7px solid transparent",["right"===s?"borderRight":"borderLeft"]:"7px solid "+go.n1,["right"===s?"left":"right"]:-6,top:"calc(50% - 7px)",content:'" "'}),d),children:o.premadeLabel}),i)):null}}o2.defaultEvents=yZ.defaultEvents;var i2=o2;var a2=function(e){let{style:t,start:n,end:r,graphData:o,isConcise:i,compact:a}=e;return(0,wo.jsx)(r2,{children:(e,t,n)=>o&&(0,wo.jsxs)(tZ,{scale:{x:"time",y:"linear"},theme:n2,domainPadding:10,width:e,height:t,containerComponent:(0,wo.jsx)(BZ,{voronoiDimension:"x"}),children:[(0,wo.jsxs)(lJ,{children:[(0,wo.jsx)(h0,{data:o.expenses,style:{data:{fill:n2.colors.red}}}),(0,wo.jsx)(h0,{data:o.income})]}),(0,wo.jsx)(J5,{data:o.balances,labelComponent:(0,wo.jsx)(i2,{portalHost:n}),labels:e=>e.premadeLabel,style:{data:{stroke:go.n5}}}),(0,wo.jsx)(sX,{tickFormat:e=>Hp(e,i?"MMM ''yy":"MMM d"),tickValues:o.balances.map((e=>e.x)),tickCount:Math.min(5,o.balances.length),offsetY:50}),(0,wo.jsx)(sX,{dependentAxis:!0,crossAxis:!1})]})})};function l2(e,t,n){const r=Zp();return n>r&&(n=r),t<e&&(t=e),[t,n]}function s2(e){const t=Zp();return[nh(t,e),t]}var u2=function(e){let{title:t,start:n,end:r,show1Month:o,allMonths:i,onChangeDates:a}=e;return(0,wo.jsxs)(Ll,{style:{padding:20,paddingTop:0,flexShrink:0},children:[(0,wo.jsxs)(Ls,{to:"/reports",bare:!0,style:{marginBottom:"15",alignSelf:"flex-start"},children:[(0,wo.jsx)(FP,{width:10,height:10,style:{marginRight:5}})," Back"]}),(0,wo.jsx)(Ll,{style:mo.veryLargeText,children:t}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",marginTop:15},children:[(0,wo.jsxs)("div",{children:[(0,wo.jsx)(zs,{style:{flex:0,backgroundColor:"white"},onChange:e=>a(...function(e,t,n){const r=e[e.length-1].name;return n<t&&(n=th(t,6)),l2(r,t,n)}(i,e.target.value,r)),value:n,children:i.map((e=>(0,wo.jsx)("option",{value:e.name,children:e.pretty},e.name)))})," ","to"," ",(0,wo.jsx)(zs,{style:{flex:0,backgroundColor:"white"},onChange:e=>a(...function(e,t,n){const r=e[e.length-1].name;return t>n&&(t=nh(n,6)),l2(r,t,n)}(i,n,e.target.value)),value:r,children:i.map((e=>(0,wo.jsx)("option",{value:e.name,children:e.pretty},e.name)))})]}),o&&(0,wo.jsx)(zl,{bare:!0,style:{marginLeft:15},onClick:()=>a(...s2(1)),children:"1 month"}),(0,wo.jsx)(zl,{bare:!0,style:{marginLeft:15},onClick:()=>a(...s2(2)),children:"3 months"}),(0,wo.jsx)(zl,{bare:!0,style:{marginLeft:15},onClick:()=>a(...s2(5)),children:"6 months"}),(0,wo.jsx)(zl,{bare:!0,style:{marginLeft:15},onClick:()=>a(...s2(12)),children:"1 Year"}),(0,wo.jsx)(zl,{bare:!0,style:{marginLeft:15},onClick:()=>a(...function(e){return[e[e.length-1].name,Zp()]}(i)),children:"All Time"})]})]})};var c2=function(e,t){const n=Sf(),[r,o]=(0,h.useState)(null);return(0,h.useEffect)((()=>{let e;return t(n,(e=>o(e))).then((t=>{e=t})),()=>{e&&e()}}),[t]),r};var d2=function(){const[e,t]=(0,h.useState)(null),[n,r]=(0,h.useState)(nh(Zp(),30)),[o,i]=(0,h.useState)(Jp()),[a,l]=(0,h.useState)((()=>dL(lk(o),lk(n))>93)),s=(0,h.useMemo)((()=>mL(n,o,a)),[n,o,a]),u=c2("cash_flow",s);if((0,h.useEffect)((()=>{!async function(){const e=await qe("get-earliest-transaction"),n=lh(e?Qp(lk(e.date)):Zp(),Zp()).map((e=>({name:e,pretty:fh(e,"MMMM, yyyy")}))).reverse();t(n)}()}),[]),!e||!u)return null;const{graphData:c,totalExpenses:d,totalIncome:f}=u;return(0,wo.jsxs)(Ll,{style:[mo.page,{minWidth:650,overflow:"hidden"}],children:[(0,wo.jsx)(u2,{title:"Cash Flow",allMonths:e,start:ch(n),end:ch(o),show1Month:!0,onChangeDates:function(e,t){const n=dL(lk(t),lk(e))>93;let o=t+"-31";o>Jp()&&(o=Jp()),r(e+"-01"),i(o),l(n)}}),(0,wo.jsxs)(Ll,{style:{backgroundColor:"white",paddingLeft:30,paddingRight:30,overflow:"auto"},children:[(0,wo.jsxs)(Ll,{style:{paddingTop:20,paddingRight:20,flexShrink:0,alignItems:"flex-end",color:go.n3},children:[(0,wo.jsx)(Ks,{style:{marginBottom:5,minWidth:160},left:(0,wo.jsx)(Ms,{children:"Income:"}),right:(0,wo.jsx)(ql,{style:{fontWeight:600},children:zr(f)})}),(0,wo.jsx)(Ks,{style:{marginBottom:5,minWidth:160},left:(0,wo.jsx)(Ms,{children:"Expenses:"}),right:(0,wo.jsx)(ql,{style:{fontWeight:600},children:zr(d)})}),(0,wo.jsx)(ql,{style:{fontWeight:600},children:(0,wo.jsx)(fL,{amount:f+d})})]}),(0,wo.jsx)(a2,{start:n,end:o,graphData:c,isConcise:a}),(0,wo.jsxs)(Ll,{style:{marginTop:30},children:[(0,wo.jsx)($s,{children:(0,wo.jsx)("strong",{children:"How is cash flow calculated?"})}),(0,wo.jsx)($s,{children:"Cash flow shows the balance of your budgeted accounts over time, and the amount of expenses/income each day or month. Your budgeted accounts are considered to be \u201ccash on hand,\u201d so this gives you a picture of how available money fluctuates."})]})]})]})};function f2(e,t,n){return async(r,o)=>{if(0===n.length)return null;const i=await Promise.all(n.map((async n=>{let[r,o]=await Promise.all([pr(fr("transactions").filter({account:n.id,date:{$lt:e+"-01"}}).calculate({$sum:"$amount"})).then((e=>{let{data:t}=e;return t})),pr(fr("transactions").filter({account:n.id,$and:[{date:{$gte:e+"-01"}},{date:{$lte:t+"-31"}}]}).groupBy({$month:"$date"}).select([{date:{$month:"$date"}},{amount:{$sum:"$amount"}}])).then((e=>{let{data:t}=e;return t}))]);return{id:n.id,balances:gL(o,"date"),starting:r}})));o(function(e,t,n){const r=lh(t,n),o=e.map((e=>{let t=e.starting;return r.map((n=>(e.balances[n]&&(t+=e.balances[n].amount),t)))}));let i=!1,a=0,l=0;const s=r.reduce(((e,t,n)=>{let r=0,s=0,u=0;const c=0===e.length?null:e[e.length-1];o.forEach((e=>{const t=e[n];t<0?r+=-t:s+=t,u+=t})),u<0&&(i=!0);const d=lk(t+"-01"),f=c?u-$r(c.y):0,p=(0,wo.jsxs)("div",{children:[(0,wo.jsx)("div",{style:{marginBottom:10},children:(0,wo.jsx)("strong",{children:Hp(d,"MMMM yyyy")})}),(0,wo.jsxs)("div",{style:{lineHeight:1.5},children:[(0,wo.jsx)(Ks,{left:"Assets:",right:zr(s)}),(0,wo.jsx)(Ks,{left:"Debt:",right:`-${zr(r)}`}),(0,wo.jsx)(Ks,{left:"Net worth:",right:(0,wo.jsx)("strong",{children:zr(u)})}),(0,wo.jsx)(Ks,{left:"Change:",right:zr(f)})]})]});return 0===e.length&&(a=u),l=u,e.push({x:d,y:Vr(u),premadeLabel:p}),e}),[]);return{graphData:{data:s,hasNegative:i,start:t,end:n},netWorth:l,totalChange:l-a}}(i,e,t))}}var p2=function(e){var t=e.polar,n=uF(e,"area"),r=cF(e.style,n),o={x:mF(e,"x"),y:mF(e,"y")},i={x:s$(e,"x"),y:s$(e,"y")},a={x:_K(e,"x").domain(i.x).range(e.horizontal?o.y:o.x),y:_K(e,"y").domain(i.y).range(e.horizontal?o.x:o.y)},l=t?e.origin||gF(e):void 0,s=function(e,t){var n=GK(e);n.length<2&&(n=[]);var r=function(e){var n="log"===PK(t[e])?1/Number.MAX_SAFE_INTEGER:0,r=t[e].domain(),o=IL(r),i=DL(r),a=n;return o<0&&i<=0?a=i:o>=0&&i>0&&(a=o),PL(r)?new Date(a):a};return n.map((function(e){var t=void 0!==e._y1?e._y1:e._y,n=void 0!==e._y0?e._y0:r("y"),o=void 0!==e._x1?e._x1:e._x,i=void 0!==e._x0?e._x0:r("x");return wL()({},e,{_y0:n,_y1:t,_x0:i,_x1:o})}))}(e,a);return{style:r,data:s,scale:a,domain:i,origin:l}};function h2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h2(Object(n),!0).forEach((function(t){g2(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h2(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m2=function(e){var t=void 0!==e._y1?e._y1:e._y;return null!==t&&void 0!==t&&null!==e._y0},v2=function(e){return function(t){return e.x(void 0!==t._x1?t._x1:t._x)}},b2=function(e){return function(t){return e.y(void 0!==t._y1?t._y1:t._y)}},x2=function(e){return function(t){return e.y(t._y0)}},w2=function(e){var t=e.polar,n=e.scale,r=O5(e);return t?M0().defined(m2).curve(r).angle(function(e){return function(t){return-1*e.x(void 0!==t._x1?t._x1:t._x)+Math.PI/2}}(n)).outerRadius(b2(n)).innerRadius(x2(n)):function(e){var t=e.horizontal,n=e.scale,r=O5(e);return t?S0().defined(m2).curve(r).x0(x2(n)).x1(b2(n)).y(v2(n)):S0().defined(m2).curve(r).x(v2(n)).y1(b2(n)).y0(x2(n))}(e)},j2=function(e){e=function(e){var t=dF(e.ariaLabel,e),n=dF(e.desc,e),r=dF(e.id,e),o=fF(wL()({fill:"black"},e.style),e),i=dF(e.tabIndex,e);return wL()({},e,{ariaLabel:t,desc:n,id:r,style:o,tabIndex:i})}(e);var t=e,n=t.ariaLabel,r=t.role,o=t.shapeRendering,i=t.className,a=t.polar,l=t.origin,s=t.data,u=t.pathComponent,c=t.events,d=t.groupComponent,f=t.clipPath,p=t.id,y=t.style,g=t.desc,m=t.tabIndex,v=TF(e),b=a&&l?"translate(".concat(l.x,", ").concat(l.y,")"):void 0,x=e.transform||b,w=y.stroke&&"none"!==y.stroke&&"transparent"!==y.stroke,j=w2(e),S=w&&E5(e),k=y.stroke?"none":y.fill,C=y2(y2({"aria-label":n,className:i,role:r,shapeRendering:o,transform:x},c),{},{clipPath:f,tabIndex:m}),_=h.cloneElement(u,wL()({key:"".concat(p,"-area"),style:wL()({},y,{stroke:k}),d:j(s),desc:g,tabIndex:m},C,v)),O=w?h.cloneElement(u,wL()({key:"".concat(p,"-area-stroke"),style:wL()({},y,{fill:"none"}),d:S(s)},C)):null;return w?h.cloneElement(d,v,[_,O]):_};function S2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S2(Object(n),!0).forEach((function(t){C2(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S2(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _2(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O2(e,t){return O2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O2(e,t)}function E2(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(Fa){return!1}}();return function(){var n,r=T2(e);if(t){var o=T2(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function T2(e){return T2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T2(e)}j2.propTypes=y2(y2({},PV.primitiveProps),{},{groupComponent:oi().element,interpolation:oi().oneOfType([oi().string,oi().func]),pathComponent:oi().element}),j2.defaultProps={groupComponent:h.createElement("g",null),pathComponent:h.createElement(dX,null),role:"presentation",shapeRendering:"auto"};var P2={width:450,height:300,padding:50,interpolation:"linear"},A2=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O2(e,t)}(i,e);var t,n,r,o=E2(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,n=[{key:"shouldAnimate",value:function(){return!!this.props.animate}},{key:"render",value:function(){var e=i.animationWhitelist,t=i.role,n=bF(this.props,P2,t);if(this.shouldAnimate())return this.animateComponent(n,e);var r=this.renderContinuousData(n),o=n.standalone?this.renderContainer(n.containerComponent,r):r;return PF(o,n)}}],n&&_2(t.prototype,n),r&&_2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);A2.animationWhitelist=["data","domain","height","padding","style","width"],A2.propTypes=k2(k2(k2({},PV.baseProps),PV.dataProps),{},{interpolation:oi().oneOfType([oi().oneOf(["basis","cardinal","catmullRom","linear","monotoneX","monotoneY","natural","step","stepAfter","stepBefore"]),oi().func]),label:wV(oi().string,"Use `labels` instead for individual data labels")}),A2.defaultProps={containerComponent:h.createElement(Oq,null),dataComponent:h.createElement(j2,null),groupComponent:h.createElement(H5,null),labelComponent:h.createElement(pY,{renderInPortal:!0}),samples:50,sortKey:"x",sortOrder:"ascending",standalone:!0,theme:$q.grayscale},A2.displayName="VictoryArea",A2.role="area",A2.continuous=!0,A2.defaultTransitions={onLoad:{duration:2e3},onExit:{duration:500},onEnter:{duration:500}},A2.defaultPolarTransitions={onLoad:{duration:2e3,before:function(){return{_y:0,_y1:0,_y0:0}},after:function(e){return{_y:e._y,_y1:e._y1,_y0:e._y0}}},onExit:{duration:500,before:function(e,t,n){var r=function(e){return(0===t?n[t+1]:n[t-1])[e]};return{_x:r("_x"),_y:r("_y"),_y0:r("_y0")}}},onEnter:{duration:500,before:function(e,t,n){var r=function(e){return(0===t?n[t+1]:n[t-1])[e]};return{_x:r("_x"),_y:r("_y"),_y0:r("_y0")}},after:function(e){return{_x:e._x,_y:e._y,_y1:e._y1,_y0:e._y0}}}},A2.getDomain=s$,A2.getData=GK,A2.getBaseProps=function(e){return function(e,t){var n=bF(e,t,"area"),r=e=wL()({},n,p2(n)),o=r.data,i=r.domain,a=r.events,l=r.groupComponent,s=r.height,u=r.horizontal,c=r.interpolation,d=r.origin,f=r.padding,p=r.polar,h=r.scale,y=r.sharedEvents,g=r.standalone,m=r.style,v=r.theme,b=r.width,x=r.labels,w=r.name,j=r.disableInlineStyles,S={parent:{style:m.parent,width:b,height:s,scale:h,data:o,domain:i,standalone:g,theme:v,polar:p,origin:d,padding:f,name:w,horizontal:u},all:{data:{horizontal:u,polar:p,origin:d,scale:h,data:o,interpolation:c,groupComponent:l,style:j?{}:m.data,disableInlineStyles:j}}};return o.reduce((function(t,n,r){var o=$G(e,n,r);return(void 0!==o&&null!==o||x&&(a||y))&&(t[yY()(n.eventKey)?r:n.eventKey]={labels:QG(e,r)}),t}),S)}(e,P2)},A2.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];var M2=MQ(A2,{components:[{name:"parent",index:"parent"},{name:"data",index:"all"},{name:"labels"}]});function D2(e){let{start:t,end:n,data:r,style:o,scale:i,range:a}=e;const l=i.y(0),s=i.x(lk(t+"-01")),u=i.x(lk(n+"-01"));return s<0||u<0?null:(0,wo.jsx)("svg",{children:(0,wo.jsxs)("defs",{children:[(0,wo.jsx)("clipPath",{id:"positive",children:(0,wo.jsx)("rect",{x:s,y:a.y[1],width:u-s,height:l-a.y[1]+1,fill:"#ffffff"})}),(0,wo.jsx)("clipPath",{id:"negative",children:(0,wo.jsx)("rect",{x:s,y:l+1,width:u-s,height:Math.max(a.y[0]-l-1,0),fill:"#ffffff"})}),(0,wo.jsxs)("linearGradient",{id:"positive-gradient",gradientUnits:"userSpaceOnUse",x1:0,y1:a.y[1],x2:0,y2:l,children:[(0,wo.jsx)("stop",{offset:"0%",stopColor:n2.colors.blueFadeStart}),(0,wo.jsx)("stop",{offset:"100%",stopColor:n2.colors.blueFadeEnd})]}),(0,wo.jsxs)("linearGradient",{id:"negative-gradient",gradientUnits:"userSpaceOnUse",x1:0,y1:l,x2:0,y2:a.y[0],children:[(0,wo.jsx)("stop",{offset:"0%",stopColor:n2.colors.redFadeEnd}),(0,wo.jsx)("stop",{offset:"100%",stopColor:n2.colors.redFadeStart})]})]})})}var I2=function(e){let{style:t,start:n,end:r,graphData:o,compact:i}=e;const a=i?lJ:tZ;return(0,wo.jsx)(r2,{style:[t,i&&{height:"auto"}],children:(e,t,n)=>o&&(0,wo.jsxs)(a,{scale:{x:"time",y:"linear"},theme:n2,domainPadding:{x:0,y:10},width:e,height:t,containerComponent:(0,wo.jsx)(BZ,{voronoiDimension:"x"}),padding:i&&{top:0,bottom:0,left:0,right:0},children:[(0,wo.jsx)(D2,{start:o.start,end:o.end,data:o.data}),h.createElement(1===o.data.length?h0:M2,{data:o.data,labelComponent:(0,wo.jsx)(i2,{portalHost:n}),labels:e=>e.premadeLabel,style:{data:1===o.data.length?{width:50}:{clipPath:"url(#positive)",fill:"url(#positive-gradient)"}}}),o.data.length>1&&(0,wo.jsx)(M2,{data:o.data,style:{data:{clipPath:"url(#negative)",fill:"url(#negative-gradient)",stroke:n2.colors.red,strokeLinejoin:"round"}}}),(0,wo.jsx)(M2,{data:o.data,style:{data:{fill:"none",stroke:"none"}}}),!i&&(0,wo.jsx)(sX,{style:{ticks:{stroke:"red"}},tickFormat:e=>Hp(e,"MMM ''yy"),tickValues:o.data.map((e=>e.x)),tickCount:Math.min(5,o.data.length),offsetY:50}),!i&&(0,wo.jsx)(sX,{dependentAxis:!0,crossAxis:!o.hasNegative})]})})};var R2=de((e=>({accounts:e.queries.accounts})),(t=>Q(e,t)))((function(e){let{accounts:t}=e;const[n,r]=(0,h.useState)(null),[o,i]=(0,h.useState)(nh(Zp(),5)),[a,l]=(0,h.useState)(Zp()),s=(0,h.useMemo)((()=>f2(o,a,t)),[o,a,t]),u=c2("net_worth",s);return(0,h.useEffect)((()=>{!async function(){const e=await qe("get-earliest-transaction"),t=Zp();let n=e?Qp(lk(pL(e.date))):t;const o=nh(Zp(),12);n>o&&(n=o);const i=lh(n,Zp()).map((e=>({name:e,pretty:fh(e,"MMMM, yyyy")}))).reverse();r(i)}()}),[]),n&&u?(0,wo.jsxs)(Ll,{style:[mo.page,{minWidth:650,overflow:"hidden"}],children:[(0,wo.jsx)(u2,{title:"Net Worth",allMonths:n,start:o,end:a,onChangeDates:function(e,t){i(e),l(t)}}),(0,wo.jsxs)(Ll,{style:{backgroundColor:"white",padding:"30px",overflow:"auto"},children:[(0,wo.jsxs)(Ll,{style:{textAlign:"right",paddingRight:20,flexShrink:0},children:[(0,wo.jsx)(Ll,{style:[mo.largeText,{fontWeight:400,marginBottom:5}],children:zr(u.netWorth)}),(0,wo.jsx)(fL,{amount:u.totalChange})]}),(0,wo.jsx)(I2,{start:o,end:a,graphData:u.graphData}),(0,wo.jsxs)(Ll,{style:{marginTop:30},children:[(0,wo.jsx)($s,{children:(0,wo.jsx)("strong",{children:"How is net worth calculated?"})}),(0,wo.jsx)($s,{children:"Net worth shows the balance of all accounts over time, including all of your investments. Your \u201cnet worth\u201d is considered to be the amount you\u2019d have if you sold all your assets and paid off as much debt as possible. If you hover over the graph, you can also see the amount of assets and debt individually."})]})]})]}):null}));var N2=function(e){let t,{start:n,end:r}=e;return n=lk(n),r=lk(r),t=n.getYear()!==r.getYear()?(0,wo.jsxs)("div",{children:[Hp(n,"MMM yyyy")," - ",Hp(r,"MMM yyyy")]}):n.getMonth()!==r.getMonth()?(0,wo.jsxs)("div",{children:[Hp(n,"MMM")," - ",Hp(r,"MMM yyyy")]}):Hp(r,"MMMM yyyy"),(0,wo.jsx)(Ms,{style:{color:go.n6},children:t})};function L2(e){let{flex:t,to:n,style:r,children:o}=e;const i={flex:t,margin:15},a=(0,wo.jsx)(Ll,{style:[{backgroundColor:"white",borderRadius:2,height:200,boxShadow:"0 2px 6px rgba(0, 0, 0, .15)",transition:"box-shadow .25s",":hover":n&&{boxShadow:"0 4px 6px rgba(0, 0, 0, .15)"}},n?null:i,r],children:o});return n?(0,wo.jsx)(Rs,{to:n,exact:!0,style:[{textDecoration:"none",flex:t},i],children:a}):a}function F2(e){let{accounts:t}=e;const n=Zp(),r=nh(n,5),o=(0,h.useMemo)((()=>f2(r,n,t)),[r,n,t]),i=c2("net_worth",o);return i?(0,wo.jsx)(L2,{flex:2,to:"/reports/net-worth",children:(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",padding:20},children:[(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(Ms,{style:[mo.mediumText,{fontWeight:500,marginBottom:5}],role:"heading",children:"Net Worth"}),(0,wo.jsx)(N2,{start:r,end:n})]}),(0,wo.jsxs)(Ll,{style:{textAlign:"right"},children:[(0,wo.jsx)(Ms,{style:[mo.mediumText,{fontWeight:500,marginBottom:5}],children:zr(i.netWorth)}),(0,wo.jsx)(fL,{amount:i.totalChange,style:{color:go.n6,fontWeight:300}})]})]}),(0,wo.jsx)(I2,{start:r,end:n,graphData:i.graphData,compact:!0,style:{height:"auto",flex:1}})]})}):null}function B2(){const e=Jp(),t=Zp()+"-01",n=(0,h.useMemo)((()=>function(e,t){return async(n,r)=>{function o(){return fr("transactions").filter({$and:[{date:{$gte:e}},{date:{$lte:t}}],"account.offbudget":!1,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]}).calculate({$sum:"$amount"})}return yL([o().filter({amount:{$gt:0}}),o().filter({amount:{$lt:0}})],(e=>{r({graphData:{income:e[0],expense:e[1]}})}))}}(t,e)),[t,e]),r=c2("cash_flow_simple",n);if(!r)return null;const{graphData:o}=r,i=-(o.expense||0),a=o.income||0;return(0,wo.jsx)(L2,{flex:1,to:"/reports/cash-flow",children:(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",padding:20},children:[(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsx)(Ms,{style:[mo.mediumText,{fontWeight:500,marginBottom:5}],role:"heading",children:"Cash Flow"}),(0,wo.jsx)(N2,{start:t,end:e})]}),(0,wo.jsx)(Ll,{style:{textAlign:"right"},children:(0,wo.jsx)(fL,{amount:a-i,style:{color:go.n6,fontWeight:300}})})]}),(0,wo.jsx)(r2,{style:{height:"auto",flex:1},children:(e,t,n)=>(0,wo.jsxs)(lJ,{colorScale:[n2.colors.blue,n2.colors.red],width:100,height:t,theme:n2,domain:{x:[0,100],y:[0,Math.max(a,i,100)]},containerComponent:(0,wo.jsx)(BZ,{voronoiDimension:"x"}),labelComponent:(0,wo.jsx)(i2,{portalHost:n,offsetX:(e-100)/2,offsetY:e=>e+40>t?t-40:e,light:!0,forceActive:!0,style:{padding:0}}),padding:{top:0,bottom:0,left:0,right:0},children:[(0,wo.jsx)(h0,{barWidth:13,data:[{x:30,y:Math.max(a,5),premadeLabel:(0,wo.jsxs)("div",{style:{textAlign:"right"},children:[(0,wo.jsx)("div",{children:"Income"}),(0,wo.jsx)("div",{children:zr(a)})]}),labelPosition:"left"}],labels:e=>e.premadeLabel}),(0,wo.jsx)(h0,{barWidth:13,data:[{x:60,y:Math.max(i,5),premadeLabel:(0,wo.jsxs)("div",{children:[(0,wo.jsx)("div",{children:"Expenses"}),(0,wo.jsx)("div",{children:zr(i)})]}),labelPosition:"right",fill:n2.colors.red}],labels:e=>e.premadeLabel})]})})]})})}var z2=de((e=>({accounts:e.queries.accounts})),(t=>Q(e,t)))((function(e){let{accounts:t}=e;return(0,wo.jsxs)(Ll,{style:[mo.page,{paddingLeft:40,paddingRight:40,minWidth:700}],children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",flex:"0 0 auto"},children:[(0,wo.jsx)(F2,{accounts:t}),(0,wo.jsx)(B2,{})]}),(0,wo.jsx)(Ll,{style:{flex:"0 0 auto",flexDirection:"row"},children:(0,wo.jsxs)(L2,{style:[{color:"#a0a0a0",justifyContent:"center",alignItems:"center",width:200},mo.mediumText],children:["More reports",(0,wo.jsx)("br",{})," coming soon!"]})})]})}));function U2(){return(0,wo.jsxs)(Ll,{style:{flex:1},"data-testid":"reports-page",children:[(0,wo.jsx)(_i,{path:"/reports",exact:!0,component:z2}),(0,wo.jsx)(_i,{path:"/reports/net-worth",exact:!0,component:R2}),(0,wo.jsx)(_i,{path:"/reports/cash-flow",exact:!0,component:d2})]})}var W2=e=>(0,wo.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M6.847 21.429a3.408 3.408 0 0 1-2.662-1.34l-3.76-4.273a1.714 1.714 0 0 1 2.572-2.263l3.522 4.01a.429.429 0 0 0 .631.014L21.036 3.105a1.715 1.715 0 1 1 2.486 2.362l-14.06 14.8a3.327 3.327 0 0 1-2.615 1.162Z",fill:"currentColor"})});let H2=43;function K2(e){let{schedule:t,status:n,onAction:r}=e,[o,i]=(0,h.useState)(!1);return(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(zl,{bare:!0,onClick:e=>{e.stopPropagation(),i(!0)},children:(0,wo.jsx)(qx,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}})}),o&&(0,wo.jsx)(Ps,{position:"bottom-right",width:150,style:{padding:0},onClose:()=>i(!1),children:(0,wo.jsx)(Hs,{onMenuSelect:e=>{r(e,t.id),i(!1)},items:["due"===n&&{name:"post-transaction",text:"Post transaction"},...t.completed?[{name:"restart",text:"Restart"}]:[{name:"skip",text:"Skip next date"},{name:"complete",text:"Complete"}],{name:"delete",text:"Delete"}]})})]})}function $2(e){let{amount:t,op:n}=e,r=Sh(t),o=zr(Math.abs(r||0)),i="isapprox"===n||"isbetween"===n;return(0,wo.jsxs)(Vw,{width:100,plain:!0,style:{textAlign:"right",flexDirection:"row",alignItems:"center",padding:"0 5px"},name:"amount",children:[i&&(0,wo.jsx)(Ll,{style:{textAlign:"left",color:go.n7,lineHeight:"1em",marginRight:10},title:(i?"Approximately ":"")+o,children:"~"}),(0,wo.jsx)(ql,{style:{flex:1,color:r>0?go.g5:null,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:(i?"Approximately ":"")+o,children:r>0?`+${o}`:`${o}`})]})}function V2(e){let{schedules:t,statuses:n,filter:r,minimal:o,allowCompleted:i,style:a,onSelect:l,onAction:s,tableStyle:u}=e,c=xe((e=>e.prefs.local.dateFormat||"MM/dd/yyyy")),[d,f]=(0,h.useState)(!1),p=bf(),y=yf(),g=(0,h.useMemo)((()=>{if(!r)return t;const e=e=>!!e&&(e.toLowerCase().includes(r.toLowerCase())||r.toLowerCase().includes(e.toLowerCase()));return t.filter((t=>{let r=p.find((e=>t._payee===e.id)),o=y.find((e=>t._account===e.id)),i=Sh(t._amount),a=("isapprox"===t._amountOp||"isbetween"===t._amountOp?"~":"")+(i>0?"+":"")+zr(Math.abs(i||0)),l=t.next_date?fh(t.next_date,c):null;return e(r&&r.name)||e(o&&o.name)||e(a)||e(n.get(t.id))||e(l)}))}),[t,r,n]),m=(0,h.useMemo)((()=>{if(!i)return g.filter((e=>!e.completed));if(d)return g;let e=g.filter((e=>!e.completed));return g.find((e=>e.completed))&&e.push({type:"show-completed"}),e}),[g,d,i]);return(0,wo.jsxs)(Ll,{style:[{flex:1},u],children:[(0,wo.jsxs)(oj,{height:H2,inset:15,version:"v2",children:[(0,wo.jsx)($w,{width:"flex",children:"Name"}),(0,wo.jsx)($w,{width:"flex",children:"Payee"}),(0,wo.jsx)($w,{width:"flex",children:"Account"}),(0,wo.jsx)($w,{width:110,children:"Next date"}),(0,wo.jsx)($w,{width:120,children:"Status"}),(0,wo.jsx)($w,{width:100,style:{textAlign:"right"},children:"Amount"}),!o&&(0,wo.jsx)($w,{width:80,style:{textAlign:"center"},children:"Recurring"}),!o&&(0,wo.jsx)($w,{width:40})]}),(0,wo.jsx)(sj,{rowHeight:H2,backgroundColor:"transparent",version:"v2",style:[{flex:1,backgroundColor:"transparent"},a],items:m,renderItem:function(e){let{item:t}=e;return"show-completed"===t.type?(0,wo.jsx)(qw,{height:H2,inset:15,backgroundColor:"transparent",style:{cursor:"pointer",backgroundColor:"white",":hover":{backgroundColor:go.hover}},onClick:()=>f(!0),children:(0,wo.jsx)($w,{width:"flex",style:{fontStyle:"italic",textAlign:"center",color:go.n6},children:"Show completed schedules"})}):function(e){let{item:t}=e;return(0,wo.jsxs)(qw,{height:H2,inset:15,backgroundColor:"transparent",onClick:()=>l(t.id),style:{cursor:"pointer",backgroundColor:"white",":hover":{backgroundColor:go.hover}},children:[(0,wo.jsx)($w,{width:"flex",name:"name",children:(0,wo.jsx)(ql,{style:null==t.name?{color:go.n8}:null,title:t.name?t.name:"",children:t.name?t.name:"None"})}),(0,wo.jsx)($w,{width:"flex",name:"payee",children:(0,wo.jsx)(zR,{type:"payees",id:t._payee})}),(0,wo.jsx)($w,{width:"flex",name:"account",children:(0,wo.jsx)(zR,{type:"accounts",id:t._account})}),(0,wo.jsx)($w,{width:110,name:"date",children:t.next_date?fh(t.next_date,c):null}),(0,wo.jsx)($w,{width:120,name:"status",style:{alignItems:"flex-start"},children:(0,wo.jsx)(rO,{status:n.get(t.id)})}),(0,wo.jsx)($2,{amount:t._amount,op:t._amountOp}),!o&&(0,wo.jsx)($w,{width:80,style:{textAlign:"center"},children:t._date&&t._date.frequency&&(0,wo.jsx)(W2,{style:{width:13,height:13}})}),!o&&(0,wo.jsx)($w,{width:40,name:"actions",children:(0,wo.jsx)(K2,{schedule:t,status:n.get(t.id),onAction:s})})]})}({item:t})},renderEmpty:r?"No matching schedules":"No schedules",allowPopupsEscape:m.length<6})]})}function q2(){let e=Ri(),[t,n]=(0,h.useState)(""),r=Ch();if(null==r)return null;let{schedules:o,statuses:i}=r;return(0,wo.jsxs)(oT,{title:"Schedules",children:[(0,wo.jsx)(Ll,{style:{alignItems:"flex-end"},children:(0,wo.jsx)(Bs,{placeholder:"Filter schedules\u2026",value:t,onChange:n})}),(0,wo.jsx)(Ll,{style:{marginTop:20,flexBasis:(H2-1)*(Math.max(o.length,1)+1),overflow:"hidden"},children:(0,wo.jsx)(V2,{schedules:o,filter:t,statuses:i,allowCompleted:!0,onSelect:function(t){e.push(`/schedule/edit/${t}`,{locationPtr:e.location})},onAction:async function(e,t){switch(e){case"post-transaction":await qe("schedule/post-transaction",{id:t});break;case"skip":await qe("schedule/skip-next-date",{id:t});break;case"complete":await qe("schedule/update",{schedule:{id:t,completed:!0}});break;case"restart":await qe("schedule/update",{schedule:{id:t,completed:!1},resetNextDate:!0});break;case"delete":await qe("schedule/delete",{id:t})}},style:{backgroundColor:"white"}})}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"space-between",margin:"20px 0",flexShrink:0},children:[(0,wo.jsx)(zl,{onClick:function(){e.push("/schedule/discover",{locationPtr:e.location})},children:"Find schedules"}),(0,wo.jsx)(zl,{primary:!0,onClick:function(){e.push("/schedule/edit",{locationPtr:e.location})},children:"Add new schedule"})]})]})}let G2=43;function Y2(e){let{schedules:t,loading:n}=e,r=nT(),o=Rx(),i=Ix();return(0,wo.jsxs)(Ll,{style:{flex:1},children:[(0,wo.jsxs)(oj,{height:G2,inset:15,version:"v2",children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,selected:o.size>0,onSelect:()=>i({type:"select-all"})}),(0,wo.jsx)($w,{width:"flex",children:"Payee"}),(0,wo.jsx)($w,{width:"flex",children:"Account"}),(0,wo.jsx)($w,{width:"auto",style:{flex:1.5},children:"When"}),(0,wo.jsx)($w,{width:100,style:{textAlign:"right"},children:"Amount"})]}),(0,wo.jsx)(sj,{rowHeight:G2,version:"v2",backgroundColor:"modal"===r.type?"transparent":void 0,style:{flex:1,backgroundColor:"modal"===r.type?"transparent":void 0},items:t,loading:n,isSelected:e=>o.has(e),renderItem:function(e){let{item:t}=e,n=o.has(t.id),r=t._conditions.find((e=>"amount"===e.field)).op,a=wh(t.date);return(0,wo.jsxs)(qw,{height:G2,inset:15,backgroundColor:"transparent",onClick:()=>{i({type:"select",id:t.id})},borderColor:n?go.b8:go.border,style:{cursor:"pointer",backgroundColor:n?go.selected:"white",":hover":{backgroundColor:n?go.selected:go.hover}},children:[(0,wo.jsx)(nj,{exposed:!0,focused:!1,selected:n,onSelect:()=>{i({type:"select",id:t.id})}}),(0,wo.jsx)($w,{width:"flex",children:(0,wo.jsx)(zR,{type:"payees",id:t.payee})}),(0,wo.jsx)($w,{width:"flex",children:(0,wo.jsx)(zR,{type:"accounts",id:t.account})}),(0,wo.jsx)($w,{width:"auto",title:a,style:{flex:1.5},children:a}),(0,wo.jsx)($2,{amount:t.amount,op:r})]})},renderEmpty:"No schedules found"})]})}function Q2(){let e=nT(),t=Ri(),[n,r]=(0,h.useState)(),[o,i]=(0,h.useState)(!1),a=Ax("discover-schedules",n,[]);return(0,h.useEffect)((()=>{!async function(){r(await qe("schedule/discover"))}()}),[]),(0,wo.jsxs)(oT,{title:"Found schedules",modalSize:{width:850,height:650},children:[(0,wo.jsx)($s,{children:"We found some possible schedules in your current transactions. Select the ones you want to create."}),(0,wo.jsx)($s,{children:"If you expected a schedule here and don\u2019t see it, it might be because the payees of the transactions don\u2019t match. Make sure you rename payees on all transactions for a schedule to be the same payee."}),(0,wo.jsx)($s,{children:"You can always do this later from \u201cMore Tools\u201d \u2192 \u201cFind Schedules.\u201d"}),(0,wo.jsx)(Nx,{instance:a,children:(0,wo.jsx)(Y2,{loading:null==n,schedules:n})}),(0,wo.jsx)(Os,{direction:"row",align:"center",justify:"flex-end",style:{paddingTop:20,paddingBottom:"modal"===e.type?0:20},children:(0,wo.jsx)(Bl,{primary:!0,loading:o,disabled:0===a.items.size,onClick:async function(){let e=n.filter((e=>a.items.has(e.id)));i(!0);for(let t of e){let e=await qe("schedule/create",{conditions:t._conditions}),{filters:n}=await qe("make-filters-from-conditions",{conditions:t._conditions});if(n.length>0){let{data:t}=await pr(fr("transactions").filter({$and:n}).select("id"));await qe("transactions-batch-update",{updated:t.map((t=>({id:t.id,schedule:e})))})}}i(!1),t.goBack()},children:"Create schedules"})})]})}function X2(e,t){let n={...e};return t&&Object.keys(t).forEach((r=>{r in e&&(n[r]=t[r])})),n}function Z2(e,t){let n=jh(e._conditions),r=(e,t,n,r)=>e?{...e,value:r}:null!=r?{op:t,field:n,value:r}:null;return null==t.date?{error:"Date is required"}:null==t.amount?{error:"A valid amount is required"}:{conditions:[r(n.payee,"is","payee",t.payee),r(n.account,"is","account",t.account),r(n.date,"isapprox","date",t.date),{op:t.amountOp,field:"amount",value:t.amount}].filter(Boolean)}}function J2(){let{id:e,initialFields:t}=Li(),n=null==e,r=bf({idKey:!0}),o=Ri(),i=ge(),a=xe((e=>e.prefs.local.dateFormat||"MM/dd/yyyy")),[l,s]=(0,h.useReducer)(((e,t)=>{switch(t.type){case"set-schedule":{let n=t.schedule,r=jh(n._conditions),o=new Set(Object.values(r)),i=n._conditions.find((e=>!o.has(e)))||n._actions.find((e=>"link-schedule"!==e.op));return{...e,schedule:t.schedule,isCustom:i,fields:{payee:n._payee,account:n._account,amount:n._amount||0,amountOp:n._amountOp||"isapprox",date:n._date,posts_transaction:t.schedule.posts_transaction,name:n.name}}}case"set-field":if(!(t.field in e.fields))throw new Error("Unknown field: "+t.field);let n={[t.field]:t.value};return"amountOp"===t.field&&t.value!==e.fields.amountOp&&("isbetween"===t.value?n.amount="number"===typeof e.fields.amount?{num1:e.fields.amount,num2:e.fields.amount}:{num1:0,num2:0}:"isbetween"===e.fields.amountOp&&(n.amount="number"===typeof e.fields.amount?e.fields.amount:e.fields.amount.num1)),{...e,fields:{...e.fields,...n}};case"set-transactions":return{...e,transactions:t.transactions};case"set-repeats":return{...e,fields:{...e.fields,date:t.repeats?{frequency:"monthly",start:Jp(),patterns:[]}:Jp()}};case"set-upcoming-dates":return{...e,upcomingDates:t.dates};case"form-error":return{...e,error:t.error};case"switch-transactions":return{...e,transactionsMode:t.mode};default:throw new Error("Unknown action: "+t.type)}}),{schedule:null,upcomingDates:null,error:null,fields:X2({payee:null,account:null,amount:null,amountOp:null,date:null,posts_transaction:!1,name:null},t),transactions:[],transactionsMode:n?"matched":"linked"});async function u(){let{data:t}=await pr(fr("schedules").filter({id:e}).select("*"));return t[0]}(0,h.useEffect)((()=>{!async function(){if(n){let e={start:Jp(),frequency:"monthly",patterns:[]};s({type:"set-schedule",schedule:{posts_transaction:!1,_date:e,_conditions:[{op:"isapprox",field:"date",value:e}],_actions:[]}})}else{let e=await u();e&&null==l.schedule&&s({type:"set-schedule",schedule:e})}}()}),[]),(0,h.useEffect)((()=>{!async function(){let e=l.fields.date;if(null==e)s({type:"set-upcoming-dates",dates:null});else if(e.frequency){let{data:t}=await Ge("schedule/get-upcoming-dates",{config:e,count:3});s({type:"set-upcoming-dates",dates:t})}else{let t=Jp();e===t||ih(e,t)?s({type:"set-upcoming-dates",dates:[e]}):s({type:"set-upcoming-dates",dates:null})}}()}),[l.fields.date]),(0,h.useEffect)((()=>{if(l.schedule&&l.schedule.id&&"linked"===l.transactionsMode){return hr(fr("transactions").filter({schedule:l.schedule.id}).select("*").options({splits:"none"}),(e=>s({type:"set-transactions",transactions:e}))).unsubscribe}}),[l.schedule,l.transactionsMode]),(0,h.useEffect)((()=>{let e,t=!0;if(l.schedule&&"matched"===l.transactionsMode){let{error:n,conditions:r}=Z2(l.schedule,l.fields);if(n)return void s({type:"form-error",error:n});r=r.map((e=>"description"===e.field?{...e,field:"payee"}:"acct"===e.field?{...e,field:"account"}:e)),qe("make-filters-from-conditions",{conditions:r}).then((n=>{let{filters:r}=n;if(t){let t=hr(fr("transactions").filter({$and:r}).select("*").options({splits:"none"}),(e=>s({type:"set-transactions",transactions:e})));e=t.unsubscribe}}))}return()=>{t=!1,e&&e()}}),[l.schedule,l.transactionsMode,l.fields]);let c=Ax("transactions",l.transactions,[]);async function d(e,t){await qe("transactions-batch-update",{updated:e.map((e=>({id:e,schedule:t||l.schedule.id})))}),c.dispatch({type:"select-none"})}if(null==l.schedule)return null;function f(e){s({type:"switch-transactions",mode:e}),c.dispatch({type:"select-none"})}let p=r?r[l.fields.payee]:null,y=!!l.fields.date&&!!l.fields.date.frequency;return(0,wo.jsxs)(oT,{title:p?`Schedule: ${p.name}`:"Schedule",modalSize:"medium",children:[(0,wo.jsx)(Os,{direction:"row",style:{marginTop:10},children:(0,wo.jsxs)(eu,{style:{flex:1},children:[(0,wo.jsx)(Js,{title:"Schedule Name",htmlFor:"name-field"}),(0,wo.jsx)(O_,{field:"string",type:"string",value:l.fields.name,multi:!1,onChange:e=>{s({type:"set-field",field:"name",value:e})}})]})}),(0,wo.jsxs)(Os,{direction:"row",style:{marginTop:20},children:[(0,wo.jsxs)(eu,{style:{flex:1},children:[(0,wo.jsx)(Js,{title:"Payee",id:"payee-label",htmlFor:"payee-field"}),(0,wo.jsx)(o_,{value:l.fields.payee,labelProps:{id:"payee-label"},inputProps:{id:"payee-field",placeholder:"(none)"},onSelect:e=>s({type:"set-field",field:"payee",value:e}),isCreatable:!0})]}),(0,wo.jsxs)(eu,{style:{flex:1},children:[(0,wo.jsx)(Js,{title:"Account",id:"account-label",htmlFor:"account-field"}),(0,wo.jsx)(QC,{includeClosedAccounts:!1,value:l.fields.account,labelProps:{id:"account-label"},inputProps:{id:"account-field",placeholder:"(none)"},onSelect:e=>s({type:"set-field",field:"account",value:e})})]}),(0,wo.jsxs)(eu,{style:{flex:1},children:[(0,wo.jsxs)(Os,{direction:"row",align:"center",style:{marginBottom:3},children:[(0,wo.jsx)(Js,{title:"Amount",htmlFor:"amount-field",style:{margin:0,flex:1}}),(0,wo.jsx)(qR,{ops:["isapprox","is","isbetween"],value:l.fields.amountOp,formatOp:e=>{switch(e){case"is":return"is exactly";case"isapprox":return"is approximately";case"isbetween":return"is between";default:throw new Error("Invalid op for select: "+e)}},style:{padding:"0 10px",color:go.n5,fontSize:12},onChange:(e,t)=>s({type:"set-field",field:"amountOp",value:t})})]}),"isbetween"===l.fields.amountOp?(0,wo.jsx)(DD,{defaultValue:l.fields.amount,onChange:e=>s({type:"set-field",field:"amount",value:e})}):(0,wo.jsx)(MD,{id:"amount-field",defaultValue:l.fields.amount,onChange:e=>s({type:"set-field",field:"amount",value:e})})]})]}),(0,wo.jsx)(Ll,{style:{marginTop:20},children:(0,wo.jsx)(Js,{title:"Date"})}),(0,wo.jsxs)(Os,{direction:"row",align:"flex-start",children:[(0,wo.jsxs)(Ll,{style:{flex:1},children:[y?(0,wo.jsx)(__,{value:l.fields.date,onChange:e=>s({type:"set-field",field:"date",value:e})}):(0,wo.jsx)(c_,{value:l.fields.date,onSelect:e=>s({type:"set-field",field:"date",value:e}),dateFormat:a}),l.upcomingDates&&(0,wo.jsxs)(Ll,{style:{fontSize:13,marginTop:20},children:[(0,wo.jsx)(ql,{style:{color:go.n4,fontWeight:600},children:"Upcoming dates"}),(0,wo.jsx)(Os,{direction:"column",spacing:1,style:{marginTop:10,color:go.n4},children:l.upcomingDates.map((e=>(0,wo.jsx)(Ll,{children:fh(e,`${a} EEEE`)},e)))})]})]}),(0,wo.jsxs)(Ll,{style:{marginTop:5,flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,wo.jsx)(tu,{id:"form_repeats",checked:y,onChange:e=>{s({type:"set-repeats",repeats:e.target.checked})}}),(0,wo.jsx)("label",{htmlFor:"form_repeats",style:{userSelect:"none"},children:"Repeats"})]}),(0,wo.jsxs)(Ll,{style:{alignItems:"flex-end",flex:1},children:[(0,wo.jsxs)(Ll,{style:{marginTop:5,flexDirection:"row",alignItems:"center",userSelect:"none",justifyContent:"flex-end"},children:[(0,wo.jsx)(tu,{id:"form_posts_transaction",checked:l.fields.posts_transaction,onChange:e=>{s({type:"set-field",field:"posts_transaction",value:e.target.checked})}}),(0,wo.jsx)("label",{htmlFor:"form_posts_transaction",style:{userSelect:"none"},children:"Automatically add transaction"})]}),(0,wo.jsx)(ql,{style:{width:350,textAlign:"right",color:go.n4,marginTop:10,fontSize:13,lineHeight:"1.4em"},children:"If checked, the schedule will automatically create transactions for you in the specified account"}),!n&&l.schedule.rule&&(0,wo.jsxs)(Os,{direction:"row",align:"center",style:{marginTop:30},children:[l.isCustom&&(0,wo.jsx)(ql,{style:{color:go.b5,fontSize:13,textAlign:"right",width:350},children:"This schedule has custom conditions and actions"}),(0,wo.jsx)(zl,{onClick:()=>async function(e){let t=await qe("rule-get",{id:e||l.schedule.rule});i(Nt("edit-rule",{rule:t,onSave:async()=>{let e=await u();s({type:"set-schedule",schedule:e})}}))}(),disabled:n,children:"Edit as rule"})]})]})]}),(0,wo.jsx)(Ll,{style:{marginTop:30,flex:1},children:(0,wo.jsxs)(Nx,{instance:c,children:[n?(0,wo.jsxs)(Ll,{style:{flexDirection:"row",padding:"5px 0"},children:[(0,wo.jsx)(ql,{style:{color:go.n4},children:"These transactions match this schedule:"}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(ql,{style:{color:go.n6},children:"Select transactions to link on save"})]}):(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(zl,{bare:!0,style:{color:"linked"===l.transactionsMode?go.b4:go.n7,marginRight:10,fontSize:14},onClick:()=>f("linked"),children:"Linked transactions"})," ",(0,wo.jsx)(zl,{bare:!0,style:{color:"matched"===l.transactionsMode?go.b4:go.n7,fontSize:14},onClick:()=>f("matched"),children:"Find matching transactions"}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(ij,{name:"transactions",items:"linked"===l.transactionsMode?[{name:"unlink",text:"Unlink from schedule"}]:[{name:"link",text:"Link to schedule"}],onSelect:(e,t)=>{switch(e){case"link":d(t);break;case"unlink":!async function(e){await qe("transactions-batch-update",{updated:e.map((e=>({id:e,schedule:null})))}),c.dispatch({type:"select-none"})}(t)}}})]}),(0,wo.jsx)(WR,{renderEmpty:"matched"===l.transactionsMode&&(()=>(0,wo.jsx)(Ll,{style:{padding:20,color:go.n4,textAlign:"center"},children:l.error?(0,wo.jsxs)(ql,{style:{color:go.r4},children:["Could not search: ",l.error]}):"No transactions found"})),transactions:l.transactions,fields:["date","payee","amount"],style:{border:"1px solid "+go.border,borderRadius:4,overflow:"hidden",marginTop:5}})]})}),(0,wo.jsxs)(Os,{direction:"row",justify:"flex-end",align:"center",style:{marginTop:20},children:[l.error&&(0,wo.jsx)(ql,{style:{color:go.r4},children:l.error}),(0,wo.jsx)(zl,{style:{marginRight:10},onClick:()=>o.goBack(),children:"Cancel"}),(0,wo.jsx)(zl,{primary:!0,onClick:async function(){if(s({type:"form-error",error:null}),l.fields.name){let{data:e}=await pr(fr("schedules").filter({name:l.fields.name}).select("id"));if(e.length>0&&e[0].id!==l.schedule.id)return void s({type:"form-error",error:"There is already a schedule with this name"})}let{error:e,conditions:t}=Z2(l.schedule,l.fields);if(e)return void s({type:"form-error",error:e});let r=await Ge(n?"schedule/create":"schedule/update",{schedule:{id:l.schedule.id,posts_transaction:l.fields.posts_transaction,name:l.fields.name},conditions:t});r.error?s({type:"form-error",error:"An error occurred while saving. Please contact help@actualbudget.com for support."}):(n&&await d([...c.items],r.data),o.goBack())},children:n?"Add":"Save"})]})]})}function e3(){let e=Ni(),t=Ri(),n=Ch((0,h.useCallback)((e=>e.filter({completed:!1})),[])),[r,o]=(0,h.useState)("");if(null==n)return null;let{schedules:i,statuses:a}=n;return(0,wo.jsxs)(oT,{title:"Link Schedule",modalSize:"medium",children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",marginBottom:20,alignItems:"center"},children:[(0,wo.jsx)(ql,{children:"Choose a schedule to link these transactions to:"}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(Bs,{isInModal:!0,width:300,placeholder:"Filter schedules\u2026",value:r,onChange:o})]}),(0,wo.jsx)(V2,{schedules:i,filter:r,statuses:a,minimal:!0,onSelect:async function(n){let{state:r}=e,o=r.transactionIds;o&&o.length>0&&await qe("transactions-batch-update",{updated:o.map((e=>({id:e,schedule:n})))}),t.goBack()},tableStyle:{marginInline:-20}})]})}function t3(){let e=Ni(),t=Ri(),n=e.state&&e.state.payees||[],r=n.length>1;return(0,wo.jsxs)(oT,{title:"Post transactions?",modalSize:"small",children:[(0,wo.jsxs)($s,{children:[n.length>0?(0,wo.jsxs)(ql,{children:["The ",r?"payees ":"payee ",n.map(((e,t)=>(0,wo.jsxs)(ql,{children:[(0,wo.jsx)(ql,{style:{color:go.p4},children:(0,wo.jsx)(zR,{id:e,type:"payees"},e)}),t===n.length-1?" ":t===n.length-2?", and ":", "]})))]}):(0,wo.jsxs)(ql,{children:["There ",r?"are payees ":"is a payee "," that "]}),(0,wo.jsxs)(ql,{children:[r?"have ":"has "," schedules that are due today. Usually we automatically post transactions for these, but you are offline or syncing failed. In order to avoid duplicate transactions, we let you choose whether or not to create transactions for these schedules."]})]}),(0,wo.jsx)($s,{children:"Be aware that other devices may have already created these transactions. If you have multiple devices, make sure you only do this on one device or you will have duplicate transactions."}),(0,wo.jsx)($s,{children:"You can always manually post a transaction later for a due schedule by selecting the schedule and clicking \u201cPost transaction\u201d in the action menu."}),(0,wo.jsxs)(Os,{direction:"row",justify:"flex-end",style:{marginTop:20},spacing:2,children:[(0,wo.jsx)(zl,{onClick:function(){t.goBack()},children:"Decide later"}),(0,wo.jsx)(zl,{primary:!0,onClick:async function(){await qe("schedule/force-run-service"),t.goBack()},children:"Post transactions"})]})]})}function n3(){let[e,t]=(0,h.useState)("");return(0,h.useEffect)((()=>{(async()=>{t(await Df())})()}),[]),e}var r3=n3;const o3=e=>{let{primaryAction:t,style:n,children:r}=e;return(0,wo.jsxs)(Ll,{...(0,lo.iv)([{backgroundColor:go.n9,alignSelf:"flex-start",alignItems:"flex-start",padding:15,borderRadius:4,border:"1px solid "+go.n8,width:"100%"},n]),children:[(0,wo.jsx)(Ll,{style:{marginBottom:t?10:0,maxWidth:500,lineHeight:1.5,gap:10},children:r}),t||null]})},i3=e=>{let{children:t}=e,n=Ni(),[r,o]=(0,h.useState)("#advanced"===n.hash);return r?(0,wo.jsxs)(Ll,{id:"advanced",style:[{gap:20,alignItems:"flex-start",marginBottom:25,width:"100%"},(0,lo.BC)(`(min-width: ${yo.breakpoint_medium})`,{width:"auto"})],innerRef:e=>{e&&"#advanced"===n.hash&&e.scrollIntoView(!0)},children:[(0,wo.jsx)(Ll,{style:{fontSize:20,fontWeight:500,flexShrink:0},children:"Advanced Settings"}),t]}):(0,wo.jsx)(Is,{id:"advanced",onClick:()=>o(!0),style:{flexShrink:0,alignSelf:"flex-start",color:go.p4,marginBottom:25},children:"Show advanced settings"})};function a3(e){let{prefs:t,pushModal:n}=e;const r=Bx(),o=!(window.crypto&&crypto.subtle);return t.encryptKeyId?(0,wo.jsx)(o3,{primaryAction:(0,wo.jsx)(zl,{onClick:function(){n("create-encryption-key",{recreate:!0})},children:"Generate new key"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)(ql,{style:{color:go.g4,fontWeight:600},children:"End-to-end Encryption is turned on."})," ","Your data is encrypted with a key that only you have before sending it it out to the cloud. Local data remains unencrypted so if you forget your password you can re-encrypt it."," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/sync/#encryption",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})}):o?(0,wo.jsx)(o3,{primaryAction:(0,wo.jsx)(zl,{disabled:!0,children:"Enable encryption\u2026"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"End-to-end encryption"})," is not available when making an unencrypted connection to a remote server. You\u2019ll need to enable HTTPS on your server to use end-to-end encryption. This problem may also occur if your browser is too old to work with Actual."," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Installing/HTTPS",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})}):r?(0,wo.jsx)(o3,{primaryAction:(0,wo.jsx)(zl,{onClick:()=>n("create-encryption-key"),children:"Enable encryption\u2026"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"End-to-end encryption"})," is not enabled. Any data on the server is still protected by the server password, but it\u2019s not end-to-end encrypted which means the server owners have the ability to read it. If you want, you can use an additional password to encrypt your data on the server."," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/sync/#encryption",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})}):(0,wo.jsx)(o3,{primaryAction:(0,wo.jsx)(zl,{disabled:!0,children:"Enable encryption\u2026"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"End-to-end encryption"})," is not available when running without a server. Budget files are always kept unencrypted locally, and encryption is only applied when sending data to a server."," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/sync/#encryption",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})})}function l3(e){let{prefs:t,savePrefs:n}=e,[r,o]=h.useState(!1);const i=xe((e=>({..._x,...Object.fromEntries(Object.entries(e.prefs.local).filter((e=>{let[t]=e;return t.startsWith("flags.")})).map((e=>{let[t,n]=e;return[t.replace("flags.",""),n]})))})));let a="report"===t.budgetType&&i.reportBudget;return(0,wo.jsx)(o3,{primaryAction:r?(0,wo.jsxs)(Ll,{style:{gap:"1em"},children:[(0,wo.jsxs)("label",{style:{display:"flex",color:a?go.n5:"inherit"},children:[(0,wo.jsx)(tu,{id:"report-budget-flag",checked:i.reportBudget,onChange:()=>{n({"flags.reportBudget":!i.reportBudget})},disabled:a})," ",(0,wo.jsxs)(Ll,{children:["Budget mode toggle",a&&(0,wo.jsx)(ql,{style:{color:go.r3,fontWeight:500},children:"Switch to a rollover budget before turning off this feature"})]})]}),(0,wo.jsxs)("label",{style:{display:"flex"},children:[(0,wo.jsx)(tu,{id:"sync-account-flag",checked:i.syncAccount,onChange:()=>{n({"flags.syncAccount":!i.syncAccount})}})," ",(0,wo.jsx)(Ll,{children:"Account syncing via Nordigen"})]}),(0,wo.jsxs)("label",{style:{display:"flex"},children:[(0,wo.jsx)(tu,{id:"goal-templates-flag",checked:i.goalTemplatesEnabled,onChange:()=>{n({"flags.goalTemplatesEnabled":!i.goalTemplatesEnabled})}})," ",(0,wo.jsx)(Ll,{children:"Goal templates"})]})]}):(0,wo.jsx)(Is,{onClick:()=>o(!0),style:{flexShrink:0,alignSelf:"flex-start",color:go.p4},children:"I understand the risks, show experimental features"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Experimental features."})," These features are not fully tested and may not work as expected. THEY MAY CAUSE IRRECOVERABLE DATA LOSS. They may do nothing at all. Only enable them if you know what you are doing."]})})}function s3(e){let{prefs:t}=e;return(0,wo.jsxs)(o3,{primaryAction:(0,wo.jsx)(zl,{onClick:async function(){let e=await qe("export-budget");window.Actual.saveFile(e,`${Hp(new Date,"yyyy-MM-dd")}-${t.id}.zip`,"Export budget")},children:"Export data"}),children:[(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Export"})," your data as a zip file containing"," ",(0,wo.jsx)("code",{children:"db.sqlite"})," and ",(0,wo.jsx)("code",{children:"metadata.json"})," files. It can be imported into another Actual instance by closing an open file (if any), then clicking the \u201cImport file\u201d button, then choosing \u201cActual.\u201d"]}),t.encryptKeyId?(0,wo.jsx)(ql,{children:"Even though encryption is enabled, the exported zip file will not have any encryption."}):null]})}function u3(e){let{numBlankPayees:t,numCleared:n,numDeleted:r}=e,o="";return 0===t&&0===n&&0===r?o="No split transactions found needing repair.":(t>0&&(o+=`Fixed ${t} splits with a blank payee.`),n>0&&(""!==o&&(o+="\n"),o+=`Fixed ${n} splits with the wrong cleared flag.`),r>0&&(""!==o&&(o+="\n"),o+=`Fixed ${r} splits that weren\u2019t properly deleted.`)),(0,wo.jsx)($s,{style:{color:go.g3,marginBottom:0,marginLeft:"1em",textAlign:"right",whiteSpace:"pre-wrap"},children:o})}function c3(){let[e,t]=(0,h.useState)(!1),[n,r]=(0,h.useState)(null);return(0,wo.jsxs)(o3,{primaryAction:(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"space-between",maxWidth:500,width:"100%",alignItems:"center"},children:[(0,wo.jsx)(Bl,{loading:e,onClick:async function(){t(!0);let e=await qe("tools/fix-split-transactions");r(e),t(!1)},children:"Repair split transactions"}),n&&u3(n)]}),children:[(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Repair split transactions"})," if you are experiencing bugs relating to split transactions and the \u201cReset budget cache\u201d button above does not help. If you see blank payees on splits or account balances (or any balances) are incorrect, this tool may fix them. This tool does two things:"]}),(0,wo.jsxs)("ul",{style:{margin:0,paddingLeft:"1.5em"},children:[(0,wo.jsx)("li",{style:{marginBottom:"0.5em"},children:"Ensures that deleted split transactions are fully deleted. In previous versions of the app, certain split transactions may appear deleted but not all of them are actually deleted. This causes the transactions list to look correct, but certain balances may be incorrect when filtering."}),(0,wo.jsx)("li",{children:"Sync the payee and cleared flag of a split transaction to the main or \u201cparent\u201d transaction, if appropriate. The payee will only be set if it currently doesn\u2019t have one."})]})]})}let d3=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],f3=[{value:"MM/dd/yyyy",label:"MM/DD/YYYY"},{value:"dd/MM/yyyy",label:"DD/MM/YYYY"},{value:"yyyy-MM-dd",label:"YYYY-MM-DD"},{value:"MM.dd.yyyy",label:"MM.DD.YYYY"},{value:"dd.MM.yyyy",label:"DD.MM.YYYY"}];function p3(e){let{title:t,children:n}=e;return(0,wo.jsxs)(Ll,{style:{alignItems:"flex-start",gap:"0.5em",flexGrow:1,[`@media (max-width: ${yo.breakpoint_xs})`]:{width:"100%"}},children:[(0,wo.jsx)(ql,{style:{fontWeight:500},children:t}),(0,wo.jsx)(Ll,{style:{alignItems:"flex-start",gap:"1em"},children:n})]})}function h3(e){let{prefs:t,savePrefs:n}=e;let r=t.firstDayOfWeekIdx||"0",o=t.dateFormat||"MM/dd/yyyy",i=t.numberFormat||"comma-dot";return(0,wo.jsx)(o3,{primaryAction:(0,wo.jsxs)(Ll,{style:{flexDirection:"row",gap:"1em",width:"100%",[`@media (max-width: ${yo.breakpoint_xs})`]:{flexDirection:"column"}},children:[(0,wo.jsxs)(p3,{title:"Numbers",children:[(0,wo.jsx)(zl,{bounce:!1,style:{padding:0},children:(0,wo.jsx)(Us,{value:i,onChange:function(e){n({numberFormat:e})},options:Dr.map((e=>[e.value,t.hideFraction?e.labelNoFraction:e.label])),style:{padding:"5px 10px",fontSize:15}},t.hideFraction)}),(0,wo.jsxs)(ql,{style:{display:"flex"},children:[(0,wo.jsx)(tu,{id:"settings-textDecimal",checked:t.hideFraction,onChange:function(e){let t=e.target.checked;n({hideFraction:t})}}),(0,wo.jsx)("label",{htmlFor:"settings-textDecimal",children:"Hide decimal places"})]})]}),(0,wo.jsx)(p3,{title:"Dates",children:(0,wo.jsx)(zl,{bounce:!1,style:{padding:0},children:(0,wo.jsx)(Us,{value:o,onChange:function(e){n({dateFormat:e})},options:f3.map((e=>[e.value,e.label])),style:{padding:"5px 10px",fontSize:15}})})}),(0,wo.jsx)(p3,{title:"First day of the week",children:(0,wo.jsx)(zl,{bounce:!1,style:{padding:0},children:(0,wo.jsx)(Us,{value:r,onChange:function(e){n({firstDayOfWeekIdx:e})},options:d3.map((e=>[e.value,e.label])),style:{padding:"5px 10px",fontSize:15}})})})]}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Formatting"})," does not affect how budget data is stored, and can be changed at any time."]})})}function y3(e){let{globalPrefs:t,saveGlobalPrefs:n}=e,[r,o]=(0,h.useState)(!1),i=(0,h.useRef)(null);return(0,h.useEffect)((()=>{i.current&&i.current.scrollTo(1e4,0)}),[]),(0,wo.jsxs)(o3,{primaryAction:(0,wo.jsxs)(Ll,{style:{flexDirection:"row"},children:[(0,wo.jsx)(zl,{onClick:async function(){let e=await window.Actual.openFileDialog({properties:["openDirectory"]});e&&(n({documentDir:e[0]}),o(!0))},children:"Change location"}),r&&(0,wo.jsx)(DN,{children:"A restart is required for this change to take effect"})]}),children:[(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Actual\u2019s files"})," are stored in a folder on your computer. Currently, that\u2019s:"]}),(0,wo.jsx)(ql,{innerRef:i,style:{backgroundColor:go.n10,padding:"7px 10px",borderRadius:4,overflow:"auto",whiteSpace:"nowrap","::-webkit-scrollbar":{display:"none"}},children:t.documentDir})]})}function g3(){let[e,t]=(0,h.useState)(!1);return(0,wo.jsx)(o3,{primaryAction:(0,wo.jsx)(Bl,{loading:e,onClick:async function(){t(!0),await qe("reset-budget-cache"),t(!1)},children:"Reset budget cache"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Reset budget cache"})," will clear all cached values for the budget and recalculate the entire budget. All values in the budget are cached for performance reasons, and if there is a bug in the cache you won\u2019t see correct values. There is no danger in resetting the cache. Hopefully you never have to do this."]})})}function m3(e){let{resetSync:t}=e,[n,r]=(0,h.useState)(!1);return(0,wo.jsx)(o3,{primaryAction:(0,wo.jsx)(Bl,{loading:n,onClick:async function(){r(!0),await t(),r(!1)},children:"Reset sync"}),children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Reset sync"})," will remove all local data used to track changes for syncing, and create a fresh sync ID on the server. This file on other devices will have to be re-downloaded to use the new sync ID. Use this if there is a problem with syncing and you want to start fresh."]})})}function v3(){const e=zx(),t=r3(),n=function(){let[e,t]=(0,h.useState)(!1);const n=n3();return(0,h.useEffect)((()=>{(async()=>{t(await If(n))})()}),[n]),e}();return(0,wo.jsxs)(o3,{children:[(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"Actual"})," is a super fast privacy-focused app for managing your finances."]}),(0,wo.jsxs)(Ll,{style:[{flexDirection:"column",gap:10},(0,lo.BC)(`(min-width: ${yo.breakpoint_medium})`,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"50% 50%",columnGap:"2em",gridAutoFlow:"column"})],children:[(0,wo.jsxs)(ql,{children:["Client version: v",window.Actual.ACTUAL_VERSION]}),(0,wo.jsxs)(ql,{children:["Server version: ",e]}),n?(0,wo.jsxs)("a",{style:{color:go.p4},href:"https://actualbudget.github.io/docs/Release-Notes",children:["New version available: ",t]}):(0,wo.jsx)(ql,{style:{color:go.g2,fontWeight:600},children:"You\u2019re up to date!"}),(0,wo.jsx)(ql,{children:(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Release-Notes",children:"Release Notes"})})]})]})}function b3(e){let{children:t}=e;return(0,wo.jsx)(ql,{style:{fontWeight:500},children:t})}function x3(e){let{prefs:t}=e;return(0,wo.jsxs)(o3,{children:[(0,wo.jsxs)(ql,{children:[(0,wo.jsx)("strong",{children:"IDs"})," are the names Actual uses to identify your budget internally. There are several different IDs associated with your budget. The Budget ID is used to identify your budget file. The Sync ID is used to access the budget on the server."]}),(0,wo.jsxs)(ql,{children:[(0,wo.jsx)(b3,{children:"Budget ID:"})," ",t.id]}),(0,wo.jsxs)(ql,{style:{color:go.n5},children:[(0,wo.jsx)(b3,{children:"Sync ID:"})," ",t.groupId||"(none)"]})]})}var w3=UO(go.n11)(de((e=>({prefs:e.prefs.local,globalPrefs:e.prefs.global})),e)((function(e){let{loadPrefs:t,savePrefs:n,saveGlobalPrefs:r,prefs:o,globalPrefs:i,pushModal:a,resetSync:l,closeBudget:s}=e;return(0,h.useEffect)((()=>{let e=Ye("prefs-updated",(()=>{t()}));return t(),()=>e()}),[t]),(0,wo.jsx)(Ll,{style:{marginInline:i.floatingSidebar&&!Ef()?"auto":0},children:(0,wo.jsx)(oT,{title:"Settings",titleStyle:Ef()?{backgroundColor:go.n11,color:go.n1}:void 0,children:(0,wo.jsxs)(Ll,{style:{flexShrink:0,gap:30},children:[Ef()&&(0,wo.jsxs)(Ll,{style:{gap:10,flexDirection:"row",alignItems:"flex-end"},children:[(0,wo.jsxs)(eu,{children:[(0,wo.jsx)(Js,{title:"Budget Name"}),(0,wo.jsx)(Vl,{value:o.budgetName,disabled:!0,style:{color:"#999"}})]}),(0,wo.jsx)(zl,{onClick:s,children:"Close Budget"})]}),(0,wo.jsx)(v3,{}),!ho&&(0,wo.jsx)(y3,{globalPrefs:i,saveGlobalPrefs:r}),(0,wo.jsx)(h3,{prefs:o,savePrefs:n}),(0,wo.jsx)(a3,{prefs:o,pushModal:a}),(0,wo.jsx)(s3,{prefs:o}),(0,wo.jsxs)(i3,{children:[(0,wo.jsx)(x3,{prefs:o}),(0,wo.jsx)(g3,{}),(0,wo.jsx)(m3,{resetSync:l}),(0,wo.jsx)(c3,{}),(0,wo.jsx)(l3,{prefs:o,savePrefs:n})]})]})})})})));function j3(e){let{path:t,component:n}=e;return(0,wo.jsx)(_i,{path:t,children:e=>(0,wo.jsx)(Ll,{style:{flex:1,display:e.match?"flex":"none"},children:(0,wo.jsx)(n,{...e})})})}function S3(e){let{isMobile:t,location:n}=e;return(0,wo.jsxs)(Mi,{location:n,children:[(0,wo.jsx)(_i,{path:"/",exact:!0,render:()=>(0,wo.jsx)(wi,{to:"/budget"})}),(0,wo.jsx)(j3,{path:"/reports",component:U2}),(0,wo.jsx)(j3,{path:"/budget",component:t?qD:PD}),(0,wo.jsx)(_i,{path:"/schedules",exact:!0,component:q2}),(0,wo.jsx)(_i,{path:"/schedule/edit",exact:!0,component:J2}),(0,wo.jsx)(_i,{path:"/schedule/edit/:id",component:J2}),(0,wo.jsx)(_i,{path:"/schedule/link",component:e3}),(0,wo.jsx)(_i,{path:"/schedule/discover",component:Q2}),(0,wo.jsx)(_i,{path:"/schedule/posts-offline-notification",component:t3}),(0,wo.jsx)(_i,{path:"/payees",exact:!0,component:sL}),(0,wo.jsx)(_i,{path:"/rules",exact:!0,component:YD}),(0,wo.jsx)(_i,{path:"/settings",component:w3}),(0,wo.jsx)(_i,{path:"/nordigen/link",exact:!0,component:GN}),(0,wo.jsx)(_i,{path:"/accounts/:id",exact:!0,children:e=>{const n=t?YE:zO;return e.match&&(0,wo.jsx)(n,{...e},e.match.params.id)}}),(0,wo.jsx)(_i,{path:"/accounts",exact:!0,component:t?uT:zO})]})}function k3(e){let{isMobile:t}=e,n=Ni(),r=Pf(n,"locationPtr"),o=[n];for(;r;)o.unshift(r),r=Pf(r,"locationPtr");let i=o[0],a=o.slice(1);return(0,wo.jsxs)(ow,{location:o[o.length-1],children:[(0,wo.jsx)(S3,{location:i,isMobile:t}),a.map(((e,n)=>(0,wo.jsx)(tT,{type:"modal",current:n===a.length-1,children:(0,wo.jsx)(S3,{location:e,isMobile:t})},e.key)))]})}function C3(e){let{icon:t,name:n,path:r}=e;return(0,wo.jsxs)(Vi,{to:r,style:{alignItems:"center",color:"#8E8E8F",display:"flex",flexDirection:"column",textDecoration:"none"},activeStyle:{color:go.p5},children:[(0,wo.jsx)(t,{width:22,height:22,style:{color:"inherit",marginBottom:"5px"}}),n]})}function _3(){return(0,wo.jsxs)("div",{style:{backgroundColor:"white",borderTop:`1px solid ${go.n10}`,bottom:0,...mo.shadow,display:"flex",height:"80px",justifyContent:"space-around",paddingTop:10,width:"100%"},children:[(0,wo.jsx)(C3,{name:"Budget",path:"/budget",icon:Of,isActive:!1}),(0,wo.jsx)(C3,{name:"Accounts",path:"/accounts",icon:_f,isActive:!1}),(0,wo.jsx)(C3,{name:"Settings",path:"/settings",icon:Cf,isActive:!1})]})}class O3 extends h.Component{constructor(e){super(e),this.state={isMobile:Ef()},this.history=Yo();let t=this.history.push;this.history.push=(e,n)=>{let r=function(e){return{...e,_version:Tf}}(e.state||n);return"object"===typeof e?t.call(this.history,{...e,state:r}):t.call(this.history,e,r)},window.__history=this.history,Ne("url",window.location.href),this.cleanup=this.history.listen((e=>{Ne("url",window.location.href)})),this.handleWindowResize=this.handleWindowResize.bind(this)}handleWindowResize(){this.setState({isMobile:Ef()})}componentDidMount(){"/subscribe"===this.history.location.pathname&&this.history.push("/"),this.props.getAccounts().then((e=>{0===e.length&&this.history.push("/accounts")})),xs.setScope("app"),setTimeout((async()=>{await this.props.sync(),function(e,t,r){qe("get-upgrade-notifications").then((t=>{t.forEach((t=>{switch(t){case"schedules":{let t="Track bills and subscriptions and much more with scheduled transactions. We can search all your existing transactions and try to find existing schedules.\n\n"+(n.g.IS_BETA?"NOTE: You are using the beta version, and this will not reset your sync data. This is safe to do.":"");"mobile"===po&&(t="Track bills and subscriptions and much more with scheduled transactions. Upcoming transactions will be shown in the accounts screen. Use the desktop app to create schedules."),e({type:"message",title:"Scheduled transactions are now available!",message:t,sticky:!0,id:"find-schedules",button:"mobile"!==po&&{title:"Find schedules",action:async()=>{window.__history&&window.__history.push("/schedule/discover",{locationPtr:window.__history.location})}},onClose:()=>{qe("seen-upgrade-notification",{type:"schedules"})}});break}case"repair-splits":r&&e({type:"message",title:"Split transactions now support transfers & payees",message:"The payee field is now available on split transactions, allowing you to perform transfers on individual split transactions.\n\nAll existing split transactions have a blank payee and we recommend using the tool below to set the payee from the parent. [View a video walkthrough](https://www.youtube.com/watch?v=5kTtAsB0Oqk)",sticky:!0,id:"repair-splits",button:{title:"Repair splits...",action:()=>r.push("/tools/fix-splits",{locationPtr:r.location})},onClose:()=>{qe("seen-upgrade-notification",{type:"repair-splits"})}})}}))}))}(this.props.addNotification,this.props.resetSync,this.history)}),100),setTimeout((async()=>{await this.props.sync(),await async function(e,t,n,r,o){let i=await n();await t(i)&&(await r())["flags.updateNotificationShownForVersion"]!==i&&e({type:"message",title:"A new version of Actual is available!",message:`Version ${i} of Actual was recently released.`,sticky:!0,id:"update-notification",button:{title:"Open changelog",action:()=>{window.open("https://actualbudget.github.io/docs/Release-Notes")}},onClose:async()=>{await o({"flags.updateNotificationShownForVersion":i})}})}(this.props.addNotification,If,Df,this.props.loadPrefs,this.props.savePrefs)}),100),window.addEventListener("resize",this.handleWindowResize)}componentWillUnmount(){this.cleanup(),window.removeEventListener("resize",this.handleWindowResize)}render(){return(0,wo.jsx)(yi,{history:this.history,children:(0,wo.jsx)(df,{children:(0,wo.jsxs)(Ll,{style:{height:"100%",backgroundColor:go.n10},children:[(0,wo.jsx)(GD,{}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",flex:1},children:[!this.state.isMobile&&(0,wo.jsx)(YA,{}),(0,wo.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",width:"100%"},children:[!this.state.isMobile&&(0,wo.jsx)(nM,{style:{WebkitAppRegion:"drag",position:"absolute",top:0,left:0,right:0,zIndex:1e3}}),(0,wo.jsxs)("div",{style:{flex:1,display:"flex",overflow:"auto",position:"relative"},children:[(0,wo.jsx)(QN,{}),(0,wo.jsx)(TP,{}),(0,wo.jsx)(k3,{isMobile:this.state.isMobile}),(0,wo.jsx)(qN,{history:this.history})]}),this.state.isMobile&&(0,wo.jsxs)(Mi,{children:[(0,wo.jsx)(_i,{path:"/budget",component:_3}),(0,wo.jsx)(_i,{path:"/accounts",component:_3}),(0,wo.jsx)(_i,{path:"/settings",component:_3})]})]})]})]})})})}}var E3=de(null,e)((function(e){let t=(0,h.useMemo)((()=>(0,wo.jsx)(O3,{...e})),[e]);return(0,wo.jsx)(kf,{children:(0,wo.jsx)(ZA,{children:(0,wo.jsx)(qA,{children:(0,wo.jsx)(KP,{children:(0,wo.jsx)(mf,{children:(0,wo.jsx)(pf,{children:(0,wo.jsx)(Tc,{backend:ld,children:t})})})})})})})}));var T3=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M24 11.113a5.765 5.765 0 0 0-5.216-5.952.249.249 0 0 1-.191-.12 7.684 7.684 0 0 0-14.1 2.294.251.251 0 0 1-.227.2A4.643 4.643 0 0 0 .624 9.774 4.47 4.47 0 0 0 0 12.223a4.293 4.293 0 0 0 1.235 3.1 4.624 4.624 0 0 0 1.78 1.062.963.963 0 0 0 1.243-.86v-.026a.985.985 0 0 0-.658-1.033 2.58 2.58 0 0 1-.96-.572A2.374 2.374 0 0 1 2 12.109a2.588 2.588 0 0 1 2.586-2.588 2.7 2.7 0 0 1 .535.054.989.989 0 0 0 .811-.184 1 1 0 0 0 .392-.779c.085-5.736 8.293-7.372 10.818-2.044a.974.974 0 0 0 .941.57 3.733 3.733 0 0 1 3 1.309 3.888 3.888 0 0 1 .9 2.812 3.428 3.428 0 0 1-1.473 2.667.973.973 0 0 0-.4.964l.01.059a.968.968 0 0 0 1.525.608A5.4 5.4 0 0 0 24 11.113Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M12.231 9.7a6.5 6.5 0 1 0 6.5 6.5 6.508 6.508 0 0 0-6.5-6.5Zm3.124 4.155a.75.75 0 0 1 .15 1.05l-2.905 3.87a1.493 1.493 0 0 1-1.1.6h-.111a1.485 1.485 0 0 1-1.055-.443l-1.5-1.5a.75.75 0 0 1 1.066-1.06l1.3 1.3a.249.249 0 0 0 .376-.026L14.305 14a.751.751 0 0 1 1.05-.149Z",fill:"currentColor"})]});var P3=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M24 10.663A5.817 5.817 0 0 0 22.228 6.5a5.711 5.711 0 0 0-3.447-1.585.249.249 0 0 1-.191-.12 7.684 7.684 0 0 0-14.1 2.294.251.251 0 0 1-.227.2A4.59 4.59 0 0 0 0 11.859a4.324 4.324 0 0 0 1.236 3.21 5.529 5.529 0 0 0 3.605 1.377 1 1 0 0 0 .985-1.015 1.023 1.023 0 0 0-1.015-.985 3.3 3.3 0 0 1-2.172-.8A2.374 2.374 0 0 1 2 11.859a2.576 2.576 0 0 1 .954-2.007 2.6 2.6 0 0 1 2.167-.527 1 1 0 0 0 1.2-.919 5.686 5.686 0 0 1 10.82-2.088.959.959 0 0 0 .941.57 3.687 3.687 0 0 1 2.758 1.049A3.752 3.752 0 0 1 22 10.663a3.835 3.835 0 0 1-3.438 3.791 1 1 0 0 0 .132 1.992.961.961 0 0 0 .131-.009A5.807 5.807 0 0 0 24 10.663Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M15.5 17.446h-1.75a.25.25 0 0 1-.25-.25v-7.25a1.5 1.5 0 1 0-3 0V17.2a.25.25 0 0 1-.25.25H8.5a1 1 0 0 0-.707 1.707l3.5 3.5a1 1 0 0 0 1.414 0l3.5-3.5a1 1 0 0 0-.707-1.707Z",fill:"currentColor"})]});var A3=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M21.941 3.607 18.87.554A1.912 1.912 0 0 0 17.527 0H8.9A1.9 1.9 0 0 0 7 1.9V5H3.4a1.9 1.9 0 0 0-1.9 1.9v15.21A1.9 1.9 0 0 0 3.4 24h11.7a1.9 1.9 0 0 0 1.9-1.895V19h3.6a1.9 1.9 0 0 0 1.9-1.895V4.949a1.882 1.882 0 0 0-.559-1.342ZM14.5 22H4a.5.5 0 0 1-.5-.5v-14A.5.5 0 0 1 4 7h7.784a.5.5 0 0 1 .35.143L14.85 9.8a.5.5 0 0 1 .15.357V21.5a.5.5 0 0 1-.5.5Zm5.5-5h-2.75a.25.25 0 0 1-.25-.25v-6.8a1.892 1.892 0 0 0-.558-1.341L13.37 5.554A1.9 1.9 0 0 0 12.028 5H9.25A.25.25 0 0 1 9 4.75V2.5a.5.5 0 0 1 .5-.5l7.756-.026a.5.5 0 0 1 .351.143L20.35 4.8a.5.5 0 0 1 .15.357V16.5a.5.5 0 0 1-.5.5Z",fill:"currentColor"})});var M3=e=>(0,wo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,wo.jsx)("path",{d:"M3.566 15.457a1 1 0 0 0-.5-.844 2.248 2.248 0 0 1-.431-.329A2.371 2.371 0 0 1 2 12.5a2.588 2.588 0 0 1 2.585-2.588 2.645 2.645 0 0 1 .536.056A1 1 0 0 0 6.324 9c.081-5.754 8.3-7.363 10.818-2.045a.97.97 0 0 0 .941.571 3.7 3.7 0 0 1 3 1.3 3.874 3.874 0 0 1 .908 2.811 3.428 3.428 0 0 1-1.1 2.375 1.316 1.316 0 0 0-.42 1.089.912.912 0 0 0 1.476.628A5.408 5.408 0 0 0 24 11.418a5.763 5.763 0 0 0-5.22-5.866.25.25 0 0 1-.19-.12 7.685 7.685 0 0 0-14.1 2.3.251.251 0 0 1-.227.2 4.642 4.642 0 0 0-3.643 2.24A4.471 4.471 0 0 0 0 12.619a4.287 4.287 0 0 0 1.235 3.09 4.177 4.177 0 0 0 .852.645 1 1 0 0 0 1.478-.9Z",fill:"currentColor"}),(0,wo.jsx)("path",{d:"M18.5 15.8a6.5 6.5 0 1 0-6.5 6.5 6.508 6.508 0 0 0 6.5-6.5Zm-7.25 1.25v-.55a1.257 1.257 0 0 1 .986-1.221 1.125 1.125 0 1 0-1.361-1.1.75.75 0 1 1-1.5 0 2.625 2.625 0 1 1 3.538 2.461.25.25 0 0 0-.163.234v.18a.75.75 0 0 1-1.5 0ZM12 18.8a1 1 0 1 1-1 1 1 1 0 0 1 1-1Z",fill:"currentColor"})]});var D3=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M23.113 5.954 21.849 4.69l.881-.88a1.914 1.914 0 1 0-2.707-2.71L9.04 12.085a6.014 6.014 0 1 0 2.707 2.707l3.739-3.737.762.762a1.75 1.75 0 1 0 2.475-2.475l-.763-.762 1.416-1.417 1.264 1.263a1.788 1.788 0 0 0 2.473 0 1.751 1.751 0 0 0 0-2.472Zm-16.737 8.5a3 3 0 1 1-3 3 3 3 0 0 1 3-2.998Z",fill:"currentColor"})});var I3=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M10.664 20.073a1.249 1.249 0 1 0-.507 2.447A10.739 10.739 0 1 0 2.4 16.1a.25.25 0 0 1-.084.3l-1 .726a1 1 0 0 0 .377 1.787l3.946.849a1.062 1.062 0 0 0 .21.022 1 1 0 0 0 .978-.79l.945-4.4a1 1 0 0 0-1.565-1.02l-1.361.989a.25.25 0 0 1-.386-.128 8.255 8.255 0 1 1 6.205 5.643Z",fill:"currentColor"})});function R3(e){return"unknown"===e.state?"This is a cloud-based file but its state is unknown because you are offline.":e.encryptKeyId?e.hasKey?"This file is encrypted and you have key to access it.":"This file is encrypted and you do not have the key for it.":null}function N3(e){let{onDelete:t,onClose:n}=e;return(0,wo.jsx)(Hs,{onMenuSelect:function(e){if(n(),"delete"===e)t()},items:[{name:"delete",text:"Delete"}]})}function L3(e){let{state:t,onDelete:n}=e,[r,o]=(0,h.useState)(!1);return(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(zl,{bare:!0,onClick:e=>{e.stopPropagation(),o(!0)},children:(0,wo.jsx)(qx,{style:{width:16,height:16}})}),r&&(0,wo.jsx)(Ps,{position:"bottom-right",style:{padding:0},onClose:()=>o(!1),children:(0,wo.jsx)(N3,{state:t,onDelete:n,onClose:()=>o(!1)})})]})}function F3(e){let t,n,r,{file:o}=e;switch(o.state){case"unknown":t=M3,n="Network unavailable",r=go.n7;break;case"remote":t=P3,n="Available for download";break;case"local":case"broken":t=A3,n="Local";break;default:t=T3,n="Syncing"}return(0,wo.jsxs)(Ll,{style:{color:r,alignItems:"center",flexDirection:"row",marginTop:8},children:[(0,wo.jsx)(t,{color:r,style:{width:18,height:18,color:"currentColor"}}),(0,wo.jsx)(ql,{style:{marginLeft:5},children:n})]})}function B3(e){let{file:t,onSelect:n,onDelete:r}=e,o=(0,h.useRef)(!1);return(0,wo.jsxs)(Ll,{onClick:()=>async function(e){o.current||(o.current=!0,await n(e),o.current=!1)}(t),title:R3(t),style:[{flexDirection:"row",justifyContent:"space-between",alignItems:"center",...mo.shadow,margin:10,padding:"12px 15px",backgroundColor:"white",borderRadius:6,flexShrink:0,cursor:"pointer",":hover":{backgroundColor:go.hover}}],children:[(0,wo.jsxs)(Ll,{style:{alignItems:"flex-start"},children:[(0,wo.jsx)(ql,{style:[{fontSize:16,fontWeight:700}],children:t.name}),(0,wo.jsx)(F3,{file:t})]}),(0,wo.jsxs)(Ll,{style:{flex:"0 0 auto",flexDirection:"row",alignItems:"center"},children:[t.encryptKeyId&&(0,wo.jsx)(D3,{style:{width:13,height:13,marginRight:8,color:t.hasKey?go.b5:go.n8}}),(0,wo.jsx)(L3,{state:t.state,onDelete:()=>r(t)})]})]})}function z3(e){let{files:t,onSelect:n,onDelete:r}=e;return(0,wo.jsx)(Ll,{style:{flexGrow:1,[`@media (min-width: ${yo.breakpoint_narrow})`]:{flexGrow:0,maxHeight:310},overflow:"auto","& *":{userSelect:"none"}},children:t.map((e=>(0,wo.jsx)(B3,{file:e,onSelect:n,onDelete:r},e.id||e.cloudFileId)))})}function U3(e){let{onRefresh:t}=e,[n,r]=(0,h.useState)(!1);let o=n?ko:I3;return(0,wo.jsx)(zl,{bare:!0,style:{padding:10,marginRight:5},onClick:async function(){r(!0),await t(),r(!1)},children:(0,wo.jsx)(o,{color:go.n1,style:{width:18,height:18,color:go.n1}})})}var W3=de((e=>({files:e.budgets.allFiles,isLoggedIn:!!e.user.data})),e)((function(t){let{files:n=[],getUserData:r,loadAllFiles:o,pushModal:i,loadBudget:a,createBudget:l,downloadBudget:s}=t;const[u,c]=(0,h.useState)(!1),d=function(){let{testMode:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u||(c(!0),l({testMode:e}))};return(0,wo.jsxs)(Ll,{style:{flex:1,justifyContent:"center",minWidth:yo.breakpoint_narrow,[`@media (max-width: ${yo.breakpoint_narrow})`]:{width:"100vw",minWidth:"100vw",marginInline:-20,marginTop:20}},children:[(0,wo.jsxs)(Ll,{children:[(0,wo.jsx)(ql,{style:[mo.veryLargeText,{margin:20}],children:"Files"}),(0,wo.jsx)(Ll,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",marginRight:5},children:(0,wo.jsx)(U3,{onRefresh:()=>{r(),o()}})})]}),(0,wo.jsx)(z3,{files:n,actions:e,onSelect:e=>{"remote"===e.state?s(e.cloudFileId):a(e.id)},onDelete:e=>i("delete-budget",{file:e})}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"flex-end",padding:25,paddingLeft:5},children:[(0,wo.jsx)(zl,{bare:!0,style:{marginLeft:10,color:go.n4},onClick:e=>{e.preventDefault(),i("import")},children:"Import file"}),(0,wo.jsx)(zl,{primary:!0,onClick:d,style:{marginLeft:15},children:"Create new file"}),PN()&&(0,wo.jsx)(zl,{primary:!0,onClick:()=>d({testMode:!0}),style:{marginLeft:15},children:"Create test file"})]})]})}));function H3(){let[e,t]=(0,h.useState)(!1),n=Ri(),r=Ni(),o=Ux();return(0,h.useEffect)((()=>{!async function(){let e=e=>{r.pathname!==e?n.push(e):t(!0)};if(null==await qe("get-server-url")){let t=window.location.origin,{error:r,hasServer:i,bootstrapped:a}=await qe("subscribe-needs-bootstrap",{url:t});if(r||!i)return console.log(r),void n.push("/config-server");await o(t,{validate:!1}),e(a?"/login":"/bootstrap")}else{let{error:t,bootstrapped:r}=await qe("subscribe-needs-bootstrap");t?n.push("/error",{error:t}):e(r?"/login":"/bootstrap")}}()}),[n,r]),{checked:e}}function K3(e){let{text:t}=e;return(0,wo.jsx)("h1",{style:{fontSize:40,fontWeight:700,color:go.p3,marginBottom:20},children:t})}const $3=h.forwardRef(((e,t)=>(0,wo.jsx)(Vl,{...e,style:[{padding:10,fontSize:15,border:"none",...mo.shadow,":focus":{border:"none",...mo.shadow}},e.style]})));function V3(){!function(e){(0,h.useEffect)((()=>{WO(e)}),[e,WO])}(go.p5);let e=ge(),t=Ri(),[n,r]=(0,h.useState)(""),o=Bx(),i=Ux();(0,h.useEffect)((()=>{r(o)}),[o]);let[a,l]=(0,h.useState)(!1),[s,u]=(0,h.useState)(null);async function c(){await i(null),await e(sr()),t.push("/")}return(0,wo.jsxs)(Ll,{style:{maxWidth:500,marginTop:-30},children:[(0,wo.jsx)(K3,{text:"Where\u2019s the server?"}),(0,wo.jsx)(ql,{style:{fontSize:16,color:go.n2,lineHeight:1.5},children:o?(0,wo.jsx)(wo.Fragment,{children:"Existing sessions will be logged out and you will log in to this server. We will validate that Actual is running at this URL."}):(0,wo.jsx)(wo.Fragment,{children:"There is no server configured. After running the server, specify the URL here to use the app. You can always change this later. We will validate that Actual is running at this URL."})}),s&&(0,wo.jsx)(ql,{style:{marginTop:20,color:go.r4,borderRadius:4,fontSize:15},children:function(e){return"network-failure"===e?"Server is not running at this URL. Make sure you have HTTPS set up properly.":"Server does not look like an Actual server. Is it set up correctly?"}(s)}),(0,wo.jsxs)("form",{style:{display:"flex",flexDirection:"row",marginTop:30},onSubmit:o=>{o.preventDefault(),async function(){if(""===n||a)return;u(null),l(!0);let{error:o}=await i(n);if("network-failure"!==o||n.startsWith("http://")||n.startsWith("https://"))o?(l(!1),u(o)):(l(!1),await e(ur()),t.push("/"));else{let{error:o}=await i("https://"+n);o?(r("https://"+n),u(o)):(await e(ur()),t.push("/")),l(!1)}}()},children:[(0,wo.jsx)($3,{autoFocus:!0,placeholder:"https://example.com",value:n,onChange:e=>r(e.target.value),style:{flex:1,marginRight:10}}),(0,wo.jsx)(Bl,{primary:!0,loading:a,style:{fontSize:15},children:"OK"}),o&&(0,wo.jsx)(zl,{bare:!0,type:"button",style:{fontSize:15,marginLeft:10},onClick:()=>t.goBack(),children:"Cancel"})]}),(0,wo.jsx)(Ll,{style:{flexDirection:"row",flexFlow:"row wrap",justifyContent:"center",marginTop:15},children:o?(0,wo.jsx)(zl,{bare:!0,style:{color:go.n4},onClick:c,children:"Stop using a server"}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)(zl,{bare:!0,style:{color:go.n4,margin:5,marginRight:15},onClick:function(){r(window.location.origin)},children:["Use ",window.location.origin.replace(/https?:\/\//,"")]}),(0,wo.jsx)(zl,{bare:!0,style:{color:go.n4,margin:5},onClick:c,children:"Don\u2019t use a server"}),PN()&&(0,wo.jsx)(zl,{primary:!0,style:{marginLeft:15},onClick:async function(){await i(null),await e(Xn({testMode:!0})),window.__history.push("/")},children:"Create test file"})]})})]})}function q3(e){let{modalProps:t,actions:n,file:r}=e,[o,i]=(0,h.useState)(null);async function a(){i("cloud"),await n.deleteBudget(r.id,r.cloudFileId),i(null),t.onBack()}async function l(){i("local"),await n.deleteBudget(r.id),i(null),t.onBack()}let s=r.cloudFileId&&"broken"!==r.state;return(0,wo.jsx)(ks,{...t,title:"Delete "+r.name,padding:0,showOverlay:!1,onClose:t.onBack,children:()=>(0,wo.jsxs)(Ll,{style:{padding:15,paddingTop:0,paddingBottom:25,width:500,lineHeight:"1.5em"},children:[s&&(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)(ql,{children:["This is a ",(0,wo.jsx)("strong",{children:"hosted file"})," which means it is stored on your server to make it available for download on any device. You can delete it from the server, which will also remove it from all of your devices."]}),(0,wo.jsx)(Bl,{primary:!0,loading:"cloud"===o,style:{backgroundColor:go.r4,alignSelf:"center",border:0,marginTop:10,padding:"10px 30px",fontSize:14},onClick:a,children:"Delete file from all devices"})]}),r.id&&(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(ql,{style:[s&&{marginTop:20}],children:s?(0,wo.jsx)(ql,{children:"You can also delete just the local copy. This will remove all local data and the file will be listed as available for download."}):(0,wo.jsxs)(ql,{children:["broken"===r.state?(0,wo.jsxs)(ql,{children:["This is a ",(0,wo.jsx)("strong",{children:"hosted file"})," but it was created by another user. You can only delete the local copy."]}):(0,wo.jsxs)(ql,{children:["This a ",(0,wo.jsx)("strong",{children:"local file"})," which is not stored on a server."]})," ","Deleting it will remove it and all of its backups permanently."]})}),(0,wo.jsx)(Bl,{primary:!s,loading:"local"===o,style:[{alignSelf:"center",marginTop:10,padding:"10px 30px",fontSize:14},s?{color:go.r4,borderColor:go.r4}:{border:0,backgroundColor:go.r4}],onClick:l,children:"Delete file locally"})]})]})})}function G3(e){return"not-ynab4"===e?"This file is not valid. Please select a .ynab4 file":"An unknown error occurred while importing. Sorry! We have been notified of this issue."}var Y3=function(e){let{modalProps:t,actions:n}=e;const[r]=(0,h.useState)(!1);function o(e){switch(e){case"ynab4":n.pushModal("import-ynab4");break;case"ynab5":n.pushModal("import-ynab5");break;case"actual":n.pushModal("import-actual")}}let i={padding:10,border:"1px solid "+go.border,borderRadius:6,marginBottom:10,display:"block"};return(0,wo.jsx)(ks,{...t,title:"Import From",style:{width:400},children:()=>(0,wo.jsxs)(Ll,{style:[mo.smallText,{lineHeight:1.5}],children:[r&&(0,wo.jsx)(Ms,{style:{color:go.r4,marginBottom:15},children:G3(r)}),(0,wo.jsx)(ql,{style:{marginBottom:15},children:"Select an app to import from, and we\u2019ll guide you through the process."}),(0,wo.jsxs)(zl,{style:i,onClick:()=>o("ynab4"),children:[(0,wo.jsx)("span",{style:{fontWeight:700},children:"YNAB4"}),(0,wo.jsx)(Ll,{style:{color:go.n5},children:"The old unsupported desktop app"})]}),(0,wo.jsxs)(zl,{style:i,onClick:()=>o("ynab5"),children:[(0,wo.jsx)("span",{style:{fontWeight:700},children:"nYNAB"}),(0,wo.jsx)(Ll,{style:{color:go.n5},children:(0,wo.jsx)("div",{children:"The newer web app"})})]}),(0,wo.jsxs)(zl,{style:i,onClick:()=>o("actual"),children:[(0,wo.jsx)("span",{style:{fontWeight:700},children:"Actual"}),(0,wo.jsx)(Ll,{style:{color:go.n5},children:(0,wo.jsx)("div",{children:"Import a file exported from Actual"})})]})]})})};function Q3(e){switch(e){case"parse-error":return"Unable to parse file. Please select a JSON file exported from nYNAB.";case"not-ynab5":return"This file is not valid. Please select a JSON file exported from nYNAB.";case"not-zip-file":return"This file is not valid. Please select an unencrypted archive of Actual data.";case"invalid-zip-file":return"This archive is not a valid Actual export file.";case"invalid-metadata-file":return"The metadata file in the given archive is corrupted.";default:return"An unknown error occurred while importing. Sorry! We have been notified of this issue."}}var X3=function(e){let{modalProps:t,availableImports:n}=e;const r=ge(),[o,i]=(0,h.useState)(!1),[a,l]=(0,h.useState)(!1);async function s(){const e=await window.Actual.openFileDialog({properties:["openFile"],filters:[{name:"actual",extensions:["zip","blob"]}]});if(e){l(!0),i(!1);try{await r(Zn(e[0],"actual"))}catch(t){i(t.message)}finally{l(!1)}}}return(0,wo.jsx)(ks,{...t,title:"Import from Actual export",style:{width:400},children:()=>(0,wo.jsxs)(Ll,{style:[mo.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,wo.jsx)(Ms,{style:{color:go.r4,marginBottom:15},children:Q3(o)}),(0,wo.jsxs)(Ll,{style:{"& > div":{lineHeight:"1.7em"}},children:[(0,wo.jsxs)($s,{children:["You can import data from another Actual account or instance. First export your data from a different account, and it will give you a compressed file. This file is a simple zip file that contains the"," ",(0,wo.jsx)("code",{children:"db.sqlite"})," and ",(0,wo.jsx)("code",{children:"metadata.json"})," files."]}),(0,wo.jsx)($s,{children:"Select one of these compressed files and import it here."}),(0,wo.jsx)(Ll,{style:{alignSelf:"center"},children:(0,wo.jsx)(Bl,{loading:a,primary:!0,onClick:s,children:"Select file..."})})]})]})})};function Z3(e){return"not-ynab4"===e?"This file is not valid. Please select a compressed ynab4 zip file.":"An unknown error occurred while importing. Sorry! We have been notified of this issue."}var J3=function(e){let{modalProps:t,availableImports:n}=e;const r=ge(),[o,i]=(0,h.useState)(!1),[a,l]=(0,h.useState)(!1);async function s(){const e=await window.Actual.openFileDialog({properties:["openFile"],filters:[{name:"ynab",extensions:["zip"]}]});if(e){l(!0),i(!1);try{await r(Zn(e[0],"ynab4"))}catch(t){i(t.message)}finally{l(!1)}}}return(0,wo.jsx)(ks,{...t,title:"Import from YNAB4",style:{width:400},children:()=>(0,wo.jsxs)(Ll,{style:[mo.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,wo.jsx)(Ms,{style:{color:go.r4,marginBottom:15},children:Z3(o)}),(0,wo.jsxs)(Ll,{style:{alignItems:"center"},children:[(0,wo.jsxs)($s,{children:["To import data from YNAB4, locate where your YNAB4 data is stored. It is usually in your Documents folder under YNAB. Your data is a directory inside that with the ",(0,wo.jsx)("code",{children:".ynab4"})," suffix."]}),(0,wo.jsxs)($s,{children:["When you\u2019ve located your data,"," ",(0,wo.jsx)("strong",{children:"compress it into a zip file"}),". On macOS, right-click the folder and select \u201cCompress\u201d. On Windows, right-click and select \u201cSend to \u2192 Compressed (zipped) folder\u201d. Upload the zipped folder for importing."]}),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(Bl,{loading:a,primary:!0,onClick:s,children:"Select zip file..."})})]})]})})};function e6(e){switch(e){case"parse-error":return"Unable to parse file. Please select a JSON file exported from nYNAB.";case"not-ynab5":return"This file is not valid. Please select a JSON file exported from nYNAB.";default:return"An unknown error occurred while importing. Sorry! We have been notified of this issue."}}var t6=function(e){let{modalProps:t,availableImports:n}=e;const r=ge(),[o,i]=(0,h.useState)(!1),[a,l]=(0,h.useState)(!1);async function s(){const e=await window.Actual.openFileDialog({properties:["openFile"],filters:[{name:"ynab",extensions:["json"]}]});if(e){l(!0),i(!1);try{await r(Zn(e[0],"ynab5"))}catch(t){i(t.message)}finally{l(!1)}}}return(0,wo.jsx)(ks,{...t,title:"Import from nYNAB",style:{width:400},children:()=>(0,wo.jsxs)(Ll,{style:[mo.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,wo.jsx)(Ms,{style:{color:go.r4,marginBottom:15},children:e6(o)}),(0,wo.jsxs)(Ll,{style:{alignItems:"center","& > div":{lineHeight:"1.7em"}},children:[(0,wo.jsxs)($s,{children:[(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/migration/nynab",target:"_blank",children:"Read here"})," ","for instructions on how to migrate your data from YNAB. You need to export your data as JSON, and that page explains how to do that."]}),(0,wo.jsx)($s,{children:"Once you have exported your data, select the file and Actual will import it. Budgets may not match up exactly because things work slightly differently, but you should be able to fix up any problems."}),(0,wo.jsx)(Ll,{children:(0,wo.jsx)(Bl,{loading:a,primary:!0,onClick:s,children:"Select file..."})})]})]})})};var n6=de((e=>({modalStack:e.modals.modalStack,isHidden:e.modals.isHidden,budgets:e.budgets.budgets,availableImports:e.budgets.availableImports,globalPrefs:e.prefs.global,allFiles:e.budgets.allFiles,isLoggedIn:!!e.user.data})),(t=>({actions:Q(e,t)})))((function(e){let{modalStack:t,isHidden:n,allFiles:r,availableImports:o,globalPrefs:i,isLoggedIn:a,actions:l}=e,s=t.map(((e,r)=>{let{name:i,options:a}=e;const s={onClose:l.popModal,onPush:l.pushModal,onBack:l.popModal,isCurrent:r===t.length-1,isHidden:n,stackIndex:r};switch(i){case"delete-budget":return(0,wo.jsx)(q3,{modalProps:s,actions:l,file:a.file},i);case"import":return(0,wo.jsx)(Y3,{modalProps:s,actions:l,availableImports:o},i);case"import-ynab4":return(0,wo.jsx)(J3,{modalProps:s,actions:l},i);case"import-ynab5":return(0,wo.jsx)(t6,{modalProps:s,actions:l},i);case"import-actual":return(0,wo.jsx)(X3,{modalProps:s,actions:l},i);case"load-backup":return(0,wo.jsx)(dD,{initialState:{backups:[]},didMount:async e=>{let{setState:t}=e;t({backups:await qe("backups-get",{id:a.budgetId})})},children:e=>{let{state:t}=e;return(0,wo.jsx)(TN,{budgetId:a.budgetId,modalProps:{...s,onClose:l.popModal},backupDisabled:!0,actions:l,backups:t.backups})}},i);case"create-encryption-key":return(0,wo.jsx)(NR,{modalProps:s,actions:l,options:a},i);case"fix-encryption-key":return(0,wo.jsx)(lN,{modalProps:s,actions:l,options:a},i);default:throw new Error("Unknown modal: "+i)}}));return(0,wo.jsx)(Ll,{style:{flex:1,padding:50},children:s})}));function r6(){const e=Bx();return(0,wo.jsxs)(Ll,{style:{position:"absolute",bottom:0,left:0,right:0,justifyContent:"center",flexDirection:"row",marginBottom:15,zIndex:5e3},children:[(0,wo.jsx)(ql,{children:e?(0,wo.jsxs)(wo.Fragment,{children:["Using server: ",(0,wo.jsx)("strong",{children:e})]}):(0,wo.jsx)("strong",{children:"No server configured"})}),(0,wo.jsx)(Rs,{bare:!0,to:"/config-server",style:{marginLeft:15},children:"Change"})]})}function o6(e){let{buttons:t,onSetPassword:n,onError:r}=e,[o,i]=(0,h.useState)(""),[a,l]=(0,h.useState)(""),[s,u]=(0,h.useState)(!1),[c,d]=(0,h.useState)(!1);async function f(e){e.preventDefault(),c||(o===a?(d(!0),await n(o),d(!1)):r("password-match"))}return(0,wo.jsxs)("form",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",marginTop:30},onSubmit:f,children:[(0,wo.jsx)($3,{autoFocus:!0,placeholder:"Password",type:s?"text":"password",value:o,onChange:e=>i(e.target.value),onEnter:f}),(0,wo.jsx)($3,{placeholder:"Confirm password",type:s?"text":"password",value:a,onChange:e=>l(e.target.value),style:{marginTop:10},onEnter:f}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center",fontSize:15,marginTop:20},children:[(0,wo.jsxs)("label",{style:{userSelect:"none"},children:[(0,wo.jsx)("input",{type:"checkbox",onChange:function(e){u(e.target.checked)}})," Show password"]}),(0,wo.jsx)(Ll,{style:{flex:1}}),t,(0,wo.jsx)(Bl,{primary:!0,loading:c,children:"OK"})]})]})}function i6(){let e=ge(),[t,n]=(0,h.useState)(null),{checked:r}=H3();return r?(0,wo.jsxs)(Ll,{style:{maxWidth:450,marginTop:-30},children:[(0,wo.jsx)(K3,{text:"Welcome to Actual!"}),(0,wo.jsx)($s,{style:{fontSize:16,color:go.n2},children:"Actual is a super fast privacy-focused app for managing your finances. To secure your data, you\u2019ll need to set a password for your server."}),(0,wo.jsxs)($s,{isLast:!0,style:{fontSize:16,color:go.n2},children:["Consider opening"," ",(0,wo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/using-actual/",target:"_blank",rel:"noopener noreferrer",style:{color:go.b4},children:"our tour"})," ","in a new tab for some guidance on what to do when you\u2019ve set your password."]}),t&&(0,wo.jsx)(ql,{style:{marginTop:20,color:go.r4,borderRadius:4,fontSize:15},children:function(e){switch(e){case"invalid-password":return"Password cannot be empty";case"password-match":return"Passwords do not match";case"network-failure":return"Unable to contact the server";default:return`An unknown error occurred: ${e}`}}(t)}),(0,wo.jsx)(o6,{buttons:(0,wo.jsx)(zl,{bare:!0,style:{fontSize:15,color:go.b4,marginRight:15},onClick:async function(){await e(Xn({demoMode:!0}))},children:"Try Demo"}),onSetPassword:async function(t){n(null);let{error:r}=await qe("subscribe-bootstrap",{password:t});r?n(r):e(sr())},onError:n})]}):null}function a6(){let e=Ri(),[t,n]=(0,h.useState)(null),[r,o]=(0,h.useState)(null);return(0,wo.jsxs)(Ll,{style:{maxWidth:500,marginTop:-30},children:[(0,wo.jsx)(K3,{text:"Change server password"}),(0,wo.jsx)(ql,{style:{fontSize:16,color:go.n2,lineHeight:1.4},children:"This will change the password for this server instance. All existing sessions will stay logged in."}),t&&(0,wo.jsx)(ql,{style:{marginTop:20,color:go.r4,borderRadius:4,fontSize:15},children:function(e){switch(e){case"invalid-password":return"Password cannot be empty";case"password-match":return"Passwords do not match";case"network-failure":return"Unable to contact the server";default:return"Internal server error"}}(t)}),r&&(0,wo.jsx)(ql,{style:{marginTop:20,color:go.g4,borderRadius:4,fontSize:15},children:r}),(0,wo.jsx)(o6,{buttons:(0,wo.jsx)(zl,{bare:!0,type:"button",style:{fontSize:15,marginRight:10},onClick:()=>e.push("/"),children:"Cancel"}),onSetPassword:async function(t){n(null);let{error:r}=await qe("subscribe-change-password",{password:t});r?n(r):(o("Password successfully changed"),await qe("subscribe-sign-in",{password:t}),e.push("/"))},onError:n})]})}function l6(){let e=Ri(),t=Ni(),{error:n}=t.state||{};return(0,wo.jsxs)(Ll,{style:{alignItems:"center"},children:[(0,wo.jsx)(ql,{style:{fontSize:16,color:go.n2,lineHeight:1.4},children:(r=n,"network-failure"===r?"Unable to access server. Make sure the configured URL for the server is accessible.":"Server returned an error while checking its status.")}),(0,wo.jsx)(zl,{onClick:function(){e.push("/")},style:{marginTop:20},children:"Try again"})]});var r}function s6(){let e=ge(),[t,n]=(0,h.useState)(""),[r,o]=(0,h.useState)(!1),[i,a]=(0,h.useState)(null),{checked:l}=H3();return l?(0,wo.jsxs)(Ll,{style:{maxWidth:450,marginTop:-30},children:[(0,wo.jsx)(K3,{text:"Sign in to this Actual instance"}),(0,wo.jsx)(ql,{style:{fontSize:16,color:go.n2,lineHeight:1.4},children:"If you lost your password, you likely still have access to your server to manually reset it."}),i&&(0,wo.jsx)(ql,{style:{marginTop:20,color:go.r4,borderRadius:4,fontSize:15},children:function(e){switch(e){case"invalid-password":return"Invalid password";case"network-failure":return"Unable to contact the server";default:return`An unknown error occurred: ${e}`}}(i)}),(0,wo.jsxs)("form",{style:{display:"flex",flexDirection:"row",marginTop:30},onSubmit:async function(n){if(n.preventDefault(),""===t||r)return;a(null),o(!0);let{error:i}=await qe("subscribe-sign-in",{password:t});o(!1),i?a(i):e(sr())},children:[(0,wo.jsx)($3,{autoFocus:!0,placeholder:"Password",type:"password",onChange:e=>n(e.target.value),style:{flex:1,marginRight:10}}),(0,wo.jsx)(Bl,{primary:!0,loading:r,style:{fontSize:15},children:"Sign in"})]}),(0,wo.jsx)(Ll,{style:{flexDirection:"row",justifyContent:"center",marginTop:15},children:(0,wo.jsx)(zl,{bare:!0,style:{fontSize:15,color:go.b4,marginLeft:10},onClick:async function(){await e(Xn({demoMode:!0}))},children:"Try Demo \u2192"})})]}):null}var u6=de(null,e)((function(e){let{createBudget:t,pushModal:n}=e;return(0,wo.jsxs)(Ll,{style:{gap:10,maxWidth:500,fontSize:15,maxHeight:"100vh",marginBlock:20},children:[(0,wo.jsx)(ql,{style:mo.veryLargeText,children:"Let\u2019s get started!"}),(0,wo.jsxs)(Ll,{style:{overflowY:"auto"},children:[(0,wo.jsxs)($s,{children:["Actual is a personal finance tool that focuses on beautiful design and a slick user experience."," ",(0,wo.jsx)("strong",{children:"Editing your data should be as fast as possible."})," On top of that, we want to provide powerful tools to allow you to do whatever you want with your data."]}),(0,wo.jsxs)($s,{style:{"& a, & a:visited":{color:go.p5}},children:["Currently, Actual implements budgeting based on a"," ",(0,wo.jsx)(Ns,{asAnchor:!0,style:{color:go.p5},href:"https://actualbudget.github.io/docs/Budgeting/howitworks",children:"monthly envelope system"}),". Consider taking our"," ",(0,wo.jsx)(Ns,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/using-actual/",children:"guided tour"})," ","to help you get your bearings, and check out the rest of the documentation while you\u2019re there to learn more about advanced topics."]}),(0,wo.jsx)($s,{style:{color:go.n5},children:"Get started by importing an existing budget file from Actual or another budgeting app, or start fresh with an empty budget. You can always create or import another budget later."})]}),(0,wo.jsxs)(Ll,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",flexShrink:0},children:[(0,wo.jsx)(zl,{onClick:()=>n("import"),children:"Import my budget"}),(0,wo.jsx)(zl,{primary:!0,onClick:t,children:"Start fresh"})]})]})}));function c6(){const e=zx();return(0,wo.jsx)(ql,{style:{color:go.n7,":hover":{color:go.n2},margin:15,marginLeft:17,[`@media (min-width: ${yo.breakpoint_medium})`]:{position:"absolute",bottom:0,right:0,marginLeft:15,marginRight:17,zIndex:5001}},href:"https://actualbudget.github.io/docs/Release-Notes/",children:`App: v${window.Actual.ACTUAL_VERSION} | Server: ${e}`})}var d6=de((e=>{let{modalStack:t}=e.modals;return{files:e.budgets.allFiles,userData:e.user.data,managerHasInitialized:e.app.managerHasInitialized,currentModals:t.map((e=>e.name))}}),e)((function(e){let{isLoading:t,files:n,userData:r,managerHasInitialized:o,setAppState:i,getUserData:a,loadAllFiles:l}=e;const[s]=(0,h.useState)(Yo);return window.__history=s,(0,h.useEffect)((()=>{o||t||i({loadingText:""}),async function(){await a()&&await l(),i({managerHasInitialized:!0,...t?null:{loadingText:null}})}()}),[]),o?t?null:(0,wo.jsxs)(yi,{history:s,children:[(0,wo.jsxs)(Ll,{style:{height:"100%"},children:[(0,wo.jsx)(Ll,{style:{position:"absolute",top:0,left:0,right:0,height:40,WebkitAppRegion:"drag"}}),(0,wo.jsx)(Ll,{style:{position:"absolute",bottom:40,right:15},children:(0,wo.jsx)(QN,{style:{position:"relative",left:"initial",right:"initial"}})}),o&&(0,wo.jsx)(Ll,{style:{alignItems:"center",bottom:0,justifyContent:"center",left:0,padding:20,position:"absolute",right:0,top:0},children:r&&n?(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsxs)(Mi,{children:[(0,wo.jsx)(_i,{exact:!0,path:"/config-server",component:V3}),(0,wo.jsx)(_i,{exact:!0,path:"/change-password",component:a6}),n&&n.length>0?(0,wo.jsx)(_i,{exact:!0,path:"/",component:W3}):(0,wo.jsx)(_i,{exact:!0,path:"/",component:u6}),(0,wo.jsx)(_i,{path:"/",render:()=>(0,wo.jsx)(wi,{to:"/"})})]}),(0,wo.jsx)(Ll,{style:{position:"absolute",top:0,right:0,padding:"6px 10px",zIndex:4e3},children:(0,wo.jsxs)(Mi,{children:[(0,wo.jsx)(_i,{exact:!0,path:"/config-server",component:null}),(0,wo.jsx)(_i,{exact:!0,path:"/",render:()=>(0,wo.jsx)(QA,{style:{padding:"4px 7px"}})})]})})]}):(0,wo.jsxs)(Mi,{children:[(0,wo.jsx)(_i,{exact:!0,path:"/login",component:s6}),(0,wo.jsx)(_i,{exact:!0,path:"/error",component:l6}),(0,wo.jsx)(_i,{exact:!0,path:"/config-server",component:V3}),(0,wo.jsx)(_i,{exact:!0,path:"/bootstrap",component:i6}),(0,wo.jsx)(_i,{path:"/",render:()=>(0,wo.jsx)(wi,{to:"/bootstrap"})})]})}),(0,wo.jsxs)(Mi,{children:[(0,wo.jsx)(_i,{exact:!0,path:"/config-server",component:null}),(0,wo.jsx)(_i,{path:"/",component:r6})]}),(0,wo.jsx)(c6,{})]}),(0,wo.jsx)(n6,{history:s})]}):null}));let f6={border:0,fontSize:15,padding:"10px 13px"};function p6(){const e=xe((e=>e.prefs.local&&e.prefs.local.hideMobileMessage||!0));let[t,n]=(0,h.useState)(Ef()&&!e&&!document.cookie.match(/hideMobileMessage=true/)),[r,o]=(0,h.useState)(!1),i=ge();return t?(0,wo.jsxs)(Ll,{style:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:go.n1,color:"white",padding:10,margin:10,borderRadius:6,zIndex:1e4,fontSize:15,...mo.shadowLarge},children:[(0,wo.jsxs)(ql,{style:{lineHeight:"1.5em"},children:[(0,wo.jsx)("strong",{children:"Actual features are limited on small screens."}),(0,wo.jsx)("br",{}),(0,wo.jsx)("span",{children:"While we work to improve this experience, you may find the full Actual feature set on devices with larger screens."})]}),(0,wo.jsxs)(Ll,{style:{gap:16,marginTop:20,justifyContent:"center"},children:[(0,wo.jsx)(zl,{style:f6,onClick:function(){if(n(!1),r)i(In({hideMobileMessage:!0}));else{let e=new Date;e.setTime(e.getTime()+3e5),document.cookie="hideMobileMessage=true;path=/;expires="+e.toGMTString()}},children:"Try it anyway"}),(0,wo.jsxs)(Ll,{style:{alignItems:"center",flexDirection:"row",justifyContent:"flex-end"},children:[(0,wo.jsx)(tu,{id:"dont_remind_me",checked:r,onChange:()=>{o(!r)}}),(0,wo.jsx)("label",{htmlFor:"dont_remind_me",style:{userSelect:"none"},children:"Don\u2019t remind me again"})]})]})]}):null}var h6=e=>(0,wo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,wo.jsx)("path",{d:"M10 8.586 2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z",fill:"currentColor"})});var y6=de((e=>({updateInfo:e.app.updateInfo,showUpdateNotification:e.app.showUpdateNotification})),(t=>Q(e,t)))((function(e){let{updateInfo:t,showUpdateNotification:n,updateApp:r,setAppState:o}=e;if(t&&n){let e=t.releaseNotes;return(0,wo.jsxs)(Ll,{style:{position:"absolute",bottom:0,right:0,margin:"15px 17px",backgroundColor:go.p6,color:"white",padding:"7px 10px",borderRadius:4,zIndex:1e4,maxWidth:450},children:[(0,wo.jsxs)(Ll,{style:{flexDirection:"row",alignItems:"center"},children:[(0,wo.jsx)(Ll,{style:{marginRight:10,fontWeight:700},children:(0,wo.jsxs)(ql,{children:["App updated to ",t.version]})}),(0,wo.jsx)(Ll,{style:{flex:1}}),(0,wo.jsx)(Ll,{style:{marginTop:-1},children:(0,wo.jsxs)(ql,{children:[(0,wo.jsx)(Is,{onClick:r,style:{color:"white",textDecoration:"underline"},children:"Restart"})," ","(",(0,wo.jsx)(Is,{style:{color:"white",textDecoration:"underline"},onClick:()=>window.Actual.openURLInBrowser("https://actualbudget.github.io/docs/Release-Notes/"),children:"notes"}),")",(0,wo.jsx)(zl,{bare:!0,style:{display:"inline",padding:"1px 7px 2px 7px"},onClick:()=>function(e){e({updateInfo:null,showUpdateNotification:!1})}(o),children:(0,wo.jsx)(h6,{width:9,style:{color:"white"}})})]})})]}),e&&(0,wo.jsx)(Ll,{style:{marginTop:10,fontWeight:500},children:e})]})}return null}));class g6 extends h.Component{constructor(){super(...arguments),this.state={fatalError:null,initializing:!0,hiddenScrollbars:xo()}}async init(){const e=await n.g.Actual.getServerSocket();try{await async function(e){return new Promise(((t,n)=>Ve(e,t,n)))}(e)}catch(Fa){if("app-init-failure"===Fa.type)return void this.setState({initializing:!1,fatalError:Fa});throw Fa}await this.props.loadGlobalPrefs();const t=await qe("get-last-opened-backup");t&&(await this.props.loadBudget(t),qe("get-remote-files").then((e=>{if(e){let t=e.find((e=>e.fileId===this.props.cloudFileId));t&&t.deleted&&this.props.closeBudget()}})))}async componentDidMount(){await Promise.all([so(),this.init()]),this.setState({initializing:!1});let e=()=>{this.state.hiddenScrollbars!==xo()&&this.setState({hiddenScrollbars:xo()})};window.addEventListener("focus",e),this.cleanup=()=>window.removeEventListener("focus",e)}componentDidCatch(e){this.setState({fatalError:e})}componentDidUpdate(e){this.props.budgetId!==e.budgetId&&n.g.Actual.updateAppMenu(!!this.props.budgetId)}render(){const{budgetId:e,loadingText:t}=this.props,{fatalError:n,initializing:r,hiddenScrollbars:o}=this.state;return(0,wo.jsxs)("div",{...(0,lo.iv)([{height:"100%",backgroundColor:"#E8ECF0",overflow:"hidden"},mo.lightScrollbar]),children:[n?(0,wo.jsxs)(h.Fragment,{children:[(0,wo.jsx)(Xs,{}),(0,wo.jsx)(ru,{error:n,buttonText:"Restart app"})]}):r?(0,wo.jsx)(Xs,{initializing:r,loadingText:t}):e?(0,wo.jsx)(E3,{}):(0,wo.jsxs)(wo.Fragment,{children:[(0,wo.jsx)(Xs,{initializing:r,loadingText:t}),(0,wo.jsx)(d6,{isLoading:null!=t})]}),(0,wo.jsx)(y6,{}),(0,wo.jsx)(p6,{})]},o?"hidden-scrollbars":"scrollbars")}}var m6=de((e=>({budgetId:e.prefs.local&&e.prefs.local.id,cloudFileId:e.prefs.local&&e.prefs.local.cloudFileId,loadingText:e.app.loadingText})),e)(g6);n(1803);const v6=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"===typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if("undefined"===typeof n(void 0,{type:V.INIT}))throw new Error(H(12));if("undefined"===typeof n(void 0,{type:V.PROBE_UNKNOWN_ACTION()}))throw new Error(H(13))}))}(n)}catch(Fa){i=Fa}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},l=0;l<a.length;l++){var s=a[l],u=n[s],c=e[s],d=u(c,t);if("undefined"===typeof d){t&&t.type;throw new Error(H(14))}o[s]=d,r=r||d!==c}return(r=r||a.length!==Object.keys(e).length)?o:e}}(ao);const b6=G((function(e,t){return t.type===gt&&(e={budgets:e.budgets,user:e.user,prefs:{local:null,global:e.prefs.global},app:{...br,updateInfo:e.updateInfo,showUpdateNotification:e.showUpdateNotification,managerHasInitialized:e.app.managerHasInitialized,loadingText:e.app.loadingText}}),v6(e,t)}),void 0,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(H(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=X.apply(void 0,i)(n.dispatch),W(W({},n),{},{dispatch:r})}}}(Ce)),x6=Q(e,b6.dispatch);!function(e,t){n.g.Actual.onEventFromMain("update-downloaded",((t,n)=>{e.setAppState({updateInfo:n})})),n.g.Actual.onEventFromMain("update-error",(e=>{})),Ye("server-error",(t=>{e.addGenericErrorNotification()})),Ye("update-loading-status",(t=>{if("updating"===t)e.updateStatusText("Updating...")})),Ye("orphaned-payees",(t=>{let{orphanedIds:n,updatedPayeeIds:r}=t;e.pushModal("merge-unused-payees",{payeeIds:n,targetPayeeId:r[0]})})),Ye("schedules-offline",(e=>{let{payees:t}=e,n=window.__history;n&&n.push("/schedule/posts-offline-notification",{locationPtr:n.location,payees:t})})),Ye("sync-event",(async n=>{let{type:r,tables:o}=n,i=t.getState().prefs.local;i&&i.id&&"applied"===r&&(o.includes("payees")||o.includes("payee_mapping"))&&e.getPayees()})),Ye("sync-event",(async t=>{let{type:n}=t;"unauthorized"===n&&e.addNotification({type:"warning",message:"Unable to authenticate with server",sticky:!0,id:"auth-issue"})})),function(e,t){let n=!1;Ye("sync-event",(r=>{let{type:o,subtype:i,meta:a,tables:l}=r,s=t.getState().prefs.local;if(s&&s.id)if("success"===o)n&&(n=!1,e.addNotification({title:"Syncing has been fixed!",message:"Happy budgeting!",type:"message"})),l.includes("prefs")&&e.loadPrefs(),(l.includes("categories")||l.includes("category_groups")||l.includes("category_mapping"))&&e.getCategories(),(l.includes("payees")||l.includes("payee_mapping"))&&e.getPayees(),l.includes("accounts")&&e.getAccounts();else if("error"===o){let o=null,l="[Learn more](https://actualbudget.github.io/docs/Getting-Started/sync#debugging-sync-issues)";const s="https://github.com/actualbudget/actual/issues/new?assignees=&labels=bug%2Cneeds+triage&template=bug-report.yml&title=%5BBug%5D%3A+";switch(i){case"out-of-sync":o=n?{title:"Your data is still out of sync",message:"We were unable to repair your sync state, sorry! You need to reset your sync state. "+l,sticky:!0,id:"reset-sync",button:{title:"Reset sync",action:e.resetSync}}:{title:"Your data is out of sync",message:"There was a problem syncing your data. We can try to repair your sync state to fix it. "+l,type:"warning",sticky:!0,id:"repair-sync",button:{title:"Repair",action:async()=>{n=!0,await qe("sync-repair"),e.sync()}}};break;case"file-old-version":o={title:"Actual has updated the syncing format",message:"This happens rarely (if ever again). The internal syncing format has changed and you need to reset sync. This will upload data from this device and revert all other devices. [Learn more about what this means](https://actualbudget.github.io/docs/Getting-Started/sync#what-does-resetting-sync-mean).\n\nOld encryption keys are not migrated. If using encryption, [reset encryption here](#makeKey).",messageActions:{makeKey:()=>e.pushModal("create-encryption-key")},sticky:!0,id:"old-file",button:{title:"Reset sync",action:e.resetSync}};break;case"file-key-mismatch":o={title:"Your encryption key need to be reset",message:"Something went wrong when registering your encryption key id. You need to recreate your key. "+l,sticky:!0,id:"invalid-key-state",button:{title:"Reset key",action:()=>e.pushModal("create-encryption-key")}};break;case"file-not-found":o={title:"This file is not a cloud file",message:"You need to register it to take advantage of syncing which allows you to use it across devices and never worry about losing your data. "+l,type:"warning",sticky:!0,id:"register-file",button:{title:"Register",action:async()=>{await e.uploadBudget(),e.sync(),e.loadPrefs()}}};break;case"file-needs-upload":o={title:"File needs upload",message:"Something went wrong when creating this cloud file. You need to upload this file to fix it. "+l,sticky:!0,id:"upload-file",button:{title:"Upload",action:e.resetSync}};break;case"file-has-reset":case"file-has-new-key":let{cloudFileId:i}=t.getState().prefs.local;o={title:"Syncing has been reset on this cloud file",message:"You need to revert it to continue syncing. Any unsynced data will be lost. If you like, you can instead [upload this file](#upload) to be the latest version. "+l,messageActions:{upload:e.resetSync},sticky:!0,id:"needs-revert",button:{title:"Revert",action:()=>e.closeAndDownloadBudget(i)}};break;case"encrypt-failure":case"decrypt-failure":o=a.isMissingKey?{title:"Missing encryption key",message:"Unable to encrypt your data because you are missing the key. Create your key to sync your data.",sticky:!0,id:"encrypt-failure-missing",button:{title:"Create key",action:()=>e.pushModal("fix-encryption-key",{onSuccess:()=>e.sync()})}}:{message:"Unable to encrypt your data. You have the correct key so this is likely an internal failure. To fix this, reset your sync data with a new key.",sticky:!0,id:"encrypt-failure",button:{title:"Reset key",action:()=>e.pushModal("create-encryption-key",{onSuccess:()=>e.sync()})}};break;case"invalid-schema":console.trace("invalid-schema",a),o={title:"Update required",message:"We couldn\u2019t apply changes from the server. This probably means you need to update the app to support the latest database.",type:"warning"};break;case"apply-failure":console.trace("apply-failure",a),o={message:`We couldn\u2019t apply that change to the database. Please report this as a bug by [opening a Github issue](${s}).`};break;case"beta-version":case"network":break;default:console.trace("unkown error",r),o={message:`We had problems syncing your changes. Please report this as a bug by [opening a Github issue](${s}).`}}o&&e.addNotification({type:"error",...o})}}))}(e,t),Ye("undo-event",(n=>{let{tables:r,undoTag:o}=n,i=[];(r.includes("categories")||r.includes("category_groups")||r.includes("category_mapping"))&&i.push(e.getCategories()),r.includes("accounts")&&i.push(e.getAccounts());let a=Fe(o);a&&Promise.all(i).then((()=>{if(e.setLastUndoState(n),a.openModal){let{modalStack:n}=t.getState().modals;0!==n.length&&n[n.length-1].name===a.openModal||e.replaceModal(a.openModal)}else if(e.closeModal(),window.location.href!==a.url)return window.location.href=a.url,!0}))})),Ye("fallback-write-error",(()=>{e.addNotification({type:"error",title:"Unable to save changes",sticky:!0,message:"This browser only supports using the app in one tab at a time, and another tab has opened the app. No changes will be saved from this tab; please close it and continue working in the other one."})})),Ye("start-load",(()=>{e.closeBudgetUI(),e.setAppState({loadingText:""})})),Ye("finish-load",(()=>{e.closeModal(),e.setAppState({loadingText:null}),e.loadPrefs()})),Ye("start-import",(()=>{e.closeBudgetUI(),e.setAppState({loadingText:"Importing..."})})),Ye("finish-import",(()=>{e.closeModal(),e.setAppState({loadingText:null}),e.loadPrefs()})),Ye("show-budgets",(()=>{e.closeBudgetUI(),e.setAppState({loadingText:null})}))}(x6,b6),window.__actionsForMenu=x6,window.$send=qe,window.$query=pr,window.$q=fr;const w6=document.getElementById("root");(0,je.s)(w6).render((0,wo.jsx)(w,{store:b6,children:(0,wo.jsx)(Kx,{children:(0,wo.jsx)(m6,{})})}))}()}();
|
|
3
|
-
//# sourceMappingURL=main.8c52ae96.js.map
|