@actual-app/web 23.4.2 → 23.5.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 +3 -3
- package/build/data/migrations/1682974838138_remove_payee_rules.sql +5 -0
- package/build/data-file-index.txt +1 -0
- package/build/index.html +1 -1
- package/build/kcab/kcab.worker.e2ee9d65fbc7d1214a04.js +32 -0
- package/build/kcab/kcab.worker.e2ee9d65fbc7d1214a04.js.map +1 -0
- package/build/kcab/{xfo.kcab.worker.f69af9ddb3faa7a57f53.js → xfo.kcab.worker.e2ee9d65fbc7d1214a04.js} +1 -1
- package/build/static/js/main.8c52ae96.js +3 -0
- package/build/static/js/{main.9c657c78.js.LICENSE.txt → main.8c52ae96.js.LICENSE.txt} +9 -10
- package/build/static/js/main.8c52ae96.js.map +1 -0
- package/package.json +3 -4
- package/build/kcab/kcab.worker.f69af9ddb3faa7a57f53.js +0 -31
- package/build/kcab/kcab.worker.f69af9ddb3faa7a57f53.js.map +0 -1
- package/build/static/js/main.9c657c78.js +0 -3
- package/build/static/js/main.9c657c78.js.map +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see main.9c657c78.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 U=new Uint32Array(f),z=0,W=0,H=-1/0;W<f;W++){var K=this._ids[W];this._dists[K]>H&&(U[z++]=K,H=this._dists[K])}return this.hull=U.subarray(0,z),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))}},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-")}},9071:function(e){"use strict";var t=function(e){};e.exports=function(e,n,r,o,i,a,l,s){if(t(n),!e){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,o,i,a,l,s],d=0;(u=new Error(n.replace(/%s/g,(function(){return c[d++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},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 U(e){var t={label:[]};return B(t,{src:e}),I({id:w(t),style:t,label:b?t.label.join("."):"",type:"css"})}var z={};Object.defineProperty(z,"toString",{enumerable:!1,value:function(){return"css-nil"}});var W="undefined"!==typeof WeakMap?[z,new WeakMap,new WeakMap,new WeakMap]:[z],H=!1;var K,$="undefined"!==typeof WeakMap?(K=U,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}):U;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):z}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(2341),o=n(9071),i=n(5092);e.exports=function(){function e(e,t,n,r,a,l){l!==i&&o(!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=r,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 U(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 z(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=U(e.type,!1);case 11:return e=U(e.type.render,!1);case 1:return e=U(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,Ue={onError:function(e){Ne=!0,Le=e}};function ze(e,t,n,r,o,i,a,l,s){Ne=!1,Le=null,Re.apply(Ue,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 Ut(){_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 zt(e,t){e.blockedOn===t&&(e.blockedOn=null,_t||(_t=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Ut)))}function Wt(e){function t(t){return zt(t,e)}if(0<Ot.length){zt(Ot[0],e);for(var n=1;n<Ot.length;n++){var r=Ot[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&zt(Et,e),null!==Tt&&zt(Tt,e),null!==Pt&&zt(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 Un(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 zn(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(ze.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 Ur(e,t,n){var r=0;t&&(r|=4),Hr(n,e,r,t)}var zr="_reactListening"+Math.random().toString(36).slice(2);function Wr(e){if(!e[zr]){e[zr]=!0,a.forEach((function(t){"selectionchange"!==t&&(Nr.has(t)||Ur(t,!1,e),Ur(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[zr]||(t[zr]=!0,Ur("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?Un(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=zn(n))&&(b.data=v))),(v=Nn?function(e,t){switch(e){case"compositionend":return zn(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&&Un(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,Uo=!1,zo=!1;function Wo(e){null===Bo?Bo=[e]:Bo.push(e)}function Ho(){if(!zo&&null!==Bo){zo=!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,Uo=!1}catch(o){throw null!==Bo&&(Bo=Bo.slice(e+1)),qe(Je,Ho),o}finally{bt=t,zo=!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 Ui=(new r.Component).refs;function zi(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=Ui,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)&&(zi(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===Ui&&(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 Ua(){return Oa().memoizedState}function za(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 za(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,za(4194308,4,qa.bind(null,t,e),n)},useLayoutEffect:function(e,t){return za(4194308,4,e,t)},useInsertionEffect:function(e,t){return za(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:Ua,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:Ua,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+=z(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&&(zi(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&&(zi(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,Ul(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 Ul(e,t,l,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var s=r.dgst;return r=s,Ul(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(),Ul(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 Ul(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 zl(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&&zl(e,n,t);else if(19===e.tag)zl(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,Us=null,zs=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,Uo&&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){Uo=!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,zs,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,zs,Ks),t);break}ju(e,zs,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,zs,Ks),r);break}ju(e,zs,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=Us;return e.current.memoizedState.isDehydrated&&(pu(e,t).flags|=256),2!==(e=mu(e,t))&&(t=zs,zs=n,null!==t&&lu(t)),e}function lu(e){null===zs?zs=e:zs.push.apply(zs,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,zs,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,Uo&&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,zs=Us=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===Us?Us=[a]:Us.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 Uu(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 zu(e,t,n,r,o,i,a,l,s){return e=new Uu(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=zu(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=zu(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=zu(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(1568)),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(1568)),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},4617:function(e,t,n){"use strict";var r=n(8476);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}},1568:function(e,t,n){e.exports=n(4617)()},8476:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6876:function(e,t,n){"use strict";var r=n(6235);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}},225:function(e,t,n){e.exports=n(6876)()},6235:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},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)}},8076:function(e,t,n){"use strict";var r=n(8827);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}},311:function(e,t,n){e.exports=n(8076)()},8827:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},773:function(e,t,n){"use strict";var r=n(4104);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}},5769:function(e,t,n){e.exports=n(773)()},4104:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},187:function(e,t,n){"use strict";var r=n(4457);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}},7667:function(e,t,n){e.exports=n(187)()},4457:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6981:function(e,t,n){"use strict";var r=n(1486);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}},3064:function(e,t,n){e.exports=n(6981)()},1486:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7830:function(e,t,n){"use strict";var r=n(6835);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}},8522:function(e,t,n){e.exports=n(7830)()},6835:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7887:function(e,t,n){"use strict";var r=n(5834);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}},5143:function(e,t,n){e.exports=n(7887)()},5834:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8022:function(e,t,n){"use strict";var r=n(8482);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}},840:function(e,t,n){e.exports=n(8022)()},8482:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},193:function(e,t,n){"use strict";var r=n(2525);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}},811:function(e,t,n){e.exports=n(193)()},2525:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2555:function(e,t,n){"use strict";var r=n(898);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}},1513:function(e,t,n){e.exports=n(2555)()},898:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},623:function(e,t,n){"use strict";var r=n(452);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}},5545:function(e,t,n){e.exports=n(623)()},452:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7908:function(e,t,n){"use strict";var r=n(9738);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}},1543:function(e,t,n){e.exports=n(7908)()},9738:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},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 tr},closeBudget:function(){return Yn},closeBudgetUI:function(){return Qn},closeModal:function(){return zt},connectAccounts:function(){return kn},connectNordigenAccounts:function(){return Cn},createAccount:function(){return ln},createBudget:function(){return Zn},createCategory:function(){return qt},createGroup:function(){return Zt},createPayee:function(){return rn},debugCell:function(){return Dn},deleteBudget:function(){return Xn},deleteCategory:function(){return Gt},deleteGroup:function(){return en},downloadBudget:function(){return nr},focused:function(){return Hn},forceCloseAccount:function(){return dn},getAccounts:function(){return on},getBanks:function(){return Mn},getCategories:function(){return Vt},getPayees:function(){return tn},getUserData:function(){return ur},hideModals:function(){return Ft},importBudget:function(){return Jn},importTransactions:function(){return Tn},initiallyLoadPayees:function(){return nn},linkAccount:function(){return Sn},loadAllFiles:function(){return qn},loadBackup:function(){return rr},loadBudget:function(){return Gn},loadBudgets:function(){return $n},loadGlobalPrefs:function(){return Nn},loadPrefs:function(){return In},loadRemoteFiles:function(){return Vn},loggedIn:function(){return cr},makeBackup:function(){return or},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 Ut},pushModal:function(){return Nt},redo:function(){return mn},removeNotification:function(){return Kt},reopenAccount:function(){return cn},replaceModal:function(){return Lt},resetSync:function(){return ar},saveGlobalPrefs:function(){return Ln},savePrefs:function(){return Rn},setAccountsSyncing:function(){return vn},setAppState:function(){return Bn},setFailedAccounts:function(){return wn},setLastTransaction:function(){return On},setLastUndoState:function(){return zn},setUndoEnabled:function(){return yn},showModals:function(){return Bt},signOut:function(){return dr},sync:function(){return lr},syncAccounts:function(){return _n},syncAndDownload:function(){return sr},undo:function(){return gn},unlinkAccount:function(){return jn},unregister:function(){return ir},updateAccount:function(){return an},updateApp:function(){return Un},updateCategory:function(){return Yt},updateGroup:function(){return Jt},updateNewTransactions:function(){return Pn},updateStatusText:function(){return Kn},uploadBudget:function(){return er},uploadFile:function(){return Wn}});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 TM},BudgetTotalsMonth:function(){return AM},CategoryMonth:function(){return RM},ExpenseCategoryMonth:function(){return LM},ExpenseGroupMonth:function(){return NM},GroupMonth:function(){return DM},IncomeCategoryMonth:function(){return BM},IncomeGroupMonth:function(){return FM},IncomeHeaderMonth:function(){return MM}});var o={};n.r(o),n.d(o,{BudgetSummary:function(){return QM},BudgetTotalsMonth:function(){return eD},ExpenseCategoryMonth:function(){return rD},ExpenseGroupMonth:function(){return nD},IncomeCategoryMonth:function(){return iD},IncomeGroupMonth:function(){return oD},IncomeHeaderMonth:function(){return tD}});var i={};n.r(i),n.d(i,{scaleBand:function(){return nB},scaleDiverging:function(){return YH},scaleDivergingLog:function(){return QH},scaleDivergingPow:function(){return ZH},scaleDivergingSqrt:function(){return JH},scaleDivergingSymlog:function(){return XH},scaleIdentity:function(){return HU},scaleImplicit:function(){return eB},scaleLinear:function(){return WU},scaleLog:function(){return ZU},scaleOrdinal:function(){return tB},scalePoint:function(){return oB},scalePow:function(){return lz},scaleQuantile:function(){return bz},scaleQuantize:function(){return xz},scaleRadial:function(){return cz},scaleSequential:function(){return WH},scaleSequentialLog:function(){return HH},scaleSequentialPow:function(){return $H},scaleSequentialQuantile:function(){return qH},scaleSequentialSqrt:function(){return VH},scaleSequentialSymlog:function(){return KH},scaleSqrt:function(){return sz},scaleSymlog:function(){return nz},scaleThreshold:function(){return wz},scaleTime:function(){return FH},scaleUtc:function(){return BH},tickFormat:function(){return UU}});var a={};n.r(a),n.d(a,{easeBack:function(){return BY},easeBackIn:function(){return LY},easeBackInOut:function(){return BY},easeBackOut:function(){return FY},easeBounce:function(){return IY},easeBounceIn:function(){return DY},easeBounceInOut:function(){return RY},easeBounceOut:function(){return IY},easeCircle:function(){return jY},easeCircleIn:function(){return xY},easeCircleInOut:function(){return jY},easeCircleOut:function(){return wY},easeCubic:function(){return lY},easeCubicIn:function(){return iY},easeCubicInOut:function(){return lY},easeCubicOut:function(){return aY},easeElastic:function(){return WY},easeElasticIn:function(){return zY},easeElasticInOut:function(){return HY},easeElasticOut:function(){return WY},easeExp:function(){return bY},easeExpIn:function(){return mY},easeExpInOut:function(){return bY},easeExpOut:function(){return vY},easeLinear:function(){return tY},easePoly:function(){return cY},easePolyIn:function(){return sY},easePolyInOut:function(){return cY},easePolyOut:function(){return uY},easeQuad:function(){return oY},easeQuadIn:function(){return nY},easeQuadInOut:function(){return oY},easeQuadOut:function(){return rY},easeSin:function(){return yY},easeSinIn:function(){return pY},easeSinInOut:function(){return yY},easeSinOut:function(){return hY}});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 MJ},area:function(){return x0},areaRadial:function(){return T0},curveBasis:function(){return b1},curveBasisClosed:function(){return w1},curveBasisOpen:function(){return S1},curveBumpX:function(){return D0},curveBumpY:function(){return I0},curveBundle:function(){return C1},curveCardinal:function(){return E1},curveCardinalClosed:function(){return P1},curveCardinalOpen:function(){return M1},curveCatmullRom:function(){return R1},curveCatmullRomClosed:function(){return L1},curveCatmullRomOpen:function(){return B1},curveLinear:function(){return g0},curveLinearClosed:function(){return z1},curveMonotoneX:function(){return Y1},curveMonotoneY:function(){return Q1},curveNatural:function(){return J1},curveStep:function(){return t5},curveStepAfter:function(){return r5},curveStepBefore:function(){return n5},line:function(){return b0},lineRadial:function(){return E0},link:function(){return F0},linkHorizontal:function(){return B0},linkRadial:function(){return z0},linkVertical:function(){return U0},pie:function(){return S0},pointRadial:function(){return P0},radialArea:function(){return T0},radialLine:function(){return E0},stack:function(){return s5},stackOffsetDiverging:function(){return c5},stackOffsetExpand:function(){return u5},stackOffsetNone:function(){return o5},stackOffsetSilhouette:function(){return d5},stackOffsetWiggle:function(){return f5},stackOrderAppearance:function(){return p5},stackOrderAscending:function(){return y5},stackOrderDescending:function(){return m5},stackOrderInsideOut:function(){return v5},stackOrderNone:function(){return i5},stackOrderReverse:function(){return b5},symbol:function(){return y1},symbolAsterisk:function(){return H0},symbolCircle:function(){return K0},symbolCross:function(){return $0},symbolDiamond:function(){return G0},symbolDiamond2:function(){return Y0},symbolPlus:function(){return Q0},symbolSquare:function(){return X0},symbolSquare2:function(){return Z0},symbolStar:function(){return n1},symbolTimes:function(){return f1},symbolTriangle:function(){return o1},symbolTriangle2:function(){return a1},symbolWye:function(){return d1},symbolX:function(){return f1},symbols:function(){return p1},symbolsFill:function(){return p1},symbolsStroke:function(){return h1}});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.4.2";d=new Worker(c),u(d),window.SharedArrayBuffer&&localStorage.removeItem("SharedArrayBufferOverride"),d.postMessage({type:"init",version:p,isDev:f,publicUrl:"",hash:"f69af9ddb3faa7a57f53",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(Wa){n=Wa,d=Wa}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 U=(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},U):U}),[s,U,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 U(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 z(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?z(Object(n),!0).forEach((function(t){U(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(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},Ue=function(e){Ie=Ie.filter((t=>t.id!==e))};let ze=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;ze.delete(t)}else if("reply"===e.type){const{id:t,result:n,mutated:r,undoTag:o}=e,i=ze.get(t);i&&(ze.delete(t),r||Ue(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=>{ze.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 Ut(){return{type:kt}}function zt(){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(){return async e=>{e({type:lt,banks:await qe("banks")})}}function Dn(e,t){return{type:vt,sheet:e,name:t}}function In(){return async(e,t)=>{let n=await qe("load-prefs"),r=t().prefs.local;return n&&n.id&&!r&&e(zt()),e({type:ut,prefs:n,globalPrefs:await qe("load-global-prefs")}),n}}function Rn(e){return async t=>{await qe("save-prefs",e),t({type:ct,prefs:e})}}function Nn(){return async(e,t)=>{let n=await qe("load-global-prefs");return e({type:ut,prefs:t().prefs.local,globalPrefs:n}),n}}function Ln(e){return async t=>{await qe("save-global-prefs",e),t({type:dt,globalPrefs:e})}}function Fn(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 Bn(e){return{type:mt,state:e}}function Un(){return async e=>{n.g.Actual.applyAppUpdate(),e(Bn({updateInfo:null}))}}function zn(e){return{type:Et,undoState:e}}function Wn(e,t){return n=>qe("upload-file-web",{filename:e,contents:t})}function Hn(){return e=>qe("app-focused")}function Kn(e){return(t,n)=>{const{loadingText:r}=n().app;null!=r&&t(Bn({loadingText:e}))}}function $n(){return async e=>{const t=await qe("get-budgets");e({type:ft,budgets:t})}}function Vn(){return async e=>{const t=await qe("get-remote-files");e({type:pt,files:t})}}function qn(){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 Gn(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(Bn({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(Bn({loadingText:null}))}r(zt()),await r(In());const a=o().prefs.local;r(Bn({loadingText:null})),r(Bn({maxMonths:a.maxMonths}))}}function Yn(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&(e({type:gt}),e(Bn({loadingText:"Closing..."})),await qe("close-budget"),e(Bn({loadingText:null})),localStorage.getItem("SharedArrayBufferOverride")&&window.location.reload())}}function Qn(){return async(e,t)=>{let n=t().prefs.local;n&&n.id&&e({type:gt})}}function Xn(e,t){return async n=>{await qe("delete-budget",{id:e,cloudFileId:t}),await n(qn())}}function Zn(){let{testMode:e,demoMode:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(n,r)=>{n(Bn({loadingText:e||t?"Making demo...":""})),t?await qe("create-demo-budget"):await qe("create-budget",{testMode:e}),n(zt()),await n(qn()),await n(In()),n(Bn({loadingText:null}))}}function Jn(e,t){return async(n,r)=>{const{error:o}=await qe("import-budget",{filepath:e,type:t});if(o)throw new Error(o);n(zt()),await n(In()),window.__history.push("/budget")}}function er(e){return async t=>{let{error:n}=await qe("upload-budget",{id:e});return n?{error:n}:(await t(qn()),{})}}function tr(e){return async t=>{t(Bn({loadingText:"Downloading..."})),await t(Yn()),t(nr(e,{replace:!0}))}}function nr(e){let{replace:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async n=>{n(Bn({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(nr(e,{replace:t}))}};n(Nt("fix-encryption-key",r)),n(Bn({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(nr(e,{replace:!0}));n(Bn({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(Nn()),n(qn()),n(Gn(r))]),n(Bn({loadingText:null})),r}}function rr(e,t){return async(n,r)=>{const o=r().prefs.local;o&&o.id&&await n(Yn()),await qe("backup-load",{id:e,backupId:t}),n(Gn(e))}}function or(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&await qe("backup-make",{id:n.id})}}function ir(){return async e=>{const t=await qe("unregister");e({type:st,profile:t})}}function ar(){return async(e,t)=>{let{error:n}=await qe("sync-reset");n?(alert(Fn(n)),"encrypt-failure"===n.reason&&n.meta.isMissingKey||"file-has-new-key"===n.reason?e(Nt("fix-encryption-key",{onSuccess:()=>{e(ar())}})):"encrypt-failure"===n.reason&&e(Nt("create-encryption-key",{recreate:!0}))):(await e(lr()),await e(In()))}}function lr(){return async(e,t)=>{const n=t().prefs.local;if(n&&n.id){let{error:e}=await qe("sync");return{error:e}}}}function sr(e){return async(t,n)=>{let r=await t(lr());if(r.error)return{error:r.error};let o=await t(_n(e));if(o){let e=await t(lr());return!e.error||{error:e.error}}return{hasUpdated:o||r.updated}}}function ur(){return async e=>{const t=await qe("subscribe-get-user");return e({type:Ot,data:t}),t}}function cr(){return async e=>{await e(ur()),e(qn())}}function dr(){return async e=>{await qe("subscribe-sign-out"),e(ur()),e(Nn()),e(Yn()),e({type:Dt})}}class fr{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 fr({...this.state,filterExpressions:[...this.state.filterExpressions,e]})}unfilter(e){let t=new Set(e);return new fr({...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 fr({...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 fr({...this.state,groupExpressions:[...this.state.groupExpressions,...e]})}orderBy(e){return Array.isArray(e)||(e=[e]),new fr({...this.state,orderExpressions:[...this.state.orderExpressions,...e]})}limit(e){return new fr({...this.state,limit:e})}offset(e){return new fr({...this.state,offset:e})}raw(){return new fr({...this.state,rawMode:!0})}withDead(){return new fr({...this.state,withDead:!0})}withoutValidatedRefs(){return new fr({...this.state,validateRefs:!1})}options(e){return new fr({...this.state,tableOptions:e})}serialize(){return this.state}}function pr(e){return new fr({table:e})}var hr=pr;async function yr(e){return qe("query",e.serialize())}function gr(e,t,n){let r=new vr(e,t,n);return r.run(),r}function mr(e,t,n){let r=new br(e,t,n);return r.run(),r}class vr{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};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((()=>yr(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 br extends vr{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(e,t,n),this._fetchCount=()=>yr(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(),yr(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 yr(this.query.filter({id:e}).select(r));if(0===i.data.length)return;let a=i.data[0];i=await yr(this.query.filter({[r]:{["asc"===o?"$lte":"$gte"]:a[r]}}));let l=i.data;return i=await yr(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 yr(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 xr={banks:[],failedAccounts:new Map,accountsSyncing:null};const wr={loadingText:null,updateInfo:null,showUpdateNotification:!0,managerHasInitialized:!1,lastUndoState:{current:null},lastSplitState:{current:null}};function jr(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 Sr={budgets:[],availableImports:[],remoteFiles:null,allFiles:null};const kr={selectedCell:null};var Cr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kr,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 _r={modalStack:[],isHidden:!1};var Or=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 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 _r}return e};const Er={notifications:[]};function Tr(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 Pr(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 Ar(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 Mr(e,t){let n=Ar(e),r=Ar(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=Tr(t,e);n&&i.push(n)}else o.push(e)})),{added:o,updated:i,deleted:a}}function Dr(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[r.id]=r}return t}function Ir(e){return e[0].toUpperCase()+e.slice(1)}let Rr=[{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"}],Nr={value:null,formatter:null,regex:null};function Lr(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="."}Nr={value:o,separator:r,formatter:new Intl.NumberFormat(t,{minimumFractionDigits:i?0:2,maximumFractionDigits:i?0:2}),regex:n}}function Fr(){return Nr}Lr({format:"comma-dot",hideFraction:!1});const Br=2**51-1,Ur=-Br;function zr(e){if(!Number.isInteger(e))throw new Error("safeNumber: number is not an integer: "+JSON.stringify(e));if(e>Br||e<Ur)throw new Error("safeNumber: can\u2019t safely perform arithmetic with number: "+e);return e}function Wr(e){return Nr.formatter.format(zr(e)/100)}function Hr(e){return Nr.formatter.format(e)}function Kr(e){let t=parseFloat(e.replace(Nr.regex,"").replace(Nr.separator,"."));return isNaN(t)?null:t}function $r(e){let t=Kr(e);return null==t?null:Vr(t)}function Vr(e){return Math.round(100*e)}function qr(e){return parseFloat((zr(e)/100).toFixed(2))}const Gr={local:null,global:null};const Yr={};var Qr=function(e,t){return e===t};var Xr=function(e,t){var n;void 0===t&&(t=Qr);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 Zr={newTransactions:[],matchedTransactions:[],lastTransaction:null,updatedAccounts:[],accounts:[],categories:{grouped:[],list:[]},payees:[],earliestTransaction:null};const Jr=Xr((e=>Dr(e))),eo=Xr((e=>Dr(e))),to=Xr((e=>{let t={};return e.forEach((e=>{e.categories.forEach((e=>{t[e.id]=e}))})),t})),no=Xr(((e,t)=>{let n=Jr(t);return e.filter((e=>{if(e.transfer_acct){let t=n[e.transfer_acct];return null!=t&&!t.closed}return!0}))})),ro={stage:null,fromYNAB:!1};const oo={data:null};const io={app: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 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]:Zr,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]:xr,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:Cr,profile:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yr,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]:Gr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ut:return t.prefs&&Lr({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)&&Lr({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:Or,notifications:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Er,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]:Sr,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ft:return{...e,budgets:t.budgets,allFiles:jr(t.budgets,e.remoteFiles)};case pt:return{...e,remoteFiles:t.files,allFiles:jr(e.budgets,t.files)};case ht:return{...e,budgets:t.budgetes,remoteFiles:t.remoteFiles,allFiles:jr(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]:ro,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]:oo,t=arguments.length>1?arguments[1]:void 0;return t.type===Ot?{...e,data:t.data}:e}};var ao,lo=io,so=n(6634);async function uo(){if("ResizeObserver"in window===!1){const e=await n.e(145).then(n.bind(n,9145));window.ResizeObserver=e.ResizeObserver}}const co=navigator.platform&&"win32"===navigator.platform.toLowerCase(),fo=navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0,po=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent),co?"windows":fo?"mac":"linux"),ho="web",yo=!(null===(ao=window.Actual)||void 0===ao||!ao.IS_FAKE_WEB);var go={breakpoint_xs:"350px",breakpoint_narrow:"512px",breakpoint_medium:"768px",breakpoint_wide:"1024px"};const mo={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"};mo.border=mo.n10,mo.hover="#fafafa",mo.selected=mo.b9,mo.resolve=(e,t)=>{if("border"===e)return mo["n"+(8+t)];throw new Error("Unknown color name: "+e)};const vo={veryLargeText:{fontSize:30,fontWeight:600},largeText:{fontSize:20,fontWeight:700,letterSpacing:.5},mediumText:{fontSize:15,fontWeight:500},smallText:{fontSize:13,[`@media (min-width: ${go.breakpoint_medium})`]:{}},verySmallText:{fontSize:13},page:{paddingTop:8,flex:1,[`@media (min-width: ${go.breakpoint_xs})`]:{minWidth:360,paddingTop:36},[`@media (min-width: ${go.breakpoint_medium})`]:{minWidth:500}},pageHeader:{fontSize:25,borderBottomWidth:5,borderColor:mo.purple2,borderStyle:"solid",display:"inline",flex:0,color:mo.grey4,marginTop:40,marginBottom:20,paddingBottom:5},pageContent:{paddingLeft:2,paddingRight:2,[`@media (min-width: ${go.breakpoint_medium})`]:{paddingLeft:20,paddingRight:20}},settingsPageContent:{padding:20,[`@media (min-width: ${go.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:mo.n9,elevation:0},headerTintColor:mo.n1,headerTitleStyle:{color:mo.n1,fontSize:15,fontWeight:600},headerBackTitle:null},text:{fontSize:16},textColor:mo.n1};let bo=!1;function xo(){vo.lightScrollbar=!bo&&{"& ::-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"}},vo.darkScrollbar=!bo&&{"& ::-webkit-scrollbar":{width:7,backgroundColor:"rgba(0, 0, 0, 0)"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"rgba(200, 200, 200, .5)"}},vo.scrollbarWidth=bo?0:13}if("web"===ho){function x6(){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}bo=x6(),xo(),window.addEventListener("focus",(()=>{bo=x6(),xo()}))}const wo=()=>bo;var jo=n(8993);var So=e=>{let{color:t="#fff"}=e,[n]=(0,h.useState)("gradient-"+Math.random());return(0,jo.jsxs)("svg",{...e,viewBox:"0 0 38 38",style:{...e.style},children:[(0,jo.jsx)("defs",{children:(0,jo.jsxs)("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:n,children:[(0,jo.jsx)("stop",{stopColor:t,stopOpacity:0,offset:"0%"}),(0,jo.jsx)("stop",{stopColor:t,stopOpacity:.631,offset:"63.146%"}),(0,jo.jsx)("stop",{stopColor:t,offset:"100%"})]})}),(0,jo.jsxs)("g",{transform:"translate(1 2)",fill:"none",fillRule:"evenodd",children:[(0,jo.jsx)("path",{d:"M36 18c0-9.94-8.06-18-18-18",stroke:"url(#"+n+")",strokeWidth:2,fill:"none"}),(0,jo.jsx)("circle",{fill:t,cx:36,cy:18,r:1})]})]})};const ko=so.iv.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(666deg)"}});var Co=function(e){return(0,jo.jsx)("span",{...(0,so.iv)({animationName:ko,animationDuration:"1.6s",animationTimingFunction:"cubic-bezier(0.17, 0.67, 0.83, 0.67)",animationIterationCount:"infinite",lineHeight:0}),children:(0,jo.jsx)(So,{...e})})};var _o=n.p+"static/media/bg.42987350d58d04897ed83a3ce50df2d5.svg";var Oo=function(e){let{selected:t}=e;return(0,jo.jsx)("div",{...(0,so.iv)({position:"absolute",top:0,bottom:0,left:0,right:0,background:`url(${_o}) no-repeat center center fixed`,backgroundSize:"100% 100%"})})};var Eo=function(e){return function(t){e.forEach((function(e){"function"===typeof e?e(t):null!=e&&(e.current=t)}))}},To=n(2942),Po=n.n(To);function Ao(e,t){return Ao=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ao(e,t)}function Mo(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ao(e,t)}function Do(e){return"/"===e.charAt(0)}function Io(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 Ro=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&Do(e),a=t&&Do(t),l=i||a;if(e&&Do(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?Io(o,c):".."===d?(Io(o,c),u++):u&&(Io(o,c),u--)}if(!l)for(;u--;u)o.unshift("..");!l||""===o[0]||o[0]&&Do(o[0])||o.unshift("");var f=o.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};function No(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var Lo=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=No(t),o=No(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},Fo=!0,Bo="Invariant failed";function Uo(e,t){if(!e){if(Fo)throw new Error(Bo);var n="function"===typeof t?t():t;throw new Error(n?Bo+": "+n:Bo)}}function zo(e){return"/"===e.charAt(0)?e:"/"+e}function Wo(e){return"/"===e.charAt(0)?e.substr(1):e}function Ho(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 Ko(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function $o(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 Vo(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(Wa){throw Wa instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):Wa}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=Ro(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function qo(){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 Go=!("undefined"===typeof window||!window.document||!window.document.createElement);function Yo(e,t){t(window.confirm(e))}var Qo="popstate",Xo="hashchange";function Zo(){try{return window.history.state||{}}catch(Wa){return{}}}function Jo(e){void 0===e&&(e={}),Go||Uo(!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?Yo:l,u=o.keyLength,c=void 0===u?6:u,d=e.basename?Ko(zo(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=Ho(i,d)),Vo(i,r,n)}function p(){return Math.random().toString(36).substr(2,c)}var h=qo();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(Zo()))}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(Zo()),w=[x.key];function S(e){return d+$o(e)}function k(e){t.go(e)}var C=0;function _(e){1===(C+=e)&&1===e?(window.addEventListener(Qo,g),r&&window.addEventListener(Xo,m)):0===C&&(window.removeEventListener(Qo,g),r&&window.removeEventListener(Xo,m))}var O=!1;var E={length:t.length,action:"POP",location:x,createHref:S,push:function(e,r){var o="PUSH",i=Vo(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=Vo(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 ei="hashchange",ti={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+Wo(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:Wo,decodePath:zo},slash:{encodePath:zo,decodePath:zo}};function ni(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function ri(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function oi(e){window.location.replace(ni(window.location.href)+"#"+e)}function ii(e){void 0===e&&{},Go||Uo(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,o=void 0===r?Yo:r,i=n.hashType,a=void 0===i?"slash":i,l=e.basename?Ko(zo(e.basename)):"",s=ti[a],u=s.encodePath,c=s.decodePath;function d(){var e=c(ri());return l&&Ho(e,l),Vo(e)}var f=qo();function p(e){j(_,e),_.length=t.length,f.notifyListeners(_.location,_.action)}var h=!1,y=null;function g(){var e=ri(),t=u(e);if(e!==t)oi(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===$o(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($o(t));-1===n&&0;var r=x.lastIndexOf($o(e));-1===r&&0;var o=n-r;o&&(!0,w(o))}(e)}))}}(n)}}var m=ri(),v=u(m);m!==v&&oi(v);var b=d(),x=[$o(b)];function w(e){t.go(e)}var S=0;function k(e){1===(S+=e)&&1===e?window.addEventListener(ei,g):0===S&&window.removeEventListener(ei,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")&&ni(window.location.href),n+"#"+u(l+$o(e))},push:function(e,t){var n="PUSH",r=Vo(e,void 0,void 0,_.location);f.confirmTransitionTo(r,n,o,(function(e){if(e){var t=$o(r),o=u(l+t);if(ri()!==o){t,function(e){window.location.hash=e}(o);var i=x.lastIndexOf($o(_.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=Vo(e,void 0,void 0,_.location);f.confirmTransitionTo(r,n,o,(function(e){if(e){var t=$o(r),o=u(l+t);ri()!==o&&(t,oi(o));var i=x.indexOf($o(_.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 ai(e,t,n){return Math.min(Math.max(e,t),n)}var li=n(225),si=n.n(li),ui=1073741823,ci="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:{};var di=h.createContext||function(e,t){var n,r,o="__create-react-context-"+function(){var e="__global_unique_id__";return ci[e]=(ci[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}Mo(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):ui,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]=si().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}Mo(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?ui: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?ui: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]=si().object,r),{Provider:i,Consumer:a}},fi=di,pi=n(6406),hi=n.n(pi),yi=function(e){var t=fi();return t.displayName=e,t},gi=yi("Router-History"),mi=function(e){var t=fi();return t.displayName=e,t},vi=mi("Router"),bi=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}Mo(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(vi.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},h.createElement(gi.Provider,{children:this.props.children||null,value:this.props.history}))},t}(h.Component);h.Component;var xi=function(e){function t(){return e.apply(this,arguments)||this}Mo(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 wi={},ji=1e4,Si=0;function ki(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(wi[e])return wi[e];var t=hi().compile(e);return Si<ji&&(wi[e]=t,Si++),t}(e)(t,{pretty:!0})}function Ci(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return h.createElement(vi.Consumer,null,(function(e){e||Uo(!1);var r=e.history,i=e.staticContext,a=o?r.push:r.replace,l=Vo(t?"string"===typeof n?ki(n,t.params):j({},n,{pathname:ki(n.pathname,t.params)}):n);return i?(a(l),null):h.createElement(xi,{onMount:function(){a(l)},onUpdate:function(e,t){var n=Vo(t.to);(function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&Lo(e.state,t.state)})(n,j({},l,{key:n.key}))||a(l)},to:n})}))}var _i={},Oi=1e4,Ei=0;function Ti(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=_i[n]||(_i[n]={});if(r[e])return r[e];var o=[],i={regexp:hi()(e,o,t),keys:o};return Ei<Oi&&(r[e]=i,Ei++),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 Pi=function(e){function t(){return e.apply(this,arguments)||this}return Mo(t,e),t.prototype.render=function(){var e=this;return h.createElement(vi.Consumer,null,(function(t){t||Uo(!1);var n=e.props.location||t.location,r=j({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Ti(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(vi.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 Ai(e){return"/"===e.charAt(0)?e:"/"+e}function Mi(e,t){if(!e)return t;var n=Ai(e);return 0!==t.pathname.indexOf(n)?t:j({},t,{pathname:t.pathname.substr(n.length)})}function Di(e){return"string"===typeof e?e:$o(e)}function Ii(e){return function(){Uo(!1)}}function Ri(){}h.Component;var Ni=function(e){function t(){return e.apply(this,arguments)||this}return Mo(t,e),t.prototype.render=function(){var e=this;return h.createElement(vi.Consumer,null,(function(t){t||Uo(!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?Ti(o.pathname,j({},e.props,{path:i})):t.match}})),r?h.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(h.Component);function Li(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=S(t,["wrappedComponentRef"]);return h.createElement(vi.Consumer,null,(function(t){return t||Uo(!1),h.createElement(e,j({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,C()(n,e)}var Fi=h.useContext;function Bi(){return Fi(gi)}function Ui(){return Fi(vi).location}function zi(){var e=Fi(vi).match;return e?e.params:{}}h.Component;h.Component;var Wi=function(e,t){return"function"===typeof e?e(t):e},Hi=function(e,t){return"string"===typeof e?Vo(e,null,null,t):e},Ki=function(e){return e},$i=h.forwardRef;"undefined"===typeof $i&&($i=Ki);var Vi=$i((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=Ki!==$i&&t||n,h.createElement("a",l)}));var qi=$i((function(e,t){var n=e.component,r=void 0===n?Vi:n,o=e.replace,i=e.to,a=e.innerRef,l=S(e,["component","replace","to","innerRef"]);return h.createElement(vi.Consumer,null,(function(e){e||Uo(!1);var n=e.history,s=Hi(Wi(i,e.location),e.location),u=s?n.createHref(s):"",c=j({},l,{href:u,navigate:function(){var t=Wi(i,e.location);(o?n.replace:n.push)(t)}});return Ki!==$i?c.ref=t||a:c.innerRef=a,h.createElement(r,c)}))})),Gi=function(e){return e},Yi=h.forwardRef;"undefined"===typeof Yi&&(Yi=Gi);var Qi=Yi((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(vi.Consumer,null,(function(e){e||Uo(!1);var n=c||e.location,o=Hi(Wi(y,n),n),v=o.pathname,b=v&&v.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),x=b?Ti(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 Gi!==Yi?C.ref=t||g:C.innerRef=g,h.createElement(qi,C)}))})),Xi=(n(8136),Zi()?h.useLayoutEffect:h.useEffect);"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math&&self;function Zi(){return!("undefined"===typeof window||!window.document||!window.document.createElement)}function Ji(e,t){var n=(0,h.createContext)(t);return n.displayName=e,n}function ea(e){return h.forwardRef(e)}function ta(e,t){return h.memo(e,t)}function na(e){return e&&e.ownerDocument?e.ownerDocument:Zi()?document:null}function ra(e){return"boolean"===typeof e}function oa(e){return!(!e||"[object Function]"!={}.toString.call(e))}function ia(e){return"which"in e?3===e.which:"button"in e&&2===e.button}function aa(e){return"string"===typeof e}function la(){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 sa(){}var ua=sa;var ca=sa;function da(e){var t=h.useRef();return t.current||(t.current={v:e()}),t.current.v}function fa(){var e=(0,h.useState)(Object.create(null))[1];return(0,h.useCallback)((function(){e(Object.create(null))}),[])}function pa(){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(oa(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 ha(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}}var ya=!1,ga=0,ma=function(){return++ga};var va,ba=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=fa();return Xi((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})},xa=["bottom","height","left","right","top","width"],wa=new Map,ja=function e(){var t=[];wa.forEach((function(e,n){var r=n.getBoundingClientRect();(function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),xa.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)}))})),va=window.requestAnimationFrame(e)};var Sa=function(e,t){return{observe:function(){var n=0===wa.size;wa.has(e)?wa.get(e).callbacks.push(t):wa.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&ja()},unobserve:function(){var n=wa.get(e);if(n){var r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||wa.delete(e),wa.size||cancelAnimationFrame(va)}}}};function ka(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 Xi((function(){d.current=n,e.current!==o&&i(e.current)})),Xi((function(){o&&!a.current&&(a.current=!0,c(o.getBoundingClientRect()))}),[o]),Xi((function(){var n,r=o;return l.current||(l.current=!0,r=e.current),r?(n=Sa(r,(function(e){d.current&&d.current(e),c(e)})),t&&n.observe(),i):i;function i(){n&&n.unobserve()}}),[t,o]),u}var Ca=n(264),_a=n.n(Ca);function Oa(){return Oa=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},Oa.apply(this,arguments)}var Ea=(0,h.forwardRef)((function(e,t){return h.createElement(ba,null,h.createElement(Ta,Object.assign({ref:t},e)))}));var Ta=(0,h.forwardRef)((function(e,t){var n=e.targetRef,r=e.position,o=void 0===r?Ma: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=ka(s,!l.hidden),c=ka(n,!l.hidden),d=pa(s,t);return function(e,t){var n=na(e.current);function r(e){"Tab"===e.key&&t.current&&0===_a()(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&&_a()(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&&_a()(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&&_a()(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&&_a()(t.current),r=n&&n[n.length-1];r&&(e.preventDefault(),r.focus())}function d(e){var n=t.current&&_a()(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?_a()(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===_a()(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&&_a()(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:Oa({position:"absolute"},Pa.apply(void 0,[o,c,u].concat(a)),l.style)}))}));function Pa(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 Aa(e,t){return{top:Ia(e,t).directionUp?e.top-t.height+window.pageYOffset+"px":e.top+e.height+window.pageYOffset+"px"}}var Ma=function(e,t){return e&&t?Oa({left:Ia(e,t).directionRight?e.right-t.width+window.pageXOffset+"px":e.left+window.pageXOffset+"px"},Aa(e,t)):{}},Da=function(e,t){return e&&t?Oa({width:e.width,left:e.left},Aa(e,t)):{}};function Ia(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 Ra,Na=Ea;function La(){return La=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},La.apply(this,arguments)}function Fa(e,t){void 0===t&&(t={});return Ji(e,La({descendants:[],registerDescendant:sa,unregisterDescendant:sa},t))}function Ba(e,t,n){var r=fa(),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 Xi((function(){return e.element||r(),i(La({},e,{index:s})),function(){return a(e.element)}}),[r,s,i,c,a].concat(Object.values(e))),s}function Ua(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,[La({},r,{element:t,index:n})]);else if(0===e.length)o=[].concat(e,[La({},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=La({},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 La({},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"}(Ra||(Ra={}));var za={type:"xstate.init"};function Wa(e){return void 0===e?[]:[].concat(e)}function Ha(e){return{type:"xstate.assign",assignment:e}}function Ka(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 $a(e){return function(t){return e===t}}function Va(e){return"string"==typeof e?{type:e}:e}function qa(e,t){return{value:e,context:t,actions:[],changed:!1,matches:$a(e)}}var Ga=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function Ya(){return Ya=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},Ya.apply(this,arguments)}var Qa,Xa,Za,Ja=function(e){var t;return e.subscribe((function(e){t=e})).unsubscribe(),t};function el(e,t,n){var r=(0,h.useRef)(e),o=da((function(){return function(e){var t=e.initialState,n=Ra.NotStarted,r=new Set,o={_machine:e,send:function(o){n===Ra.Running&&(t=e.transition(t,o),Ga(t,Va(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=Ra.Running,Ga(t,za),o},stop:function(){return n=Ra.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 Ja(o)})),l=a[0],s=a[1],u=(0,h.useCallback)((function(e){var n=aa(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(Ya({},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 Ya({},l,{matches:function(e){return e===l.value}})}),[l.changed,l.context,l.value]);return[c,u,o]}function tl(e,t){return da((function(){return function(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:Wa(e.states[e.initial].entry).map((function(e){return Ka(e,t.actions)})),context:e.context,matches:$a(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=Va(r),c=e.states[l];if(c.on){var d=Wa(c.on[u.type]),f=function(t){if(void 0===t)return{value:qa(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 Ka(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:$a(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 qa(l,s)}};return n}(e,t)}))}function nl(){return nl=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},nl.apply(this,arguments)}function rl(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"}(Xa||(Xa={})),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"}(Za||(Za={}));var ol=Ha({navigationValue:null}),il=Ha({typeaheadQuery:null}),al=Ha({value:function(e,t){return t.value}}),ll=Ha({navigationValue:function(e,t){return t.value}}),sl=Ha({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 ul(e,t){if(t.type===Za.Blur){var n=t.refs,r=n.list,o=n.popover,i=t.relatedTarget,a=o&&na(o)||document;return!(a.activeElement===r||!o||o.contains(i||a.activeElement))}return!1}function cl(e,t){if(t.type===Za.OutsideMouseDown||t.type===Za.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 dl(e,t){return!!e.options.find((function(t){return t.value===e.navigationValue}))}function fl(e,t){var n=t.refs,r=n.popover,o=n.list,i=t.relatedTarget;return!(r&&i&&r.contains(i)&&i!==o)&&dl(e)}function pl(e,t){requestAnimationFrame((function(){t.refs.list&&t.refs.list.focus()}))}function hl(e,t){t.refs.button&&t.refs.button.focus()}function yl(e,t){return!t.disabled}function gl(e,t){return t.type!==Za.OptionTouchStart||!t||!t.disabled}function ml(e,t){return(!t||!t.disabled)&&null!=e.navigationValue}function vl(e,t){t.callback&&t.callback(t.value)}function bl(e,t){if(t.type===Za.KeyDownEnter){var n=t.refs.hiddenInput;if(n&&n.form){var r=n.form.querySelector("button,[type='submit']");r&&r.click()}}}var xl=Ha({typeaheadQuery:function(e,t){return(e.typeaheadQuery||"")+t.query}}),wl=Ha({value:function(e,t){if(t.type===Za.UpdateAfterTypeahead&&t.query){var n=kl(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}}),jl=Ha({navigationValue:function(e,t){if(t.type===Za.UpdateAfterTypeahead&&t.query){var n=kl(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}}),Sl=((Qa={})[Za.GetDerivedData]={actions:Ha((function(e,t){return nl({},e,t.data)}))},Qa[Za.ValueChange]={actions:[al,vl]},Qa);function kl(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 Cl=Fa("ListboxDescendantContext"),_l=Ji("ListboxContext",{}),Ol=(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=rl(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=tl(function(e){var t,n,r,o,i,a,l=e.value;return{id:"listbox",initial:Xa.Idle,context:{value:l,options:[],navigationValue:null,typeaheadQuery:null},states:(a={},a[Xa.Idle]={on:nl({},Sl,(t={},t[Za.ButtonMouseDown]={target:Xa.Open,actions:[sl],cond:yl},t[Za.KeyDownSpace]={target:Xa.Navigating,actions:[sl,pl],cond:yl},t[Za.KeyDownSearch]={target:Xa.Idle,actions:xl,cond:yl},t[Za.UpdateAfterTypeahead]={target:Xa.Idle,actions:[wl],cond:yl},t[Za.ClearTypeahead]={target:Xa.Idle,actions:il},t[Za.KeyDownNavigate]={target:Xa.Navigating,actions:[sl,il,pl],cond:yl},t[Za.KeyDownEnter]={actions:[bl],cond:yl},t))},a[Xa.Interacting]={entry:[ol],on:nl({},Sl,(n={},n[Za.ClearNavSelection]={actions:[ol,pl]},n[Za.KeyDownEnter]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},n[Za.KeyDownSpace]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},n[Za.ButtonMouseDown]={target:Xa.Idle,actions:[hl]},n[Za.KeyDownEscape]={target:Xa.Idle,actions:[hl]},n[Za.OptionMouseDown]={target:Xa.Dragging},n[Za.OutsideMouseDown]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Dragging,actions:il,cond:dl}],n[Za.OutsideMouseUp]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Navigating,cond:dl},{target:Xa.Interacting,actions:il}],n[Za.KeyDownEnter]=Xa.Interacting,n[Za.Blur]=[{target:Xa.Idle,cond:ul,actions:il},{target:Xa.Navigating,cond:fl},{target:Xa.Interacting,actions:il}],n[Za.OptionTouchStart]={target:Xa.Navigating,actions:[ll,il],cond:gl},n[Za.OptionMouseEnter]={target:Xa.Navigating,actions:[ll,il],cond:gl},n[Za.KeyDownNavigate]={target:Xa.Navigating,actions:[ll,il,pl]},n))},a[Xa.Open]={on:nl({},Sl,(r={},r[Za.ClearNavSelection]={actions:[ol]},r[Za.KeyDownEnter]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},r[Za.KeyDownSpace]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},r[Za.ButtonMouseDown]={target:Xa.Idle,actions:[hl]},r[Za.KeyDownEscape]={target:Xa.Idle,actions:[hl]},r[Za.OptionMouseDown]={target:Xa.Dragging},r[Za.OutsideMouseDown]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Dragging,cond:dl},{target:Xa.Interacting,actions:il}],r[Za.OutsideMouseUp]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Navigating,cond:dl},{target:Xa.Interacting,actions:il}],r[Za.Blur]=[{target:Xa.Idle,cond:ul,actions:il},{target:Xa.Navigating,cond:fl},{target:Xa.Interacting,actions:il}],r[Za.ButtonMouseUp]={target:Xa.Navigating,actions:[sl,pl]},r[Za.OptionTouchStart]={target:Xa.Navigating,actions:[ll,il],cond:gl},r[Za.KeyDownNavigate]={target:Xa.Navigating,actions:[ll,il,pl]},r[Za.KeyDownSearch]={target:Xa.Navigating,actions:xl},r[Za.UpdateAfterTypeahead]={actions:[jl]},r[Za.ClearTypeahead]={actions:il},r[Za.OptionMouseMove]=[{target:Xa.Dragging,actions:[ll],cond:gl},{target:Xa.Dragging}],r))},a[Xa.Dragging]={on:nl({},Sl,(o={},o[Za.ClearNavSelection]={actions:[ol]},o[Za.KeyDownEnter]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},o[Za.KeyDownSpace]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},o[Za.ButtonMouseDown]={target:Xa.Idle,actions:[hl]},o[Za.KeyDownEscape]={target:Xa.Idle,actions:[hl]},o[Za.OptionMouseDown]={target:Xa.Dragging},o[Za.OutsideMouseDown]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Navigating,cond:dl},{target:Xa.Interacting,actions:il}],o[Za.OutsideMouseUp]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Navigating,cond:dl,actions:pl},{target:Xa.Interacting,actions:[il,pl]}],o[Za.Blur]=[{target:Xa.Idle,cond:ul,actions:il},{target:Xa.Navigating,cond:fl},{target:Xa.Interacting,actions:il}],o[Za.ButtonMouseUp]={target:Xa.Navigating,actions:[sl,pl]},o[Za.OptionTouchStart]={target:Xa.Navigating,actions:[ll,il],cond:gl},o[Za.OptionMouseEnter]={target:Xa.Dragging,actions:[ll,il],cond:gl},o[Za.KeyDownNavigate]={target:Xa.Navigating,actions:[ll,il,pl]},o[Za.KeyDownSearch]={target:Xa.Navigating,actions:xl},o[Za.UpdateAfterTypeahead]={actions:[jl]},o[Za.ClearTypeahead]={actions:il},o[Za.OptionMouseMove]=[{target:Xa.Navigating,actions:[ll],cond:gl},{target:Xa.Navigating}],o[Za.OptionMouseUp]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},o))},a[Xa.Navigating]={on:nl({},Sl,(i={},i[Za.ClearNavSelection]={actions:[ol,pl]},i[Za.KeyDownEnter]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},i[Za.KeyDownSpace]={target:Xa.Idle,actions:[al,il,hl,vl],cond:ml},i[Za.ButtonMouseDown]={target:Xa.Idle,actions:[hl]},i[Za.KeyDownEscape]={target:Xa.Idle,actions:[hl]},i[Za.OptionMouseDown]={target:Xa.Dragging},i[Za.OutsideMouseDown]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Navigating,cond:dl},{target:Xa.Interacting,actions:il}],i[Za.OutsideMouseUp]=[{target:Xa.Idle,cond:cl,actions:il},{target:Xa.Navigating,cond:dl},{target:Xa.Interacting,actions:il}],i[Za.Blur]=[{target:Xa.Idle,cond:ul,actions:il},{target:Xa.Navigating,cond:fl},{target:Xa.Interacting,actions:il}],i[Za.ButtonMouseUp]={target:Xa.Navigating,actions:[sl,pl]},i[Za.OptionTouchStart]={target:Xa.Navigating,actions:[ll,il],cond:gl},i[Za.OptionMouseEnter]={target:Xa.Navigating,actions:[ll,il],cond:gl},i[Za.KeyDownNavigate]={target:Xa.Navigating,actions:[ll,il,pl]},i[Za.KeyDownSearch]={target:Xa.Navigating,actions:xl},i[Za.UpdateAfterTypeahead]={actions:[jl]},i[Za.ClearTypeahead]={actions:il},i[Za.OptionMouseMove]=[{target:Xa.Navigating,actions:[ll],cond:gl},{target:Xa.Navigating}],i))},a)}}({value:(m.current?f:i)||null})),P=el(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||(ya?ma():null),n=(0,h.useState)(t),r=n[0],o=n[1];return Xi((function(){null===r&&o(ma())}),[]),(0,h.useEffect)((function(){!1===ya&&(ya=!0)}),[]),null!=r?String(r):void 0}(g.id),I=g.id||la("listbox-input",D),R=pa(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=Nl(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 U=b.find((function(e){return!e.disabled}));U&&U.value&&M({type:Za.ValueChange,value:U.value})}return ua(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:Za.ValueChange,value:f})})),Xi((function(){M({type:Za.GetDerivedData,data:{options:b}})}),[b,M]),(0,h.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;Bl(t,O.current)||M({type:Za.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;Bl(t,O.current)||M({type:Za.OutsideMouseUp,relatedTarget:n||t})}return L&&window.addEventListener("mouseup",e),function(){window.removeEventListener("mouseup",e)}}),[M,L]),ca("listbox"),h.createElement(Ua,{context:Cl,items:b,set:x},h.createElement(_l.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}),oa(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 El=ea((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=rl(e,["aria-label","arrow","as","children","onKeyDown","onMouseDown","onMouseUp"]),f=(0,h.useContext)(_l),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=pa(y,t),k=Ll();var C=la("button",v),_=(0,h.useMemo)((function(){return l?oa(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:ha(s,k),onMouseDown:ha(u,(function(e){ia(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),x({type:Za.ButtonMouseDown,disabled:g}))})),onMouseUp:ha(c,(function(e){ia(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),x({type:Za.ButtonMouseUp}))}))}),_,o&&h.createElement(Al,null,ra(o)?null:o))}));var Tl=ta(El),Pl=(0,h.forwardRef)((function(e,t){var n=e.children,r=rl(e,["children"]),o=(0,h.useContext)(_l).isExpanded;return h.createElement("span",Object.assign({"aria-hidden":!0},r,{ref:t,"data-reach-listbox-arrow":"","data-expanded":o?"":void 0}),oa(n)?n({isExpanded:o,expanded:o}):n||"\u25bc")}));var Al=(0,h.memo)(Pl),Ml=(0,h.forwardRef)((function(e,t){var n=e.position,r=void 0===n?Da:n,o=e.onBlur,i=e.onKeyDown,a=e.portal,l=void 0===a||a,s=e.unstable_observableRefs,u=rl(e,["position","onBlur","onKeyDown","portal","unstable_observableRefs"]),c=(0,h.useContext)(_l),d=c.buttonRef,f=c.popoverRef,p=c.send,y=c.isExpanded,g=pa(f,t),m=Ll(),v=nl({hidden:!y,tabIndex:-1},u,{ref:g,"data-reach-listbox-popover":"",onBlur:ha(o,(function(e){var t=e.nativeEvent;requestAnimationFrame((function(){p({type:Za.Blur,relatedTarget:t.relatedTarget||t.target})}))})),onKeyDown:ha(i,m)});return l?h.createElement(Na,Object.assign({},v,{targetRef:d,position:r,unstable_observableRefs:s})):h.createElement("div",Object.assign({},v))}));var Dl=(0,h.memo)(Ml),Il=ea((function(e,t){var n=e.as,r=void 0===n?"ul":n,o=rl(e,["as"]),i=(0,h.useContext)(_l),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=pa(t,c);return h.createElement(r,Object.assign({"aria-activedescendant":Fl(s?p:f),"aria-labelledby":a?void 0:l,"aria-label":a,role:"listbox",tabIndex:-1},o,{ref:y,"data-reach-listbox-list":"",id:la("listbox",u)}))}));var Rl=ea((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=rl(e,["as","children","disabled","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onTouchStart","value","label"]);var g=(0,h.useContext)(_l),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);Ba({element:P.current,value:f,label:T,disabled:!!i},Cl);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=pa(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:Fl(f),"data-reach-listbox-option":"","data-current":D?"":void 0,"data-label":T,"data-value":f,onMouseDown:ha(a,(function(e){ia(e.nativeEvent)||(e.preventDefault(),w({type:Za.OptionMouseDown}))})),onMouseEnter:ha(l,(function(){w({type:Za.OptionMouseEnter,value:f,disabled:!!i})})),onMouseLeave:ha(s,(function(){w({type:Za.ClearNavSelection})})),onMouseMove:ha(u,(function(){j!==Xa.Open&&C===f||w({type:Za.OptionMouseMove,value:f,disabled:!!i})})),onMouseUp:ha(c,(function(e){ia(e.nativeEvent)||w({type:Za.OptionMouseUp,value:f,callback:b,disabled:!!i})})),onTouchStart:ha(d,(function(){w({type:Za.OptionTouchStart,value:f,disabled:!!i})}))}),o)}));function Nl(e){return[Xa.Navigating,Xa.Open,Xa.Dragging,Xa.Interacting].includes(e)}function Ll(){var e,t=(0,h.useContext)(_l),n=t.disabled,r=t.onValueChange,o=t.stateData,i=o.navigationValue,a=o.typeaheadQuery,l=t.state,s=t.send,u=(e=Cl,(0,h.useContext)(e).descendants);(0,h.useEffect)((function(){a&&s({type:Za.UpdateAfterTypeahead,query:a,callback:r});var e=window.setTimeout((function(){null!=a&&s({type:Za.ClearTypeahead})}),1e3);return function(){window.clearTimeout(e)}}),[r,s,a]);var c=u.findIndex((function(e){return e.value===i})),d=ha((function(e){var t=e.key,o=aa(t)&&1===t.length,a=u.find((function(e){return e.value===i}));switch(t){case"Enter":return void s({type:Za.KeyDownEnter,value:i,callback:r,disabled:!(!(null===a||void 0===a?void 0:a.disabled)&&!n)});case" ":return e.preventDefault(),void s({type:Za.KeyDownSpace,value:i,callback:r,disabled:!(!(null===a||void 0===a?void 0:a.disabled)&&!n)});case"Escape":return Nl(l)&&e.stopPropagation(),void s({type:Za.KeyDownEscape});case"Tab":var c=e.shiftKey?Za.KeyDownShiftTab:Za.KeyDownTab;return void s({type:c});default:return void(o&&s({type:Za.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]}}}(Cl,{currentIndex:c,orientation:"vertical",key:"index",rotate:!0,filter:function(e){return!e.disabled},callback:function(e){s({type:Za.KeyDownNavigate,value:u[e].value,disabled:n})}}));return d}function Fl(e){var t=(0,h.useContext)(_l).listboxId;return e?la("option-"+e,t):void 0}function Bl(e,t){return!(e!==t&&!(null===t||void 0===t?void 0:t.contains(e)))}var Ul="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0,zl=navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0;function Wl(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function Hl(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=zl?"cmd":"ctrl"),n[r]=e[t]}return n}function Kl(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 $l={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,"-":Ul?173:189,"=":Ul?61:187,";":Ul?59:186,"'":222,"[":219,"]":221,"\\":220},Vl={"\u21e7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},ql={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Gl={16:!1,18:!1,17:!1,91:!1},Yl={},Ql=1;Ql<20;Ql++)$l["f".concat(Ql)]=111+Ql;var Xl=[],Zl="all",Jl=[],es=function(e){return"mod"===e&&(e=zl?"cmd":"ctrl"),$l[e.toLowerCase()]||Vl[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function ts(e){Zl=e||"all"}function ns(){return Zl||"all"}var rs=function(e){var t=e.key,n=e.scope,r=e.method,o=e.splitKey,i=void 0===o?"+":o;Kl(t).forEach((function(e){var t=e.split(i),o=t.length,a=t[o-1],l="*"===a?"*":es(a);if(Yl[l]){n||(n=ns());var s=o>1?Hl(Vl,t):[];Yl[l]=Yl[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 os(e,t,n){var r;if(t.scope===n||"all"===t.scope){for(var o in r=t.mods.length>0,Gl)Object.prototype.hasOwnProperty.call(Gl,o)&&(!Gl[o]&&t.mods.indexOf(+o)>-1||Gl[o]&&-1===t.mods.indexOf(+o))&&(r=!1);(0!==t.mods.length||Gl[16]||Gl[18]||Gl[17]||Gl[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 is(e){var t=Yl["*"],n=e.keyCode||e.which||e.charCode;if(as.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===Xl.indexOf(n)&&229!==n&&Xl.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=ql[t];e[t]&&-1===Xl.indexOf(n)?Xl.push(n):!e[t]&&Xl.indexOf(n)>-1?Xl.splice(Xl.indexOf(n),1):"metaKey"===t&&e[t]&&3===Xl.length&&(e.ctrlKey||e.shiftKey||e.altKey||(Xl=Xl.slice(Xl.indexOf(n))))})),n in Gl){for(var r in Gl[n]=!0,Vl)Vl[r]===n&&(as[r]=!0);if(!t)return}for(var o in Gl)Object.prototype.hasOwnProperty.call(Gl,o)&&(Gl[o]=e[ql[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===Xl.indexOf(17)&&Xl.push(17),-1===Xl.indexOf(18)&&Xl.push(18),Gl[17]=!0,Gl[18]=!0);var i=ns();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)&&os(e,t[a],i);if(n in Yl)for(var l=0;l<Yl[n].length;l++)if(("keydown"===e.type&&Yl[n][l].keydown||"keyup"===e.type&&Yl[n][l].keyup)&&Yl[n][l].key){for(var s=Yl[n][l],u=s.splitKey,c=s.key.split(u),d=[],f=0;f<c.length;f++)d.push(es(c[f]));d.sort().join("")===Xl.sort().join("")&&os(e,s,i)}}}function as(e,t,n){Xl=[];var r=Kl(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=Hl(Vl,e)),(e="*"===(e=e[e.length-1])?"*":es(e))in Yl||(Yl[e]=[]),Yl[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 Jl.indexOf(e)>-1}(a)&&window&&(Jl.push(a),Wl(a,"keydown",(function(e){is(e)})),Wl(window,"focus",(function(){Xl=[]})),Wl(a,"keyup",(function(e){is(e),function(e){var t=e.keyCode||e.which||e.charCode,n=Xl.indexOf(t);if(n>=0&&Xl.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&Xl.splice(0,Xl.length),93!==t&&224!==t||(t=91),t in Gl)for(var r in Gl[t]=!1,Vl)Vl[r]===t&&(as[r]=!1)}(e)})))}var ls={setScope:ts,getScope:ns,deleteScope:function(e,t){var n,r;for(var o in e||(e=ns()),Yl)if(Object.prototype.hasOwnProperty.call(Yl,o))for(n=Yl[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;ns()===e&&ts(t||"all")},getPressedKeyCodes:function(){return Xl.slice(0)},isPressed:function(e){return"string"===typeof e&&(e=es(e)),-1!==Xl.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&&rs(e)}));else if("object"===typeof e)e.key&&rs(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=""),rs({key:e,scope:o,method:i,splitKey:"+"})}}else Object.keys(Yl).forEach((function(e){return delete Yl[e]}))}};for(var ss in ls)Object.prototype.hasOwnProperty.call(ls,ss)&&(as[ss]=ls[ss]);if("undefined"!==typeof window){var us=window.hotkeys;as.noConflict=function(e){return e&&window.hotkeys===as&&(window.hotkeys=us),as},window.hotkeys=as}var cs=as;let ds=h.createContext(null);function fs(e){let{children:t}=e,n=(0,h.useRef)(null),r=(0,h.useMemo)((()=>({keyRef:n,onKeyChange:e=>{n.current=e}})),[n]);return(0,jo.jsx)(ds.Provider,{value:r,children:t})}function ps(e,t){let n=(0,h.useContext)(ds),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])}var hs=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:4,strokeLinecap:"round",strokeMiterlimit:10,d:"m2 2 20 20M22 2 2 22"})});var ys=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 15",style:{color:"#242134",...e.style},children:(0,jo.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 gs=function(e){const{numberOfLines:t,style:n,innerRef:r,...o}=e;return(0,jo.jsx)("span",{...o,ref:r,className:`${e.className||""} ${(0,so.iv)(e.style)}`})};var ms=function(e){const{style:t,nativeStyle:n,innerRef:r,...o}=e;return(0,jo.jsx)("div",{...o,ref:r,style:n,className:`view ${e.className||""} ${(0,so.iv)(e.style)}`})};function vs(e,t){return h.Children.toArray(t).reduce(((t,n)=>n?n.type===h.Fragment?t.concat(vs(n.key,n.props.children)):(t.push({key:e+n.key,child:n}),t):t),[])}const bs=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=vs("",a);return(0,jo.jsx)(ms,{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,jo.jsx)(gs,{children:o}):o,{key:r,style:[l&&{borderWidth:1,borderColor:"red"},a?null:{[n]:5*i},o.props?o.props.style:null]})}))})}));var xs=bs;const ws=h.createContext();function js(){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 Ss 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,...vo.shadowLarge,borderRadius:4,backgroundColor:"white"};return this.getContainer()?(0,jo.jsx)("div",{ref:e=>this.target=e,children:we.createPortal((0,jo.jsx)("div",{...(0,so.iv)(r,n,vo.darkScrollbar),ref:this.contentRef,"data-testid":"tooltip",onClick:e=>{e.stopPropagation()},children:e}),this.getContainer())}):null}}function ks(e){let{children:t,centered:n,...r}=e;return(0,jo.jsx)(gs,{numberOfLines:1,...r,children:t})}Ss.contextType=ws;function Cs(e){const{style:t,innerRef:n,...r}=e;return(0,jo.jsx)("div",{...r,ref:n,className:`${e.className||""} ${(0,so.iv)(e.style)}`})}const _s=h.forwardRef(((e,t)=>{let{children:n,...r}=e;return(0,jo.jsx)(ms,{...r,ref:t,style:[{marginTop:15,marginLeft:5,marginRight:5,borderRadius:6,backgroundColor:"white",borderColor:mo.p3,boxShadow:"0 1px 2px #9594A8"},r.style],children:(0,jo.jsx)(ms,{style:{borderRadius:6,overflow:"hidden"},children:n})})}));function Os(e){let{style:t,children:n,...r}=e;return(0,jo.jsx)(As,{...(0,so.iv)({textDecoration:"none",color:vo.textColor,backgroundColor:"transparent",border:0,cursor:"pointer",padding:0,font:"inherit",":hover":{textDecoration:"underline"}},vo.smallText,t),...r,children:n})}function Es(e){let{to:t,exact:n,style:r,activeStyle:o,children:i}=e,a=function(e){var t=Ui(),n=Fi(vi).match;return e?Ti(t.pathname,e):n}({path:t,exact:!0});return(0,jo.jsx)(Qi,{to:t,exact:n,...(0,so.iv)([vo.smallText,r,a?o:null]),children:i})}const Ts=h.forwardRef(((e,t)=>{let{asAnchor:n,children:r,...o}=e;function i(e){e.preventDefault(),window.Actual.openURLInBrowser(o.href)}return n?(0,jo.jsx)("a",{ref:t,...o,onClick:i,children:r}):(0,jo.jsx)(As,{ref:t,bare:!0,...o,onClick:i,children:r})}));const Ps=Li((function(e){let{history:t,staticContext:n,to:r,style:o,activeStyle:i,match:a,location:l,...s}=e;return(0,jo.jsx)(Pi,{path:r,children:e=>{let{match:n}=e;return(0,jo.jsx)(As,{style:[o,n?i:null],...s,onClick:e=>{s.onClick&&s.onClick(e),t.push(r)}})}})})),As=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)"}:{...vo.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?mo.n7:mo.p5:"white",border:a?"none":"1px solid "+(o?s?mo.n7:mo.p5:mo.n9),color:o?"white":s?mo.n6:mo.n1,transition:"box-shadow .25s",...vo.smallText},{":hover":!s&&u},{":active":!s&&c},i&&u,r&&c,l];return(0,jo.jsx)(h,{ref:t,..."string"===typeof f?(0,so.iv)(y):{style:y},disabled:s,...p,children:n})})),Ms=h.forwardRef(((e,t)=>{let{loading:n,children:r,...o}=e;return(0,jo.jsxs)(As,{...o,style:[{position:"relative"},o.style],children:[n&&(0,jo.jsx)(ms,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},children:(0,jo.jsx)(Co,{color:"currentColor",style:{width:20,height:20,color:"currentColor"}})}),(0,jo.jsx)(ms,{style:{opacity:n?0:1,flexDirection:"row",alignItems:"center"},children:r})]})})),Ds={outline:0,backgroundColor:"white",margin:0,padding:5,borderRadius:4,border:"1px solid #d0d0d0"};function Is(e){let{style:t,inputRef:n,onEnter:r,onUpdate:o,focused:i,...a}=e,l=(0,h.useRef)();return ps(l,i),(0,jo.jsx)("input",{ref:n?Eo([n,l]):l,...(0,so.iv)(Ds,{":focus":{border:"1px solid "+mo.b5,boxShadow:"0 1px 1px "+mo.b7},"::placeholder":{color:mo.n7}},vo.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)}})}function Rs(e){let{leftContent:t,rightContent:n,inputStyle:r,style:o,getStyle:i,...a}=e,[l,s]=(0,h.useState)(!1);return(0,jo.jsxs)(ms,{style:[Ds,{padding:0,flex:1,flexDirection:"row",alignItems:"center"},l&&{border:"1px solid "+mo.b5,boxShadow:"0 1px 1px "+mo.b7},o,i&&i(l)],children:[t,(0,jo.jsx)(Is,{...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 Ns(e){let{inputRef:t,value:n,onChange:r,placeholder:o,isInModal:i,width:a=350}=e;return(0,jo.jsx)(Is,{inputRef:t,placeholder:o,value:n,onChange:e=>r(e.target.value),style:{width:a,borderColor:i?null:"transparent",backgroundColor:i?null:mo.n11,":focus":i?null:{backgroundColor:"white","::placeholder":{color:mo.n8}}}})}const Ls=h.forwardRef(((e,t)=>{let{style:n,children:r,...o}=e;return(0,jo.jsx)("select",{ref:t,...(0,so.iv)({backgroundColor:"transparent",height:28,fontSize:14,flex:1,border:"1px solid #d0d0d0",borderRadius:4,color:mo.n1,":focus":{border:"1px solid "+mo.b5,boxShadow:"0 1px 1px "+mo.b7,outline:"none"}},n),...o,children:r})}));function Fs(e){let{options:t,value:n,onChange:r,style:o,disabledKeys:i=[]}=e;return(0,jo.jsxs)(Ol,{value:n,onChange:r,style:{lineHeight:"1em"},children:[(0,jo.jsx)(Tl,{...(0,so.iv)([{borderWidth:0,padding:5,borderRadius:4},o]),arrow:(0,jo.jsx)(ys,{style:{width:7,height:7,paddingTop:3}})}),(0,jo.jsx)(Dl,{style:{zIndex:1e4,outline:0,borderRadius:4},children:(0,jo.jsx)(Il,{children:t.map((e=>{let[t,n]=e;return(0,jo.jsx)(Rl,{value:t,disabled:i.includes(t),children:n},t)}))})})]})}function Bs(e){let{keyName:t}=e;return(0,jo.jsx)(gs,{style:{fontSize:10,color:mo.n6},children:t})}function Us(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!==Us.line&&e.type!==Us.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,jo.jsxs)(ms,{style:{outline:"none",borderRadius:4,overflow:"hidden"},tabIndex:1,innerRef:i,children:[t,a.map(((e,t)=>{if(e===Us.line)return(0,jo.jsx)(ms,{style:{margin:"3px 0px"},children:(0,jo.jsx)(ms,{style:{borderTop:"1px solid "+mo.n10}})},t);if(e.type===Us.label)return(0,jo.jsx)(gs,{style:{color:mo.n6,fontSize:11,lineHeight:"1em",textTransform:"uppercase",margin:"3px 9px"},children:e.name},e.name);let n=a[t-1];return(0,jo.jsxs)(ms,{role:"button",style:[{cursor:"default",padding:"9px 10px",marginTop:0===t||n===Us.line||n.type===Us.label?0:-3,flexDirection:"row",alignItems:"center"},e.disabled&&{color:mo.n7},!e.disabled&&l===t&&{backgroundColor:mo.n10}],onMouseEnter:()=>s(t),onMouseLeave:()=>s(null),onClick:t=>!e.disabled&&o&&o(e.name),children:[(0,jo.jsx)(gs,{style:{lineHeight:0},children:e.icon&&h.createElement(e.icon,{width:e.iconSize||10,height:e.iconSize||10,style:{marginRight:7,width:10}})}),(0,jo.jsx)(gs,{children:e.text}),(0,jo.jsx)(ms,{style:{flex:1}}),e.key&&(0,jo.jsx)(Bs,{keyName:e.key})]},e.name)})),n]})}function zs(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,jo.jsxs)(ms,{style:[{flexDirection:"row",alignItems:"center"},r],...l,children:[(0,jo.jsx)(Cs,{style:[{marginRight:10},"left"===a&&s,o],children:t}),(0,jo.jsx)(Cs,{style:[{flex:1,textAlign:"right"},"right"===a&&s,i],children:n})]})}function Ws(e){let{style:t,isLast:n,children:r,...o}=e;return(0,jo.jsx)("div",{...o,...(0,so.iv)(!n&&{marginBottom:15},t,{lineHeight:"1.5em"}),children:r})}function Hs(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,jo.jsx)(ms,{innerRef:l,style:[t,n&&{width:n.width,height:n.height},r&&!o&&{display:"none"}],children:a})}function 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=cs.getScope();return cs.setScope("modal"),()=>cs.setScope(e)}),[]),(0,jo.jsx)(Po(),{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,jo.jsxs)(Hs,{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: ${go.breakpoint_narrow})`]:{minWidth:go.breakpoint_narrow}},vo.shadowLarge,m,vo.lightScrollbar],children:[l&&(0,jo.jsxs)(ms,{style:{padding:20,position:"relative",flexShrink:0},children:[s&&(0,jo.jsx)(ms,{style:{color:mo.n2,flex:1,alignSelf:"center",textAlign:"center",width:"calc(100% - 40px)"},children:(0,jo.jsx)(gs,{style:{fontSize:25,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})}),(0,jo.jsx)(ms,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",alignItems:"center"},children:(0,jo.jsx)(ms,{style:{flexDirection:"row",marginRight:15},children:u&&(0,jo.jsx)(As,{bare:!0,onClick:e=>w(),style:{padding:"10px 10px"},"aria-label":"Close",children:(0,jo.jsx)(hs,{width:10})})})})]}),(0,jo.jsx)(ms,{style:{padding:a,paddingTop:0,flex:1},children:"function"===typeof x?x():x}),d&&(0,jo.jsx)(ms,{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,jo.jsx)(Co,{style:{width:20,height:20},color:mo.n1})})]})})}function $s(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,jo.jsxs)(ms,{innerRef:i,style:[{flexDirection:"row",marginTop:30},t],children:[n,(0,jo.jsx)(ms,{style:{flex:1}}),o]})}function Vs(e){let{label:t,labelWidth:n,children:r,width:o,style:i}=e;return(0,jo.jsxs)("label",{...(0,so.iv)({display:"flex",flexDirection:"row",alignItems:"center",margin:"7px 0",width:o},i),children:[(0,jo.jsxs)("div",{style:{width:n||75,textAlign:"right",paddingRight:10},children:[t,":"]}),r]})}function qs(e){let{style:t,children:n}=e;return(0,jo.jsx)(ms,{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,jo.jsxs)(ms,{style:t,children:[(0,jo.jsx)(ms,{onMouseEnter:s,onMouseLeave:u,style:n,children:r}),a&&o()]})}function Qs(e){let{title:t,style:n}=e;return(0,jo.jsx)(gs,{style:[vo.text,{color:mo.n2,textAlign:"right",fontSize:12,marginBottom:2},n],children:t})}Us.line=Symbol("menu-line"),Us.label=Symbol("menu-label");var Xs=function(e){let{initializing:t,loadingText:n}=e;return(0,jo.jsxs)(h.Fragment,{children:[(0,jo.jsx)(Oo,{}),(null!=n||t)&&(0,jo.jsxs)(ms,{...(0,so.iv)({position:"absolute",top:0,left:0,right:0,padding:50,paddingTop:200,color:mo.n1,alignItems:"center"}),children:[(0,jo.jsx)(Cs,{style:{marginBottom:20,fontSize:18},children:n}),(0,jo.jsx)(Co,{width:25,color:mo.n1})]})]})};function Zs(e){let{title:t,style:n}=e;return(0,jo.jsx)(ms,{style:[{fontWeight:500,textTransform:"uppercase",color:mo.b3,marginBottom:5,lineHeight:"1em"},n],children:t})}function Js(e){let{style:t,title:n,htmlFor:r}=e;return(0,jo.jsx)(gs,{style:[{fontSize:13,marginBottom:3,color:mo.n3},t],children:(0,jo.jsx)("label",{htmlFor:r,children:n})})}function eu(e){let{style:t,children:n}=e;return(0,jo.jsx)(ms,{style:t,children:n})}function tu(e){return(0,jo.jsx)("input",{type:"checkbox",...e,...(0,so.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 "+mo.b6,backgroundColor:mo.b6,"::after":{display:"block",background:mo.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 "+mo.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,jo.jsx)(gs,{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,jo.jsxs)(gs,{children:["Actual requires access to ",(0,jo.jsx)("code",{children:"SharedArrayBuffer"})," in order to function properly. If you\u2019re seeing this error, either your browser does not support ",(0,jo.jsx)("code",{children:"SharedArrayBuffer"}),", or your server is not sending the appropriate headers, or you are not using HTTPS. See"," ",(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Troubleshooting/SharedArrayBuffer",children:"our troubleshooting documentation"})," ","to learn more. ",(0,jo.jsx)(ou,{})]}):(0,jo.jsxs)(gs,{children:["There was a problem loading the app in this browser version. If this continues to be a problem, you can"," ",(0,jo.jsx)("a",{href:"https://github.com/actualbudget/releases",children:"download the desktop app"}),"."]}),(0,jo.jsx)(ms,{style:{alignItems:"center",justifyContent:"center",height:"100%"},children:(0,jo.jsxs)(xs,{style:{paddingBottom:100,maxWidth:500,color:mo.r4,lineHeight:"1.5em",fontSize:15,"& a":{color:mo.r4}},children:[(0,jo.jsx)(gs,{children:t}),(0,jo.jsxs)(gs,{children:["Please get"," ",(0,jo.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,jo.jsx)(Ks,{isCurrent:!0,showClose:!1,title:"Fatal Error",children:()=>(0,jo.jsxs)(ms,{style:{maxWidth:500},children:[(0,jo.jsx)(Ws,{children:"There was an unrecoverable error in the UI. Sorry!"}),(0,jo.jsxs)(Ws,{children:["If this error persists, please get"," ",(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Contact",style:{color:mo.p4},children:"in touch"})," ","so it can be investigated."]}),(0,jo.jsx)(Ws,{children:(0,jo.jsx)(As,{onClick:()=>window.Actual.relaunch(),children:e})}),(0,jo.jsxs)(Ws,{isLast:!0,style:{fontSize:11},children:[(0,jo.jsx)(Os,{onClick:()=>this.setState({showError:!0}),style:{color:mo.p4},children:"Show Error"}),n&&(0,jo.jsx)(Cs,{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,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(Ws,{style:{marginTop:10},children:["Actual uses ",(0,jo.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,jo.jsx)("code",{children:"SharedArrayBuffer"}),", you may encounter data loss or notice multiple budget files being merged with each other."]}),(0,jo.jsxs)("label",{style:{display:"flex",alignItems:"center",marginBottom:10},children:[(0,jo.jsx)(tu,{checked:n,onChange:r})," I understand the risks, run Actual in the unsupported fallback mode"]}),(0,jo.jsx)(As,{disabled:!n,onClick:()=>{window.localStorage.setItem("SharedArrayBufferOverride","true"),window.location.reload()},children:"Open Actual"})]}):(0,jo.jsx)(Os,{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 Uu(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 zu(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:Uu(e),publishDragSource:zu(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 Uc(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 zc(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=Uc(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 Uc(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=zc(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:zc(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:zc(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:zc(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(Wa){}}}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 Ud(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 zd=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(zd);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=Bi(),[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=gr(hr("accounts").select("*"),(async n=>{e&&t(n)}));return()=>{e.unsubscribe(),e=null}}),[]),e}();return(0,jo.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?Jr(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=gr(hr("payees").select("*"),(async n=>{e&&t(n)}));return()=>{e.unsubscribe(),e=null}}),[]),e}();return(0,jo.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?eo(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>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;r="string"===typeof r?{name:r,value:null}:r;let a=`${e}!${r.name}`,l=this.observeCell(a,i);if(t.has(a)&&i(t.get(a)),null!=n[a])n[a].then(i);else{const l=this.get(e,r.name,o);n[a]=l,l.then((e=>{n[a]===l&&(t.set(a,e),i(e))}))}return l}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,jo.jsx)(jf.Provider,{value:n,children:t})}var Cf=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsxs)("svg",{...e,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:[(0,jo.jsx)("g",{clipPath:"url(#a)",children:(0,jo.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,jo.jsx)("defs",{children:(0,jo.jsx)("clipPath",{id:"a",children:(0,jo.jsx)("path",{fill:"currentColor",d:"M0 0h20v20H0z"})})})]});var Of=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 Uf(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 zf(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=Uf(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=Uf(e).getTime(),r=Wf(t);return new Date(n+r)}(e,-Wf(t))}var Kf=864e5;function $f(e){Lf(1,arguments);var t=Uf(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=Uf(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=Uf(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=Uf(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=Uf(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=Uf(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=Uf(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,Up=/^'([^]*?)'?$/,zp=/''/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 _=Uf(e);if(!zf(_))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(Up);if(!t)return e;return t[1].replace(zp,"'")}(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=Uf(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=Uf(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=Uf(e),r=Uf(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?"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=Uf(e),r=Uf(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)}Xr((e=>new RegExp(e.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}"))));const ph=Xr((e=>e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,""))),hh=Xr((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=Xr((e=>e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-"))),gh=(Xr((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+"$")})),Xr((e=>e.replace(/y+/g,"yy")))),mh=Xr((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 gr(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 pr("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=hr("schedules").select("*");return t=gr(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,jo.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(Wa){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 Uh=10,zh=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}(zh),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",Uh),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}(zh);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(Wa){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(Wa){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(Wa){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(Wa){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 Uy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zy=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 Uy(Fy(e=o.call.apply(o,[this].concat(n))),"priority",130),Uy(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(Wa){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(Wa){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(Wa){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(Wa){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(Wa){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(Wa){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=Uf(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(Wa){return!1}}();return function(){var n,r=zg(e);if(t){var o=zg(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 Ug(e)}(this,n)}}function Ug(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zg(e){return zg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zg(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(Ug(e=o.call.apply(o,[this].concat(n))),"priority",100),Wg(Ug(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=Uf(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(Wa){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(Wa){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=Uf(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(Wa){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(Wa){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(Wa){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(Wa){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 Um=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=Uf(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 zm(e){return zm="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},zm(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(Wa){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"===zm(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(Wa){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(Wa){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(Wa){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(Wa){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(Wa){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(Wa){return!1}}();return function(){var n,r=Uv(e);if(t){var o=Uv(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 Uv(e){return Uv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Uv(e)}function zv(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 zv(Bv(e=o.call.apply(o,[this].concat(n))),"priority",70),zv(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(Wa){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(Wa){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(Wa){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(Wa){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(Wa){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(Wa){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 Ub(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(Wa){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 zb(e)}(this,n)}}function zb(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=Ub(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(zb(e=o.call.apply(o,[this].concat(n))),"priority",20),Hb(zb(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 zy,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 Um,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?Uf(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=Uf(n);if(isNaN(L.getTime()))return new Date(NaN);var F,B=Hf(L,bp(L)),U={},z=qb(N);try{for(z.s();!(F=z.n()).done;){var W=F.value;if(!W.validate(B,T))return new Date(NaN);var H=W.set(B,U,T);Array.isArray(H)?(B=H[0],Th(U,H[1])):B=H}}catch(K){z.e(K)}finally{z.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=pr("transactions").options({splits:"grouped"}),n=nx(e);return n&&(t=t.filter(n)),t}function ox(e,t,n){let r,o=Kr(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:[zf(r)&&{date:Xp(r)},null!=o&&{amount:{$transform:"$abs",$eq:Vr(o)}},null!=o&&Number.isInteger(o)&&{amount:{$transform:{$abs:{$idiv:["$",100]}},$eq:o}}].filter(Boolean)}})}function ix(e){return{name:`balance-${e.id}`,query:pr("transactions").filter({account:e.id}).options({splits:"none"}).calculate({$sum:"$amount"})}}function ax(){return{query:pr("transactions").filter({"account.closed":!1}).calculate({$sum:"$amount"}),name:"accounts-balance"}}function lx(){return{name:"budgeted-accounts-balance",query:pr("transactions").filter({"account.offbudget":!1,"account.closed":!1}).calculate({$sum:"$amount"})}}function sx(){return{name:"offbudget-accounts-balance",query:pr("transactions").filter({"account.offbudget":!0,"account.closed":!1}).calculate({$sum:"$amount"})}}let ux=pr("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=Mr(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:Mr([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,jo.jsx)(Dx.Provider,{value:t.items,children:(0,jo.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,jo.jsx)(Nx,{instance:l,fetchAllIds:o,children:a})}const Fx=(0,h.createContext)({}),Bx=()=>(0,h.useContext)(Fx).url,Ux=()=>(0,h.useContext)(Fx).version,zx=()=>(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,jo.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,jo.jsxs)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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,jo.jsx)("svg",{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)("svg",{...e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)(rw.Provider,{value:t,children:n})}var iw=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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=so.iv.keyframes({"0%":{transform:"rotateZ(0deg)"},"100%":{transform:"rotateZ(360deg)"}});function lw(e){let{animating:t,iconStyle:n}=e;return(0,jo.jsx)(ms,{style:[{animation:t?`${aw} 1s infinite linear`:null}],children:(0,jo.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 cs(t,{scope:o,keyup:!0},e),()=>{cs.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,jo.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,jo.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}}}cs.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,jo.jsx)("svg",{...e,viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)(Ss,{position:r,onClose:()=>o(i),children:t?(0,jo.jsx)("textarea",{ref:l,...(0,so.iv)({border:"1px solid "+mo.border,padding:7,minWidth:300,minHeight:120,outline:"none"}),value:i||"",onChange:e=>a(e.target.value)}):(0,jo.jsx)(gs,{...(0,so.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=mo.n8,tooltipPosition:i,style:a}=e,[l,s]=(0,h.useState)(!1),u=js(),{data:c}=function(e,t){let[n,r]=(0,h.useState)(null);return(0,h.useEffect)((()=>{let n=gr(e,(async e=>{n&&r(e)}),t);return()=>{n.unsubscribe(),n=null}}),[e]),{data:n}}((0,h.useMemo)((()=>hr("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,jo.jsxs)(ms,{style:[{flexShrink:0}],onMouseEnter:()=>{y(setTimeout((()=>{s(!0)}),300))},onMouseLeave:()=>{clearTimeout(p),s(!1)},children:[(0,jo.jsx)(As,{bare:!0,className:f||g?"":"hover-visible",style:[{color:o},a,f&&{display:"flex !important"},g&&{color:mo.n1}],...u.getOpenEvents(),children:(0,jo.jsx)(fw,{style:{width:n,height:r,color:"currentColor"}})}),g&&(0,jo.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 Wr(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 Wr(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,jo.jsx)(mw,{binding:t,debug:a,children:e=>{let{name:t,value:a}=e;return(0,jo.jsx)(gs,{style:["financial"===n&&vo.tnum,o,i&&i(a)],numberOfLines:1,"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(Wa){}}}}}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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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=Xr(((e,t,n,r)=>this.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:r}))),this._callOnScroll=Xr(((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=Xr(((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,jo.jsx)(Fw,{onResize:this.onHeaderResize,children:o=>(0,jo.jsxs)(x,{className:e,onScroll:this._onScrollVertical,ref:this._outerRefSetter,style:{height:t,width:p,overflow:"auto",...d},children:[(0,jo.jsx)(ms,{innerRef:o,children:n}),(0,jo.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 Uw=32,zw=mo.n11;function Ww(e,t){document.hasFocus()?e&&e(t):t.stopPropagation()}const Hw=h.createContext({backgroundColor:"white",borderColor:mo.n9});function Kw(e){let{backgroundColor:t,borderColor:n,children:r}=e,o=(0,h.useMemo)((()=>({backgroundColor:t,borderColor:n})),[t,n]);return(0,jo.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,jo.jsx)(ms,{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},vo.smallText,l],"data-testid":r,children:(0,jo.jsx)(ms,{style:[{flex:1,padding:"0 5px",justifyContent:"center"},s],children:i?(0,jo.jsx)(gs,{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);ps(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,jo.jsx)(ms,{innerRef:v,style:[w,j,p],className:"animated-cell",...g,"data-testid":r,children:f?d:o?d():(0,jo.jsx)(ms,{style:[{flex:1,padding:"0 5px",justifyContent:"center"},vo.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,jo.jsx)(gs,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l?l(a):a})})})}function qw(e){let{backgroundColor:t="white",borderColor:n=mo.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,jo.jsx)(Kw,{backgroundColor:d?mo.y9:t,borderColor:d?mo.y8:n,children:(0,jo.jsxs)(ms,{innerRef:y,style:[{flexDirection:"row",height:s||Uw,flex:"0 0 "+(s||Uw)+"px",userSelect:"text","&.animated .animated-cell":{transition:".7s background-color"}},o&&{marginTop:-1},u],"data-testid":"row",...c,children:[0!==r&&(0,jo.jsx)($w,{width:r}),l,0!==r&&(0,jo.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,jo.jsx)(Is,{...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,jo.jsx)(Vw,{textAlign:o,...a,children:()=>(0,jo.jsxs)(h.Fragment,{children:[(0,jo.jsx)(Qw,{value:a.value,onUpdate:n,onBlur:r,style:[{textAlign:o},t&&t.style],...t}),i&&(0,jo.jsx)(Ss,{targetHeight:Uw,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,jo.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,jo.jsx)(Vw,{...r,name:"delete",width:20,style:[{alignItems:"center",userSelect:"none"},n],onClick:e=>{e.stopPropagation(),t&&t()},children:()=>(0,jo.jsx)(hs,{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,jo.jsx)(ms,{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 ${mo.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,jo.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,jo.jsx)(tj,{style:[{width:12,height:12,border:"1px solid "+mo.n8,borderRadius:3,justifyContent:"center",alignItems:"center",":focus":{border:"1px solid "+mo.b5,boxShadow:"0 1px 2px "+mo.b5}},n&&{backgroundColor:r?mo.b9:mo.b5,borderColor:r?mo.b9:mo.b5}],onEdit:a,onSelect:i,clickBehavior:"none",children:n&&(0,jo.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,jo.jsx)(mw,{binding:s,onChange:()=>{l.exposed&&r&&r.onBlur&&r.onBlur()},children:e=>(0,jo.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,jo.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,jo.jsx)(ms,{style:"v2"===r&&{borderRadius:"6px 6px 0 0",overflow:"hidden",flexShrink:0},children:(0,jo.jsx)(qw,{backgroundColor:"white",borderColor:mo.border,collapsed:!0,...o,style:[{zIndex:200},"v2"===r?{color:mo.n4,fontWeight:500}:{color:mo.n4},o.style],children:t?t.map((e=>(0,jo.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,jo.jsxs)(ms,{children:[(0,jo.jsx)(cw,{keys:n||{}}),(0,jo.jsxs)(As,{bare:!0,style:{color:mo.b3},onClick:()=>l(!0),children:[(0,jo.jsx)(ys,{width:8,height:8,style:{marginRight:5}}),i.size," ",t]}),a&&(0,jo.jsx)(Ss,{position:"bottom-right",width:200,style:{padding:0},onClose:()=>l(!1),children:(0,jo.jsx)(Us,{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,jo.jsx)(sj,{...r,navigator:o})})),sj=h.forwardRef(((e,t)=>{let{items:n,count:r,headers:o,contentHeader:i,loading:a,rowHeight:l=Uw,backgroundColor:s=zw,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,jo.jsx)(ms,{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,jo.jsx)(ms,{style:[{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:s}],children:(0,jo.jsx)(Co,{width:25,color:mo.n1})});let R=0===(r||n.length);return(0,jo.jsxs)(ms,{style:[{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"}},p],tabIndex:"1",..._(j),"data-testid":"table",children:[o&&(0,jo.jsx)(oj,{version:v,height:l,...Array.isArray(o)?{headers:o}:{children:o}}),(0,jo.jsx)(ms,{style:{flex:1,backgroundColor:s},children:R?(N=c,null==N?null:"function"===typeof N?N():(0,jo.jsx)(ms,{style:{justifyContent:"center",alignItems:"center",fontStyle:"italic",color:mo.n6,flex:1},children:N})):(0,jo.jsx)(Iw,{children:e=>{let{width:t,height:o}=e;return 0===t||0===o?null:(0,jo.jsx)(ws.Provider,{value:!x&&E,children:(0,jo.jsx)(fs,{children:(0,jo.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(Wa){}}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 Uj(){return Nj(/AppleWebKit/i)&&!Nj(/Chrome/i)}function zj(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||!zS(e))return;let n=document.activeElement,r=e.current;if(!WS(n,r))return;let o=qS(US(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):zS(e)&&!HS(t.target,e)?n.current?n.current.focus():RS&&VS(RS.current):zS(e)&&(n.current=t.target)},l=t=>{r.current=requestAnimationFrame((()=>{zS(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(US(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(US(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(US(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(US(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 US(e){return e[0].parentElement}function zS(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(US(e),{tabbable:t},e);r.currentNode=n;let o=r.nextNode();t&&!o&&(r=qS(US(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=qr(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=Vr(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&&Kr(String(e))||0};return{...t,error:null,value:e}}var ak=e=>(0,jo.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"#242134",...e.style},children:(0,jo.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(hr("schedules").select("*"),vk,vr);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 Wr(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,jo.jsx)(gs,{style:{color:mo.p4},children:"(empty)"});if(1===t.length)return(0,jo.jsxs)(gs,{children:["[",(0,jo.jsx)(gs,{style:{color:mo.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,jo.jsxs)(gs,{style:{color:mo.n3},children:["[",e.map(((e,n)=>{let r,i=(0,jo.jsx)(gs,{style:{color:mo.p4},children:d(e)});return r=o?0!==n?" ":"":(0,jo.jsxs)(jo.Fragment,{children:[0===n&&(0,jo.jsx)("br",{}),"\xa0\xa0"]}),(0,jo.jsxs)(gs,{children:[r,i,n===t.length-1?"":",",!o&&(0,jo.jsx)("br",{})]},n)})),n>0&&(0,jo.jsxs)(gs,{style:{color:mo.p4},children:["\xa0\xa0",(0,jo.jsxs)("a",{href:"#",onClick:function(e){e.preventDefault(),c(!0)},...(0,so.iv)({color:mo.p4,textDecoration:"none",":hover":{textDecoration:"underline"}}),children:[n," more items..."]}),!o&&(0,jo.jsx)("br",{})]}),"]"]})}return t&&null!=t.num1&&null!=t.num2?(0,jo.jsxs)(gs,{children:[(0,jo.jsx)(gs,{style:{color:mo.p4},children:d(t.num1)})," and"," ",(0,jo.jsx)(gs,{style:{color:mo.p4},children:d(t.num2)})]}):(0,jo.jsx)(gs,{style:{color:mo.p4},children:d(t)})}function xk(e){let{field:t,op:n,value:r,options:o,prefix:i,style:a}=e;return(0,jo.jsxs)(ms,{style:[{display:"block",maxWidth:"100%",backgroundColor:mo.n10,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},a],children:[i&&(0,jo.jsxs)(gs,{style:{color:mo.n3},children:[i," "]}),(0,jo.jsx)(gs,{style:{color:mo.p4},children:ek(t,o)})," ",(0,jo.jsx)(gs,{style:{color:mo.n3},children:tk(n)})," ",(0,jo.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=eo(n),{data:o}=mk.useQuery();return(0,jo.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,jo.jsx)(ms,{style:[{display:"block",maxWidth:"100%",backgroundColor:mo.n10,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},i],children:"set"===n?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gs,{style:{color:mo.n3},children:tk(n)})," ",(0,jo.jsx)(gs,{style:{color:mo.p4},children:ek(t,o)})," ",(0,jo.jsx)(gs,{style:{color:mo.n3},children:"to "}),(0,jo.jsx)(bk,{value:r,field:t})]}):"link-schedule"===n?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gs,{style:{color:mo.n3},children:tk(n)})," ",(0,jo.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?mo.b8:mo.border,d=n||"select"===i;return(0,jo.jsxs)(qw,{height:"auto",borderColor:c,backgroundColor:r?mo.selected:d?mo.hover:"white",style:{fontSize:13,zIndex:o||r?101:"auto"},collapsed:"true",onMouseEnter:()=>a&&a(t.id),onMouseLeave:()=>a&&a(null),children:[(0,jo.jsx)(nj,{exposed:n||r||o,focused:"select"===i,onSelect:()=>{u({type:"select",id:t.id})},onEdit:()=>l(t.id,"select"),selected:r}),(0,jo.jsx)(Vw,{name:"stage",width:50,plain:!0,style:{color:mo.n5},children:t.stage&&(0,jo.jsx)(ms,{style:{alignSelf:"flex-start",margin:5,backgroundColor:mo.b10,color:mo.b1,borderRadius:4,padding:"3px 5px"},children:t.stage})}),(0,jo.jsx)($w,{width:"flex",style:{padding:"15px 0"},truncate:!1,children:(0,jo.jsxs)(xs,{direction:"row",align:"center",children:[(0,jo.jsx)(ms,{style:{flex:1,alignItems:"flex-start"},"data-testid":"conditions",children:t.conditions.map(((e,n)=>(0,jo.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,jo.jsx)(gs,{children:(0,jo.jsx)(gk,{color:mo.n4,style:{width:12,height:12}})}),(0,jo.jsx)(ms,{style:{flex:1,alignItems:"flex-start"},"data-testid":"actions",children:t.actions.map(((e,t)=>(0,jo.jsx)(Sk,{field:e.field,op:e.op,value:e.value,options:e.options,style:0!==t&&{marginTop:3}},t)))})]})}),(0,jo.jsx)(Vw,{name:"edit",focused:"edit"===i,plain:!0,style:{padding:"0 15px",paddingLeft:5},children:(0,jo.jsx)(As,{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,jo.jsx)(ms,{style:[{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"}},i],tabIndex:"1","data-testid":"table",...f(s),children:(0,jo.jsx)(ms,{innerRef:d,style:{maxWidth:"100%",overflow:"auto"},onScroll:function(e){null!=c.current&&o&&e.target.scrollTop>c.current-750&&o()},children:(0,jo.jsx)("div",{ref:u,onMouseLeave:a,children:l})})})}));function _k(){let e=Rx(),t=Ix();return(0,jo.jsxs)(oj,{version:"v2",style:{},children:[(0,jo.jsx)(nj,{exposed:!0,focused:!1,selected:e.size>0,onSelect:()=>t({type:"select-all"})}),(0,jo.jsx)(Vw,{value:"Stage",width:50}),(0,jo.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,jo.jsx)(ms,{children:t.map((e=>{let t=o===e.id,i=n.has(e.id),l=r.editingId===e.id;return(0,jo.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,jo.jsx)(Nx,{instance:g,children:(0,jo.jsxs)(ms,{style:{overflow:"hidden"},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",padding:t?"0 13px 15px":"0 0 15px",flexShrink:0},children:[(0,jo.jsx)(ms,{style:{color:mo.n4,flexDirection:"row",alignItems:"center",width:"50%"},children:(0,jo.jsxs)(gs,{children:["Rules are always run in the order that you see them."," ",(0,jo.jsx)(Ts,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Budgeting/rules/",style:{color:mo.n4},children:"Learn more"})]})}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(Is,{placeholder:"Filter rules...",value:s,onChange:e=>{u(e.target.value),d.onEdit(null)},style:{width:350,borderColor:t?null:"transparent",backgroundColor:t?null:mo.n11,":focus":t?null:{backgroundColor:"white","::placeholder":{color:mo.n8}}}})]}),(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(_k,{}),(0,jo.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,jo.jsx)(Ok,{rules:y,selectedItems:g.items,navigator:d,hoveredRule:m,onHover:j,onEditRule:w})})]}),(0,jo.jsx)(ms,{style:{paddingBlock:15,paddingInline:t?13:0,borderTop:t&&"1px solid "+mo.border,flexShrink:0},children:(0,jo.jsxs)(xs,{direction:"row",align:"center",justify:"flex-end",spacing:2,children:[g.items.size>0&&(0,jo.jsxs)(As,{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,jo.jsx)(As,{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,jo.jsx)(mk.Provider,{children:(0,jo.jsx)(Tk,{isModal:t,payeeId:n,setLoading:r})})}n(7633);var Ak="undefined"===typeof document?null:document.getElementById("a11y-status-message"),Mk=[];function Dk(e){var t=Mk[Mk.length-1]===e;Mk=t?[].concat(Mk,[e]):[e];for(var n=function(){if(Ak)return Ak;return(Ak=document.createElement("div")).setAttribute("id","a11y-status-message"),Ak.setAttribute("role","status"),Ak.setAttribute("aria-live","assertive"),Ak.setAttribute("aria-relevant","additions text"),Object.assign(Ak.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),document.body.appendChild(Ak),Ak}();n.lastChild;)n.removeChild(n.firstChild);Mk.filter(Boolean).forEach((function(e,t){n.appendChild(function(e,t){var n=t===Mk.length-1?"block":"none",r=document.createElement("div");return r.style.display=n,r.textContent=e,r}(e,t))}))}var Ik=0;function Rk(e){return"function"===typeof e?e:Nk}function Nk(){}var Lk=function e(t,n,r){return null!==n&&n!==r.parentNode?t(n)?n===document.body&&0===n.scrollTop?document.documentElement:n:e(t,n.parentNode,r):null}.bind(null,(function(e){return e.scrollHeight>e.clientHeight}));function Fk(e,t){return e===t||e.contains(t)}function Bk(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=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.defaultPrevented}))}}function Uk(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.find((function(e){return"undefined"!==typeof e}))}function zk(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function Wk(e){return e.nodeName?"string"===typeof e.nodeName:"string"===typeof e.type}function Hk(e){return e.props||e.attributes}var Kk=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function $k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return Kk.forEach((function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}function Vk(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}var qk=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Gk=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},Yk=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Qk=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},Xk=function(e){function t(){qk(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=Qk(this,e.call.apply(e,[this].concat(r)));Zk.call(i);var a=i.getState({highlightedIndex:i.props.defaultHighlightedIndex,isOpen:i.props.defaultIsOpen,inputValue:i.props.defaultInputValue,selectedItem:i.props.defaultSelectedItem});return null!=a.selectedItem&&(a.inputValue=i.props.itemToString(a.selectedItem)),i.state=a,i.id=i.props.id||"downshift-"+String(Ik++),i}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.getState=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state;return Object.keys(t).reduce((function(n,r){return n[r]=e.isControlledProp(r)?e.props[r]:t[r],n}),{})},t.prototype.isControlledProp=function(e){return void 0!==this.props[e]},t.prototype.getItemCount=function(){return null!=this.itemCount?this.itemCount:void 0!==this.props.itemCount?this.props.itemCount:this.items.length},t.prototype.getItemNodeFromIndex=function(e){return this.props.environment.document.getElementById(this.getItemId(e))},t.prototype.scrollHighlightedItemIntoView=function(){!function(e,t){var n=Lk(e,t);if(null!==n){var r=getComputedStyle(n),o=n.getBoundingClientRect(),i=parseInt(r.borderTopWidth,10),a=i+parseInt(r.borderBottomWidth,10),l=o.top+i,s=e.getBoundingClientRect();if(s.top<0&&o.top<0)n.scrollTop+=s.top;else if(s.top<0)n.scrollTop+=s.top-l;else if(s.top>0&&o.top<0)o.bottom>0&&s.bottom+a>o.bottom&&(n.scrollTop+=s.bottom-o.bottom+a);else{var u=s.top+n.scrollTop-l;u<n.scrollTop?n.scrollTop=u:u+s.height+a>n.scrollTop+o.height&&(n.scrollTop=u+s.height-o.height+a)}}}(this.getItemNodeFromIndex(this.getState().highlightedIndex),this._rootNode)},t.prototype.moveHighlightedIndex=function(e,t){this.getState().isOpen?this.changeHighlightedIndex(e,t):this.setHighlightedIndex(void 0,Gk({isOpen:!0},t))},t.prototype.changeHighlightedIndex=function(e,t){var n=this.getItemCount()-1;if(!(n<0)){var r=this.getState().highlightedIndex;null===r&&(r=e>0?-1:n+1);var o=r+e;o<0?o=n:o>n&&(o=0),this.setHighlightedIndex(o,t)}},t.prototype.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.getButtonProps,u=this.getToggleButtonProps,c=this.getLabelProps,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,getButtonProps:s,getToggleButtonProps:u,getLabelProps: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}},t.prototype.getItemId=function(e){return this.id+"-item-"+e},t.prototype.componentDidMount=function(){var e=this;this._isMounted=!0;var n=function(){e.isMouseDown=!0},r=function(n){var r=e.props.environment.document;e.isMouseDown=!1;var o=e._rootNode&&Fk(e._rootNode,n.target),i=e._rootNode&&Fk(e._rootNode,r.activeElement);o||i||!e.getState().isOpen||e.reset({type:t.stateChangeTypes.mouseUp},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))},o=function(n){!(e._rootNode&&Fk(e._rootNode,n.target))&&e.getState().isOpen&&e.reset({type:t.stateChangeTypes.touchStart},(function(){return e.props.onOuterClick(e.getStateAndHelpers())}))};this.props.environment.addEventListener("mousedown",n),this.props.environment.addEventListener("mouseup",r),this.props.environment.addEventListener("touchstart",o),this.cleanup=function(){e._isMounted=!1,e.props.environment.removeEventListener("mousedown",n),e.props.environment.removeEventListener("mouseup",r),e.props.environment.removeEventListener("touchstart",o)}},t.prototype.componentDidUpdate=function(e,n){this.isControlledProp("selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:t.stateChangeTypes.controlledPropUpdatedSelectedItem,inputValue:this.props.itemToString(this.props.selectedItem)});var r=void 0===this.props.highlightedIndex?this.state:this.props,o=void 0===e.highlightedIndex?n:e;r.highlightedIndex===o.highlightedIndex||this.avoidScrolling||this.scrollHighlightedItemIntoView(),this.updateStatus()},t.prototype.componentWillUnmount=function(){this.cleanup()},t.prototype.render=function(){var e=zk(this.props.render||this.props.children,Nk);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=zk(e(this.getStateAndHelpers()));if(!t)return null;if(this.getRootProps.called)return this.getRootProps.suppressRefError||function(e,t){var n=t.refKey,r="ref"!==n,o=!Wk(e);if(o&&!r)throw new Error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps");if(!o&&r)throw new Error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+n+'"');if(!Hk(e)[n])throw new Error('downshift: You must apply the ref prop "'+n+'" from getRootProps onto your root element.')}(t,this.getRootProps),t;if(Wk(t))return h.cloneElement(t,this.getRootProps(Hk(t)));throw new Error("downshift: If you return a non-DOM element, you must use apply the getRootProps function")},t}(h.Component);Xk.defaultProps={defaultHighlightedIndex:null,defaultSelectedItem:null,defaultInputValue:"",defaultIsOpen:!1,getA11yStatusMessage:function(e){var t=e.isOpen,n=e.highlightedItem,r=e.selectedItem,o=e.resultCount,i=e.previousResultCount,a=e.itemToString;return t?o?n&&o===i?a(n):o+" "+(1===o?"result is":"results are")+" available, use up and down arrow keys to navigate.":"No results.":r?a(r):""},itemToString:function(e){return null==e?"":String(e)},onStateChange:function(){},onInputValueChange:function(){},onUserAction:function(){},onChange:function(){},onSelect:function(){},onOuterClick:function(){},selectedItemChanged:function(e,t){return e!==t},environment:"undefined"===typeof window?{}:window,stateReducer:function(e,t){return t},breakingChanges:{}},Xk.stateChangeTypes={unknown:"__autocomplete_unknown__",mouseUp:"__autocomplete_mouseup__",itemMouseEnter:"__autocomplete_item_mouseenter__",keyDownArrowUp:"__autocomplete_keydown_arrow_up__",keyDownArrowDown:"__autocomplete_keydown_arrow_down__",keyDownEscape:"__autocomplete_keydown_escape__",keyDownEnter:"__autocomplete_keydown_enter__",clickItem:"__autocomplete_click_item__",blurInput:"__autocomplete_blur_input__",changeInput:"__autocomplete_change_input__",keyDownSpaceButton:"__autocomplete_keydown_space_button__",clickButton:"__autocomplete_click_button__",blurButton:"__autocomplete_blur_button__",controlledPropUpdatedSelectedItem:"__autocomplete_controlled_prop_updated_selected_item__",touchStart:"__autocomplete_touchstart__"};var Zk=function(){var e=this;this.input=null,this.items=[],this.itemCount=null,this.previousResultCount=0,this.setItemCount=function(t){return e.itemCount=t},this.unsetItemCount=function(){return e.itemCount=null},this.setHighlightedIndex=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.defaultHighlightedIndex,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n=$k(n),e.internalSetState(Gk({highlightedIndex:t},n))},this.clearSelection=function(t){e.internalSetState({selectedItem:null,inputValue:"",isOpen:!1},t)},this.selectItem=function(t,n,r){n=$k(n),e.internalSetState(Gk({isOpen:!1,highlightedIndex:e.props.defaultHighlightedIndex,selectedItem:t,inputValue:e.isControlledProp("selectedItem")&&e.props.breakingChanges.resetInputOnSelection?e.props.defaultInputValue:e.props.itemToString(t)},n),r)},this.selectItemAtIndex=function(t,n,r){var o=e.items[t];null!=o&&e.selectItem(o,n,r)},this.selectHighlightedItem=function(t,n){return e.selectItemAtIndex(e.getState().highlightedIndex,t,n)},this.internalSetState=function(t,n){var r=void 0,o=void 0,i={},a="function"===typeof t;return!a&&t.hasOwnProperty("inputValue")&&e.props.onInputValueChange(t.inputValue,Gk({},e.getStateAndHelpers(),t)),e.setState((function(n){n=e.getState(n);var l=a?t(n):t;l=e.props.stateReducer(n,l),r=l.hasOwnProperty("selectedItem");var s={},u={};return r&&l.selectedItem!==n.selectedItem&&(o=l.selectedItem),l.type=l.type||Xk.stateChangeTypes.unknown,Object.keys(l).forEach((function(t){n[t]!==l[t]&&(i[t]=l[t]),"type"!==t&&(u[t]=l[t],e.isControlledProp(t)||(s[t]=l[t]))})),a&&l.hasOwnProperty("inputValue")&&e.props.onInputValueChange(l.inputValue,Gk({},e.getStateAndHelpers(),l)),s}),(function(){Rk(n)(),Object.keys(i).length>1&&e.props.onStateChange(i,e.getStateAndHelpers()),r&&e.props.onSelect(t.selectedItem,e.getStateAndHelpers()),void 0!==o&&e.props.onChange(o,e.getStateAndHelpers()),e.props.onUserAction(i,e.getStateAndHelpers())}))},this.rootRef=function(t){return e._rootNode=t},this.getRootProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).suppressRefError,o=void 0!==r&&r,i=n.refKey,a=void 0===i?"ref":i,l=Yk(n,["refKey"]);return e.getRootProps.called=!0,e.getRootProps.refKey=a,e.getRootProps.suppressRefError=o,Gk(((t={})[a]=e.rootRef,t),l)},this.keyDownHandlers={ArrowDown:function(e){e.preventDefault();var t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:Xk.stateChangeTypes.keyDownArrowDown})},ArrowUp:function(e){e.preventDefault();var t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:Xk.stateChangeTypes.keyDownArrowUp})},Enter:function(e){if(this.getState().isOpen){e.preventDefault();var t=this.getState().highlightedIndex,n=this.items[t],r=this.getItemNodeFromIndex(t);if(null==n||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:Xk.stateChangeTypes.keyDownEnter})}},Escape:function(e){e.preventDefault(),this.reset({type:Xk.stateChangeTypes.keyDownEscape})}},this.buttonKeyDownHandlers=Gk({},this.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:Xk.stateChangeTypes.keyDownSpaceButton})}}),this.getToggleButtonProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onClick,r=t.onKeyDown,o=t.onBlur,i=Yk(t,["onClick","onKeyDown","onBlur"]),a=e.getState().isOpen,l={onClick:Bk(n,e.button_handleClick),onKeyDown:Bk(r,e.button_handleKeyDown),onBlur:Bk(o,e.button_handleBlur)},s=i.disabled?{}:l;return Gk({type:"button",role:"button","aria-label":a?"close menu":"open menu","aria-expanded":a,"aria-haspopup":!0,"data-toggle":!0},s,i)},this.getButtonProps=this.getToggleButtonProps,this.button_handleKeyDown=function(t){var n=Vk(t);e.buttonKeyDownHandlers[n]&&e.buttonKeyDownHandlers[n].call(e,t)},this.button_handleClick=function(t){t.preventDefault(),e.props.environment.document.activeElement===e.props.environment.document.body&&t.target.focus(),setTimeout((function(){return e.toggleMenu({type:Xk.stateChangeTypes.clickButton})}))},this.button_handleBlur=function(t){var n=t.target;setTimeout((function(){e.isMouseDown||null!=e.props.environment.document.activeElement&&e.props.environment.document.activeElement.id===e.inputId||e.props.environment.document.activeElement===n||e.reset({type:Xk.stateChangeTypes.blurButton})}))},this.getLabelProps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getLabelProps.called=!0,e.getInputProps.called&&t.htmlFor&&t.htmlFor!==e.inputId)throw new Error('downshift: You provided the htmlFor of "'+t.htmlFor+'" for your label, but the id of your input is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');return e.inputId=Uk(e.inputId,t.htmlFor,e.id+"-input"),Gk({},t,{htmlFor:e.inputId})},this.getInputProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.onKeyDown,o=n.onBlur,i=n.onChange,a=n.onInput,l=Yk(n,["onKeyDown","onBlur","onChange","onInput"]);if(e.getInputProps.called=!0,e.getLabelProps.called&&l.id&&l.id!==e.inputId)throw new Error('downshift: You provided the id of "'+l.id+'" for your input, but the htmlFor of your label is "'+e.inputId+'". You must either remove the id from your input or set the htmlFor of the label equal to the input id.');e.inputId=Uk(e.inputId,l.id,e.id+"-input");var s=e.getState(),u=s.inputValue,c=s.isOpen,d=s.highlightedIndex,f=l.disabled?{}:((t={}).onChange=Bk(i,a,e.input_handleChange),t.onKeyDown=Bk(r,e.input_handleKeyDown),t.onBlur=Bk(o,e.input_handleBlur),t);return Gk({role:"combobox","aria-autocomplete":"list","aria-expanded":c,"aria-activedescendant":c&&"number"===typeof d&&d>=0?e.getItemId(d):null,autoComplete:"off",value:u},f,l,{id:e.inputId})},this.input_handleKeyDown=function(t){var n=Vk(t);n&&e.keyDownHandlers[n]&&e.keyDownHandlers[n].call(e,t)},this.input_handleChange=function(t){e.internalSetState({type:Xk.stateChangeTypes.changeInput,isOpen:!0,inputValue:t.target.value})},this.input_handleBlur=function(){setTimeout((function(){var t=e.props.environment.document.activeElement.dataset.toggle&&e._rootNode&&e._rootNode.contains(e.props.environment.document.activeElement);e.isMouseDown||t||e.reset({type:Xk.stateChangeTypes.blurInput})}))},this.getItemProps=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.onMouseMove,o=n.onMouseDown,i=n.onClick,a=n.index,l=n.item,s=void 0===l?function(e,t){throw new Error('The property "'+t+'" is required in "'+e+'"')}("getItemProps","item"):l,u=Yk(n,["onMouseMove","onMouseDown","onClick","index","item"]);void 0===a?(e.items.push(s),a=e.items.indexOf(s)):e.items[a]=s;var c=((t={onMouseMove:Bk(r,(function(){a!==e.getState().highlightedIndex&&(e.setHighlightedIndex(a,{type:Xk.stateChangeTypes.itemMouseEnter}),e.avoidScrolling=!0,setTimeout((function(){return e.avoidScrolling=!1}),250))})),onMouseDown:Bk(o,(function(e){e.preventDefault()}))}).onClick=Bk(i,(function(){e.selectItemAtIndex(a,{type:Xk.stateChangeTypes.clickItem})})),t),d=u.disabled?{}:c;return Gk({id:e.getItemId(a)},d,u)},this.clearItems=function(){e.items=[]},this.reset=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];t=$k(t),e.internalSetState((function(n){var r=n.selectedItem;return Gk({isOpen:!1,highlightedIndex:e.props.defaultHighlightedIndex,inputValue:e.props.itemToString(r)},t)}),Rk(n))},this.toggleMenu=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];t=$k(t),e.internalSetState((function(e){var n=e.isOpen;return Gk({isOpen:!n},t)}),(function(){e.getState().isOpen&&e.setHighlightedIndex(void 0,t),Rk(n)()}))},this.openMenu=function(t){e.internalSetState({isOpen:!0},Rk(t))},this.closeMenu=function(t){e.internalSetState({isOpen:!1},Rk(t))},this.updateStatus=function(e,t){var n=void 0;return function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];n&&clearTimeout(n),n=setTimeout((function(){n=null,e.apply(void 0,o)}),t)}}((function(){if(e._isMounted){var t=e.getState(),n=e.items[t.highlightedIndex],r=e.getItemCount(),o=e.props.getA11yStatusMessage(Gk({itemToString:e.props.itemToString,previousResultCount:e.previousResultCount,resultCount:r,highlightedItem:n},t));e.previousResultCount=r,Dk(o)}}),200)};Xk.default=Xk,Xk.resetIdCounter=function(){Ik=0};var Jk=Xk;function eC(e){const t=(0,h.useRef)();return(0,h.useEffect)((()=>{t.current=e}),[e]),t.current}const tC={};function nC(e,t,n){if(e){let e=t.findIndex((e=>e.id===n));return-1===e?null:t[e]}return n}function rC(e){return null==e?"":"string"===typeof e?e:e.name||""}function oC(e){return"string"===typeof e?e:e?e.id:null}function iC(e){let{props:{value:t,suggestions:n,embedded:r,isOpen:o=!1,strict:i,initialFilterSuggestions:a}}=e,l=nC(i,n,t),s=a?a(n,t):null;return{selectedItem:l,value:l?rC(l):"",originalItem:l,filteredSuggestions:s,highlightedIndex:null,isOpen:r||o}}function aC(e,t){return rC(e).toLowerCase().includes(t.toLowerCase())}function lC(e,t){return e.filter((e=>aC(e,t)))}function sC(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)}function uC(e,t,n){let{props:{suggestions:r,onUpdate:o,highlightFirst:i,strict:a,filterSuggestions:l=lC,getHighlightedIndex:s}}=e;if(!document.hasFocus())return;if(n.type===Jk.stateChangeTypes.controlledPropUpdatedSelectedItem)return;const u=l(r,t);if(""===t)return n.type!==Jk.stateChangeTypes.clickItem&&sC(o,a,u,null,null),{value:t,filteredSuggestions:u,highlightedIndex:null};{let e=e=>i&&e.length?0:null,r=(s||e)(u);return n.type!==Jk.stateChangeTypes.clickItem&&sC(o,a,u,r,t),{value:t,filteredSuggestions:u,highlightedIndex:r}}}function cC(e,t){let{props:n,state:r}=e;if(n.tableBehavior&&t.type===Jk.stateChangeTypes.mouseUp)return;const o={};return"highlightedIndex"in t&&(o.highlightedIndex=t.highlightedIndex),"isOpen"in t&&(o.isOpen=!!n.embedded||t.isOpen),"selectedItem"in t&&(o.selectedItem=t.selectedItem),!r.isOpen||t.type!==Jk.stateChangeTypes.keyDownArrowUp&&t.type!==Jk.stateChangeTypes.keyDownArrowDown||sC(n.onUpdate,n.strict,r.filteredSuggestions||n.suggestions,null!=o.highlightedIndex?o.highlightedIndex:r.highlightedIndex,r.value),tC.lastChangeType=t.type,o}function dC(e,t){let{props:{onSelect:n,clearAfterSelect:r,suggestions:o}}=e;return n&&setTimeout((()=>{n(oC(t))}),0),fC(o,r)}function fC(e,t){return t?{value:"",selectedItem:null,highlightedIndex:null,filteredSuggestions:e}:{isOpen:!1}}function pC(e,t){let{props:{inputProps:n}}=e;const{onChange:r}=n||{};r&&r(t.target.value)}function hC(e,t){let{props:{suggestions:n,clearAfterSelect:r,initialFilterSuggestions:o,embedded:i,onUpdate:a,onSelect:l,inputProps:s,shouldSaveFromKey:u=mC,strict:c},state:{highlightedIndex:d,originalItem:f,isOpen:p,value:h}}=e,{onKeyDown:y}=s||{};if(p)if("Enter"===t.key)if(null!=d)tC.lastChangeType===Jk.stateChangeTypes.itemMouseEnter?t.preventDefault():t.stopPropagation();else{if(!c)return t.stopPropagation(),l(h),fC(n,r);t.preventDefault(),y&&y(t)}else u(t)&&(t.preventDefault(),y&&y(t));if("Escape"===t.key){t.preventDefault(),i||t.stopPropagation();let e=o?o(n,rC(f)):null;return sC(a,c,n,null,oC(f)),{value:rC(f),selectedItem:nC(c,n,f),filteredSuggestions:e,highlightedIndex:null,isOpen:!!i}}}function yC(e){return(0,jo.jsx)(Is,{...e})}function gC(e,t,n){return(0,jo.jsx)("div",{children:e.map(((e,r)=>{let o=rC(e);return(0,h.createElement)("div",{...t({item:e}),key:o,...(0,so.iv)({padding:5,cursor:"default",backgroundColor:n===r?mo.n4:null})},o)}))})}function mC(e){return"Enter"===e.code}function vC(e,t){let{props:{inputProps:n={},openOnFocus:r=!0}}=e;if(n.onFocus&&n.onFocus(t),r)return{isOpen:!0}}function bC(e,t){let{props:n,state:{selectedItem:r}}=e,{inputProps:o={},onSelect:i}=n;if(t.preventDownshiftDefault=!0,o.onBlur&&o.onBlur(t),n.tableBehavior)return{isOpen:!1};{if(""===t.target.value)return i&&i(null),{selectedItem:null,originalValue:null,isOpen:!1};let e=r?oC(r):null;return iC({props:{...n,value:e,originalValue:e}})}}function xC(e){return e?rC(e):""}function wC(e){const[t,n]=h.useState((()=>iC({props:e}))),{value:r,selectedItem:o,filteredSuggestions:i,highlightedIndex:a,isOpen:l}=t,s=eC(e);h.useEffect((()=>{if(!s)return;const r=function(e,t){let{strict:n,suggestions:r,filterSuggestions:o=lC,initialFilterSuggestions:i,value:a,itemToString:l=xC}=t,{value:s}=e.state,u=null;function c(){let e=nC(n,r,a);e&&(u=u||{},u.value=l(e),u.selectedItem=e)}if(e.props.value!==a&&c(),e.props.suggestions!==r){let t=null;t=null!=e.state.highlightedIndex?o(r,s):i?i(r,s):null,u=u||{},c(),u.filteredSuggestions=t}return u}({props:s,state:t},e);r&&n(Object.assign({},t,r))}),[e,s]);const u=r=>function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];const l=Object.assign({},t,r({props:e,state:t},...i)||{});n(l)},{focused:c,embedded:d,containerProps:f,inputProps:p,suggestions:y,tooltipStyle:g,tooltipProps:m,renderInput:v=yC,renderItems:b=gC,itemToString:x=xC}=e,w=i||y;return(0,jo.jsx)(Jk,{onSelect:u(dC),highlightedIndex:a,selectedItem:o||null,itemToString:x,inputValue:r,isOpen:l,onInputValueChange:u(uC),onStateChange:u(cC),children:e=>{let{getInputProps:t,getItemProps:n,isOpen:r,inputValue:o,highlightedIndex:i}=e;return(0,jo.jsxs)("div",{className:"view "+(0,so.iv)({display:"flex"}).toString(),...f,children:[v(t({focused:c,...p,onFocus:u(vC),onBlur:u(bC),onKeyDown:u(hC),onChange:u(pC)})),r&&w.length>0&&(d?(0,jo.jsx)(ms,{style:{marginTop:5},"data-testid":"autocomplete",children:b(w,n,i,o)}):(0,jo.jsx)(Ss,{position:"bottom-stretch",offset:2,style:{padding:0,backgroundColor:mo.n1,color:"white",...g},...m,"data-testid":"autocomplete",children:b(w,n,i,o)}))]})}})}function jC(e){let{name:t,onRemove:n}=e;return(0,jo.jsxs)(ms,{style:{alignItems:"center",flexDirection:"row",backgroundColor:mo.b9,padding:"2px 4px",margin:"2px",borderRadius:4},children:[t,(0,jo.jsx)(As,{type:"button",bare:!0,style:{marginLeft:1},onClick:n,children:(0,jo.jsx)(ew,{style:{width:8,height:8}})})]})}function SC(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,jo.jsx)(_C,{...i,value:null,suggestions:r.filter((e=>!t.includes(oC(e)))),onSelect:function(e){e&&(e=e.trim(),n([...t,e],e))},clearAfterSelect:!0,highlightFirst:!0,strict:o,tooltipProps:{forceLayout:s.current!==t},renderInput:e=>(0,jo.jsxs)(ms,{style:[{display:"flex",flexWrap:"wrap",flexDirection:"row",alignItems:"center",backgroundColor:"white",borderRadius:4,border:"1px solid #d0d0d0"},a&&{border:"1px solid "+mo.b5,boxShadow:"0 1px 1px "+mo.b7}],children:[t.map(((e,t)=>(e=nC(o,r,e))&&(0,jo.jsx)(jC,{name:rC(e),onRemove:()=>u(oC(e))},oC(e)||t))),(0,jo.jsx)(Is,{...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 kC(e){let{title:t,style:n,hoveredStyle:r,onClick:o}=e;return(0,jo.jsx)(As,{style:[{fontSize:12,color:mo.n10,backgroundColor:"transparent",borderColor:mo.n5},n],hoveredStyle:[{backgroundColor:"rgba(200, 200, 200, .25)"},r],onClick:o,children:t})}function CC(e){let{show:t=!0,embedded:n,children:r}=e;return t&&(0,jo.jsx)(ms,{style:[{flexShrink:0},n?{paddingTop:5}:{padding:5}],onMouseDown:e=>e.preventDefault(),children:r})}function _C(e){let{multi:t,...n}=e;return t?(0,jo.jsx)(SC,{...n}):(0,jo.jsx)(wC,{...n})}function OC(e){let{items:t,getItemProps:n,highlightedIndex:r,embedded:o}=e,i=null;return(0,jo.jsx)(ms,{children:(0,jo.jsx)(ms,{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,jo.jsx)("div",{style:{color:mo.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?mo.n4:"transparent",padding:4,paddingLeft:20,borderRadius:o?4:0},"data-testid":"account-item"+(r===t?"-highlighted":"")},e.name)]}))})})}function EC(e){let{embedded:t,includeClosedAccounts:n=!0,...r}=e,o=yf()||[];return(0,jo.jsx)(_C,{strict:!0,highlightFirst:!0,embedded:t,suggestions:n?o:o.filter((e=>!1===e.closed)),renderItems:(e,n,r)=>(0,jo.jsx)(OC,{items:e,getItemProps:n,highlightedIndex:r,embedded:t}),...r})}var TC=e=>(0,jo.jsx)("svg",{...e,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",style:{color:"#242134",...e.style},children:(0,jo.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 PC=h.forwardRef(((e,t)=>{let{categoryGroups:n,emptyLabel:r,...o}=e;return(0,jo.jsxs)(Ls,{...o,ref:t,children:[(0,jo.jsx)("option",{value:"",children:r||"Select category..."}),n.map((e=>(0,jo.jsx)("optgroup",{label:e.name,children:e.categories.map((e=>(0,jo.jsx)("option",{value:e.id,children:e.name},e.id)))},e.id)))]})}));function AC(e){let{items:t,getItemProps:n,highlightedIndex:r,embedded:o,footer:i}=e,a=null;return(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(ms,{style:[{overflow:"auto",padding:"5px 0"},!o&&{maxHeight:175}],children:t.map(((e,t)=>{if("split"===e.id)return(0,jo.jsxs)(ms,{...n?n({item:e}):null,style:{backgroundColor:r===t?mo.n4:"transparent",borderRadius:o?4:0,flexShrink:0,flexDirection:"row",alignItems:"center",fontSize:11,fontWeight:500,color:mo.g8,padding:"6px 8px"},"data-testid":"split-transaction-button",children:[(0,jo.jsx)(gs,{style:{lineHeight:0},children:(0,jo.jsx)(TC,{width:10,height:10,style:{marginRight:5,color:"inherit"}})}),"Split Transaction"]},"split");const i=e.cat_group!==a;return a=e.cat_group,(0,jo.jsxs)(h.Fragment,{children:[i&&(0,jo.jsx)("div",{style:{color:mo.y9,padding:"4px 9px"},"data-testid":"category-item-group",children:e.groupName}),(0,jo.jsx)("div",{...n?n({item:e}):null,style:{backgroundColor:r===t?mo.n4:"transparent",padding:4,paddingLeft:20,borderRadius:o?4:0},"data-testid":"category-item"+(r===t?"-highlighted":""),children:e.name})]},e.id)}))}),i]})}function MC(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,jo.jsx)(_C,{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||aC(e,t)||e.groupName.toLowerCase().includes(t.toLowerCase()))),suggestions:a,renderItems:(e,t,n)=>(0,jo.jsx)(AC,{items:e,embedded:r,getItemProps:t,highlightedIndex:n}),...i})}function DC(e,t,n){let r=n?no(e,n):e;return t&&r&&(r=r.filter((e=>!!e.transfer_acct))),r||[]}function IC(e,t){return"new"!==e||t.current.startsWith("new:")?e:"new:"+t.current}function RC(e){return"string"===typeof e&&e.startsWith("new:")?"new":e}function NC(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,jo.jsxs)(ms,{children:[(0,jo.jsxs)(ms,{style:[{overflow:"auto",padding:"5px 0"},!o&&{maxHeight:175}],children:[s&&(0,jo.jsx)(ms,{...n?n({item:s}):null,style:{flexShrink:0,padding:"6px 9px",backgroundColor:0===r?mo.n4:"transparent",borderRadius:o?4:0},children:(0,jo.jsxs)(ms,{style:{display:"block",color:mo.g8,borderRadius:4,fontSize:11,fontWeight:500},children:[(0,jo.jsx)(Vx,{width:8,height:8,style:{color:mo.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,jo.jsxs)(h.Fragment,{children:[a&&(0,jo.jsx)("div",{style:{color:mo.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?mo.n4:"transparent",borderRadius:o?4:0,padding:4,paddingLeft:20}},e.name),d&&(0,jo.jsx)("div",{style:{fontSize:11,padding:5,color:mo.n5,textAlign:"center"},children:"More payees are available, search to find them"})]},e.id)}))]}),a]})}function LC(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=(0,h.useMemo)((()=>[{id:"new",name:""},...DC(f,y,p)]),[f,y,p]),v=(0,h.useRef)(""),b=ge();const[x,w]=(0,h.useState)(!1);return(0,jo.jsx)(_C,{strict:!0,embedded:l,value:RC(t),suggestions:m,tableBehavior:a,itemToString:e=>e?"new"===e.id?v.current:e.name:"",focused:x,inputProps:{...n,onBlur:()=>w(!1),onFocus:()=>w(!0),onChange:e=>v.current=e},onUpdate:e=>s&&s(IC(e,v)),onSelect:async function(e){if(a)u&&u(IC(e,v));else{let t=()=>b(rn(v.current));Array.isArray(e)?e=await Promise.all(e.map((e=>"new"===e?t():e))):"new"===e&&(e=await t()),u&&u(e)}},getHighlightedIndex:e=>e.length>1&&"new"===e[0].id?1:0,filterSuggestions:(e,t)=>{let n=e.filter(((e,n)=>"new"===e.id?!(!t||""===t||y):aC(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},initialFilterSuggestions:e=>{let t=!1,n=e.filter(((e,n)=>"new"!==e.id&&(!(n>=100&&!e.transfer_acct)||(t=!0,!1))));return t&&(n.filtered=!0),n},renderItems:(e,t,n,i)=>(0,jo.jsx)(NC,{items:e,getItemProps:t,highlightedIndex:n,inputValue:i,embedded:l,footer:(0,jo.jsxs)(CC,{embedded:l,children:[r&&(0,jo.jsx)(kC,{title:"Make Transfer",style:[o&&{marginBottom:5},y&&{backgroundColor:mo.y8,color:mo.g2,borderColor:mo.y8}],hoveredStyle:y&&{backgroundColor:mo.y8,colors:mo.y2},onClick:()=>{s&&s(null),g(!y)}}),o&&(0,jo.jsx)(kC,{title:"Manage Payees",onClick:()=>c()})]})}),...d},y?"transfers":"all")}var FC=n(8582),BC=n.n(FC);let UC={"& .pika-single.actual-date-picker":{color:mo.n11,background:mo.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:mo.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:mo.n11,"& abbr":{textDecoration:"none"}},"& .pika-button":{backgroundColor:mo.n2,color:mo.n11},"& .is-today .pika-button":{textDecoration:"underline"},"& .is-selected .pika-button":{backgroundColor:mo.n5,boxShadow:"none"}}},zC=h.forwardRef(((e,t)=>{let{value:n,dateFormat:r,onUpdate:o,onSelect:i}=e,a=(0,h.useRef)(null),l=(0,h.useRef)(null);return(0,h.useImperativeHandle)(t,(()=>({handleInputKeyDown(e){let t=null;switch(e.key){case"ArrowLeft":e.preventDefault(),t=qp(a.current.getDate(),1);break;case"ArrowUp":e.preventDefault(),t=qp(a.current.getDate(),7);break;case"ArrowRight":e.preventDefault(),t=Vp(a.current.getDate(),1);break;case"ArrowDown":e.preventDefault(),t=Vp(a.current.getDate(),7)}t&&(a.current.setDate(t,!0),o&&o(t))}})),[]),(0,h.useLayoutEffect)((()=>(a.current=new(BC())({theme:"actual-date-picker",keyboardInput:!1,defaultDate:n?tx(n,r,new Date):new Date,setDefaultDate:!0,toString(e){return Hp(e,r)},parse(e){return tx(e,r,new Date)},onSelect:i}),l.current.appendChild(a.current.el),()=>{a.current.destroy()})),[]),(0,h.useEffect)((()=>{a.current.getDate()!==n&&a.current.setDate(tx(n,r,new Date),!0)}),[n,r]),(0,jo.jsx)(ms,{style:[UC,{flex:1}],innerRef:l})}));function WC(e){return"Enter"===e.key}function HC(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=WC,tableBehavior:f,onUpdate:p,onSelect:y}=e,g=(0,h.useMemo)((()=>{if(o){let e=lk(o);if(zf(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);(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);zf(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);zf(e)&&(p&&p(Hp(e,"yyyy-MM-dd")),k(Hp(e,l)))}else{let e=tx(v,l,new Date);if(zf(e)){let t=Hp(e,"yyyy-MM-dd");p&&p(t),k(v)}}}),[v]);return(0,jo.jsxs)(ms,{...t,children:[(0,jo.jsx)(Is,{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&&(_=(0,jo.jsx)(zC,{ref:m,value:S,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?_:(0,jo.jsx)(Ss,{position:"bottom-left",offset:2,style:[{padding:0,minWidth:225},r],children:_}))]});var _}var KC=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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 $C=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 VC=5,qC=[{id:"daily",name:"Days"},{id:"weekly",name:"Weeks"},{id:"monthly",name:"Months"},{id:"yearly",name:"Years"}],GC=[...Array(31).keys()].map((e=>e+1)),YC=[{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 QC(e){return e||{start:Jp(),interval:1,frequency:"monthly",patterns:[ZC(Jp())]}}function XC(e){return{...e,interval:n_(e.interval)}}function ZC(e){return{value:parseInt(fh(e,"d")),type:"day"}}function JC(e){let{field:t,value:n,recurrence:r}=e;return"value"===t&&"day"!==r.type&&n>VC||"type"===t&&"day"!==n&&r.value>VC?{[t]:n,value:VC}:{[t]:n}}function e_(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,...JC(t)}:e))}};case"add-recurrence":return{...e,config:{...e.config,patterns:[...e.config.patterns||[],ZC(e.config.start)]}};case"remove-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.filter((e=>e!==t.recurrence))}};default:return e}}function t_(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,jo.jsx)(gs,{children:t}):(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(gs,{style:{fontWeight:600},children:"Upcoming dates"}),(0,jo.jsx)(xs,{direction:"row",spacing:4,style:{marginTop:10},children:t.map((e=>(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(gs,{children:fh(e,n)}),(0,jo.jsx)(gs,{children:fh(e,"EEEE")})]})))})]}),(0,jo.jsx)(xs,{direction:"column",spacing:1,style:{marginTop:15,color:mo.n4},children:r})}function n_(e){const t=parseInt(e);return Number.isInteger(t)&&t>0?t:1}function r_(e){let{config:t,dispatch:n}=e,r=(e,t,r)=>n({type:"update-recurrence",recurrence:e,field:t,value:r});return(0,jo.jsx)(xs,{spacing:2,style:{marginTop:10},children:t.patterns.map(((e,t)=>(0,jo.jsxs)(ms,{style:{display:"flex",flexDirection:"row"},children:[(0,jo.jsxs)(Ls,{style:{marginRight:10},value:e.value,onChange:t=>r(e,"value",function(e){return"last"===e?-1:Number(e)}(t.target.value)),children:[(0,jo.jsx)("option",{value:-1,children:"Last"}),(0,jo.jsx)("option",{disabled:!0,children:"---"}),GC.map((e=>(0,jo.jsx)("option",{value:e,children:e},e)))]}),(0,jo.jsxs)(Ls,{style:{marginRight:10},value:e.type,onChange:t=>r(e,"type",t.target.value),children:[(0,jo.jsx)("option",{value:"day",children:"Day"}),(0,jo.jsx)("option",{disabled:!0,children:"---"}),YC.map((e=>(0,jo.jsx)("option",{value:e.id,children:e.name},e.id)))]}),(0,jo.jsx)(As,{bare:!0,style:{padding:7},onClick:()=>n({type:"remove-recurrence",recurrence:e}),children:(0,jo.jsx)($C,{style:{width:8,height:8}})}),(0,jo.jsx)(As,{bare:!0,style:{padding:7,marginLeft:5},onClick:()=>n({type:"add-recurrence"}),children:(0,jo.jsx)(KC,{style:{width:10,height:10}})})]},t)))})}function o_(e){let{config:t,onClose:n,onSave:r}=e,[o,i]=(0,h.useState)(null),[a,l]=(0,h.useReducer)(e_,{config:QC(t)}),s=xe((e=>e.prefs.local.dateFormat||"MM/dd/yyyy"));(0,h.useEffect)((()=>{l({type:"replace-config",config:QC(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:XC(u),count:4});i(t?"Invalid rule":e)}()}),[u]),null==o?null:(0,jo.jsxs)(Ss,{style:{padding:10,width:380},offset:1,position:"bottom-left",onClose:n,children:[(0,jo.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,jo.jsx)("label",{htmlFor:"start",style:{marginRight:5},children:"Starts:"}),(0,jo.jsx)(HC,{id:"start",inputProps:{placeholder:"Start Date"},value:u.start,onSelect:e=>c("start",e),containerProps:{style:{width:100}},dateFormat:s})]}),(0,jo.jsxs)(xs,{direction:"row",align:"center",justify:"flex-start",style:{marginTop:10},spacing:2,children:[(0,jo.jsx)(gs,{style:{whiteSpace:"nowrap"},children:"Repeat every"}),(0,jo.jsx)(Is,{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,jo.jsx)(Ls,{onChange:e=>c("frequency",e.target.value),value:u.frequency,style:{flex:0},children:qC.map((e=>(0,jo.jsx)("option",{value:e.id,children:e.name},e.id)))}),"monthly"!==u.frequency||null!=u.patterns&&0!==u.patterns.length?null:(0,jo.jsx)(As,{onClick:()=>l({type:"add-recurrence"}),children:"Add specific days"})]}),"monthly"===u.frequency&&u.patterns&&u.patterns.length>0&&(0,jo.jsx)(r_,{config:u,dispatch:l}),(0,jo.jsx)(t_,{previewDates:o}),(0,jo.jsxs)("div",{style:{display:"flex",marginTop:15,justifyContent:"flex-end"},children:[(0,jo.jsx)(As,{onClick:n,children:"Cancel"}),(0,jo.jsx)(As,{onClick:()=>r(XC(u)),primary:!0,style:{marginLeft:10},children:"Apply"})]})]})}function i_(e){let{value:t,buttonStyle:n,onChange:r}=e,{isOpen:o,close:i,getOpenEvents:a}=js();return(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(As,{...a(),style:[{textAlign:"left"},n],children:t?wh(t):"No recurring date"}),o&&(0,jo.jsx)(o_,{config:t,onClose:i,onSave:function(e){r(e),i()}})]})}function a_(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":u.length>0&&(p=(0,jo.jsx)(LC,{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,jo.jsx)(EC,{accounts:c,value:i,multi:o,openOnFocus:!0,onSelect:s,inputProps:{inputRef:a,...h?{placeholder:"nothing"}:null}});break;case"category":p=(0,jo.jsx)(MC,{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,jo.jsx)(Is,{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,jo.jsx)(Is,{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,jo.jsx)(i_,{value:i,buttonStyle:{justifyContent:"flex-start"},onChange:s}):(0,jo.jsx)(HC,{value:i,dateFormat:f,openOnFocus:!1,inputRef:a,inputProps:{placeholder:f.toLowerCase()},onSelect:s})}break;case"boolean":p=(0,jo.jsx)(tu,{checked:i,value:i,onChange:()=>s(!i)});break;default:p=o?(0,jo.jsx)(_C,{multi:!0,suggestions:[],value:i,inputProps:{inputRef:a},onSelect:s}):(0,jo.jsx)(Is,{inputRef:a,defaultValue:i||"",placeholder:"nothing",onEnter:e=>s(e.target.value),onBlur:e=>s(e.target.value)})}return(0,jo.jsx)(ms,{style:[{flex:1},l],children:p})}let l_=["date","account","payee","notes","category","amount","cleared"].map((e=>[e,ek(e)]));function s_(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 u_(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 c_(e){let{op:t,selected:n,style:r,onClick:o}=e;return(0,jo.jsx)(As,{bare:!0,style:[{backgroundColor:mo.n10,marginBottom:5},r,n&&{color:"white","&,:hover,:active":{backgroundColor:mo.b4}}],onClick:o,children:tk(t)})}function d_(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 f_(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,jo.jsx)(Ss,{position:"bottom-left",style:{padding:15},width:300,onClose:()=>i({type:"close"}),children:(0,jo.jsxs)(NS,{children:[(0,jo.jsx)(ms,{style:{marginBottom:10},children:"amount"===t||"date"===t?(0,jo.jsx)(Fs,{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}}):Ir(ek(t))}),(0,jo.jsx)(xs,{direction:"row",align:"flex-start",spacing:1,style:{flexWrap:"wrap"},children:"boolean"===d?[(0,jo.jsx)(c_,{op:"true",selected:!0===o,onClick:()=>{i({type:"set-op",op:"is"}),i({type:"set-value",value:!0})}},"true"),(0,jo.jsx)(c_,{op:"false",selected:!1===o,onClick:()=>{i({type:"set-op",op:"is"}),i({type:"set-value",value:!1})}},"false")]:f.map((e=>(0,jo.jsx)(c_,{op:e,selected:e===r,onClick:()=>i({type:"set-op",op:e})},e)))}),(0,jo.jsxs)("form",{action:"#",children:["boolean"!==d&&(0,jo.jsx)(a_,{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,jo.jsx)(ms,{children:(0,jo.jsx)(As,{primary:!0,style:{marginTop:15},onClick:e=>{e.preventDefault(),a({field:t,op:r,value:o,options:u_(t,l)})},children:"Apply"})})]})]})})}function p_(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 d_(e,t)}}),{fieldsOpen:!1,condOpen:!1,field:null,value:null});return(0,jo.jsxs)(ms,{children:[(0,jo.jsxs)(As,{bare:!0,onClick:()=>o({type:"select-field"}),children:[(0,jo.jsx)(ak,{style:{width:16,height:16,color:"inherit",marginRight:5}})," ","Filter"]}),r.fieldsOpen&&(0,jo.jsx)(Ss,{position:"bottom-left",style:{padding:0},onClose:()=>o({type:"close"}),children:(0,jo.jsx)(Us,{onMenuSelect:e=>{o({type:"configure",field:e})},items:l_.map((e=>{let[t,n]=e;return{name:t,text:Ir(n)}}))})}),r.condOpen&&(0,jo.jsx)(f_,{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(!zf(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(!zf(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=Ir(ek(e.field));alert(t+": "+nk(r.conditionErrors[0]))}else t(e),o({type:"close"})}})]})}function h_(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):d_(e,t)),{field:t,op:n,value:r,options:o});return(0,jo.jsx)(f_,{field:l.field,initialSubfield:s_({field:t,options:o,value:r}),op:l.op,value:l.value,options:l.options,dispatch:s,onApply:e=>{i(e),a()}})}function y_(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=s_({field:t,value:o});return(0,jo.jsxs)(ms,{style:[{backgroundColor:mo.n10,borderRadius:4,flexDirection:"row",alignItems:"center",marginBottom:10,marginRight:10},l],children:[(0,jo.jsx)(As,{bare:!0,disabled:null!=n,onClick:()=>d(!0),style:{marginRight:-7},children:(0,jo.jsx)("div",{style:{paddingBlock:1,paddingLeft:5,paddingRight:2},children:n?(0,jo.jsx)(gs,{style:{color:mo.p4},children:n}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gs,{style:{color:mo.p4},children:ek(f,i)})," ",(0,jo.jsx)(gs,{style:{color:mo.n3},children:tk(r)})," ",(0,jo.jsx)(bk,{value:o,field:f,inline:!0,valueIsRaw:"contains"===r})]})})}),(0,jo.jsx)(As,{bare:!0,onClick:u,children:(0,jo.jsx)(hs,{style:{width:8,height:8,color:mo.n4,margin:5,marginLeft:3}})}),c&&(0,jo.jsx)(h_,{field:t,customName:n,op:r,value:o,options:i,stage:a,onSave:s,onClose:()=>d(!1)})]})}function g_(e){let{filters:t,editingFilter:n,onUpdate:r,onDelete:o}=e;return(0,jo.jsx)(ms,{style:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",marginTop:10,marginBottom:-5},children:t.map(((e,t)=>(0,jo.jsx)(y_,{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 m_(e,t){throw new Error(t+": "+JSON.stringify(e.str.slice(e.index,10)))}function v_(e){return e.str[e.index]}function b_(e){if(e.index>=e.str.length)return null;let t=v_(e);return e.index++,t}function x_(e,t){return v_(e)===t&&(b_(e),!0)}function w_(e){if("("===v_(e)){b_(e);let t=j_(e);return")"!==v_(e)&&m_(e,"Unbalanced parentheses"),b_(e),t}return function(e){let t="-"===v_(e);t&&b_(e),/\p{Sc}/u.test(v_(e))&&b_(e);let n="";for(;v_(e)&&v_(e).match(/[0-9,.]/);){let t=","===Fr().separator?".":",";v_(e)===t?b_(e):n+=b_(e)}""===n&&m_(e,"Unexpected character");let r=parseFloat(n.replace(Fr().separator,"."));return t?-r:r}(e)}let j_=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(;x_(n,t);)r={op:t,left:r,right:e(n)};return r}),w_)}("^","/","*","-","+");function S_(e){if("number"===typeof e)return e;let{left:t,right:n,op:r}=e;switch(r){case"+":return S_(t)+S_(n);case"-":return S_(t)-S_(n);case"*":return S_(t)*S_(n);case"/":return S_(t)/S_(n);case"^":return Math.pow(S_(t),S_(n));default:throw new Error("Unknown operator: "+r)}}function k_(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(""===e)return n;try{t=S_(function(e){let t={str:e.replace(/\s/g,""),index:0};return j_(t)}(e))}catch(Wa){return n}return isNaN(t)?n:t}var C_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"#242134",...e.style},children:(0,jo.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 __=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 O_=e=>(0,jo.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.jsx)("g",{fill:"#000",children:(0,jo.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 E_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 T_=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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,jo.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 P_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 A_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 M_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 D_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 I_=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 R_(e){let t,n,r;switch(e){case"missed":t=mo.r1,n=mo.r10,r=M_;break;case"due":t=mo.y1,n=mo.y9,r=P_;break;case"upcoming":t=mo.p1,n=mo.p10,r=E_;break;case"paid":t=mo.g2,n=mo.g10,r=I_;break;case"completed":t=mo.n4,n=mo.n11,r=D_;break;case"pending":t=mo.g4,n=mo.g11,r=E_;break;case"scheduled":t=mo.n1,n=mo.n11,r=E_;break;case"cleared":t=mo.g5,n=mo.n11,r=Xx;break;default:t=mo.n1,n=mo.n11,r=A_}return{color:t,backgroundColor:n,Icon:r}}function N_(e){let{status:t,style:n}=e,{color:r,backgroundColor:o,Icon:i}=R_(t);return(0,jo.jsxs)(ms,{style:[{color:r,backgroundColor:o,padding:"6px 8px",borderRadius:4,flexDirection:"row",alignItems:"center",flexShrink:0},n],children:[(0,jo.jsx)(i,{style:{width:13,height:13,color:"inherit",marginRight:7}}),(0,jo.jsx)(gs,{style:{lineHeight:"1em"},children:Ir(t)})]})}function L_(e,t){let{amount:n,date:r}=e;Q_(e.id)&&(n=Sh(n));let o=n<0?-n:null,i=n>0?n:null;return 0===n&&(t?i=0:o=0),zf(lk(r))||(r=null),{...e,date:r,debit:null!=o?Wr(o):"",credit:null!=i?Wr(i):""}}function F_(e,t){let n=e[t];return n&&n.is_child&&(null==e[t+1]||e[t+1].parent_id!==n.parent_id)}let B_=h.createContext(null);function U_(){let e=(0,h.useContext)(B_);return(0,h.useMemo)((()=>({...e,expanded:t=>"collapse"===e.state.mode?!e.state.ids.has(t):e.state.ids.has(t)})),[e])}function z_(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,jo.jsx)(B_.Provider,{value:l,children:t})}const W_=h.memo((e=>{let{hasSelected:t,showAccount:n,showCategory:r,showBalance:o,showCleared:i}=e,a=Ix();return(0,jo.jsxs)(qw,{borderColor:mo.n9,backgroundColor:"white",style:{color:mo.n4,fontWeight:300,zIndex:200},children:[(0,jo.jsx)(nj,{exposed:!0,focused:!1,selected:t,width:20,onSelect:()=>a({type:"select-all"})}),(0,jo.jsx)(Vw,{value:"Date",width:110}),n&&(0,jo.jsx)(Vw,{value:"Account",width:"flex"}),(0,jo.jsx)(Vw,{value:"Payee",width:"flex"}),(0,jo.jsx)(Vw,{value:"Notes",width:"flex"}),r&&(0,jo.jsx)(Vw,{value:"Category",width:"flex"}),(0,jo.jsx)(Vw,{value:"Payment",width:80,textAlign:"right"}),(0,jo.jsx)(Vw,{value:"Deposit",width:80,textAlign:"right"}),o&&(0,jo.jsx)(Vw,{value:"Balance",width:88,textAlign:"right"}),i&&(0,jo.jsx)($w,{width:21,truncate:!1}),(0,jo.jsx)(Vw,{value:"",width:15+vo.scrollbarWidth})]})}));function H_(e){let{id:t,focused:n,selected:r,status:o,isChild:i,onEdit:a,onUpdate:l}=e,s="cleared"===o||null==o,u=R_(o),c={color:"cleared"===o?mo.g5:"missed"===o?mo.r6:"due"===o?mo.y5:r?mo.b7:mo.n7};return(0,jo.jsx)(Vw,{name:"cleared",width:"auto",focused:n,style:{padding:1},plain:!0,children:(0,jo.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 K_(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,jo.jsx)(Jw,{width:"flex",name:"payee",value:n,valueStyle:[s,i&&{color:mo.n8}],formatter:()=>function(e,t,n){let{payee:r}=e;if(n){const t=e.amount>0?C_:gk;return(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(t,{width:10,height:8,style:{marginRight:5,flexShrink:0}}),(0,jo.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,jo.jsx)(LC,{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 $_(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,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",alignItems:"stretch"},children:[(0,jo.jsx)(Vw,{exposed:!0,children:()=>o?(0,jo.jsx)(O_,{style:i}):(0,jo.jsx)(E_,{style:{...i,transform:"translateY(-1px)"}})}),n]})}const V_=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)(L_(t,l)),B=Q_(L.id);function U(e,n){if(L[e]!==n){let r={...L,[e]:n};if("note"===e&&""===n&&null==L.note)return;if("account"===e&&n&&Jr(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=k_(r,null);n=null!=e?-e:null}else n=k_(o,null);return n=null!=n?Vr(n):t.amount,null==i&&(i=t.date||Jp()),{...a,date:i,amount:n}}(r,t);F(L_(e,l)),k(e)}}}t===R&&l===D||(F(L_(t,l)),N(t),I(l));let{id:z,debit:W,credit:H,payee:K,imported_payee:$,notes:V,date:q,account:G,category:Y,cleared:Q,is_parent:X,_unmatched:Z=!1}=L,J=b&&K&&eo(b)[K],ee=x&&G&&Jr(x)[G],te=J&&J.transfer_acct&&Jr(x)[J.transfer_acct],ne=L.is_child,re=c?mo.b8:mo.border,oe=te&&0===te.offbudget,ie=ee&&1===ee.offbudget,ae=f?{fontWeight:600}:null,le=u||"select"===m,se=S?{letterSpacing:-.5}:null;return(0,jo.jsxs)(qw,{borderColor:re,backgroundColor:c?mo.selected:le?mo.hover:B?"#fcfcfc":r,highlighted:d,style:[s,B&&{color:mo.n5,fontStyle:"italic"},Z&&{opacity:.5}],onMouseEnter:()=>_&&_(L.id),children:[ne&&(0,jo.jsx)($w,{borderColor:"transparent",width:110,style:{width:110,backgroundColor:mo.n11,borderBottomWidth:0}}),ne&&o&&(0,jo.jsx)($w,{borderColor:"transparent",style:{flex:1,backgroundColor:mo.n11,opacity:0}}),Y_(L.id)?ne?(0,jo.jsx)(ej,{onDelete:()=>O&&O(L.id),exposed:u||n,style:[ne&&{borderLeftWidth:1},{lineHeight:0}]}):(0,jo.jsx)(Vw,{width:20}):(0,jo.jsx)(nj,{exposed:u||c||n,focused:"select"===m,onSelect:()=>{M({type:"select",id:L.id})},onEdit:()=>C(z,"select"),selected:c,style:[ne&&{borderLeftWidth:1}],value:p&&(0,jo.jsx)(T_,{style:{width:13,height:13,color:mo.n7}})}),!ne&&(0,jo.jsx)(Jw,{name:"date",width:110,exposed:"date"===m,value:q,valueStyle:ae,formatter:e=>e?Hp(lk(e),j):"",onExpose:!B&&(e=>C(z,e)),onUpdate:e=>{U("date",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,jo.jsx)(HC,{value:q||"",dateFormat:j,inputProps:{onBlur:t,onKeyDown:n,style:a},shouldSaveFromKey:i,tableBehavior:!0,onUpdate:r,onSelect:o})}}),!ne&&o&&(0,jo.jsx)(Jw,{name:"account",width:"flex",value:G,formatter:e=>{let t=e&&Jr(x)[e];return t?t.name:""},valueStyle:ae,exposed:"account"===m,onExpose:!B&&(e=>C(z,e)),onUpdate:async e=>{e&&U("account",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,jo.jsx)(EC,{value:G,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,jo.jsx)(K_,{id:z,payeeId:K,accountId:G,focused:"payee"===m,inherited:g&&g.has("payee"),payees:b,accounts:x,valueStyle:ae,transaction:L,payee:J,transferAcct:te,importedPayee:$,isPreview:B,onEdit:C,onUpdate:U,onCreatePayee:P,onManagePayees:T});return L.schedule?(0,jo.jsx)($_,{scheduleId:L.schedule,children:e}):e})(),B?(0,jo.jsx)(Vw,{name:"notes",width:"flex"}):(0,jo.jsx)(Xw,{width:"flex",name:"notes",exposed:"notes"===m,focused:"notes"===m,value:V||"",valueStyle:ae,onExpose:!B&&(e=>C(z,e)),inputProps:{value:V||"",onUpdate:U.bind(null,"notes")}}),B?(0,jo.jsx)(Vw,{width:"flex",style:{alignItems:"flex-start"},exposed:!0,children:()=>(0,jo.jsx)(ms,{style:{color:"missed"===V?mo.r6:"due"===V?mo.y4:c?mo.b5:mo.n6,backgroundColor:"missed"===V?mo.r10:"due"===V?mo.y9:c?mo.b8:mo.n10,margin:"0 5px",padding:"3px 7px",borderRadius:4},children:Ir(V)})}):X?(0,jo.jsx)(Vw,{name:"category",width:"flex",focused:"category"===m,style:{padding:0},plain:!0,children:(0,jo.jsx)(tj,{style:{alignSelf:"flex-start",color:mo.n6,borderRadius:4,transition:"none","&:hover":{backgroundColor:"rgba(100, 100, 100, .15)",color:mo.n5}},disabled:Y_(L.id),onEdit:()=>C(z,"category"),onSelect:()=>A(z),children:(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",alignSelf:"stretch",borderRadius:4,flex:1,padding:4},children:[X&&(0,jo.jsx)(__,{style:{width:14,height:14,color:"currentColor",transition:"transform .08s",transform:y?"rotateZ(0)":"rotateZ(-90deg)"}}),(0,jo.jsx)(gs,{style:{fontStyle:"italic",userSelect:"none"},children:"Split"})]})})}):oe||ie||B?(0,jo.jsx)(Xw,{name:"category",width:"flex",exposed:"category"===m,focused:"category"===m,onExpose:!B&&(e=>C(z,e)),value:X?"Split":ie?"Off Budget":oe?"Transfer":"",valueStyle:ae,style:{fontStyle:"italic",color:"#c0c0c0",fontWeight:300},inputProps:{readOnly:!0,style:{fontStyle:"italic"}}}):(0,jo.jsx)(Jw,{name:"category",width:"flex",value:Y,formatter:e=>{return e?(t=to(v)[e],n="name",t?t[n]:""):L.id?"Categorize":"";var t,n},exposed:"category"===m,onExpose:e=>C(z,e),valueStyle:Y?ae:{fontStyle:"italic",fontWeight:300,color:mo.p8},onUpdate:async e=>{"split"===e?E(L.id):U("category",e)},children:e=>{let{onBlur:t,onKeyDown:n,onUpdate:r,onSave:o,shouldSaveFromKey:i,inputStyle:a}=e;return(0,jo.jsx)(MC,{categoryGroups:v,value:Y,focused:!0,tableBehavior:!0,showSplitOption:!ne&&!X,shouldSaveFromKey:i,inputProps:{onBlur:t,onKeyDown:n,style:a},onUpdate:r,onSelect:o,menuPortalTarget:void 0})}}),(0,jo.jsx)(Xw,{type:"input",width:80,name:"debit",exposed:"debit"===m,focused:"debit"===m,value:null==W?"":W,valueStyle:ae,textAlign:"right",title:W,onExpose:!B&&(e=>C(z,e)),style:[X&&{fontStyle:"italic"},vo.tnum,se],inputProps:{value:W,onUpdate:U.bind(null,"debit")}}),(0,jo.jsx)(Xw,{type:"input",width:80,name:"credit",exposed:"credit"===m,focused:"credit"===m,value:null==H?"":H,valueStyle:ae,textAlign:"right",title:H,onExpose:!B&&(e=>C(z,e)),style:[X&&{fontStyle:"italic"},vo.tnum,se],inputProps:{value:H,onUpdate:U.bind(null,"credit")}}),i&&(0,jo.jsx)(Vw,{name:"balance",value:null==w||ne||B?"":Wr(w),valueStyle:{color:w<0?mo.r4:mo.g4},style:[vo.tnum,se],width:88,textAlign:"right"}),a&&(0,jo.jsx)(H_,{id:z,focused:"cleared"===m,selected:c,isPreview:B,status:B?V:Q?"cleared":null,isChild:ne,onEdit:C,onUpdate:U}),(0,jo.jsx)(Vw,{width:15})]})}));function q_(e){let{error:t,isDeposit:n,onAddSplit:r,style:o}=e;return"SplitTransactionError"!==t.type?null:1===t.version?(0,jo.jsxs)(ms,{style:[{flexDirection:"row",alignItems:"center",padding:"0 5px"},o],"data-testid":"transaction-error",children:[(0,jo.jsxs)(gs,{children:["Amount left:"," ",(0,jo.jsx)(gs,{style:{fontWeight:500},children:Wr(n?t.difference:-t.difference)})]}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(As,{style:{marginLeft:15,padding:"4px 10px"},primary:!0,onClick:r,children:"Add Split"})]}):void 0}function G_(e,t){return[{id:"temp",date:t||Jp(),account:e||null,cleared:!1,amount:0}]}function Y_(e){return-1!==e.indexOf("temp")}function Q_(e){return-1!==e.indexOf("preview/")}function X_(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,jo.jsxs)(ms,{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,jo.jsx)(V_,{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,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginTop:6,marginRight:20},children:[(0,jo.jsx)(As,{style:{marginRight:10,padding:"4px 10px"},onClick:()=>y(),"data-testid":"cancel-button",children:"Cancel"}),k?(0,jo.jsx)(q_,{error:k,isDeposit:C,onAddSplit:()=>w(t[0].id)}):(0,jo.jsx)(As,{style:{padding:"4px 10px"},primary:!0,onClick:x,"data-testid":"add-button",children:"Add"})]})]})}function Z_(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=eC(s.isAdding);(0,h.useEffect)((()=>{!c&&s.isAdding&&o.onEdit("temp","date")}),[c,s.isAdding,o]);return(0,jo.jsxs)(ms,{innerRef:u,style:[{flex:1,cursor:"default"},s.style],children:[(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(W_,{hasSelected:s.selectedItems.size>0,showAccount:s.showAccount,showCategory:s.showCategory,showBalance:!!s.balances,showCleared:s.showCleared}),s.isAdding&&(0,jo.jsx)(ms,{...o.getNavigatorProps({onKeyDown:e=>s.onCheckNewEnter(e)}),children:(0,jo.jsx)(X_,{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,jo.jsxs)(ms,{style:[{flex:1,overflow:"hidden"}],"data-testid":"transaction-table",onMouseLeave:()=>a(null),children:[(0,jo.jsx)(sj,{navigator:t,ref:n,items:s.transactions,renderItem:e=>{let{item:n,index:o,position:i,editing:a}=e;const{transactions:l,selectedItems:u,hoveredTransaction:c,accounts:d,categoryGroups:f,payees:p,showCleared:h,showAccount:y,showCategory:g,balances:m,hideFraction:v,isNew:b,isMatched:x,isExpanded:w}=s;let j=n,S=c===j.id,k=u.has(j.id),C=s.transactionMap.get(j.parent_id),_=C&&C.amount>0,O=w&&w((C||j).id),E=O&&C&&C.error||j.error;return(0,jo.jsxs)(jo.Fragment,{children:[(!O||F_(l,o))&&E&&"SplitTransactionError"===E.type&&(0,jo.jsx)(Ss,{position:"bottom-right",width:250,forceTop:i,forceLayout:!0,style:{transform:"translate(-5px, 2px)"},children:(0,jo.jsx)(q_,{error:E,isDeposit:_,onAddSplit:()=>s.onAddSplit(j.id)})}),(0,jo.jsx)(V_,{editing:a,transaction:j,showAccount:y,showCategory:g,showBalance:!!m,showCleared:h,hovered:S,selected:k,highlighted:!1,added:b&&b(j.id),expanded:w&&w(j.id),matched:x&&x(j.id),showZeroInDeposit:_,balance:m&&m[j.id]&&m[j.id].balance,focusedField:a&&t.focusedField,accounts:d,categoryGroups:f,payees:p,inheritedFields:C&&C.payee===j.payee?new Set(["payee"]):new Set,dateFormat:r,hideFraction:v,onHover:s.onHover,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,jo.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 J_=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=U_(),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))),Q_(t.id)&&(n=["select","cleared"]),Y_(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(G_(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(G_(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,Y_(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(Y_(e)){let t=x.current.newTransactions;if(e===t[0].id)return;r(Sx(t,e).data)}}),[]),M=(0,h.useMemo)((()=>t=>{if(Y_(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(Y_(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,jo.jsx)(Z_,{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):"debit"!==m.focusedField&&"credit"!==m.focusedField&&"cleared"!==m.focusedField||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);F_(o,i)&&a&&a.error&&"select"!==n&&(e.stopPropagation(),D(t))}))}},onAddTemporary:E,onAddSplit:D,onCloseAddTransaction:function(){r(G_(e.currentAccountId)),e.onCloseAddTransaction()},onToggleSplit:I,newTransactions:n,tableNavigator:v,newNavigator:m})}));async function eO(e){let t=await qe("transactions-batch-update",{...e,learnCategories:!0});return t.length>0?{updates:t}:{}}async function tO(e,t,n){let r=await eO(e);n(function(e,t){return vx(Pr(t,bx(e)))}(t.newTransaction,r),Pr(r,t.data))}function nO(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=Bi();(0,h.useLayoutEffect)((()=>{O.current=n}),[n]);let T=(0,h.useCallback)((async e=>{e=Cx(e),await eO({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 eO(t.diff),k()):(S(t.newTransaction,t.data),tO(t.diff,t,S))}}),[]),A=(0,h.useCallback)((e=>{const t=wx(O.current,e);return S(t.newTransaction,t.data),tO(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),tO(t.diff,t,S),t.diff.added[0].id}),[]),D=(0,h.useCallback)((async e=>{let t=Tr(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,jo.jsx)(J_,{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 rO(e){let{onAdd:t}=e;return(0,jo.jsx)(ms,{style:{backgroundColor:"white",flex:1,alignItems:"center",borderTopWidth:1,borderColor:mo.n9},children:(0,jo.jsxs)(ms,{style:{width:550,marginTop:75,fontSize:15,alignItems:"center"},children:[(0,jo.jsxs)(gs,{style:{textAlign:"center",lineHeight:"1.4em"},children:["For Actual to be useful, you need to ",(0,jo.jsx)("strong",{children:"add an account"}),". You can link an account to automatically download transactions, or manage it locally yourself."]}),(0,jo.jsx)(As,{primary:!0,style:{marginTop:20},onClick:t,children:"Add account"}),(0,jo.jsx)(ms,{style:{marginTop:20,fontSize:13,color:mo.n5},children:"In the future, you can add accounts from the sidebar."})]})})}function oO(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,jo.jsx)(ms,{style:{flexDirection:"row",alignSelf:"center",backgroundColor:"white",...vo.shadow,borderRadius:4,marginTop:5,marginBottom:15,padding:10},children:(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[0===a?(0,jo.jsxs)(ms,{style:{color:mo.g4,flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},children:[(0,jo.jsx)(Xx,{style:{width:13,height:13,color:mo.g5,marginRight:3}}),"All reconciled!"]}):(0,jo.jsx)(ms,{style:{color:mo.n3},children:(0,jo.jsxs)(gs,{style:{fontStyle:"italic",textAlign:"center"},children:["Your cleared balance"," ",(0,jo.jsx)("strong",{children:yw(i,"financial")})," needs"," ",(0,jo.jsx)("strong",{children:(a>0?"+":"")+yw(a,"financial")})," ","to match",(0,jo.jsx)("br",{})," your bank\u2019s balance of"," ",(0,jo.jsx)(gs,{style:{fontWeight:700},children:yw(n,"financial")})]})}),(0,jo.jsx)(ms,{style:{marginLeft:15},children:(0,jo.jsx)(As,{primary:!0,onClick:r,children:"Done Reconciling"})}),0!==a&&(0,jo.jsx)(ms,{style:{marginLeft:15},children:(0,jo.jsx)(As,{onClick:()=>o(a),children:"Create Reconciliation Transaction"})})]})})}function iO(e){let{account:t,onReconcile:n,onClose:r}=e,o=bw(ix(t));return(0,jo.jsx)(Ss,{position:"bottom-right",width:275,onClose:r,children:(0,jo.jsxs)(ms,{style:{padding:"5px 8px"},children:[(0,jo.jsx)(gs,{children:"Enter the current balance of your bank account that you want to reconcile with:"}),(0,jo.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=e.target.elements[0],i=$r(t.value);null!=i?(n(null==i?o:i),r()):t.select()},children:[null!=o&&(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{defaultValue:yw(o,"financial"),style:{margin:"7px 0"}})}),(0,jo.jsx)(As,{primary:!0,children:"Reconcile"})]})]})})}function aO(e){let{onClick:t}=e;return(0,jo.jsx)(As,{bare:!0,onClick:t,"aria-label":"Menu",children:(0,jo.jsx)(qx,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}})})}function lO(e){let{onClose:t,children:n}=e;return(0,jo.jsx)(Ss,{position:"bottom-right",width:200,style:{padding:0},onClose:t,children:n})}function sO(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,jo.jsx)(iO,{account:t,onClose:l,onReconcile:s}):(0,jo.jsx)(lO,{onClose:l,children:(0,jo.jsx)(Us,{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 uO(e){let{onClose:t,onMenuSelect:n}=e;return(0,jo.jsx)(lO,{onClose:t,children:(0,jo.jsx)(Us,{onMenuSelect:e=>{n(e)},items:[{name:"export",text:"Export"}]})})}function cO(e){let{name:t,balance:n}=e;return(0,jo.jsxs)(gs,{style:{marginLeft:15,backgroundColor:mo.n10,borderRadius:4,padding:"4px 6px",color:mo.n5},children:[t," ",(0,jo.jsx)(gs,{style:{fontWeight:600},children:yw(n,"financial")})]})}function dO(e){let{selectedItems:t}=e,n=`selected-balance-${[...t].join("-")}`,r=bw({name:n,query:hr("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:hr("transactions").filter({id:{$oneof:i}}).options({splits:"all"}).calculate({$sum:"$amount"})});return null==a?null:(0,jo.jsx)(cO,{name:"Selected balance:",balance:a})}function fO(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,jo.jsxs)(ms,{style:{flexDirection:"row"},children:[(0,jo.jsx)(cO,{name:"Cleared total:",balance:n}),(0,jo.jsx)(cO,{name:"Uncleared total:",balance:r})]})}function pO(e){let{balanceQuery:t,showExtraBalances:n,onToggleExtraBalances:r}=e,o=Rx();return(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",marginTop:-5,marginLeft:-5},children:[(0,jo.jsxs)(As,{"data-testid":"account-balance",bare:!0,onClick:r,style:{"& svg":{opacity:o.size>0||n?1:0},"&:hover svg":{opacity:1}},children:[(0,jo.jsx)(vw,{binding:{...t,value:0},type:"financial",style:{fontSize:22,fontWeight:400},getStyle:e=>({color:e<0?mo.r5:e>0?mo.g5:mo.n8})}),(0,jo.jsx)(Gx,{style:{width:10,height:10,marginLeft:10,color:mo.n5,transform:n?"rotateZ(180deg)":"rotateZ(0)"}})]}),n&&(0,jo.jsx)(fO,{balanceQuery:t}),o.size>0&&(0,jo.jsx)(dO,{selectedItems:o})]})}function hO(e){let{style:t,getTransaction:n,onShow:r,onDuplicate:o,onDelete:i,onEdit:a,onUnlink:l,onCreateRule:s,onScheduleAction:u}=e,c=Rx(),d=Bi(),f=(0,h.useMemo)((()=>{let e=[...c];return{preview:!!e.find((e=>Q_(e))),trans:!!e.find((e=>!Q_(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,jo.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"}],Us.line,{type:Us.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(Q_(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 yO=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:U,onDeleteFilter:z,onScheduleAction:W}=e,[H,K]=(0,h.useState)(!1),$=(0,h.useRef)(null),V=U_(),q=c&&a&&a.account_id;return a||(q=!!s.find((e=>!!e.account_id))),(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(cw,{keys:{"mod+f":()=>{$.current&&$.current.focus()}}}),(0,jo.jsxs)(ms,{style:[vo.pageContent,{paddingBottom:10,flexShrink:0}],children:[(0,jo.jsx)(ms,{style:{marginTop:2,alignItems:"flex-start"},children:(0,jo.jsx)(ms,{children:n?(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{defaultValue:i,onEnter:e=>E(e.target.value),onBlur:()=>T(!1),style:{fontSize:25,fontWeight:500,marginTop:-5,marginBottom:-2,marginLeft:-5}})}):r?(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",gap:3,"& .hover-visible":{opacity:0,transition:"opacity .25s"},"&:hover .hover-visible":{opacity:1}},children:[(0,jo.jsx)(ms,{style:{fontSize:25,fontWeight:500,marginRight:5,marginBottom:5},"data-testid":"account-name",children:a&&a.closed?"Closed: "+i:i}),a&&(0,jo.jsx)(hw,{id:`account-${a.id}`}),(0,jo.jsx)(As,{bare:!0,className:"hover-visible",onClick:()=>T(!0),children:(0,jo.jsx)(Jx,{style:{width:11,height:11,color:mo.n8}})})]}):(0,jo.jsx)(ms,{style:{fontSize:25,fontWeight:500,marginBottom:5},"data-testid":"account-name",children:a&&a.closed?"Closed: "+i:i})})}),(0,jo.jsx)(pO,{balanceQuery:g,showExtraBalances:f,onToggleExtraBalances:O}),(0,jo.jsxs)(xs,{spacing:2,direction:"row",align:"center",style:{marginTop:12},children:[(a&&!a.closed||q)&&(0,jo.jsx)(As,{bare:!0,onClick:q?P:A,children:q?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(lw,{width:13,height:13,animating:a&&l===a.name||"__all"===l,style:{color:"currentColor",marginRight:4}})," ","Sync"]}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(Zx,{width:13,height:13,style:{color:"currentColor",marginRight:4}})," ","Import"]})}),!y&&(0,jo.jsxs)(As,{bare:!0,onClick:S,children:[(0,jo.jsx)(Vx,{width:10,height:10,style:{color:"inherit",marginRight:3}})," ","Add New"]}),(0,jo.jsx)(ms,{children:(0,jo.jsx)(p_,{onApply:B})}),(0,jo.jsx)(Rs,{leftContent:(0,jo.jsx)(tw,{style:{width:13,height:13,flexShrink:0,color:b?mo.p7:"inherit",margin:5,marginRight:0}}),rightContent:b&&(0,jo.jsx)(As,{bare:!0,style:{padding:8},onClick:()=>j(""),title:"Clear search term",children:(0,jo.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:mo.n1,transition:"color .25s"}},e&&{boxShadow:"0 0 0 2px "+mo.b5},!e&&""!==b&&{color:mo.p4}],onChange:e=>j(e.target.value)}),o?(0,jo.jsx)(ms,{children:(0,jo.jsx)(Co,{color:mo.n1,style:{width:16,height:16}})}):(0,jo.jsx)(hO,{getTransaction:e=>u.find((t=>t.id===e)),onShow:k,onDuplicate:R,onDelete:I,onEdit:N,onUnlink:L,onCreateRule:F,onScheduleAction:W}),(0,jo.jsx)(As,{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,jo.jsx)(Qx,{style:{width:14,height:14,color:"inherit"}}):(0,jo.jsx)(Yx,{style:{width:14,height:14,color:"inherit"}})}),a?(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(aO,{onClick:()=>K(!0)}),H&&(0,jo.jsx)(sO,{account:a,canSync:q,syncEnabled:c,canShowBalances:v(),showBalances:d,showCleared:p,onMenuSelect:e=>{K(!1),M(e)},onReconcile:D,onClose:()=>K(!1)})]}):(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(aO,{onClick:()=>K(!0)}),H&&(0,jo.jsx)(uO,{onMenuSelect:e=>{K(!1),M(e)},onClose:()=>K(!1)})]})]}),x&&x.length>0&&(0,jo.jsx)(g_,{filters:x,onUpdate:U,onDelete:z})]}),null!=m&&(0,jo.jsx)(oO,{targetBalance:m,balanceQuery:g,onDone:C,onCreateTransaction:_})]})}));function gO(e){let{transactions:t,filtered:n,children:r}=e,o=Eh(),i=(0,h.useMemo)((()=>o?o.schedules.filter((e=>!e.completed&&["due","upcoming","missed"].includes(o.statuses.get(e.id)))):[]),[o]),a=(0,h.useMemo)((()=>i.map((e=>({id:"preview/"+e.id,payee:e._payee,account:e._account,amount:e._amount,date:e.next_date,notes:o.statuses.get(e.id),schedule:e.id})))),[i]),l=(0,h.useMemo)((()=>!n&&a.length>0?a.concat(t):t),[n,a,t]);return r(null==o?null:l)}class mO extends h.PureComponent{constructor(e){super(e),this.fetchAllIds=async()=>{let{data:e}=await yr(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?hr("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 yr(hr("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=Pr(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 yr(hr("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 yr(hr("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=Pr(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 yr(hr("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=mr(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 yr(this.paged.getQuery().options({splits:"none"}).select([{balance:{$sumOver:"$amount"}}]));this.setState({balances:Dr(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,jo.jsx)(Ci,{to:"/accounts"});let j=!f&&!c&&0===e.length,S=c&&"budgeted"!==c&&"offbudget"!==c&&"uncategorized"!==c,k=this.getBalanceQuery(x,c);return(0,jo.jsx)(gO,{transactions:d,filtered:y,children:y=>null==y?null:(0,jo.jsx)(Lx,{name:"transactions",items:y,fetchAllIds:this.fetchAllIds,registerDispatch:e=>this.dispatchSelected=e,children:(0,jo.jsxs)(ms,{style:[vo.page,{backgroundColor:mo.n11}],children:[(0,jo.jsx)(yO,{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,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(nO,{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,jo.jsx)(rO,{onAdd:()=>s(r?"add-account":"add-local-account")}):f?null:(0,jo.jsx)(ms,{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 vO(e){let{dispatch:t}=U_();return(0,jo.jsx)(mO,{...e,splitsExpandedDispatch:t})}function bO(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=zi(),l=Ui(),s=(0,h.useContext)(rw),u=(0,h.useMemo)((()=>{let e=nx(a.id,"_account");return(l.state&&l.state.filter||"uncategorized"===a.id)&&(e={id:null}),t=>(t=t.filter({$and:[e,{"_account.closed":!1}]})).orderBy({next_date:"desc"})}),[a.id]);return(0,jo.jsx)(Oh,{transform:u,children:(0,jo.jsx)(z_,{initialMode:r.expandSplits?"collapse":"expand",children:(0,jo.jsx)(vO,{...r,...i,syncEnabled:n,modalShowing:r.modalShowing||!(!s.state||!s.state.locationPtr),accountId:a.id,location:t.location})})})}const xO=e=>t=>{class n extends h.Component{componentDidMount(){wO(e)}componentDidUpdate(){wO(e)}render(){return(0,jo.jsx)(t,{...this.props})}}return n};function wO(e){[...document.getElementsByTagName("meta")].find((e=>"theme-color"===e.name)).setAttribute("content",e)}function jO(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 SO=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 kO(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 CO=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),_O=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function OO(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script;return CO.has(t)}let t=e.split("-")[0];return _O.has(t)}function EO(){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:OO(e)?"rtl":"ltr"}}let TO=EO(),PO=new Set;function AO(){TO=EO();for(let e of PO)e(TO)}function MO(){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)(TO);return(0,h.useEffect)((()=>(0===PO.size&&window.addEventListener("languagechange",AO),PO.add(n),()=>{PO.delete(n),0===PO.size&&window.removeEventListener("languagechange",AO)})),[]),e?{locale:"en-US",direction:"ltr"}:t}const DO=h.createContext(null);function IO(){let e=MO();return(0,h.useContext)(DO)||e}new WeakMap;let RO=new Map;function NO(e){let{locale:t}=IO(),n=t+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"");if(RO.has(n))return RO.get(n);let r=new Intl.Collator(t,e);return RO.set(n,r),r}function LO(e){return Fj()||Bj()?e.altKey:e.ctrlKey}function FO(e){return Fj()?e.metaKey:e.ctrlKey}function BO(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}=IO(),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&&zj(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&&!LO(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,FO(e));t.setFocusedKey(r),FO(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,FO(e));t.setFocusedKey(r),FO(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":FO(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),zj(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 UO(){let e=window.event;return"Enter"===(null===e||void 0===e?void 0:e.key)}function zO(){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 WO{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 HO(e){return null}function KO(e){return null!=e.hasChildItems?e.hasChildItems:!!e.childItems||!!(e.title&&h.Children.count(e.children)>0)}HO.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:KO(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 $O=HO;function VO(e){return null}VO.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 qO=VO;class GO{build(e,t){return this.context=t,YO((()=>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:QO(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 <${XO(t.type)}> in <${XO(r.type)}>. Only <${XO(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:YO((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 YO(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 QO(e,t){return e&&t?n=>e(t(n)):e||(t||void 0)}function XO(e){return e[0].toUpperCase()+e.slice(1)}const ZO=new WeakMap;function JO(e){let t=ZO.get(e);if(null!=t)return t;t=0;for(let n of e)"section"===n.type?t+=JO(n.childNodes):t++;return ZO.set(e,t),t}const eE=new WeakMap;function tE(e,t){let n=eE.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 nE(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=NO({usage:"search",sensitivity:"base"}),g=t.disabledBehavior,m=(0,h.useMemo)((()=>i||new WO(n,"selection"===g?new Set:r,o,y)),[i,n,r,o,y,g]),{collectionProps:v}=BO({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);eE.set(t,{id:a,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized});let{labelProps:l,fieldProps:s}=kO({...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 rE(e,t,n){let{key:r}=e,o=eE.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()&&Uj()||(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"]=JO(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&&LO(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&&(FO(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&&!zO()||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&&!UO())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||zO()))&&d(e)},S.onPress=e=>{("touch"===e.pointerType||"pen"===e.pointerType||"virtual"===e.pointerType||"keyboard"===e.pointerType&&v&&UO()||"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:tE(t,r)},labelProps:{id:b},descriptionProps:{id:x},isFocused:u,isSelected:s,isDisabled:a,isPressed:S}}class oE extends Set{constructor(e,t,n){super(e),e instanceof oE?(this.anchorKey=t||e.anchorKey,this.currentKey=n||e.currentKey):(this.anchorKey=t,this.currentKey=n)}}function iE(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)((()=>aE(e.selectedKeys)),[e.selectedKeys]),f=(0,h.useMemo)((()=>aE(e.defaultSelectedKeys,new oE)),[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 aE(e,t){return e?"all"===e?"all":new oE(e):t}class lE{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 oE([e],e,e);else{let n=this.state.selectedKeys,r=n.anchorKey||e;t=new oE(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 oE("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 oE([e],e,e):new oE;this.state.setSelectedKeys(t)}setSelectedKeys(e){if("none"===this.selectionMode)return;let t=new oE;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 oE)}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 sE=Symbol.iterator;class uE{*[sE](){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 cE(e){let{filter:t}=e,n=iE(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 GO),[]),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 uE(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 lE(i,n)}}const dE={SECTION_HEADING:10};let fE=Xr((e=>Dr(e))),pE=Xr((e=>Dr(e)));function hE(e){return-1!==e.indexOf("preview/")}function yE(e){let t,{status:n}=e;switch(n){case"missed":t=mo.r3;break;case"due":t=mo.y3;break;case"upcoming":t=mo.n4}return(0,jo.jsx)(gs,{style:{fontSize:11,color:t,fontStyle:"italic"},children:Ir(n)})}class gE 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;hE(l)&&(u=Sh(u));let y=c?function(e,t){return e.find((e=>e.id===t)).name}(n,c):null,g=r&&s&&fE(r)[s],m=g&&g.transfer_acct&&pE(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=hE(l),w=x&&{fontStyle:"italic",color:mo.n5};return(0,jo.jsxs)(wE,{style:[{flex:1,height:60,padding:"5px 10px"},x&&{backgroundColor:mo.n11},a],children:[(0,jo.jsxs)(ms,{style:[{flex:1}],children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[h&&(0,jo.jsx)(O_,{style:{width:12,height:12,marginRight:5,color:w.color||mo.n1}}),(0,jo.jsx)(ks,{style:[vo.text,w,{fontSize:14,fontWeight:i?"600":"400"},""===v&&{color:mo.n6,fontStyle:"italic"}],children:v||"Empty"})]}),x?(0,jo.jsx)(yE,{status:p}):(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",marginTop:3},children:[(0,jo.jsx)(Xx,{style:{width:11,height:11,color:d?mo.g6:mo.n8,marginRight:5}}),o&&(0,jo.jsx)(ks,{style:{fontSize:11,marginTop:1,fontWeight:"400",color:b?mo.n3:mo.p7,fontStyle:b?null:"italic",textAlign:"left"},children:b||"Uncategorized"})]})]}),(0,jo.jsx)(gs,{style:[vo.text,w,{marginLeft:25,marginRight:5,fontSize:14}],children:Wr(u)})]})}}class mE extends h.Component{constructor(){super(...arguments),this.makeData=Xr((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,jo.jsxs)(jo.Fragment,{children:[t.ListHeaderComponent,(0,jo.jsxs)(vE,{...t,"aria-label":"transaction list",label:"",loadMore:n,selectionMode:"none",style:{flex:"1 auto",height:"100%",overflowY:"auto"},children:[0===r.length?(0,jo.jsx)(qO,{children:(0,jo.jsx)($O,{children:(0,jo.jsx)("div",{style:{display:"flex",justifyContent:"center",width:"100%"},children:(0,jo.jsx)(gs,{style:{fontSize:15},children:"No transactions"})})})}):null,r.map((e=>(0,jo.jsx)(qO,{title:fh(e.date,"MMMM dd, yyyy"),children:e.data.map(((e,t,n)=>(0,jo.jsx)($O,{style:{fontSize:t===n.length-1?98:"inherit"},textValue:e.id,children:(0,jo.jsx)(gE,{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 vE(e){let t=cE(e),n=h.useRef(),{listBoxProps:r,labelProps:o}=nE(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,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)("div",{...o,children:e.label}),(0,jo.jsx)("ul",{...r,ref:n,style:{padding:0,listStyle:"none",margin:0,overflowY:"auto",width:"100%"},children:[...t.collection].map((e=>(0,jo.jsx)(bE,{section:e,state:t},e.key)))})]})}function bE(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,jo.jsxs)("li",{...r,style:{width:"100%"},children:[t.rendered&&(0,jo.jsx)("div",{...o,style:{...vo.smallText,backgroundColor:mo.n10,borderBottom:`1px solid ${mo.n9}`,borderTop:`1px solid ${mo.n9}`,color:mo.n4,display:"flex",justifyContent:"center",paddingBottom:4,paddingTop:4,position:"sticky",top:"0",width:"100%",zIndex:dE.SECTION_HEADING},children:t.rendered}),(0,jo.jsx)("ul",{...i,style:{padding:0,listStyle:"none"},children:[...t.childNodes].map(((e,t,r)=>(0,jo.jsx)(xE,{item:e,state:n,isLast:t===r.length-1},e.key)))})]})}function xE(e){let{isLast:t,item:n,state:r}=e,o=h.useRef(),{optionProps:i,isSelected:a}=rE({key:n.key},r,o),{isFocusVisible:l,focusProps:s}=XS();return(0,jo.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 ${mo.border}`}},children:n.rendered})}const wE=h.forwardRef(((e,t)=>{let{children:n,style:r,...o}=e;return(0,jo.jsx)(ms,{style:[{height:50,flexDirection:"row",alignItems:"center",paddingLeft:10,paddingRight:10},r],ref:t,...o,children:n})}));function jE(e){let{accountName:t,onSearch:n}=e;const[r,o]=(0,h.useState)("");return(0,jo.jsx)(ms,{style:{flexDirection:"row",alignItems:"center",backgroundColor:mo.n11,margin:"11px auto 4px",borderRadius:4,padding:10,width:"100%"},children:(0,jo.jsx)(Rs,{leftContent:(0,jo.jsx)(tw,{style:{width:13,height:13,flexShrink:0,color:r?mo.p7:"inherit",margin:5,marginRight:0}}),value:r,onUpdate:e=>{o(e),n(e)},placeholder:`Search ${t}`,style:{backgroundColor:mo.n11,border:`1px solid ${mo.n9}`,fontSize:15,flex:1,height:32,marginLeft:4,padding:8}})})}const SE=70;function kE(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,jo.jsxs)(ms,{style:{flex:1,backgroundColor:mo.n11,overflowY:"hidden",width:"100%"},children:[(0,jo.jsxs)(ms,{style:{alignItems:"center",backgroundColor:mo.n11,flexShrink:0,overflowY:"hidden",paddingTop:20,top:0,width:"100%"},children:[(0,jo.jsxs)(ms,{style:{alignItems:"center",flexDirection:"row",justifyContent:"space-between",width:"100%"},children:[(0,jo.jsxs)(qi,{to:"/accounts",style:{alignItems:"center",display:"flex",textDecoration:"none",width:SE},children:[(0,jo.jsx)(SO,{style:{color:mo.b5,width:32,height:32}}),(0,jo.jsx)(gs,{style:{...vo.text,color:mo.b5,fontWeight:500},children:"Back"})]}),(0,jo.jsx)(ms,{style:{fontSize:16,fontWeight:500},children:t.name}),(0,jo.jsx)(qi,{to:"transaction/new",style:{visibility:"hidden"},children:(0,jo.jsx)(As,{bare:!0,style:{justifyContent:"center",width:SE},children:(0,jo.jsx)(Vx,{width:20,height:20})})})]}),(0,jo.jsx)(Qs,{title:"BALANCE",style:{marginTop:10}}),(0,jo.jsx)(vw,{binding:l,type:"financial",debug:!0,style:{fontSize:18,fontWeight:"500"},getStyle:e=>({color:e<0?mo.r4:mo.p5})}),(0,jo.jsx)(jE,{accountName:t.name,onSearch:c})]}),(0,jo.jsx)(mE,{transactions:f,categories:i,accounts:o,payees:a,showCategory:!t.offbudget,isNew:s,onLoadMore:u,onSelect:d})]})}const CE=Xr(((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 _E(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 OE;var EE=de((e=>({accounts:e.queries.accounts,newTransactions:e.queries.newTransactions,updatedAccounts:e.queries.updatedAccounts,categories:e.queries.categories.list,prefs:e.prefs.local})),e)(xO(mo.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=>{OE&&OE.unsubscribe(),OE=mr(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"))&&OE&&OE.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=>{OE.unsubscribe(),i(e)};let b=ix(g),x=s.prefs.numberFormat||"comma-dot",w=s.prefs.hideFraction||!1;return(0,jo.jsx)(jO,{onSync:async()=>{await t.syncAndDownload()},children:e=>{let{refreshing:r,onRefresh:i}=e;return(0,jo.jsx)(Oh,{transform:CE(d,""!==o),children:(0,jo.jsx)(_E,{accountId:t.accountId,children:e=>null==e?null:(0,h.createElement)(kE,{...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:()=>{OE&&OE.fetchNext()},onSearch:v,onSelectTransaction:()=>{}})})})}})})));function TE(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 PE(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 AE(e){switch(e){case"investment":case"mortgage":case"debt":case"other":return!0}return!1}let ME=h.createContext({type:"page"});const DE=Ef()?10:20;function IE(e){let{type:t,current:n,children:r}=e;return(0,jo.jsx)(ME.Provider,{value:{type:t,current:n},children:r})}function RE(){return h.useContext(ME)}function NE(e){let{name:t,style:n}=e;return Ef()?(0,jo.jsx)(ms,{style:[{alignItems:"center",backgroundColor:mo.b2,color:"white",flexDirection:"row",flex:"1 0 auto",fontSize:18,fontWeight:500,height:50,justifyContent:"center",overflowY:"auto"},n],children:t}):(0,jo.jsx)(gs,{style:[{fontSize:25,fontWeight:500,paddingLeft:DE,paddingRight:DE,marginBottom:15},n],children:t})}function LE(e){let{title:t,modalSize:n,children:r,titleStyle:o}=e,{type:i,current:a}=RE(),l=Bi();if("modal"===i){let e=n;return"string"===typeof n&&(e="medium"===n?{width:750,height:600}:{width:600}),(0,jo.jsx)(Ks,{title:t,isCurrent:a,size:e,onClose:()=>l.goBack(),children:r})}return(0,jo.jsxs)(ms,{style:Ef()?void 0:vo.page,children:[(0,jo.jsx)(NE,{name:t,style:o}),(0,jo.jsx)(ms,{style:Ef()?{overflowY:"auto",padding:DE}:{paddingLeft:DE,paddingRight:DE,flex:1},children:r})]})}function FE(e){let{name:t,amount:n}=e;return(0,jo.jsxs)(ms,{style:{flexDirection:"row",marginTop:28,marginBottom:10},children:[(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(gs,{style:[vo.text,{textTransform:"uppercase",color:mo.n5,fontSize:13}],"data-testid":"name",children:t})}),(0,jo.jsx)(vw,{binding:n,style:[vo.text,{color:mo.n5,fontSize:13}],type:"financial"})]})}function BE(e){let{account:t,updated:n,getBalanceQuery:r,onSelect:o}=e;return(0,jo.jsx)(ms,{style:{flex:"1 0 auto",flexDirection:"row",backgroundColor:"white",boxShadow:`0 1px 1px ${mo.n7}`,borderRadius:6,marginTop:10},children:(0,jo.jsxs)(As,{onMouseDown:()=>o(t.id),style:{flexDirection:"row",flex:1,alignItems:"center",borderRadius:6,"&:active":{opacity:.1}},children:[(0,jo.jsxs)(ms,{style:{flex:"1 auto",height:52,marginTop:10},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(ks,{style:[vo.text,{fontSize:17,fontWeight:600,color:n?mo.b2:mo.n2,paddingRight:30}],children:t.name}),t.bankId&&(0,jo.jsx)(ms,{style:{backgroundColor:mo.g5,marginLeft:"-23px",width:8,height:8,borderRadius:8}})]}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",marginTop:"4px"},children:[(0,jo.jsx)(gs,{style:[vo.smallText,{color:mo.n5}],children:PE(t.type)}),(0,jo.jsx)(Of,{style:{width:15,height:15,color:mo.n9,marginLeft:8,marginBottom:2}})]})]}),(0,jo.jsx)(vw,{binding:r(t),type:"financial",style:{fontSize:16,color:mo.n3},getStyle:e=>e<0&&{color:mo.r4}})]})})}function UE(e){let{onAdd:t}=e;return(0,jo.jsxs)(ms,{style:{flex:1,padding:30},children:[(0,jo.jsx)(gs,{style:vo.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,jo.jsx)(As,{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,jo.jsx)(gs,{style:{marginTop:20,color:mo.n5},children:"In the future, you can add accounts using the add button in the header."})]})}class zE 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,jo.jsx)(UE,{onAdd:i});const u=(0,jo.jsxs)(LE,{title:"Accounts",children:[(0,jo.jsx)(FE,{name:"Budgeted",amount:r()}),l.map(((e,r)=>(0,jo.jsx)(BE,{account:e,updated:t.includes(e.id),getBalanceQuery:n,onSelect:a},e.id))),(0,jo.jsx)(FE,{name:"Off budget",amount:o()}),s.map(((e,r)=>(0,jo.jsx)(BE,{account:e,updated:t.includes(e.id),getBalanceQuery:n,onSelect:a},e.id)))]});return(0,jo.jsx)(ms,{style:{flex:1},children:u})}}var WE=de((e=>({accounts:e.queries.accounts,newTransactions:e.queries.newTransactions,updatedAccounts:e.queries.updatedAccounts,categories:e.queries.categories.list,prefs:e.prefs.local})),e)(xO(mo.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,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(zE,{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 HE={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(HE.str(e)||HE.num(e))return e===t;if(HE.obj(e)&&HE.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!HE.und(n)||e===t}};function KE(){const e=(0,h.useState)(!1)[1];return(0,h.useCallback)((()=>e((e=>!e))),[])}function $E(e,t){return HE.und(e)||HE.nul(e)?t:e}function VE(e){return HE.und(e)?[]:HE.arr(e)?e:[e]}function qE(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 HE.fun(e)?e(...n):e}function GE(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(HE.und(t))return j({to:t},e);const n=Object.keys(e).reduce(((n,r)=>HE.und(t[r])?j({},n,{[r]:e[r]}):n),{});return j({to:t},n)}class YE{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 QE extends YE{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof YE&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof YE&&e.removeChild(this)))}}class XE extends YE{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof YE&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof YE&&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 YE)&&(t[n]=r instanceof YE?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let ZE,JE;function eT(e,t){ZE={fn:e,transform:t}}function tT(e){JE=e}let nT,rT=e=>"undefined"!==typeof window?window.requestAnimationFrame(e):-1;function oT(e){nT=e}let iT,aT=()=>Date.now();function lT(e){iT=e}let sT,uT,cT=e=>e.current;function dT(e){sT=e}class fT extends XE{constructor(e,t){super(),this.update=void 0,this.payload=e.style?j({},e,{style:sT(e.style)}):e,this.update=t,this.attach()}}let pT=!1;const hT=new Set,yT=()=>{if(!pT)return!1;let e=aT();for(let t of hT){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 YE,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||(hT.delete(t),t.stop(!0))}return hT.size?uT?uT():rT(yT):pT=!1,pT};function gT(e,t,n){if("function"===typeof e)return e;if(Array.isArray(e))return gT({range:e,output:t,extrapolate:n});if(nT&&"string"===typeof e.output[0])return nT(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 mT extends QE{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof QE&&!(e instanceof mT)?e.getPayload():Array.isArray(e)?e:[e],this.calc=gT(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=gT(e,t,n)}interpolate(e,t,n){return new mT(this,e,t,n)}}function vT(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>vT(e,t)))}class bT extends YE{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&&vT(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new mT(this,e,t,n)}}class xT extends QE{constructor(e){super(),this.payload=e.map((e=>new bT(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 mT(this,e,t)}}let wT=0;class jT{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=GE(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=S(t,["delay","to"]);if(HE.arr(o)||HE.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:qE(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;HE.obj(n)&&(this.merged=j({},n,this.merged)),HE.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=HE.arr(a.to)||HE.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 HE.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,hT.has(t)||hT.add(t),pT||(pT=!0,rT(uT||yT));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,hT.has(t)&&hT.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(HE.arr(r.to))for(let a=0;a<r.to.length;a++){const e=a,t=j({},r,GE(r.to[e]));HE.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(HE.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=j({},r,GE(n));if(HE.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=HE.num(o),s=HE.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!JE[o],u=HE.arr(o),f=!a&&!u&&!s;let h=HE.und(r[n])?o:r[n],y=a||u||s?o:1,g=qE(l,n);p&&(y=p.animations[n].parent);let m,v=i.parent,b=i.interpolation,x=VE(p?y.getPayload():y),w=o;f&&(w=nT({range:[0,1],output:[o,o]})(1));let S=b&&b.getValue();const k=!HE.und(v)&&i.animatedValues.some((e=>!e.done)),C=!HE.equ(w,S),_=!HE.equ(w,i.previous),O=!HE.equ(g,i.config);if(c||_&&C||O){if(a||s)v=b=i.parent||new bT(h);else if(u)v=b=i.parent||new xT(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 bT(0);const t={output:[e,o]};i.interpolation?(b=i.interpolation,i.interpolation.updateConfig(t)):b=v.interpolate(t)}return x=VE(p?y.getPayload():y),m=VE(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=aT(),e.done=!1,e.animatedStyles.clear()})),qE(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:VE(v.getValue()),immediate:qE(d,n),initialVelocity:$E(g.velocity,0),clamp:$E(g.clamp,!1),precision:$E(g.precision,.01),tension:$E(g.tension,170),friction:$E(g.friction,26),mass:$E(g.mass,1),duration:g.duration,easing:$E(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 ST=0;const kT="enter",CT="leave",_T="update",OT=(e,t)=>("function"===typeof t?e.map(t):VE(t)).map(String),ET=e=>{let t=e.items,n=e.keys,r=void 0===n?e=>e:n,o=S(e,["items","keys"]);return t=VE(void 0!==t?t:null),j({items:t,keys:OT(t,r)},o)};function TT(e,t,n){const r=j({items:e,keys:t||(e=>e)},n),o=ET(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=KE(),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=ET(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?[kT,CT,_T]:m,b=ET(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 kT: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":kT;k[e]={slot:i,originalKey:e,key:y?String(e):ST++,item:o,trail:M+=h,config:qE(g,o,i),from:qE(n&&void 0!==s?s||{}:u,o),to:qE(c,o)}}));break;case CT:P.forEach((e=>{const t=x.indexOf(e),n=w[t],r=CT;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:qE(g,n,r),to:qE(d,n)})),delete k[e]}));break;case _T:A.forEach((e=>{const t=l.indexOf(e),n=a[t],r=_T;k[e]=j({},k[e],{item:n,slot:r,trail:M+=h,config:qE(g,n,r),to:qE(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 jT);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||PT(v,l),u&&u(h));!Array.from(v.current.instances).some((e=>!e[1].idle))&&(p||a)&&v.current.deleted.length>0&&PT(v),d&&d(h,t,n)}},onStart:f&&(()=>f(h,t)),onFrame:c&&(e=>c(h,t,e)),delay:i,reset:s&&t===kT});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 PT(e,t){const n=e.current.deleted;for(let r of n){let n=r.key;const o=e=>e.key!==n;(HE.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 AT extends XE{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof YE||(e=ZE.transform(e)),this.payload=e}}const MT={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},DT="[-+]?\\d*\\.?\\d+",IT=DT+"%";function RT(){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 NT=new RegExp("rgb"+RT(DT,DT,DT)),LT=new RegExp("rgba"+RT(DT,DT,DT,DT)),FT=new RegExp("hsl"+RT(DT,IT,IT)),BT=new RegExp("hsla"+RT(DT,IT,IT,DT)),UT=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,zT=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,WT=/^#([0-9a-fA-F]{6})$/,HT=/^#([0-9a-fA-F]{8})$/;function KT(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 $T(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=KT(o,r,e+1/3),a=KT(o,r,e),l=KT(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*a)<<16|Math.round(255*l)<<8}function VT(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function qT(e){return(parseFloat(e)%360+360)%360/360}function GT(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function YT(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function QT(e){let t=function(e){let t;return"number"===typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=WT.exec(e))?parseInt(t[1]+"ff",16)>>>0:MT.hasOwnProperty(e)?MT[e]:(t=NT.exec(e))?(VT(t[1])<<24|VT(t[2])<<16|VT(t[3])<<8|255)>>>0:(t=LT.exec(e))?(VT(t[1])<<24|VT(t[2])<<16|VT(t[3])<<8|GT(t[4]))>>>0:(t=UT.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=HT.exec(e))?parseInt(t[1],16)>>>0:(t=zT.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=FT.exec(e))?(255|$T(qT(t[1]),YT(t[2]),YT(t[3])))>>>0:(t=BT.exec(e))?($T(qT(t[1]),YT(t[2]),YT(t[3]))|GT(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 XT=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ZT=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,JT=new RegExp(`(${Object.keys(MT).join("|")})`,"g");let eP={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 tP=["Webkit","Ms","Moz","O"];function nP(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||eP.hasOwnProperty(e)&&eP[e]?(""+t).trim():t+"px"}eP=Object.keys(eP).reduce(((e,t)=>(tP.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),eP);const rP={};dT((e=>new AT(e))),lT("div"),oT((e=>{const t=e.output.map((e=>e.replace(ZT,QT))).map((e=>e.replace(JT,QT))),n=t[0].match(XT).map((()=>[]));t.forEach((e=>{e.match(XT).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(XT).map(((t,r)=>gT(j({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(XT,(()=>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})`))}})),tT(MT),eT(((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=nP(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:rP[t]||(rP[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));"undefined"!==typeof e.getAttribute(n)&&e.setAttribute(n,s[t])}}}),(e=>e));const oP=(iP=e=>{const t=(0,h.forwardRef)(((t,n)=>{const r=KE(),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 fT(e,(()=>{let e=!1;a.current&&(e=ZE.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,(()=>cT(a,o,r))),l(t);const s=i.current.getValue(),u=(s.scrollTop,s.scrollLeft,S(s,["scrollTop","scrollLeft"])),c=(d=e,!HE.fun(d)||d.prototype instanceof h.Component?e=>a.current=function(e,t){return t&&(HE.fun(t)?t(e):HE.obj(t)&&(t.current=e)),e}(e,n):void 0);var d;return h.createElement(e,j({},u,{ref:c}))}));return t},void 0===(aP=!1)&&(aP=!0),e=>(HE.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=aP?t[0].toLowerCase()+t.substring(1):t;return e[n]=iP(n),e}),iP));var iP,aP;const lP=oP(["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 sP=de((e=>({accountsSyncing:e.account.accountsSyncing})),e)((function(e){let{accountsSyncing:t}=e;const n=TT(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,jo.jsx)(ms,{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,jo.jsx)(lP.div,{style:r,children:(0,jo.jsxs)(ms,{style:{borderRadius:4,backgroundColor:mo.b9,color:mo.b1,padding:"5px 13px",flexDirection:"row",alignItems:"center",...vo.shadow},children:[(0,jo.jsx)(lw,{animating:!0,iconStyle:{color:mo.b1}}),(0,jo.jsxs)(gs,{children:["Syncing ",t]})]})},n)}))})}));function uP(e,t){return e.map((e=>(e.id===t.cat_group&&(e.categories=[t,...e.categories]),{...e})))}function cP(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 dP(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 fP(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 pP(e,t){return e.map((e=>(e.categories=e.categories.filter((e=>e.id!==t)),e)))}function hP(e,t){return[...e,t]}function yP(e,t){return e.map((e=>e.id===t.id?{...e,...t}:e))}function gP(e,t){return e.filter((e=>e.id!==t))}var mP=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 vP=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.jsx)("rect",{x:.5,y:2.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"}),(0,jo.jsx)("rect",{x:.5,y:10.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"}),(0,jo.jsx)("rect",{x:.5,y:18.5,width:23,height:3,rx:1,ry:1,fill:"currentColor"})]});var bP=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 xP(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,jo.jsxs)(jo.Fragment,{children:["An internal error occurred. Try to login again, or get"," ",(0,jo.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,jo.jsxs)(ms,{children:[(0,jo.jsxs)(As,{bare:!0,style:{flexDirection:"row",alignItems:"center",color:mo.r5,backgroundColor:mo.r10,padding:"4px 8px",borderRadius:4},onClick:()=>f(!0),children:[(0,jo.jsx)(bP,{style:{width:14,height:14,marginRight:5,color:"currentColor"}})," ","This account is experiencing connection problems. Let\u2019s fix it."]}),d&&(0,jo.jsxs)(Ss,{position:"bottom-left",onClose:()=>f(!1),style:{fontSize:14,padding:15,maxWidth:400},children:[(0,jo.jsx)("div",{style:{marginBottom:"1.15em"},children:"The server returned the following error:"}),(0,jo.jsx)("div",{style:{marginBottom:"1.25em",color:mo.r5},children:xP(p.type,p.code)}),(0,jo.jsx)(ms,{style:{justifyContent:"flex-end",flexDirection:"row"},children:v?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(As,{onClick:b,children:"Unlink"}),(0,jo.jsx)(As,{primary:!0,onClick:function(){f(!1),nw(l,{upgradingAccountId:y.account_id})},style:{marginLeft:5},children:"Reauthorize"})]}):(0,jo.jsx)(As,{onClick:b,children:"Unlink account"})})]})]})}));let jP=h.createContext();function SP(e){let{children:t}=e,[n,r]=(0,h.useState)(1);return(0,jo.jsx)(jP.Provider,{value:{displayMax:n,setDisplayMax:r},children:t})}function kP(){return(0,h.useContext)(jP)}function CP(e){let{color:t,onClick:n}=e;return(0,jo.jsx)(E_,{style:{width:13,height:13,color:t,marginRight:5},onClick:n})}function _P(e){let{maxMonths:t,onChange:n}=e,{displayMax:r}=kP();if(r<=1)return null;let o=[];for(let i=1;i<=r;i++)o.push((0,jo.jsx)(CP,{color:t>=i?mo.n5:mo.n8,onClick:()=>n(i)},i));return(0,jo.jsx)(ms,{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 OP=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 EP=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.jsx)("path",{d:"M11 12h6v-1l-3-1V2l3-1V0H3v1l3 1v8l-3 1v1h6v7l1 1 1-1v-7z",fill:"currentColor"})});var TP=e=>(0,jo.jsx)("svg",{...e,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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 PP=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 AP=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.jsx)("path",{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z",fill:"currentColor"})});var MP=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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"})]}),DP="undefined"!==typeof window?h.useLayoutEffect:h.useEffect;function IP(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 RP(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 NP(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 LP(e,t,n){var r=function(e,t,n){var r=RP((0,h.useState)((function(){return t(e)})),2),o=r[0],i=r[1],a=(0,h.useCallback)((function(){var r=t(e);IP(o,r)||(i(r),n&&n())}),[o,e,n]);return DP(a,[]),[o,a]}(e,t,n),o=NP(r,2),i=o[0],a=o[1];return DP((function(){var t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(a,{handlerIds:[t]})}),[e,a]),i}function FP(){var e=(0,h.useContext)(Cc).dragDropManager;return Lu(null!=e,"Expected drag drop context"),e}function BP(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 UP=!1,zP=!1,WP=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(!UP,"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 UP=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{UP=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Lu(!zP,"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 zP=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{zP=!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&&BP(t.prototype,n),r&&BP(t,r),e}();function HP(e,t){"function"===typeof e?e(t):e.current=t}function KP(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){HP(n,e),HP(t,e)}}):(0,h.cloneElement)(e,{ref:t})}(o,i)}}function $P(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=KP(r);t[n]=function(){return o}}})),t}function VP(e){return VP="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},VP(e)}function qP(e){return null!==e&&"object"===VP(e)&&e.hasOwnProperty("current")}function GP(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 YP=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=$P({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,qP(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,qP(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!IP(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!IP(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&&GP(t.prototype,n),r&&GP(t,r),e}();function QP(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 XP(e){return XP="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},XP(e)}function ZP(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 JP(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=ZP(function(){var e=FP();return[(0,h.useMemo)((function(){return new WP(e)}),[e]),(0,h.useMemo)((function(){return new YP(e.getBackend())}),[e])]}(),2),r=n[0],o=n[1];!function(e,t,n){var r=FP(),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"===XP(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()}}}),[]);DP((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=QP(i,2),l=a[0],s=a[1];return t.receiveHandlerId(l),n.receiveHandlerId(l),s}),[])}(t,r,o);var i=LP(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 DP((function(){o.dragSourceOptions=t.current.options||null,o.reconnect()}),[o]),DP((function(){o.dragPreviewOptions=t.current.previewOptions||null,o.reconnect()}),[o]),[i,a,l]}function eA(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 tA=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=$P({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,qP(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!IP(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&&eA(t.prototype,n),r&&eA(t,r),e}();function nA(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 rA=!1,oA=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(!rA,"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 rA=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{rA=!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&&nA(t.prototype,n),r&&nA(t,r),e}();function iA(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 aA(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 lA(e){var t=(0,h.useRef)(e);t.current=e,Lu(null!=e.accept,"accept must be defined");var n=aA(function(){var e=FP();return[(0,h.useMemo)((function(){return new oA(e)}),[e]),(0,h.useMemo)((function(){return new tA(e.getBackend())}),[e])]}(),2),r=n[0],o=n[1];!function(e,t,n){var r=FP(),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]);DP((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=iA(i,2),l=a[0],s=a[1];return t.receiveHandlerId(l),n.receiveHandlerId(l),s}),[t,n])}(t,r,o);var i=LP(r,t.current.collect||function(){return{}},(function(){return o.reconnect()})),a=(0,h.useMemo)((function(){return o.hooks.dropTarget()}),[o]);return DP((function(){o.dropTargetOptions=e.options||null,o.reconnect()}),[e.options]),[i,a]}function sA(e){let{item:t,type:n,makePreview:r,children:o,canDrag:i,onDragChange:a}=e,l=(0,h.useRef)(a);const[{isDragging:s},u]=JP({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 uA(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]=lA({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 cA=h.createContext(null);function dA(e){let{pos:t,offset:n={}}=e,r=(0,h.useContext)(cA);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,jo.jsx)(ms,{style:[{position:"absolute",left:2,right:2,borderRadius:3,height:3,background:`linear-gradient(90deg, ${mo.b4} 0%, ${mo.b5} 100%)`,zIndex:1e4,pointerEvents:"none"},a]})}const fA=240,pA=600;function hA(e){let{style:t,to:n,exact:r,onClick:o,activeStyle:i,forceActive:a,children:l}=e;return o?(0,jo.jsx)(ms,{role:"button",tabIndex:0,style:[t,{touchAction:"auto",userSelect:"none",userDrag:"none",cursor:"pointer",...a?i:{}}],onClick:o,children:l}):(0,jo.jsx)(Es,{to:n,exact:r,style:t,activeStyle:i,forceActive:a,children:l})}function yA(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:mo.n2},p={borderLeft:"4px solid "+mo.p8,paddingLeft:19+i-4,color:mo.p8},h=[{...vo.mediumText,paddingTop:9,paddingBottom:9,paddingLeft:19+i,paddingRight:10,textDecoration:"none",color:mo.n9,...c?f:{}},{":hover":f}],y=(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",height:20},children:[(0,jo.jsx)(n,{width:15,height:15,style:{color:"inherit"}}),(0,jo.jsx)(Cs,{style:{marginLeft:8},children:r}),(0,jo.jsx)(ms,{style:{flex:1}}),u]});return(0,jo.jsxs)(ms,{style:[{flexShrink:0},o],children:[(0,jo.jsx)(hA,{style:h,to:a,exact:l,onClick:s,activeStyle:p,forceActive:d,children:y}),t?(0,jo.jsx)(ms,{style:{marginTop:5},children:t}):null]})}function gA(e){let{Icon:t,title:n,style:r,to:o,exact:i,onClick:a,bold:l,indent:s=0}=e;const u={backgroundColor:mo.n2},c={borderLeft:"4px solid "+mo.p8,paddingLeft:10+s,color:mo.p8,fontWeight:l?pA:null},d=[mA,{color:mo.n9,paddingLeft:14+s,fontWeight:l?pA:null},{":hover":u}],f=(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",height:16},children:[t&&(0,jo.jsx)(t,{width:12,height:12,style:{color:"inherit"}}),(0,jo.jsx)(Cs,{style:{marginLeft:t?8:0,color:"inherit"},children:n})]});return(0,jo.jsx)(ms,{style:[{flexShrink:0},r],children:(0,jo.jsx)(hA,{style:d,to:o,exact:i,onClick:a,activeStyle:c,children:f})})}let mA=[{marginTop:-2,marginBottom:2,paddingTop:4,paddingBottom:4,paddingRight:15,paddingLeft:10,textDecoration:"none",color:mo.n9},{":hover":{backgroundColor:mo.n2}},vo.smallText];function vA(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}=sA({type:f,onDragChange:c,item:{id:n&&n.id},canDrag:null!=n}),{dropRef:h,dropPos:y}=uA({types:n?[f]:[],id:n&&n.id,onDrop:d});return(0,jo.jsx)(ms,{innerRef:h,style:[{flexShrink:0},u],children:(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(dA,{pos:y}),(0,jo.jsx)(ms,{innerRef:p,children:(0,jo.jsxs)(Es,{to:a,style:[mA,s,{position:"relative",borderLeft:"4px solid transparent"},i&&{fontWeight:700}],activeStyle:{borderColor:mo.p8,color:mo.p8,fontWeight:s&&s.fontWeight||"normal","& .dot":{backgroundColor:mo.p8,transform:"translateX(-4.5px)"}},children:[(0,jo.jsx)(ms,{style:{position:"absolute",left:0,top:0,bottom:0,flexDirection:"row",alignItems:"center"},children:(0,jo.jsx)("div",{className:"dot",...(0,so.iv)({marginRight:3,width:5,height:5,borderRadius:5,backgroundColor:o?mo.r7:mo.g5,marginLeft:2,transition:"transform .3s",opacity:r?1:0})})}),(0,jo.jsx)(zs,{left:t,right:(0,jo.jsx)(vw,{debug:!0,binding:l,type:"financial"})})]})})]})})}function bA(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,jo.jsxs)(ms,{children:[(0,jo.jsx)(vA,{name:"All accounts",to:i,query:u(),style:{fontWeight:pA,marginTop:15}}),x.length>0&&(0,jo.jsx)(vA,{name:"For budget",to:a,query:c(),style:{fontWeight:pA,marginTop:13}}),x.map(((e,t)=>(0,jo.jsx)(vA,{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,jo.jsx)(vA,{name:"Off budget",to:l,query:d(),style:{fontWeight:pA,marginTop:13}}),b.map(((e,t)=>(0,jo.jsx)(vA,{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,jo.jsx)(gA,{style:{marginTop:15},title:"Closed accounts"+(f?"":"..."),onClick:y,bold:!0}),f&&w.map(((e,t)=>(0,jo.jsx)(vA,{name:e.name,account:e,to:o(e),query:s(e),onDragChange:j,onDrop:g},e.id))),(0,jo.jsx)(gA,{style:{marginTop:15,marginBottom:9},onClick:p,Icon:Vx,title:"Add account"})]})}function xA(e){let{style:t,isFloating:n,onFloat:r}=e;return(0,jo.jsx)(ms,{className:"float",style:[t,{flexShrink:0}],children:(0,jo.jsx)(As,{bare:!0,onClick:r,children:n?(0,jo.jsx)(EP,{style:{margin:-2,width:15,height:15,color:mo.n5,transform:"rotate(45deg)"}}):(0,jo.jsx)(MP,{style:{width:13,height:13,color:mo.n5}})})})}function wA(){let[e,t]=(0,h.useState)(!1),n=(0,h.useCallback)((()=>t((e=>!e))),[]),r=Ui();const o=["/payees","/rules","/settings","/tools"].some((e=>r.pathname.startsWith(e)));return(0,h.useEffect)((()=>{o&&t(!0)}),[r.pathname]),(0,jo.jsxs)(ms,{style:{flexShrink:0},children:[(0,jo.jsx)(yA,{title:"More",Icon:e?__:OP,onClick:n,style:{marginBottom:e?8:0},forceActive:!e&&o}),e&&(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gA,{title:"Payees",Icon:PP,to:"/payees",indent:15}),(0,jo.jsx)(gA,{title:"Rules",Icon:AP,to:"/rules",indent:15}),(0,jo.jsx)(gA,{title:"Settings",Icon:Cf,to:"/settings",indent:15})]})]})}function jA(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=!yo&&"mac"===po;const m=OA();return(0,jo.jsxs)(ms,{style:[{width:fA,color:mo.n9,backgroundColor:mo.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,jo.jsx)(xA,{style:[{height:d?0:36,alignItems:"flex-end",justifyContent:"center",overflow:"hidden",WebkitAppRegion:"drag",paddingRight:8}],isFloating:d,onFloat:f}),(0,jo.jsxs)(ms,{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,!yo&&(0,jo.jsx)(Ps,{bare:!0,to:"/settings",style:{display:"inherit",color:mo.n5,marginLeft:g?0:5,flexShrink:0},activeStyle:{color:mo.p7},children:(0,jo.jsx)(Cf,{width:15,height:15,style:{color:"inherit"}})}),(0,jo.jsx)(ms,{style:{flex:1,flexDirection:"row"}}),!g&&!m.alwaysFloats&&(0,jo.jsx)(xA,{isFloating:d,onFloat:f})]}),(0,jo.jsxs)(ms,{style:{overflow:"auto"},children:[(0,jo.jsx)(yA,{title:"Budget",Icon:Of,to:"/budget"}),(0,jo.jsx)(yA,{title:"Reports",Icon:TP,to:"/reports"}),(0,jo.jsx)(yA,{title:"Schedules",Icon:E_,to:"/schedules"}),(0,jo.jsx)(wA,{}),(0,jo.jsx)(ms,{style:{height:1,backgroundColor:mo.n3,marginTop:15,flexShrink:0}}),(0,jo.jsx)(bA,{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 SA(e){let{prefs:t,savePrefs:n}=e,r=ge(),o=Bi();const[i,a]=(0,h.useState)(!1),[l,s]=(0,h.useState)(!1);let u=[{name:"rename",text:"Rename budget"},{name:"settings",text:"Settings"},...yo?[{name:"help",text:"Help"}]:[],{name:"close",text:"Close file"}];return i?(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{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,jo.jsxs)(As,{bare:!0,style:{color:mo.n9,fontSize:16,fontWeight:500,marginLeft:-5,flex:"0 auto"},onClick:()=>s(!0),children:[(0,jo.jsx)(gs,{style:{whiteSpace:"nowrap",overflow:"hidden"},children:t.budgetName||"A budget has no name"}),(0,jo.jsx)(ys,{width:7,height:7,style:{color:"inherit",marginLeft:5}}),l&&(0,jo.jsx)(Ss,{position:"bottom-left",style:{padding:0},onClose:()=>s(!1),children:(0,jo.jsx)(Us,{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(Yn())}},items:u})})]})}var kA=Li(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,jo.jsx)(jA,{isFloating:a,budgetName:(0,jo.jsx)(SA,{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},vo.darkScrollbar]})})));const CA=h.createContext(null);function _A(e){let{children:t}=e,[n,r]=(0,h.useState)(!0);return(0,jo.jsx)(CA.Provider,{value:[n,r],children:t})}function OA(){!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)(CA);return(0,h.useMemo)((()=>({hidden:t,setHidden:n,alwaysFloats:e})),[t,n,e])}var EA=Li(de((e=>({floatingSidebar:e.prefs.global.floatingSidebar})),e)((function(e){let{floatingSidebar:t}=e,n=OA(),r=t||n.alwaysFloats;return(0,jo.jsx)(ms,{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?-fA:0}px)`,transition:"transform .5s, box-shadow .5s, border-radius .5s, bottom .5s"},children:(0,jo.jsx)(kA,{})})})));var TA=de((e=>({userData:e.user.data,files:e.budgets.allFiles,budgetId:e.prefs.local&&e.prefs.local.id})),e)(Li((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,jo.jsx)(gs,{style:[{color:mo.n5,fontStyle:"italic"},u],children:"Loading account..."}):r?r.offline?(0,jo.jsx)(ms,{style:[{color:c},u],children:"Offline"}):(0,jo.jsxs)(ms,{style:[{flexDirection:"row",alignItems:"center"},u],children:[(0,jo.jsx)(As,{bare:!0,onClick:m,style:{color:c},children:g?"Server":"No server"}),p&&(0,jo.jsx)(Ss,{position:"bottom-right",style:{padding:0},onClose:()=>y(!1),children:(0,jo.jsx)(Us,{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,jo.jsx)(As,{bare:!0,onClick:m,style:[{color:c},u],children:"Not logged in"})})));let PA=h.createContext();function AA(e){let{children:t}=e,n=(0,h.useRef)([]);return(0,jo.jsx)(PA.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 MA(){return(0,jo.jsx)(mw,{binding:{name:"uncategorized-amount",query:ux.calculate({$count:"$id"})},children:e=>{const t=e.value;return 0!==t&&(0,jo.jsxs)(Ps,{bare:!0,to:"/accounts/uncategorized",style:{color:mo.r5},children:[t," uncategorized ",1===t?"transaction":"transactions"]})}})}function DA(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,jo.jsxs)(As,{bare:!0,style:(0,so.iv)(n,{WebkitAppRegion:"none",color:"error"===a?mo.r7:"disabled"===a||"offline"===a||"local"===a?mo.n9:null},(0,so.BC)(`(min-width: ${go.breakpoint_medium})`,{color:"error"===a?mo.r4:"disabled"===a||"offline"===a||"local"===a?mo.n6:null})),onClick:r,children:["error"===a?(0,jo.jsx)(P_,{width:13,style:{color:"currentColor"}}):(0,jo.jsx)(lw,{animating:o}),(0,jo.jsx)(gs,{style:{marginLeft:3},children:"disabled"===a?"Disabled":"offline"===a?"Offline":"Sync"})]})}function IA(e){let{globalPrefs:t,saveGlobalPrefs:n,localPrefs:r}=e,{sendEvent:o}=(0,h.useContext)(PA),[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,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(_P,{maxMonths:t.maxMonths||1,onChange:e=>n({maxMonths:e})}),u&&(0,jo.jsxs)(ms,{style:{marginLeft:-5},children:[(0,jo.jsx)(Ms,{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,jo.jsxs)(Ss,{position:"bottom-left",onClose:()=>s(!1),style:{padding:10,maxWidth:400},children:[(0,jo.jsxs)(Ws,{children:["You are currently using a"," ",(0,jo.jsxs)(gs,{style:{fontWeight:600},children:["report"===c?"Report budget":"Rollover budget","."]})," ","Switching will not lose any data and you can always switch back."]}),(0,jo.jsx)(Ws,{children:(0,jo.jsxs)(Ms,{primary:!0,loading:i,onClick:function(){a(!0),i||o("budget/switch-type")},children:["Switch to a"," ","report"===c?"Rollover budget":"Report budget"]})}),(0,jo.jsx)(Ws,{isLast:!0,children:(0,jo.jsx)("a",{href:"#",style:{color:mo.n4,fontStyle:"italic"},children:"How do these types of budgeting work?"})})]})]})]})}var RA=Li(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=OA();const f=Bx();return(0,jo.jsxs)(ms,{style:[{flexDirection:"row",alignItems:"center",padding:"0 15px",height:36,pointerEvents:"none","& *":{pointerEvents:"auto"}},!yo&&"mac"===po&&a&&{paddingLeft:80},u],children:[(a||d.alwaysFloats)&&(0,jo.jsx)(As,{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,jo.jsx)(vP,{className:"menu",style:{width:15,height:15,color:mo.n5,left:0}})}),(0,jo.jsxs)(Ni,{children:[(0,jo.jsx)(Pi,{path:"/accounts",exact:!0,children:e=>(e.location.state||{}).goBack?(0,jo.jsxs)(As,{onClick:()=>e.history.goBack(),bare:!0,children:[(0,jo.jsx)(mP,{width:10,height:10,style:{marginRight:5,color:"currentColor"}})," ","Back"]}):null}),(0,jo.jsx)(Pi,{path:"/accounts/:id",exact:!0,children:e=>e.match&&(0,jo.jsx)(wP,{id:e.match.params.id})}),(0,jo.jsx)(Pi,{path:"/budget",exact:!0,children:()=>(0,jo.jsx)(IA,{globalPrefs:n,saveGlobalPrefs:r,localPrefs:o})})]}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(MA,{}),f?(0,jo.jsx)(DA,{style:{marginLeft:10},localPrefs:o,onSync:c}):null,(0,jo.jsx)(TA,{style:{marginLeft:10}})]})})));var NA=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 LA=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 FA(e,t){if(!e)throw new Error(t)}function BA(e,t){return"undefined"!==typeof e&&null!==e?e:t}class UA{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:BA(e.fromValue,0),toValue:BA(e.toValue,1),stiffness:BA(e.stiffness,100),damping:BA(e.damping,10),mass:BA(e.mass,1),initialVelocity:BA(e.initialVelocity,0),overshootClamping:BA(e.overshootClamping,!1),allowsOverdamping:BA(e.allowsOverdamping,!1),restVelocityThreshold:BA(e.restVelocityThreshold,.001),restDisplacementThreshold:BA(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>UA.MAX_DELTA_TIME_MS&&(n=UA.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;FA(o>0,"Mass value must be greater than 0"),FA(i>0,"Stiffness value must be greater than 0"),FA(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 zA(e,t,n){return{start:t<e.start?e.start:t,end:n>e.end?e.end:n}}UA.MAX_DELTA_TIME_MS=1/60*1e3*4;let WA=h.createContext();function HA(e){let{startMonth:t,numMonths:n,monthBounds:r,type:o,children:i}=e,a=zA(r,t,th(t,n-1)),l=lh(a.start,a.end);return(0,jo.jsx)(WA.Provider,{value:{months:l,type:o},children:i})}function KA(e){let{SummaryComponent:t}=e,{months:n}=(0,h.useContext)(WA),[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 UA({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,jo.jsx)("div",{...(0,so.iv)([{flex:1,overflow:"hidden"},1===n.length&&{marginLeft:-4,marginRight:-4}]),ref:a,children:(0,jo.jsx)(ms,{style:{flexDirection:"row",width:r,willChange:"transform"},innerRef:l,children:u.map(((e,n)=>(0,jo.jsx)(ms,{style:[{flex:`0 0 ${c}px`},{paddingLeft:4,paddingRight:4}],children:(0,jo.jsx)(t,{month:e})},e)))})})}const $A="0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)",VA=5;let qA=h.createContext([]);function GA(e){return[{id:"to-be-budgeted",name:"To Be Budgeted",categories:[{id:"to-be-budgeted",name:"To Be Budgeted"}]},...e]}function YA(e){return 0===e||"0"===e||""===e?{color:mo.n10}:null}function QA(e){const t=YA(e);return t||(e<0?{color:mo.r4}:void 0)}function XA(e){return{color:e<0?mo.r4:0===e?mo.n10:mo.g4}}function ZA(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 JA(){return Math.max(vo.scrollbarWidth-2,0)}class eM 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,...ZA(o.categories,t,n)})}},this.onReorderGroup=(e,t,n)=>{let{categoryGroups:r}=this.props;this.props.onReorderGroup({id:e,...ZA(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,jo.jsxs)(ms,{"data-testid":"budget-table",style:[{flex:1},vo.lightScrollbar&&{"& ::-webkit-scrollbar":{backgroundColor:"transparent"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"white"}}],children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",overflow:"hidden",flexShrink:0,paddingLeft:5,paddingRight:5+JA()},children:[(0,jo.jsx)(ms,{style:{width:200}}),(0,jo.jsx)(HA,{startMonth:n,numMonths:o,monthBounds:i,type:e,children:(0,jo.jsx)(KA,{SummaryComponent:u.SummaryComponent})})]}),(0,jo.jsxs)(HA,{startMonth:r,numMonths:o,monthBounds:i,type:e,children:[(0,jo.jsx)(oM,{MonthComponent:u.BudgetTotalsComponent}),(0,jo.jsx)(ws.Provider,{value:this.budgetCategoriesRef,children:(0,jo.jsx)(ms,{style:{overflowY:"scroll",overflowAnchor:"none",flex:1,paddingLeft:5,paddingRight:5},innerRef:this.budgetCategoriesRef,children:(0,jo.jsx)(ms,{style:{opacity:x?.5:1,flexShrink:0},onKeyDown:this.onKeyDown,innerRef:e=>this.budgetDataNode=e,children:(0,jo.jsx)(uM,{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 tM(e){let{innerRef:t,category:n,dragPreview:r,dragging:o,editing:i,style:a,borderColor:l=mo.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,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},children:[(0,jo.jsx)("div",{"data-testid":"category-name",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:n.name}),(0,jo.jsxs)(ms,{style:{flexShrink:0,marginLeft:5},children:[(0,jo.jsx)(As,{bare:!0,onClick:e=>{e.stopPropagation(),v(!0)},style:{color:"currentColor",padding:3},children:(0,jo.jsx)(__,{width:14,height:14,style:{color:"currentColor"}})}),m&&(0,jo.jsx)(Ss,{position:"bottom-left",width:200,style:{padding:0},onClose:()=>v(!1),children:(0,jo.jsx)(Us,{onMenuSelect:e=>{"rename"===e?d(n.id):p(n.id),v(!1)},items:[{name:"rename",text:"Rename"},{name:"delete",text:"Delete"}]})})]}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(hw,{id:n.id,style:o&&{color:"currentColor"}})]});return(0,jo.jsx)(ms,{innerRef:t,style:[{width:200,"& button":{display:"none"}},!o&&!r&&{"&:hover button":{display:"flex",color:mo.n1}},o&&{color:mo.n8},r&&{backgroundColor:"white",zIndex:1e4,borderRadius:6,overflow:"hidden"},a],onKeyDown:e=>{"Enter"===e.key&&(d(null),e.stopPropagation())},children:(0,jo.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 nM(e){let{group:t,editing:n,collapsed:r,dragPreview:o,innerRef:i,style:a,borderColor:l=mo.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,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},onClick:e=>{p(t.id)},children:[!o&&(0,jo.jsx)(ys,{width:8,height:8,style:{marginRight:5,marginLeft:5,flexShrink:0,transition:"transform .1s",transform:r?"rotate(-90deg)":""}}),(0,jo.jsxs)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:[o&&(0,jo.jsx)(gs,{style:{fontWeight:500},children:"Group: "}),t.name]}),!o&&(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(ms,{style:{marginLeft:5,flexShrink:0},children:[(0,jo.jsx)(As,{bare:!0,onClick:e=>{e.stopPropagation(),m(!0)},style:{padding:3},children:(0,jo.jsx)(__,{width:14,height:14})}),g&&(0,jo.jsx)(Ss,{position:"bottom-left",width:200,style:{padding:0},onClose:()=>m(!1),children:(0,jo.jsx)(Us,{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,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(hw,{id:t.id})]})]});return(0,jo.jsx)(ms,{innerRef:i,style:[a,{width:200,backgroundColor:mo.n11,"& button":{display:"none"},"&:hover button":{display:"flex",color:mo.n1}},o&&{paddingLeft:10,zIndex:1e4,borderRadius:6,overflow:"hidden"}],onKeyDown:e=>{"Enter"===e.key&&(s(null),e.stopPropagation())},children:(0,jo.jsx)(Xw,{value:t.name,formatter:e=>v,width:"flex",exposed:n,borderColor:mo.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 rM(e){let{component:t,editingIndex:n,args:r,style:o}=e,{months:i,type:a}=(0,h.useContext)(WA);return i.map(((e,i)=>{let a=n===i;return(0,jo.jsx)(gw.Provider,{value:dh(e),children:(0,jo.jsx)(ms,{style:[{flex:1},{borderLeft:"1px solid "+mo.border},o],children:(0,jo.jsx)(t,{monthIndex:i,editing:a,...r})})},i)}))}const oM=h.memo((function(e){let{MonthComponent:t}=e;return(0,jo.jsxs)(ms,{"data-testid":"budget-totals",style:{backgroundColor:"white",flexDirection:"row",flexShrink:0,boxShadow:$A,marginLeft:5,marginRight:5+JA(),borderRadius:"4px 4px 0 0",borderBottom:"1px solid "+mo.border},children:[(0,jo.jsx)(ms,{style:{width:200,color:mo.n4,justifyContent:"center",paddingLeft:18},children:"Category"}),(0,jo.jsx)(rM,{component:t})]})}));function iM(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}=sA({type:"group",onDragChange:c,item:t,canDrag:null===r}),{dropRef:m,dropPos:v}=uA({types:"group",id:t.id,onDrop:d}),{dropRef:b,dropPos:x}=uA({types:"category",id:t.id,onDrop:f,onLongHover:()=>{n&&p(t.id)}});return(0,jo.jsxs)(qw,{collapsed:!0,backgroundColor:mo.n11,style:{fontWeight:600},children:[o&&!o.preview&&"group"===o.type&&(0,jo.jsx)(ms,{innerRef:m,style:{position:"absolute",left:0,right:0,height:n?Uw-1:(1+t.categories.length)*(Uw-1)+1,zIndex:1e4},children:(0,jo.jsx)(dA,{pos:v,offset:{top:1}})}),(0,jo.jsx)(dA,{pos:x,offset:{top:1}}),(0,jo.jsxs)(ms,{innerRef:b,style:{flex:1,flexDirection:"row",opacity:y&&!o.preview?.3:1},children:[(0,jo.jsx)(nM,{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,jo.jsx)(rM,{component:a,args:{group:t}})]})]})}function aM(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}=sA({type:"category",onDragChange:f,item:t,canDrag:null===r}),{dropRef:g,dropPos:m}=uA({types:"category",id:t.id,onDrop:p});return(0,jo.jsxs)(qw,{innerRef:g,collapsed:!0,backgroundColor:"transparent",children:[(0,jo.jsx)(dA,{pos:m,offset:{top:1}}),(0,jo.jsxs)(ms,{style:[{flex:1,flexDirection:"row"}],children:[(0,jo.jsx)(tM,{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,jo.jsx)(rM,{component:i,editingIndex:r&&r.id===t.id&&r.cell,args:{category:t,onEdit:l,onBudgetAction:c,onShowActivity:d}})]})]})}function lM(e){let{group:t,editingCell:n,collapsed:r,MonthComponent:o,onEditName:i,onSave:a,onToggleCollapse:l,onShowNewCategory:s}=e;return(0,jo.jsxs)(qw,{collapsed:!0,backgroundColor:mo.n11,style:{fontWeight:600},children:[(0,jo.jsx)(nM,{group:t,collapsed:r,editing:n&&"name"===n.cell&&n.id===t.id,onEdit:i,onSave:a,onToggleCollapse:l,onShowNewCategory:s}),(0,jo.jsx)(rM,{component:o,args:{group:t}})]})}function sM(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}=sA({type:"income-category",onDragChange:u,item:t,canDrag:null===r}),{dropRef:h,dropPos:y}=uA({types:"income-category",id:t.id,onDrop:d});return(0,jo.jsxs)(qw,{innerRef:h,collapsed:!0,backgroundColor:"transparent",children:[(0,jo.jsx)(dA,{pos:y,offset:{top:1}}),(0,jo.jsx)(tM,{innerRef:p,category:t,isLast:n,editing:r&&"name"===r.cell&&r.id===t.id,onEditName:i,onSave:l,onDelete:s}),(0,jo.jsx)(rM,{component:o,editingIndex:r&&r.id===t.id&&r.cell,args:{category:t,onEdit:a,isLast:n,onShowActivity:f,onBudgetAction:c}})]})}const uM=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,jo.jsx)(ms,{style:{marginBottom:10,backgroundColor:"white",overflow:"hidden",boxShadow:$A,borderRadius:"0 0 4px 4px",flex:1},children:S.map(((e,r)=>{let a;switch(e.type){case"new-group":a=(0,jo.jsx)(qw,{style:{backgroundColor:mo.n11},children:(0,jo.jsx)(nM,{group:{id:"new",name:""},editing:!0,onSave:p,onHideNewGroup:j,onEdit:c})});break;case"new-category":a=(0,jo.jsx)(qw,{children:(0,jo.jsx)(tM,{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,jo.jsx)(iM,{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,jo.jsx)(aM,{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,jo.jsx)(ms,{style:{height:70,backgroundColor:"white"},children:(0,jo.jsx)(cM,{MonthComponent:l.IncomeHeaderComponent,onShowNewGroup:w})});break;case"income-group":a=(0,jo.jsx)(lM,{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,jo.jsx)(sM,{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,jo.jsx)(cA.Provider,{value:h,children:(0,jo.jsx)(ms,{style:!k&&{":hover":{backgroundColor:"#fcfcfc"}},children:a})},e.value?e.value.id:"income-separator"===e.type?"separator":r)}))})}));function cM(e){let{MonthComponent:t,onShowNewGroup:n}=e;return(0,jo.jsxs)(ms,{style:{flexDirection:"row",flex:1},children:[(0,jo.jsx)(ms,{style:{width:200,alignItems:"flex-start",justifyContent:"flex-start"},children:(0,jo.jsx)(As,{onClick:n,style:{fontSize:12,margin:10},children:"Add Group"})}),(0,jo.jsx)(rM,{component:t,style:{border:0,justifyContent:"flex-end"}})]})}const dM=h.memo((e=>{let{startMonth:t,onMonthSelect:n,numMonths:r,monthBounds:o,style:i}=e;return(0,jo.jsx)(ms,{style:{marginLeft:205,flexShrink:0},children:(0,jo.jsx)(ms,{style:{marginRight:5+JA()},children:(0,jo.jsx)(pM,{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 fM(e){return lh(uh(e)+"-01",function(e){return uh(e)+"-12"}(e))}const pM=e=>{let{startMonth:t,numDisplayed:n,monthBounds:r,style:o,onSelect:i}=e;const a=Zp(),l=fM(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,jo.jsxs)(ms,{style:[{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},o],children:[(0,jo.jsx)(ms,{style:{padding:"3px 0px",margin:"3px 0",fontWeight:"bold",fontSize:14,flex:"0 0 40px"},children:fh(u,"yyyy")}),(0,jo.jsx)(ms,{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,jo.jsx)(ms,{style:[{marginRight:1,padding:"big"===d?"3px 5px":"3px 3px",textAlign:"center",cursor:"default",borderRadius:2,":hover":p&&{backgroundColor:mo.p6,color:"white"}},!p&&{color:mo.n7},vo.smallText,a&&{backgroundColor:mo.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:mo.p6},l&&{textDecoration:"underline"}],onClick:()=>i(f),children:"small"===d?e[0]:e},e)}))}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",flex:"0 0 50px",justifyContent:"flex-end"},children:[(0,jo.jsx)(As,{onClick:()=>i(nh(t,1)),bare:!0,children:(0,jo.jsx)(NA,{width:12,height:12})}),(0,jo.jsx)(As,{onClick:()=>i(th(t,1)),bare:!0,children:(0,jo.jsx)(LA,{width:12,height:12})})]})]})};const hM=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}=kP(),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,jo.jsx)(qA.Provider,{value:o,children:(0,jo.jsx)(ms,{style:{width:n,height:r,alignItems:"center",opacity:n<=0||r<=0?0:1},children:(0,jo.jsxs)(ms,{style:{width:"100%",maxWidth:g},children:[(0,jo.jsx)(dM,{startMonth:i,numMonths:y,monthBounds:s,onMonthSelect:function(e){u(e,y)}}),(0,jo.jsx)(eM,{ref:t,categoryGroups:o,prewarmStartMonth:i,startMonth:a,numMonths:y,monthBounds:s,...d})]})})})}));var yM=h.forwardRef(((e,t)=>(0,jo.jsx)(Iw,{children:n=>{let{width:r,height:o}=n;return(0,jo.jsx)(hM,{ref:t,width:r,height:o,...e})}})));function gM(e){let{carryover:t,balance:n,category:r,disabled:o}=e,i=bw(t),a=bw(n);return(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(vw,{binding:n,type:"financial",getStyle:QA,style:[{textAlign:"right"},!o&&{cursor:"pointer",":hover":{textDecoration:"underline"}}]}),!0===i&&(0,jo.jsx)(ms,{style:{alignSelf:"center",marginLeft:2,position:"absolute",right:-4,top:0,bottom:0,justifyContent:"center"},children:(0,jo.jsx)(LA,{width:7,height:7,style:{...QA(a)}})})]})}var mM=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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 vM=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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 bM=h.createContext(null);function xM(e){let{summaryCollapsed:t,onBudgetAction:n,onToggleSummaryCollapse:r,children:o}=e,i=Zp();return(0,jo.jsx)(bM.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,jo.jsxs)("svg",{viewBox:"0 0 20 20",style:t,children:[(0,jo.jsx)("circle",{r:"10",cx:"10",cy:"10",fill:o}),(0,jo.jsx)("circle",{r:4,cx:"10",cy:"10",fill:"none",stroke:r,strokeWidth:8,strokeDasharray:`${a} ${l}`,transform:"rotate(-90) translate(-20)"})," "]})}function jM(e,t){return 0===t?e>0?1:0:e/t}function SM(e){let{current:t,target:n}=e,r=bw(t)||0,o=!1;r<0&&(o=!0,r=-r);let i=jM(r,bw(n)||0);return(0,jo.jsx)(wM,{progress:i,color:o?mo.r7:mo.g5,backgroundColor:o?mo.r10:mo.n10,style:{width:20,height:20}})}function kM(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=jM(o,i),(0,jo.jsx)(wM,{progress:t,color:a?mo.r7:mo.g5,backgroundColor:a?mo.r10:mo.n10,style:{width:20,height:20}})}function CM(e){let{title:t,current:n,target:r,ProgressComponent:o,style:i}=e;return(0,jo.jsxs)(ms,{style:[{lineHeight:1.5,flexDirection:"row",alignItems:"center",fontSize:14},i],children:[(0,jo.jsx)(o,{current:n,target:r}),(0,jo.jsxs)(ms,{style:{marginLeft:10},children:[(0,jo.jsx)(ms,{children:(0,jo.jsx)(gs,{style:{color:mo.n4},children:t})}),(0,jo.jsxs)(gs,{children:[(0,jo.jsx)(vw,{binding:n,type:"financial"}),(0,jo.jsxs)(gs,{style:{color:mo.n6,fontStyle:"italic"},children:[" of ",(0,jo.jsx)(vw,{binding:r,type:"financial",style:vo.notFixed})]})]})]})]})}function _M(e){let{projected:t,style:n}=e;return(0,jo.jsx)(CM,{title:"Income",current:dx.totalIncome,target:dx.totalBudgetedIncome,ProgressComponent:SM,style:n})}function OM(e){let{style:t}=e;return(0,jo.jsx)(CM,{title:"Expenses",current:dx.totalSpent,target:dx.totalBudgetedExpense,ProgressComponent:kM,style:t})}function EM(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,jo.jsxs)(ms,{style:[{alignItems:"center",fontSize:14},n],children:[t?(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Projected Savings:"}):(0,jo.jsx)(ms,{style:{color:mo.n4},children:a?"Overspent:":"Saved:"}),(0,jo.jsx)(Ys,{renderContent:()=>{if(!t){let e=o-r;return(0,jo.jsxs)(Ss,{position:"bottom-center",style:{padding:10,fontSize:14},children:[(0,jo.jsx)(zs,{left:"Projected Savings:",right:(0,jo.jsx)(gs,{style:[XA(r),vo.tnum],children:yw(r,"financial-with-sign")})}),(0,jo.jsx)(zs,{left:"Difference:",right:(0,jo.jsx)(gs,{style:[XA(e),vo.tnum],children:yw(e,"financial-with-sign")})})]})}return null},children:(0,jo.jsx)(ms,{...(0,so.iv)([{fontSize:25,color:t?mo.y3:a?mo.r4:mo.p5}]),children:yw(i,"financial")})})]})}const TM=h.memo((function(e){let{month:t}=e,{currentMonth:n,summaryCollapsed:r,onBudgetAction:o,onToggleSummaryCollapse:i}=(0,h.useContext)(bM),[a,l]=(0,h.useState)(!1);function s(e){l(!1)}let u=r?mM:vM;return(0,jo.jsx)(ms,{style:{backgroundColor:"white",boxShadow:$A,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,jo.jsxs)(gw.Provider,{value:dh(t),children:[(0,jo.jsxs)(ms,{style:[{padding:"0 13px"},r?{margin:"10px 0"}:{marginTop:16}],children:[(0,jo.jsx)(ms,{style:{position:"absolute",left:10,top:0},children:(0,jo.jsx)(As,{className:"hover-visible",bare:!0,onClick:i,children:(0,jo.jsx)(u,{width:13,height:13,style:{color:mo.n6,margin:1}})})}),(0,jo.jsx)("div",{...(0,so.iv)([{textAlign:"center",marginTop:3,fontSize:18,fontWeight:500,textDecorationSkip:"ink"},n===t&&{textDecoration:"underline"}]),children:fh(t,"MMMM")}),(0,jo.jsxs)(ms,{style:{position:"absolute",right:10,top:0,flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(ms,{children:(0,jo.jsx)(hw,{id:`budget-${t}`,width:15,height:15,tooltipPosition:"bottom-right",defaultColor:mo.n6})}),(0,jo.jsxs)(ms,{style:{userSelect:"none"},children:[(0,jo.jsx)(As,{bare:!0,onClick:function(e){l(!0)},children:(0,jo.jsx)(qx,{width:15,height:15,style:{color:mo.n5}})}),a&&(0,jo.jsx)(Ss,{position:"bottom-right",width:200,style:{padding:0},onClose:s,children:(0,jo.jsx)(Us,{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,jo.jsxs)(xs,{spacing:2,style:{alignSelf:"center",backgroundColor:mo.n11,borderRadius:4,padding:"10px 15px",marginTop:13},children:[(0,jo.jsx)(_M,{}),(0,jo.jsx)(OM,{})]}),r?(0,jo.jsx)(ms,{style:{alignItems:"center",padding:"10px 20px",justifyContent:"space-between",backgroundColor:mo.n11,borderTop:"1px solid "+mo.n10},children:(0,jo.jsx)(EM,{projected:t>=n})}):(0,jo.jsx)(EM,{projected:t>=n,style:{marginTop:13,marginBottom:20}})]})})}));let PM={flex:1,padding:"0 5px",textAlign:"right"};const AM=h.memo((function(){return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",marginRight:VA,paddingTop:10,paddingBottom:10},children:[(0,jo.jsxs)(ms,{style:PM,children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Budgeted"}),(0,jo.jsx)(vw,{binding:dx.totalBudgetedExpense,type:"financial",style:{color:mo.n4,fontWeight:600},formatter:e=>yw(parseFloat(e||"0"),"financial")})]}),(0,jo.jsxs)(ms,{style:PM,children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Spent"}),(0,jo.jsx)(vw,{binding:dx.totalSpent,type:"financial",style:{color:mo.n4,fontWeight:600}})]}),(0,jo.jsxs)(ms,{style:PM,children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Balance"}),(0,jo.jsx)(vw,{binding:dx.totalLeftover,type:"financial",style:{color:mo.n4,fontWeight:600}})]})]})}));function MM(){return(0,jo.jsxs)(ms,{style:{flexDirection:"row",marginRight:VA,paddingBottom:5},children:[(0,jo.jsx)(ms,{style:PM,children:(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Budgeted"})}),(0,jo.jsx)(ms,{style:PM,children:(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Received"})})]})}const DM=h.memo((function(e){let{group:t}=e,n=mo.border,{id:r}=t;return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row"},children:[(0,jo.jsx)(rj,{name:"budgeted",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600},vo.tnum],valueProps:{binding:dx.groupBudgeted(r),type:"financial"}}),(0,jo.jsx)(rj,{name:"spent",width:"flex",textAlign:"right",borderColor:n,style:[{fontWeight:600},vo.tnum],valueProps:{binding:dx.groupSumAmount(r),type:"financial"}}),!t.is_income&&(0,jo.jsx)(rj,{name:"balance",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600,paddingRight:VA},vo.tnum],valueProps:{binding:dx.groupBalance(r),type:"financial"}})]})}));function IM(e){let{categoryId:t,tooltip:n,monthIndex:r,onBudgetAction:o}=e,i=bw(dx.catCarryover(t));return(0,jo.jsx)(Ss,{position:"bottom-right",width:200,style:{padding:0},onClose:n.close,children:(0,jo.jsx)(Us,{onMenuSelect:e=>{o(r,"carryover",{category:t,flag:!i}),n.close()},items:[{name:"carryover",text:i?"Remove overspending rollover":"Rollover overspending"}]})})}const RM=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=mo.border,d=js();return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row"},children:[(0,jo.jsx)(rj,{name:"budget",sync:!0,exposed:a,width:"flex",borderColor:c,onExpose:()=>l(n.id,t),style:[a&&{zIndex:100},vo.tnum],textAlign:"right",valueStyle:[{cursor:"default",margin:1,padding:"0 4px",borderRadius:4},{":hover":{boxShadow:"inset 0 0 0 1px "+mo.n7,backgroundColor:"white"}}],valueProps:{binding:dx.catBudgeted(n.id),type:"financial",getValueStyle:YA,formatExpr:e=>Wr(e),unformatExpr:e=>Vr(k_(e,0))},inputProps:{onBlur:()=>{l(null)}},onSave:e=>{s(t,"budget-amount",{category:n.id,amount:e})}}),(0,jo.jsx)($w,{name:"spent",width:"flex",borderColor:c,style:{textAlign:"right"},children:(0,jo.jsx)("span",{onClick:()=>u(n.name,n.id,t),children:(0,jo.jsx)(vw,{binding:dx.catSumAmount(n.id),type:"financial",getStyle:YA,style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})}),!n.is_income&&(0,jo.jsxs)($w,{name:"balance",width:"flex",borderColor:c,style:{paddingRight:VA,textAlign:"right"},children:[(0,jo.jsx)("span",{...n.is_income?{}:d.getOpenEvents(),children:(0,jo.jsx)(gM,{category:n,disabled:n.is_income,carryover:dx.catCarryover(n.id),balance:dx.catBalance(n.id)})}),d.isOpen&&(0,jo.jsx)(IM,{categoryId:n.id,tooltip:d,monthIndex:t,onBudgetAction:s})]})]})})),NM=DM,LM=RM,FM=DM,BM=RM;function UM(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)(qA);u=u.filter((e=>!e.is_income)),r&&(u=GA(u));let[c,d]=(0,h.useState)(null),[f,p]=(0,h.useState)(null);function y(){let e=k_(c,null);e&&f&&(i(Vr(e),f),a())}return(0,h.useEffect)((()=>{(async()=>{if(n){const e=await l.get(s,n);d(Wr(Math.max(e.value,0)))}else d(Wr(Math.max(t,0)))})()}),[]),null===c?null:(0,jo.jsxs)(Ss,{position:"bottom-right",width:200,style:{padding:10},...o,onClose:a,children:[(0,jo.jsx)(ms,{style:{marginBottom:5},children:"Transfer this amount:"}),(0,jo.jsx)(ms,{children:(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{value:c,onChange:e=>d(e.target.value),onEnter:y})})}),(0,jo.jsx)(ms,{style:{margin:"10px 0 5px 0"},children:"To:"}),(0,jo.jsx)(MC,{categoryGroups:u,value:null,openOnFocus:!0,onUpdate:e=>{},onSelect:e=>p(e),inputProps:{onEnter:y,placeholder:"(none)"}}),(0,jo.jsx)(ms,{style:{alignItems:"flex-end",marginTop:10},children:(0,jo.jsx)(As,{primary:!0,style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:y,children:"Transfer"})})]})}function zM(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 WM=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=zM(this,e.call.apply(e,[this].concat(i))),HM.call(r),zM(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),HM=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)}},KM=WM;function $M(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=k_(i,null);e&&t(Vr(e)),n()}return(0,h.useEffect)((()=>{(async()=>{const e=await r.get(o,"to-budget");a(Wr(Math.max(e.value,0)))})()}),[]),null===i?null:(0,jo.jsxs)(Ss,{position:"bottom-right",width:200,style:{padding:10},onClose:n,children:[(0,jo.jsx)(ms,{style:{marginBottom:5},children:"Hold this amount:"}),(0,jo.jsx)(ms,{children:(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{value:i,onChange:e=>a(e.target.value),onEnter:l})})}),(0,jo.jsx)(ms,{style:{alignItems:"flex-end",marginTop:10},children:(0,jo.jsx)(As,{primary:!0,style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:l,children:"Hold"})})]})}let VM=h.createContext(null);function qM(e){let{categoryGroups:t,summaryCollapsed:n,onBudgetAction:r,onToggleSummaryCollapse:o,children:i}=e,a=Zp();return(0,jo.jsx)(VM.Provider,{value:{currentMonth:a,categoryGroups:t,summaryCollapsed:n,onBudgetAction:r,onToggleSummaryCollapse:o},children:i})}function GM(e){let{prevMonthName:t,collapsed:n}=e;return(0,jo.jsxs)(ms,{style:[{flexDirection:"row",lineHeight:1.5,justifyContent:"center"},!n&&{padding:"5px 0",marginTop:17,backgroundColor:mo.n11,borderTopWidth:1,borderBottomWidth:1,borderColor:mo.n9},n&&{padding:7},vo.smallText],children:[(0,jo.jsxs)(ms,{style:{textAlign:"right",marginRight:10,minWidth:50},children:[(0,jo.jsx)(Ys,{style:{flexShrink:0},renderContent:()=>(0,jo.jsxs)(Ss,{width:200,style:{lineHeight:1.5,padding:"6px 10px"},children:[(0,jo.jsx)(zs,{left:"Income:",right:(0,jo.jsx)(vw,{binding:cx.totalIncome,type:"financial"})}),(0,jo.jsx)(zs,{left:"From Last Month:",right:(0,jo.jsx)(vw,{binding:cx.fromLastMonth,type:"financial"})})]}),children:(0,jo.jsx)(vw,{binding:cx.incomeAvailable,type:"financial",style:{fontWeight:600}})}),(0,jo.jsx)(vw,{binding:cx.lastMonthOverspent,formatter:e=>{let t=yw(e,"financial");return e>0?"+"+t:0===e?"-"+t:t},style:[{fontWeight:600},vo.tnum]}),(0,jo.jsx)(vw,{binding:cx.totalBudgeted,formatter:e=>{let t=yw(e,"financial");return e>0?"+"+t:0===e?"-"+t:t},style:[{fontWeight:600},vo.tnum]}),(0,jo.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},vo.tnum]})]}),(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(Cs,{children:"Available Funds"}),(0,jo.jsxs)(Cs,{children:["Overspent in ",t]}),(0,jo.jsx)(Cs,{children:"Budgeted"}),(0,jo.jsx)(Cs,{children:"For Next Month"})]})]})}function YM(e){let{month:t,prevMonthName:n,collapsed:r,onBudgetAction:o}=e;return(0,jo.jsx)(mw,{binding:cx.toBudget,initialValue:0,children:e=>{const i=parseInt(e.value),a=isNaN(i)?0:i,l=a<0;return(0,jo.jsxs)(ms,{style:{alignItems:"center"},children:[(0,jo.jsx)(Cs,{children:l?"Overbudgeted:":"To Budget:"}),(0,jo.jsx)(KM,{initialState:{menuOpen:null},children:s=>{let{state:u,setState:c}=s;return(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(Ys,{disabled:!r||u.menuOpen,renderContent:()=>(0,jo.jsx)(Ss,{position:"bottom-center",children:(0,jo.jsx)(GM,{collapsed:!0,prevMonthName:n})}),children:(0,jo.jsx)(Cs,{onClick:()=>c({menuOpen:"actions"}),"data-cellname":e.name,...(0,so.iv)([vo.veryLargeText,{fontWeight:400,userSelect:"none",cursor:"pointer",color:l?mo.r4:mo.p5,marginBottom:-1,borderBottom:"1px solid transparent",":hover":{borderColor:l?mo.r4:mo.p5}}]),children:yw(a,"financial")})}),"actions"===u.menuOpen&&(0,jo.jsx)(Ss,{position:"bottom-center",width:200,style:{padding:0},onClose:()=>c({menuOpen:null}),children:(0,jo.jsx)(Us,{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,jo.jsx)($M,{onClose:()=>c({menuOpen:null}),onSubmit:e=>{o(t,"hold",{amount:e})}}),"transfer"===u.menuOpen&&(0,jo.jsx)(UM,{initialAmount:i,onClose:()=>c({menuOpen:null}),onSubmit:(e,n)=>{o(t,"transfer-available",{amount:e,category:n})}})]})}})]})}})}function QM(e){let{month:t,isGoalTemplatesEnabled:n}=e,{currentMonth:r,summaryCollapsed:o,onBudgetAction:i,onToggleSummaryCollapse:a}=(0,h.useContext)(VM),[l,s]=(0,h.useState)(!1);function u(e){s(!1)}let c=fh(eh(t),"MMM"),d=o?mM:vM;return(0,jo.jsx)(ms,{"data-testid":"budget-summary",style:{backgroundColor:"white",boxShadow:$A,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,jo.jsxs)(gw.Provider,{value:dh(t),children:[(0,jo.jsxs)(ms,{style:[{padding:"0 13px"},o?{margin:"10px 0"}:{marginTop:16}],children:[(0,jo.jsx)(ms,{style:{position:"absolute",left:10,top:0},children:(0,jo.jsx)(As,{className:"hover-visible",bare:!0,onClick:a,children:(0,jo.jsx)(d,{width:13,height:13,style:{color:mo.n6,margin:1}})})}),(0,jo.jsx)("div",{...(0,so.iv)([{textAlign:"center",marginTop:3,fontSize:18,fontWeight:500,textDecorationSkip:"ink"},r===t&&{textDecoration:"underline"}]),children:fh(t,"MMMM")}),(0,jo.jsxs)(ms,{style:{position:"absolute",right:10,top:0,flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(ms,{children:(0,jo.jsx)(hw,{id:`budget-${t}`,width:15,height:15,tooltipPosition:"bottom-right",defaultColor:mo.n6})}),(0,jo.jsxs)(ms,{style:{userSelect:"none",marginLeft:2},children:[(0,jo.jsx)(As,{bare:!0,onClick:function(e){s(!0)},children:(0,jo.jsx)(qx,{width:15,height:15,style:{color:mo.n5}})}),l&&(0,jo.jsx)(Ss,{position:"bottom-right",width:200,style:{padding:0},onClose:u,children:(0,jo.jsx)(Us,{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,jo.jsx)(ms,{style:{alignItems:"center",padding:"10px 20px",justifyContent:"space-between",backgroundColor:mo.n11,borderTop:"1px solid "+mo.n10},children:(0,jo.jsx)(YM,{collapsed:o,prevMonthName:c,month:t,onBudgetAction:i})}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(GM,{prevMonthName:c}),(0,jo.jsx)(ms,{style:{margin:"23px 0"},children:(0,jo.jsx)(YM,{month:t,onBudgetAction:i})})]})]})})}function XM(e){let{showToBeBudgeted:t,inline:n,tooltipProps:r,onSubmit:o,onClose:i}=e,a=(0,h.useContext)(qA);a=GA(a.filter((e=>!e.is_income)));let[l,s]=(0,h.useState)(null);function u(){l&&(o(l),i())}return(0,jo.jsxs)(Ss,{position:"bottom-right",width:200,style:{padding:10},...r,onClose:i,children:[(0,jo.jsx)(ms,{style:{marginBottom:5},children:"Cover from category:"}),(0,jo.jsx)(Gs,{children:e=>(0,jo.jsx)(MC,{categoryGroups:a,value:null,openOnFocus:!0,onUpdate:e=>{},onSelect:e=>s(e),inputProps:{inputRef:e,onKeyDown:e=>{"Enter"===e.key&&u()}}})}),(0,jo.jsx)(ms,{style:{alignItems:"flex-end",marginTop:10},children:(0,jo.jsx)(As,{primary:!0,style:{fontSize:12,paddingTop:3},onClick:u,children:"Transfer"})})]})}function ZM(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,jo.jsxs)(jo.Fragment,{children:["menu"===l&&(0,jo.jsx)(Ss,{position:"bottom-right",width:200,style:{padding:0},onClose:n.close,children:(0,jo.jsx)(Us,{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,jo.jsx)(UM,{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,jo.jsx)(XM,{showToBeBudgeted:!0,onClose:n.close,onSubmit:e=>{o(r,"cover",{to:t,from:e})}})]})}let JM={flex:1,padding:"0 5px",textAlign:"right"};const eD=h.memo((function(){return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",marginRight:VA,paddingTop:10,paddingBottom:10},children:[(0,jo.jsxs)(ms,{style:JM,children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Budgeted"}),(0,jo.jsx)(vw,{binding:cx.totalBudgeted,type:"financial",style:{color:mo.n4,fontWeight:600},formatter:e=>yw(-parseFloat(e||"0"),"financial")})]}),(0,jo.jsxs)(ms,{style:JM,children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Spent"}),(0,jo.jsx)(vw,{binding:cx.totalSpent,type:"financial",style:{color:mo.n4,fontWeight:600}})]}),(0,jo.jsxs)(ms,{style:JM,children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"Balance"}),(0,jo.jsx)(vw,{binding:cx.totalBalance,type:"financial",style:{color:mo.n4,fontWeight:600}})]})]})}));function tD(){return(0,jo.jsx)(qw,{style:{color:mo.n4,alignItems:"center",paddingRight:10},children:(0,jo.jsx)(ms,{style:{flex:1,textAlign:"right"},children:"Received"})})}const nD=h.memo((function(e){let{group:t}=e,n=mo.border,{id:r}=t;return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row"},children:[(0,jo.jsx)(rj,{name:"budgeted",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600},vo.tnum],valueProps:{binding:cx.groupBudgeted(r),type:"financial"}}),(0,jo.jsx)(rj,{name:"spent",width:"flex",textAlign:"right",borderColor:n,style:[{fontWeight:600},vo.tnum],valueProps:{binding:cx.groupSumAmount(r),type:"financial"}}),(0,jo.jsx)(rj,{name:"balance",width:"flex",borderColor:n,textAlign:"right",style:[{fontWeight:600,paddingRight:VA},vo.tnum],valueProps:{binding:cx.groupBalance(r),type:"financial"}})]})})),rD=h.memo((function(e){let{monthIndex:t,category:n,editing:r,onEdit:o,onBudgetAction:i,onShowActivity:a}=e,l=mo.border,s=js();return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row"},children:[(0,jo.jsx)(rj,{name:"budget",sync:!0,exposed:r,width:"flex",borderColor:l,onExpose:()=>o(n.id,t),style:[r&&{zIndex:100},vo.tnum],textAlign:"right",valueStyle:[{cursor:"default",margin:1,padding:"0 4px",borderRadius:4},{":hover":{boxShadow:"inset 0 0 0 1px "+mo.n7,backgroundColor:"white"}}],valueProps:{binding:cx.catBudgeted(n.id),type:"financial",getValueStyle:YA,formatExpr:e=>Wr(e),unformatExpr:e=>Vr(k_(e,0))},inputProps:{onBlur:()=>{o(null)}},onSave:e=>{i(t,"budget-amount",{category:n.id,amount:e})}}),(0,jo.jsx)($w,{name:"spent",width:"flex",borderColor:l,style:{textAlign:"right"},children:(0,jo.jsx)("span",{onClick:()=>a(n.name,n.id,t),children:(0,jo.jsx)(vw,{binding:cx.catSumAmount(n.id),type:"financial",getStyle:YA,style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})}),(0,jo.jsxs)($w,{name:"balance",width:"flex",borderColor:l,style:{paddingRight:VA,textAlign:"right"},children:[(0,jo.jsx)("span",{...s.getOpenEvents(),children:(0,jo.jsx)(gM,{category:n,carryover:cx.catCarryover(n.id),balance:cx.catBalance(n.id)})}),s.isOpen&&(0,jo.jsx)(ZM,{categoryId:n.id,tooltip:s,monthIndex:t,onBudgetAction:i})]})]})}));function oD(e){let{group:t}=e;return(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(rj,{name:"received",width:"flex",borderColor:mo.border,textAlign:"right",style:[{fontWeight:600,paddingRight:VA},vo.tnum],valueProps:{binding:cx.groupIncomeReceived,type:"financial"}})})}function iD(e){let{category:t,isLast:n,monthIndex:r,onShowActivity:o}=e;return(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)($w,{name:"received",width:"flex",borderColor:mo.border,style:[{paddingRight:VA,textAlign:"right"},n&&{borderBottomWidth:0}],children:(0,jo.jsx)("span",{onClick:()=>o(t.name,t.id,r),children:(0,jo.jsx)(vw,{binding:cx.catSumAmount(t.id),type:"financial",style:{cursor:"pointer",":hover":{textDecoration:"underline"}}})})})})}let aD=null;class lD 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:uP(t,{...e,is_income:e.is_income?1:0,id:n})})}else this.props.updateCategory(e),this.setState({categoryGroups:cP(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:pP(n,e)}))}}):(this.props.deleteCategory(e),this.setState({categoryGroups:pP(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:hP(t,{...e,is_income:0,categories:e.categories||[],id:n})})}else this.props.updateGroup(e),this.setState({categoryGroups:yP(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:gP(t,e)})}}):(this.props.deleteGroup(e),this.setState({categoryGroups:gP(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:dP(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:fP(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=aD||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&&(aD=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=zA(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,jo.jsx)(xM,{summaryCollapsed:f,onBudgetAction:this.onBudgetAction,onToggleSummaryCollapse:this.onToggleCollapse,children:(0,jo.jsx)(yM,{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,jo.jsx)(qM,{categoryGroups:a,summaryCollapsed:f,onBudgetAction:this.onBudgetAction,onToggleSummaryCollapse:this.onToggleCollapse,children:(0,jo.jsx)(yM,{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,jo.jsx)(ms,{style:{flex:1},innerRef:e=>this.page=e,children:e})):null}}const sD=h.memo((e=>{const t=Ox("goalTemplatesEnabled");return(0,jo.jsx)(QM,{...e,isGoalTemplatesEnabled:t})}));var uD=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)(PA),i=(0,h.useMemo)((()=>({SummaryComponent:TM,ExpenseCategoryComponent:LM,ExpenseGroupComponent:NM,IncomeCategoryComponent:BM,IncomeGroupComponent:FM,BudgetTotalsComponent:AM,IncomeHeaderComponent:MM})),[r]),a=(0,h.useMemo)((()=>({SummaryComponent:sD,ExpenseCategoryComponent:rD,ExpenseGroupComponent:nD,IncomeCategoryComponent:iD,IncomeGroupComponent:oD,BudgetTotalsComponent:eD,IncomeHeaderComponent:tD})),[o]);return(0,jo.jsx)(ms,{style:[vo.page,{paddingLeft:8,paddingRight:8,overflow:"hidden"}],children:(0,jo.jsx)(lD,{...e,reportComponents:i,rolloverComponents:a,spreadsheet:t,titlebar:n})})}));var cD=e=>(0,jo.jsx)("svg",{...e,viewBox:"0 0 23 3",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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 dD(e){let{id:t,defaultValue:n=0,onChange:r,style:o}=e,[i,a]=(0,h.useState)(n<=0),[l,s]=(0,h.useState)(Wr(Math.abs(n)));function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=$r(l);r(e?t<0?t:-t:t>0?t:-t)}return(0,jo.jsx)(Rs,{id:t,leftContent:(0,jo.jsx)(As,{bare:!0,style:{padding:"0 7px"},onClick:function(){a(!i),u(!i)},children:i?(0,jo.jsx)(cD,{style:{width:8,height:8}}):(0,jo.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 fD(e){let{defaultValue:t,onChange:n}=e,[r,o]=(0,h.useState)(t.num1),[i,a]=(0,h.useState)(t.num2);return(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(dD,{defaultValue:r,onChange:e=>{o(e),n({num1:e,num2:i})}}),(0,jo.jsx)(ms,{style:{margin:"0 5px"},children:"and"}),(0,jo.jsx)(dD,{defaultValue:i,onChange:e=>{a(e),n({num1:r,num2:e})}})]})}const pD=e=>{let{children:t,style:n,...r}=e;return(0,jo.jsx)(ms,{style:[{height:50,borderBottomWidth:1,borderColor:mo.border,flexDirection:"row",alignItems:"center",paddingLeft:10,paddingRight:10,zIndex:1},n],...r,children:t})};function hD(e){let{toBudget:t,onClick:n}=e;return(0,jo.jsx)(mw,{binding:t,children:e=>{let{value:t}=e;return(0,jo.jsxs)(As,{bare:!0,style:{flexDirection:"column",alignItems:"flex-start"},onClick:n,children:[(0,jo.jsx)(Qs,{title:t<0?"OVERBUDGETED":"TO BUDGET",style:{color:mo.n1,flexShrink:0}}),(0,jo.jsx)(gs,{style:[vo.smallText,{fontWeight:"500",color:t<0?mo.r4:mo.n1}],children:yw(t,"financial")})]})}})}function yD(e){let{projected:t}=e,n=bw(dx.totalBudgetedSaved)||0,r=bw(dx.totalSaved)||0,o=t?n:r,i=o<0;return(0,jo.jsxs)(ms,{style:{flexDirection:"column",alignItems:"flex-start"},children:[t?(0,jo.jsx)(Qs,{title:"PROJECTED SAVINGS",style:{color:mo.n1}}):(0,jo.jsx)(Qs,{title:i?"OVERSPENT":"SAVED",style:{color:mo.n1}}),(0,jo.jsx)(gs,{style:[vo.smallText,{fontWeight:"500",color:t?mo.y3:i?mo.r4:mo.n1}],children:yw(o,"financial")})]})}class gD 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,jo.jsx)(mw,{binding:t,children:t=>(0,jo.jsxs)(ms,{style:r,children:[(0,jo.jsx)(dD,{value:qr(t.value||0),style:{height:46,transform:"translateX(6px)",...!n&&{opacity:0,position:"absolute",top:0}},focused:n,textStyle:[vo.smallText,o],onChange:()=>{},onBlur:e=>{l(a,"budget-amount",{category:i,amount:Vr(e)})}}),(0,jo.jsx)(ms,{style:{justifyContent:"center",height:46,...n&&{display:"none"}},children:(0,jo.jsx)(gs,{style:[vo.smallText,o],"data-testid":e,children:yw(t.value||0,"financial")})})]})})}}class mD 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,jo.jsxs)(pD,{style:[{backgroundColor:t?mo.p11:"transparent",borderBottomWidth:0,borderTopWidth:n>0?1:0},r],"data-testid":"row",children:[(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(gs,{style:vo.smallText,children:e.name})}),(0,jo.jsxs)(ms,{style:{alignItems:"center",flexDirection:"row",opacity:this.opacity},children:[(0,jo.jsx)(gD,{name:"budgeted",binding:a,editing:t,style:{width:90},textStyle:[vo.smallText,{textAlign:"right"}],categoryId:e.id,month:o,onBudgetAction:i}),(0,jo.jsx)(vw,{name:"balance",binding:l,style:[vo.smallText,{width:90,textAlign:"right"}],getStyle:e=>e<0&&{color:mo.r4},type:"financial"})]})]});return(0,jo.jsx)("div",{children:s})}}class vD 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,jo.jsxs)(pD,{style:{flexDirection:"row",alignItems:"center",backgroundColor:mo.n11},"data-testid":"totals",children:[(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(gs,{style:[vo.smallText,{fontWeight:"500"}],"data-testid":"name",children:e.name})}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",opacity:this.opacity},children:[(0,jo.jsx)(vw,{binding:cx.groupBudgeted(e.id),style:[vo.smallText,{width:90,fontWeight:"500",textAlign:"right"}],type:"financial"}),(0,jo.jsx)(vw,{binding:cx.groupBalance(e.id),style:[vo.smallText,{width:90,fontWeight:"500",textAlign:"right"}],type:"financial"})]}),t&&(0,jo.jsx)(ms,{children:(0,jo.jsx)(As,{onClick:()=>n(e.id),style:{padding:10},children:(0,jo.jsx)(Vx,{width:15,height:15,color:mo.n1})})})]});return r}}class bD extends h.PureComponent{render(){const{name:e,budget:t,balance:n,style:r,nameTextStyle:o,amountTextStyle:i}=this.props;return(0,jo.jsxs)(pD,{style:[{flexDirection:"row",alignItems:"center",padding:10,backgroundColor:"transparent"},r],children:[(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(gs,{style:[vo.smallText,o],"data-testid":"name",children:e})}),t&&(0,jo.jsx)(vw,{binding:t,style:[vo.smallText,{width:90,textAlign:"right"},i],type:"financial"}),(0,jo.jsx)(vw,{binding:n,style:[vo.smallText,{width:90,textAlign:"right"},i],type:"financial"})]})}}class xD 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,jo.jsxs)(_s,{style:{marginTop:7,marginBottom:7},children:[(0,jo.jsx)(vD,{group:e,budgeted:cx.groupBudgeted(e.id),balance:cx.groupBalance(e.id),editMode:t,onAddCategory:a,onReorderCategory:i}),e.categories.map(((e,a)=>(0,jo.jsx)(mD,{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,jo.jsxs)(ms,{children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginTop:50,marginBottom:5,marginRight:14},children:["report"===e&&(0,jo.jsx)(Qs,{title:"BUDGETED",style:{width:90}}),(0,jo.jsx)(Qs,{title:"RECEIVED",style:{width:90}})]}),(0,jo.jsxs)(_s,{style:{marginTop:0},children:[(0,jo.jsx)(bD,{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:mo.n11}}),t.categories.map(((t,n)=>(0,jo.jsx)(bD,{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 jD extends h.Component{constructor(){super(...arguments),this.getGroups=Xr((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,jo.jsxs)(ms,{"data-testid":"budget-groups",style:{flex:"1 0 auto",overflowY:"auto",paddingBottom:15},children:[d.map((e=>(0,jo.jsx)(xD,{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,jo.jsx)(wD,{type:e,group:c})]})}}class SD 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,jo.jsx)(gw.Provider,{value:dh(n),children:(0,jo.jsxs)(ms,{style:{flex:1,overflowY:"hidden"},"data-testid":"budget-table",children:[(0,jo.jsx)(kD,{currentMonth:n,monthBounds:r,editMode:o,onDone:()=>this.props.onEditMode(!1),onOpenActionSheet:d,onPrevMonth:i,onNextMonth:a}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",flex:"1 0 auto",padding:10,paddingRight:14,backgroundColor:"white",borderBottomWidth:1,borderColor:mo.n9},children:["report"===e?(0,jo.jsx)(yD,{projected:n>=y}):(0,jo.jsx)(hD,{toBudget:cx.toBudget,onClick:c}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsxs)(ms,{style:{width:90},children:[(0,jo.jsx)(Qs,{title:"BUDGETED",style:{color:mo.n1}}),(0,jo.jsx)(vw,{binding:dx.totalBudgetedExpense,type:"financial",style:[vo.smallText,{color:mo.n1,textAlign:"right",fontWeight:"500"}],formatter:e=>yw(-parseFloat(e||"0"),"financial")})]}),(0,jo.jsxs)(ms,{style:{width:90},children:[(0,jo.jsx)(Qs,{title:"BALANCE",style:{color:mo.n1}}),(0,jo.jsx)(vw,{binding:cx.totalBalance,type:"financial",style:[vo.smallText,{color:mo.n1,textAlign:"right",fontWeight:"500"}]})]})]}),(0,jo.jsx)(ms,{style:{overflowY:"auto"},children:o?(0,jo.jsx)(h.Fragment,{children:(0,jo.jsx)(ms,{children:(0,jo.jsx)(jD,{categoryGroups:t,editingId:p,editMode:o,gestures:this.gestures,onEditCategory:()=>{},onAddCategory:l,onReorderCategory:s,onReorderGroup:u})})}):(0,jo.jsx)(ms,{children:(0,jo.jsx)(jD,{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 kD=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,jo.jsxs)(ms,{style:{alignItems:"center",flexDirection:"row",flexShrink:0,height:50,justifyContent:"center",backgroundColor:mo.p5},children:[!r&&(0,jo.jsx)(As,{bare:!0,onClick:u&&i,style:[d,{left:0,opacity:u?1:.6,padding:"5px 30px 5px 0"}],children:(0,jo.jsx)(NA,{style:{color:mo.n11},width:"15",height:"15"})}),(0,jo.jsx)(gs,{style:[vo.mediumText,{marginTop:12,marginBottom:12,color:mo.n11,textAlign:"center"}],children:fh(t,"MMMM ''yy")}),r?(0,jo.jsx)(As,{bare:!0,onClick:o,style:[d,{position:"absolute",top:0,bottom:0,right:0}],textStyle:{color:mo.n11,fontSize:15,fontWeight:"500"},children:"Done"}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(As,{bare:!0,onClick:c&&a,style:[d,{opacity:c?1:.6}],children:(0,jo.jsx)(LA,{style:{color:mo.n11},width:"15",height:"15"})}),(0,jo.jsx)(DA,{style:{color:"white",position:"absolute",top:0,bottom:0,right:0,backgroundColor:"transparent",paddingLeft:12,paddingRight:12},localPrefs:s,onSync:l})]})]})}));class CD 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:uP(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:dP(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:fP(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,jo.jsx)(jO,{onSync:this.sync,children:r=>{let{refreshing:a,onRefresh:f}=r;return(0,jo.jsx)(SD,{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,jo.jsx)(ms,{style:{flex:1,backgroundColor:"white",alignItems:"center",justifyContent:"center",marginBottom:25},children:(0,jo.jsx)(Co,{width:25,height:25})})}}var _D=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)(xO(mo.p5)((function(e){let t=Sf();return(0,jo.jsx)(CD,{...e,spreadsheet:t})})));function OD(){let e=Bi();return(0,h.useEffect)((()=>{const t=t=>{if(!yo&&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"===po&&e.push("/settings")}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}),[]),null}function ED(){return(0,jo.jsx)(LE,{title:"Rules",children:(0,jo.jsx)(Pk,{})})}var TD=function(e){let{month:t,modalProps:n}=e;const r=fh(eh(t),"MMM");return(0,jo.jsx)(Ks,{title:"Budget Details",...n,animate:!0,children:()=>(0,jo.jsxs)(gw.Provider,{value:dh(t),children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"center",paddingTop:15,paddingBottom:15},children:[(0,jo.jsxs)(ms,{style:[vo.text,{fontWeight:"600",textAlign:"right",marginRight:10}],children:[(0,jo.jsx)(vw,{binding:cx.incomeAvailable,type:"financial"}),(0,jo.jsx)(vw,{binding:cx.lastMonthOverspent,type:"financial"}),(0,jo.jsx)(vw,{binding:cx.totalBudgeted,type:"financial"}),(0,jo.jsx)(vw,{binding:cx.forNextMonth,type:"financial"})]}),(0,jo.jsxs)(ms,{style:[vo.text,{display:"flex",flexDirection:"column",textAlign:"left"}],children:[(0,jo.jsx)(gs,{children:"Available Funds"}),(0,jo.jsxs)(gs,{children:["Overspent in ",r]}),(0,jo.jsx)(gs,{children:"Budgeted"}),(0,jo.jsx)(gs,{children:"For Next Month"})]})]}),(0,jo.jsx)(ms,{style:{alignItems:"center",marginBottom:15},children:(0,jo.jsx)(mw,{binding:cx.toBudget,children:e=>{let{value:t}=e;return(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gs,{style:vo.text,children:t<0?"Overbudget:":"To budget:"}),(0,jo.jsx)(gs,{style:[vo.text,{fontWeight:"600",fontSize:22,color:t<0?mo.r4:mo.n1}],children:yw(t,"financial")})]})}})}),(0,jo.jsx)(ms,{style:{flexDirection:"row",justifyContent:"center",paddingBottom:15},children:(0,jo.jsx)(As,{style:{marginRight:10},onClick:n.onClose,children:"Close"})})]})})},PD=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 AD(e,t){function n(){this.constructor=e}PD(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var MD=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 DD(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 ID="undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{};function RD(e,t){return e(t={exports:{}},t.exports),t.exports}function ND(e){return function(){return e}}var LD=function(){};LD.thatReturns=ND,LD.thatReturnsFalse=ND(!1),LD.thatReturnsTrue=ND(!0),LD.thatReturnsNull=ND(null),LD.thatReturnsThis=function(){return this},LD.thatReturnsArgument=function(e){return e};var FD=LD,BD=function(e){};var UD=function(e,t,n,r,o,i,a,l){if(BD(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}},zD=Object.getOwnPropertySymbols,WD=Object.prototype.hasOwnProperty,HD=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 KD="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";var $D=RD((function(e){e.exports=function(){function e(e,t,n,r,o,i){i!==KD&&UD(!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=FD,n.PropTypes=n,n}()})),VD=$D.object,qD=$D.oneOfType,GD=$D.string,YD=$D.node,QD=$D.func,XD=$D.bool,ZD=($D.element,RD((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 ID&&ID&&ID.Object===Object&&ID,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(Wa){}}(),U=B&&B.isTypedArray;function z(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(Wa){}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:ze(e),b=h?s:ze(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(!z(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,Ue)}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 Ue=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[]},ze=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(Wa){}try{return e+""}catch(Wa){}}return""}function Ke(e,t){return e===t||e!==e&&t!==t}(de&&ze(new de(new ArrayBuffer(1)))!=E||fe&&ze(new fe)!=y||pe&&ze(pe.resolve())!=b||he&&ze(new he)!=j||ye&&ze(new ye)!=_)&&(ze=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=U?function(e){return function(t){return e(t)}}(U):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)}}))),JD=function(){};var eI=JD,tI="Expected a function",nI="__lodash_hash_undefined__",rI=1/0,oI="[object Function]",iI="[object GeneratorFunction]",aI="[object Symbol]",lI=/^\./,sI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uI=/\\(\\)?/g,cI=/^\[object .+?Constructor\]$/,dI="object"==typeof ID&&ID&&ID.Object===Object&&ID,fI="object"==typeof self&&self&&self.Object===Object&&self,pI=dI||fI||Function("return this")();var hI=Array.prototype,yI=Function.prototype,gI=Object.prototype,mI=pI["__core-js_shared__"],vI=function(){var e=/[^.]+$/.exec(mI&&mI.keys&&mI.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),bI=yI.toString,xI=gI.hasOwnProperty,wI=gI.toString,jI=RegExp("^"+bI.call(xI).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),SI=pI.Symbol,kI=hI.splice,CI=RI(pI,"Map"),_I=RI(Object,"create"),OI=SI?SI.prototype:void 0,EI=OI?OI.toString:void 0;function TI(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 PI(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 AI(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 MI(e,t){for(var n=e.length;n--;)if(BI(e[n][0],t))return n;return-1}function DI(e){if(!zI(e)||(t=e,vI&&vI in t))return!1;var t,n=function(e){var t=zI(e)?wI.call(e):"";return t==oI||t==iI}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(Wa){}return t}(e)?jI:cI;return n.test(function(e){if(null!=e){try{return bI.call(e)}catch(Wa){}try{return e+""}catch(Wa){}}return""}(e))}function II(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 RI(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return DI(n)?n:void 0}TI.prototype.clear=function(){this.__data__=_I?_I(null):{}},TI.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},TI.prototype.get=function(e){var t=this.__data__;if(_I){var n=t[e];return n===nI?void 0:n}return xI.call(t,e)?t[e]:void 0},TI.prototype.has=function(e){var t=this.__data__;return _I?void 0!==t[e]:xI.call(t,e)},TI.prototype.set=function(e,t){return this.__data__[e]=_I&&void 0===t?nI:t,this},PI.prototype.clear=function(){this.__data__=[]},PI.prototype.delete=function(e){var t=this.__data__,n=MI(t,e);return!(n<0)&&(n==t.length-1?t.pop():kI.call(t,n,1),!0)},PI.prototype.get=function(e){var t=this.__data__,n=MI(t,e);return n<0?void 0:t[n][1]},PI.prototype.has=function(e){return MI(this.__data__,e)>-1},PI.prototype.set=function(e,t){var n=this.__data__,r=MI(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},AI.prototype.clear=function(){this.__data__={hash:new TI,map:new(CI||PI),string:new TI}},AI.prototype.delete=function(e){return II(this,e).delete(e)},AI.prototype.get=function(e){return II(this,e).get(e)},AI.prototype.has=function(e){return II(this,e).has(e)},AI.prototype.set=function(e,t){return II(this,e).set(e,t),this};var NI=FI((function(e){e=function(e){return null==e?"":function(e){if("string"==typeof e)return e;if(WI(e))return EI?EI.call(e):"";var t=e+"";return"0"==t&&1/e==-rI?"-0":t}(e)}(e);var t=[];return lI.test(e)&&t.push(""),e.replace(sI,(function(e,n,r,o){t.push(r?o.replace(uI,"$1"):n||e)})),t}));function LI(e){if("string"==typeof e||WI(e))return e;var t=e+"";return"0"==t&&1/e==-rI?"-0":t}function FI(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(tI);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(FI.Cache||AI),n}function BI(e,t){return e===t||e!==e&&t!==t}FI.Cache=AI;var UI=Array.isArray;function zI(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function WI(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&wI.call(e)==aI}var HI=function(e){return UI(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,LI):WI(e)?[e]:function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(NI(e))},KI=RD((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 ID&&ID&&ID.Object===Object&&ID,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 U(e,t){return e.set(t[0],t[1]),e}function z(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(Wa){}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||Ue(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||ze(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,U,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,z,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 Ue(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||M.test(e))&&e>-1&&e%1==0&&e<t}function ze(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(Wa){}try{return e+""}catch(Wa){}}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(!ze(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 $I(e,t,n,r){void 0===r&&(r=0);for(var o=HI(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e}function VI(e,t,n){for(var r={},o=r,i=0,a=HI(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]=KI(s);else{var u=a[i+1];o=o[l]=XI(u)&&Number(u)>=0?[]:{}}}return o[a[i]]=n,MD({},e,r)}function qI(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];QI(l)?n.get(l)||(n.set(l,!0),r[a]=Array.isArray(l)?[]:{},qI(l,t,n,r[a])):r[a]=t}return r}var GI="undefined"!==typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,YI=function(e){return"function"===typeof e},QI=function(e){return null!==e&&"object"===typeof e},XI=function(e){return String(Math.floor(Number(e)))===e},ZI=function(e){return 0===h.Children.count(e)};function JI(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);JI(i)?i.then((function(){return n(o,void 0)}),(function(e){return n(o,e)})):n(o,i)},t}AD(t,e),t.prototype.componentWillMount=function(){var e=this.props,t=e.render,n=e.children,r=e.component;eI(!(r&&t),"You should not use <Field component> and <Field render> in the same <Field> component; <Field component> will be ignored"),eI(!(this.props.component&&n&&YI(n)),"You should not use <Field component> and <Field children> as a function in the same <Field> component; <Field component> will be ignored."),eI(!(t&&n&&!ZI(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=DD(e,["validate","name","render","children","component"]),s=this.context.formik,u={value:"radio"===l.type||"checkbox"===l.type?l.value:$I(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):YI(o)?o(c):"string"===typeof a?(0,h.createElement)(a,MD({},u,l,{children:o})):(0,h.createElement)(a,MD({},c,l,{children:o}))},t.contextTypes={formik:VD},t.propTypes={name:GD.isRequired,component:qD([GD,QD]),render:QD,children:qD([QD,YD]),validate:QD}})(h.Component),Object.getOwnPropertySymbols,Object.prototype.propertyIsEnumerable;var eR=Object.getPrototypeOf;eR&&eR(Object),Object.getOwnPropertyNames;var tR=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r.splice(t,1),r.splice(n,0,o),r},nR=function(e,t,n){var r=(e||[]).slice(),o=r[t];return r[t]=r[n],r[n]=o,r},rR=function(e,t,n){var r=(e||[]).slice();return r.splice(t,0,n),r},oR=(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 MD({},n,{values:VI(n.values,d,e($I(l,d))),errors:r?VI(n.errors,d,e($I(u,d))):n.errors,touched:t?VI(n.touched,d,e($I(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 nR(n,e,t)}),!1,!1)},n.move=function(e,t){return n.updateArrayField((function(n){return tR(n,e,t)}),!1,!1)},n.insert=function(e,t){return n.updateArrayField((function(n){return rR(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}AD(t,e),t.prototype.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?n.slice():[];return t||(t=r[e]),YI(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=MD({},e,{form:this.context.formik,name:i});return n?(0,h.createElement)(n,a):r?r(a):o?"function"===typeof o?o(a):ZI(o)?null:h.Children.only(o):null},t.defaultProps={validateOnChange:!0},t.contextTypes={formik:VD}}(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,YI(r)?r():r).then((function(){n.setState({errors:{}}),t&&t()}),(function(e){return n.setState({errors:iR(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);JI(t)?t.then((function(){n.setState({errors:{}})}),(function(e){return n.setState({errors:e,isSubmitting:!1})})):n.setErrors(t)}},n.handleChange=function(e){if(!GI){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 MD({},e,{values:VI(e.values,u,c)})})),n.props.validateOnChange&&n.runValidations(VI(n.state.values,u,c))}},n.setFieldValue=function(e,t,r){void 0===r&&(r=!0),n.setState((function(n){return MD({},n,{values:VI(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:qI(n.state.values,!0),isSubmitting:!0}),n.props.validate){var e=n.props.validate(n.state.values)||{};if(JI(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(!GI){e.persist();var t=e.target,r=t.name,o=t.id,i=(t.outerHTML,r||o);0,n.setState((function(e){return{touched:VI(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 MD({},n,{touched:VI(n.touched,e,t)})}),(function(){n.props.validateOnBlur&&r&&n.runValidations(n.state.values)}))},n.setFieldError=function(e,t){n.setState((function(n){return MD({},n,{errors:VI(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());JI(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=!ZD(n.initialValues,n.state.values);return{dirty:t,isValid:t?n.state.errors&&0===Object.keys(n.state.errors).length:!1!==e&&YI(e)?e(n.props):e,initialValues:n.initialValues}},n.getFormikBag=function(){return MD({},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 AD(t,e),t.prototype.getChildContext=function(){return{formik:this.getFormikBag()}},t.prototype.componentWillReceiveProps=function(e){this.props.enableReinitialize&&!ZD(e.initialValues,this.props.initialValues)&&(this.initialValues=e.initialValues,this.resetForm(e.initialValues))},t.prototype.componentWillMount=function(){eI(!(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"),eI(!(this.props.component&&this.props.children&&!ZI(this.props.children)),"You should not use <Formik component> and <Formik children> in the same <Formik> component; <Formik children> will be ignored"),eI(!(this.props.render&&this.props.children&&!ZI(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):ZI(r)?null:h.Children.only(r):null},t.defaultProps={validateOnChange:!0,validateOnBlur:!0,isInitialValid:!1,enableReinitialize:!1},t.propTypes={validateOnChange:XD,validateOnBlur:XD,isInitialValid:qD([QD,XD]),initialValues:VD,onReset:QD,onSubmit:QD.isRequired,validationSchema:qD([QD,VD]),validate:QD,component:QD,render:QD,children:qD([QD,YD]),enableReinitialize:XD},t.childContextTypes={formik:VD},t}(h.Component));function iR(e){for(var t={},n=0,r=e.inner;n<r.length;n++){var o=r[n];t[o.path]||(t=VI(t,o.path,o.message))}return t}function aR(e,t,n){const r=n.find((e=>e.id===t)),o=r&&1===r.offbudget;return 0===e.offbudget&&o}function lR(e){let{categoryGroups:t,...n}=e;return(0,jo.jsxs)(Ls,{...n,children:[(0,jo.jsx)("option",{value:"",children:"Select category..."}),t.map((e=>(0,jo.jsx)("optgroup",{label:e.name,children:e.categories.map((e=>(0,jo.jsx)("option",{value:e.id,children:e.name},e.id)))},e.id)))]})}var sR=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,jo.jsx)(Ks,{title:"Close Account",...l,style:{flex:0},loading:s,children:()=>(0,jo.jsxs)(ms,{children:[(0,jo.jsxs)(Ws,{children:["Are you sure you want to close ",(0,jo.jsx)("strong",{children:t.name}),"?"," ",i?(0,jo.jsx)("span",{children:"This account has no transactions so it will be permanently deleted."}):(0,jo.jsx)("span",{children:"This account has transactions so we can\u2019t permanently delete it."})]}),(0,jo.jsx)(oR,{validateOnChange:!1,initialValues:{transfer:"",category:""},onSubmit:(e,r)=>{let{setErrors:i}=r;const s={};0!==o&&""===e.transfer&&(s.transfer="required"),aR(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,jo.jsxs)("form",{onSubmit:g,children:[0!==o&&(0,jo.jsxs)(ms,{children:[(0,jo.jsxs)(Ws,{children:["This account has a balance of"," ",(0,jo.jsx)("strong",{children:Wr(o)}),". To close this account, select a different account to transfer this balance to:"]}),(0,jo.jsxs)(Ls,{name:"transfer",value:s.transfer,onChange:h,onBlur:y,style:{width:200,marginBottom:15},children:[(0,jo.jsx)("option",{value:"",children:"Select account..."}),(0,jo.jsx)("optgroup",{label:"For Budget",children:d.map((e=>(0,jo.jsx)("option",{value:e.id,children:e.name},e.id)))}),(0,jo.jsx)("optgroup",{label:"Off Budget",children:f.map((e=>(0,jo.jsx)("option",{value:e.id,children:e.name},e.id)))})]}),c.transfer&&(0,jo.jsx)(qs,{style:{marginBottom:15},children:"Transfer is required"}),aR(t,s.transfer,n)&&(0,jo.jsxs)(ms,{style:{marginBottom:15},children:[(0,jo.jsx)(Ws,{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,jo.jsx)(lR,{categoryGroups:r,name:"category",value:s.category,onChange:h,onBlur:y,style:{width:200}}),c.category&&(0,jo.jsx)(qs,{children:"Category is required"})]})]}),!i&&(0,jo.jsx)(ms,{style:{marginBottom:15},children:(0,jo.jsxs)(gs,{style:{fontSize:12},children:["You can also"," ",(0,jo.jsx)("a",{href:"#",onClick:e=>{e.preventDefault(),u(!0),a.forceCloseAccount(t.id).then((()=>l.onClose()))},style:{color:mo.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,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[(0,jo.jsx)(As,{type:"submit",style:{marginRight:10},onClick:l.onClose,children:"Cancel"}),(0,jo.jsx)(As,{type:"submit",primary:!0,children:"Close Account"})]})]})}})]})})};function uR(){return null}function cR(e){let{account:t,offbudget:n,onSelect:r}=e;return(0,jo.jsx)(ms,{style:[{marginBottom:8,flexShrink:0,userSelect:"none"},vo.mediumText],onClick:r,children:(0,jo.jsxs)(ms,{style:[{padding:12,...vo.shadow,cursor:"pointer",transition:"transform .20s",fontSize:14,borderRadius:4,flexDirection:"row",alignItems:"center",border:"1px solid "+mo.n10}],children:[(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(ms,{style:{fontWeight:600},children:t.name}),(0,jo.jsxs)(ms,{style:{fontSize:13,color:mo.n5,flexDirection:"row"},children:[PE(TE(t.type,t.subtype)),(0,jo.jsxs)(gs,{style:{marginLeft:4},children:["...",t.mask]})]})]}),n?(0,jo.jsx)(gs,{style:{color:mo.n8},children:"Off budget"}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(Rw,{style:{width:15,height:15,color:mo.g5}}),(0,jo.jsx)(gs,{style:{color:mo.g5,marginLeft:5},children:"Budgeted"})]})]})})}function dR(e){let{institution:t,publicToken:n,upgradingId:r,modalProps:o,accounts:i,actions:a}=e,[l,s]=(0,h.useState)((()=>i.filter((e=>AE(TE(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,jo.jsx)(Ks,{title:r?"Link Account":"Link Accounts",...o,children:()=>(0,jo.jsxs)(ms,{style:{maxWidth:500},children:[(0,jo.jsxs)(gs,{style:{fontSize:15,marginBottom:15,lineHeight:"1.4em"},children:["A ",(0,jo.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,jo.jsx)(ms,{style:{maxHeight:300,overflow:"auto",paddingLeft:5,paddingRight:5,marginLeft:-5,marginRight:-5},children:(0,jo.jsx)(ms,{children:0===i.length?(0,jo.jsx)(uR,{}):i.map((e=>{let t=l.includes(e.id);return(0,jo.jsx)(cR,{account:e,offbudget:t,onSelect:()=>function(e){l.includes(e)?s(l.filter((t=>t!==e))):s([...l,e])}(e.id)},e.id)}))})}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:30},children:[(0,jo.jsx)(As,{style:{marginRight:10},onClick:o.onBack,children:"Back"}),(0,jo.jsx)(As,{primary:!0,onClick:u,children:r?"Link Account":"Next"})]})]})})}function fR(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,jo.jsx)(gs,{style:{marginTop:15,color:mo.r4},children:t})},f=!!(n||r).is_income;return(0,jo.jsx)(Ks,{title:"Confirm Delete",...t,style:{flex:0},children:()=>(0,jo.jsxs)(ms,{style:{lineHeight:1.5},children:[r?(0,jo.jsxs)(Cs,{children:["Categories in the group ",(0,jo.jsx)("strong",{children:r.name})," are used by existing transaction",!f&&" or it has a positive leftover balance currently","."," ",(0,jo.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,jo.jsxs)(Cs,{children:[(0,jo.jsx)("strong",{children:n.name})," is used by existing transactions",!f&&" or it has a positive leftover balance currently","."," ",(0,jo.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,jo.jsxs)(ms,{style:{marginTop:20,flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[(0,jo.jsx)(gs,{children:"Transfer to:"}),(0,jo.jsx)(ms,{style:{flex:1,marginLeft:10,marginRight:30},children:(0,jo.jsx)(PC,{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,jo.jsx)(As,{primary:!0,onClick:()=>{a?(i(a),t.onClose()):u("required-transfer")},children:"Delete"})]})]})})}function pR(e){let{modalProps:t,syncServerStatus:n}=e;const r=ge(),o=()=>{nw(((e,t)=>r(Nt(e,t))))},i=()=>{r(Nt("add-local-account"))};return(0,jo.jsx)(Ks,{title:"Add Account",...t,children:()=>(0,jo.jsxs)(ms,{style:{maxWidth:500},children:[(0,jo.jsxs)(gs,{style:{marginBottom:10,lineHeight:"1.4em",fontSize:15},children:[(0,jo.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,jo.jsx)(Ms,{primary:!0,disabled:"online"!==n,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:o,children:"Link bank account"}),"online"!==n&&(0,jo.jsxs)(Ws,{style:{color:mo.r5,marginTop:5},children:["Nordigen integration is only available for budgets using actual-server."," ",(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Installing/overview",target:"_blank",rel:"noopener noreferrer",children:"Learn more."})]}),(0,jo.jsx)(ms,{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,jo.jsx)(As,{style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,color:mo.n3},onClick:i,children:"Create local account"})]})})}function hR(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 Fn(e)}(e.error));n.loadGlobalPrefs(),n.loadAllFiles(),n.sync(),l(!1),n.popModal()}}return(0,jo.jsx)(Ks,{...t,style:{width:600},title:f?"Generate new key":"Enable encryption",onClose:()=>n.popModal(),children:()=>(0,jo.jsxs)(jo.Fragment,{children:[f?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(Ws,{style:{marginTop:5},children:["This will generate a new key for encrypting your data."," ",(0,jo.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,jo.jsx)(Ts,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}),(0,jo.jsx)(Ws,{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,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(Ws,{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,jo.jsx)("strong",{children:"This requires a sync reset"})," and all other devices will have to revert to this version of your data."," ",(0,jo.jsx)(Ts,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}),(0,jo.jsx)(Ws,{children:(0,jo.jsxs)("ul",{...(0,so.iv)({marginTop:0,"& li":{marginBottom:8}}),children:[(0,jo.jsxs)("li",{children:[(0,jo.jsx)("strong",{children:"Important:"})," if you forget this password"," ",(0,jo.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,jo.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,jo.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,jo.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,jo.jsxs)("form",{onSubmit:e=>{e.preventDefault(),p()},children:[(0,jo.jsxs)(ms,{style:{alignItems:"center"},children:[(0,jo.jsx)(gs,{style:{fontWeight:600,marginBottom:3},children:"Password"}),s&&(0,jo.jsx)(ms,{style:{color:mo.r4,textAlign:"center",fontSize:13,marginBottom:3},children:s}),(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{type:c?"text":"password",style:{width:300},onChange:e=>i(e.target.value)})}),(0,jo.jsx)(gs,{style:{marginTop:5},children:(0,jo.jsxs)("label",{style:{userSelect:"none"},children:[(0,jo.jsx)("input",{type:"checkbox",onClick:()=>d(!c)})," ","Show password"]})})]}),(0,jo.jsx)($s,{style:{marginTop:20},children:(0,jo.jsx)(Ms,{loading:a,primary:!0,children:"Enable"})})]})]})})}var yR=function(e){let{modalProps:t,actions:n,history:r}=e;return(0,jo.jsx)(Ks,{title:"Create Local Account",...t,showBack:!1,children:()=>(0,jo.jsx)(ms,{children:(0,jo.jsx)(oR,{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 qr($r(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,jo.jsxs)("form",{onSubmit:l,children:[(0,jo.jsx)(Vs,{label:"Name",width:"75%",children:(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{name:"name",value:n.name,onChange:i,onBlur:a,style:{flex:1}})})}),r.name&&(0,jo.jsx)(qs,{style:{marginLeft:75},children:"Name is required"}),(0,jo.jsx)(Vs,{label:"Type",width:"75%",children:(0,jo.jsxs)(Ls,{name:"type",value:n.type,onChange:e=>{u("offbudget",AE(e.target.value)),i(e)},onBlur:a,children:[(0,jo.jsx)("option",{value:"checking",children:"Checking / Cash"}),(0,jo.jsx)("option",{value:"savings",children:"Savings"}),(0,jo.jsx)("option",{value:"credit",children:"Credit Card"}),(0,jo.jsx)("option",{value:"investment",children:"Investment"}),(0,jo.jsx)("option",{value:"mortgage",children:"Mortgage"}),(0,jo.jsx)("option",{value:"debt",children:"Debt"}),(0,jo.jsx)("option",{value:"other",children:"Other"})]})}),r.type&&(0,jo.jsx)(qs,{style:{marginLeft:75},children:"You must select a type"}),(0,jo.jsx)(ms,{style:{width:"75%",flexDirection:"row",justifyContent:"flex-end"},children:(0,jo.jsxs)(ms,{style:{flexDirection:"column"},children:[(0,jo.jsxs)("label",{style:{userSelect:"none",textAlign:"right",width:"100%",display:"flex",verticalAlign:"center",justifyContent:"flex-end"},htmlFor:"offbudget",children:[(0,jo.jsx)("input",{id:"offbudget",name:"offbudget",type:"checkbox",checked:!!n.offbudget,onChange:i,onBlur:a}),"Off-budget"]}),(0,jo.jsx)("div",{style:{textAlign:"right",fontSize:"0.7em",color:mo.n5,marginTop:3},children:(0,jo.jsxs)(gs,{children:["This cannot be changed later. ",(0,jo.jsx)("br",{})," ","\n","See"," ",(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Accounts/overview/#off-budget-accounts",target:"_blank",rel:"noopener noreferrer",style:{color:mo.n5},children:"Accounts Overview"})," ","for more information."]})})]})}),(0,jo.jsx)(Vs,{label:"Balance",width:"75%",children:(0,jo.jsx)(Is,{name:"balance",value:n.balance,onChange:i,onBlur:a,style:{flex:1}})}),r.balance&&(0,jo.jsx)(qs,{style:{marginLeft:75},children:"Balance must be a number"}),(0,jo.jsxs)($s,{children:[(0,jo.jsx)(As,{onClick:()=>t.onBack(),type:"button",children:"Back"}),(0,jo.jsx)(As,{primary:!0,style:{marginLeft:10},children:"Create"})]})]})}})})})};var gR=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=Vr(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,jo.jsx)(HC,{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,jo.jsx)(EC,{value:null,accounts:l,focused:!0,embedded:!0,onSelect:e=>{e&&p(e)},...y});break;case"payee":t="Payee",n=(0,jo.jsx)(LC,{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,jo.jsx)(Is,{focused:!0,onEnter:e=>p(e.target.value),style:h});break;case"category":t="Category",n=(0,jo.jsx)(MC,{categoryGroups:s,value:null,focused:!0,embedded:!0,showSplitOption:!1,onUpdate:()=>{},onSelect:e=>{p(e)},...y});break;case"amount":t="Amount",n=(0,jo.jsx)(Is,{focused:!0,onEnter:e=>p(e.target.value),style:h})}return(0,jo.jsx)(Ks,{noAnimation:!0,showHeader:!1,focusAfterClose:!1,...i,padding:0,style:[{flex:0,padding:"15px 10px",backgroundColor:mo.n1,color:"white"},r&&{minWidth:r}],children:()=>(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(Zs,{title:t,style:{alignSelf:"center",color:mo.b10,marginBottom:10}}),(0,jo.jsx)(ms,{style:{flex:1},children:n})]})})}));var mR=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 vR(e){let t,{type:n,id:r,noneColor:o=mo.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,jo.jsx)(t,{idKey:!0,children:e=>{let t=e[r];return(0,jo.jsx)(gs,{style:null==t?{color:o}:null,title:t?t.name:"None",children:t?t.name:"None"})}})}const bR=h.memo((function(e){let{transaction:t,fields:n,payees:r,categories:o,accounts:i,selected:a}=e,l=to(o)[t.category],s=Jr(i)[t.account],u=Ix();return(0,jo.jsxs)(qw,{children:[(0,jo.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,jo.jsx)($w,{width:100,children:t.date},n);case"imported_payee":return(0,jo.jsx)($w,{width:"flex",children:t.imported_payee},n);case"payee":return(0,jo.jsx)(Vw,{width:"flex",exposed:!0,style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:()=>(0,jo.jsxs)(jo.Fragment,{children:[t.schedule&&(0,jo.jsx)(O_,{style:{width:13,height:13,margin:"0 5px"}}),(0,jo.jsx)(vR,{type:"payees",id:t.payee})]})},n);case"category":return(0,jo.jsx)($w,{width:"flex",title:l&&l.name,children:l?l.name:""},n);case"account":return(0,jo.jsx)($w,{width:"flex",title:s.name,children:s.name},n);case"notes":return(0,jo.jsx)($w,{width:"flex",title:t.notes,children:t.notes},n);case"amount":return(0,jo.jsx)($w,{width:75,style:[{textAlign:"right"},vo.tnum],children:Wr(t.amount)},n);default:return null}}))]})}));function xR(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 zf(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,jo.jsx)(bR,{transaction:t,payees:a,categories:l,accounts:s,fields:f,selected:c&&c.has(t.id)})}),[a,l,f,c]);return(0,jo.jsx)(sj,{style:i,items:p,renderEmpty:r,headers:(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.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,jo.jsx)($w,{width:100,children:"Date"},t);case"imported_payee":return(0,jo.jsx)($w,{width:"flex",children:"Imported payee"},t);case"payee":return(0,jo.jsx)($w,{width:"flex",children:"Payee"},t);case"category":return(0,jo.jsx)($w,{width:"flex",children:"Category"},t);case"account":return(0,jo.jsx)($w,{width:"flex",children:"Account"},t);case"notes":return(0,jo.jsx)($w,{width:"flex",children:"Notes"},t);case"amount":return(0,jo.jsx)($w,{width:75,style:{textAlign:"right"},children:"Amount"},t);default:return null}}))]}),renderItem:y})}function wR(e,t,n){return e.map((e=>e===t?n():e))}function jR(e,t){return e.map(((e,n)=>({...e,error:t[n]})))}function SR(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 kR(e){let{fields:t,style:n,value:r,onChange:o}=e;return(0,jo.jsx)(ms,{style:n,children:(0,jo.jsx)(Fs,{options:t,value:r,onChange:e=>o("field",e),style:{color:mo.p4}})})}function CR(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,jo.jsx)(Fs,{options:t.map((e=>[e,i(e,n)])),value:o,onChange:e=>a("op",e),style:r})}function _R(e){let{onAdd:t,onDelete:n,style:r}=e;return(0,jo.jsxs)(jo.Fragment,{children:[n&&(0,jo.jsx)(As,{bare:!0,onClick:n,style:{padding:7},"aria-label":"Delete entry",children:(0,jo.jsx)($C,{style:{width:8,height:8}})}),t&&(0,jo.jsx)(As,{bare:!0,onClick:t,style:{padding:7},"aria-label":"Add entry",children:(0,jo.jsx)(KC,{style:{width:10,height:10}})})]})}function OR(e){let{type:t}=e;return(0,jo.jsx)(gs,{style:{fontSize:12,textAlign:"center",color:mo.r5,marginBottom:5},children:nk(t)})}function ER(e){let{error:t,style:n,children:r}=e;return(0,jo.jsxs)(ms,{style:n,"data-testid":"editor-row",children:[(0,jo.jsx)(xs,{direction:"row",align:"center",spacing:1,style:{padding:"3px 5px"},children:r}),t&&(0,jo.jsx)(OR,{type:t})]})}function TR(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,jo.jsx)(fD,{defaultValue:d,onChange:e=>a("value",e)}):(0,jo.jsx)(a_,{field:u,type:f,value:d,multi:"oneOf"===c,onChange:e=>a("value",e)}),(0,jo.jsxs)(ER,{style:o,error:h,children:[(0,jo.jsx)(kR,{fields:LR,value:u,onChange:a}),(0,jo.jsx)(CR,{ops:n,value:c,type:f,onChange:a}),(0,jo.jsx)(ms,{style:{flex:1},children:t}),(0,jo.jsx)(xs,{direction:"row",children:(0,jo.jsx)(_R,{onAdd:s,onDelete:i&&"date"===u?null:l})})]})}function PR(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,jo.jsx)(ms,{style:{flex:1},children:t});let[o]=r.schedules,i=o&&r.statuses.get(o.id);return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",alignItems:"center"},children:[(0,jo.jsxs)(ms,{style:{marginRight:15,flexDirection:"row"},children:[(0,jo.jsxs)(gs,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:["Payee:"," ",(0,jo.jsx)(vR,{type:"payees",id:o._payee,noneColor:mo.n5})]}),(0,jo.jsx)(gs,{style:{margin:"0 5px"},children:" \u2014 "}),(0,jo.jsxs)(gs,{style:{flexShrink:0},children:["Amount: ",(a=o._amount,a?"number"===typeof a?Wr(a):`${Wr(a.num1)} to ${Wr(a.num2)}`:Wr(0))]}),(0,jo.jsx)(gs,{style:{margin:"0 5px"},children:" \u2014 "}),(0,jo.jsxs)(gs,{style:{flexShrink:0},children:["Next: ",fh(o.next_date,n)]})]}),(0,jo.jsx)(N_,{status:i})]});var a}let AR=["category","payee","notes","cleared","account","date","amount"].map((e=>[e,ek(e)]));function MR(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,jo.jsxs)(ER,{style:r,error:d,children:["set"===s?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(ms,{style:{padding:"5px 10px",lineHeight:"1em"},children:tk(s)}),(0,jo.jsx)(kR,{fields:AR,value:l,onChange:o}),(0,jo.jsx)(ms,{style:{flex:1},children:(0,jo.jsx)(a_,{field:l,type:c,op:s,value:u,onChange:e=>o("value",e)},f)})]}):"link-schedule"===s?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(ms,{style:{padding:"5px 10px",color:mo.p4},children:tk(s)}),(0,jo.jsx)(PR,{id:u||null})]}):null,(0,jo.jsx)(xs,{direction:"row",children:(0,jo.jsx)(_R,{onAdd:a,onDelete:"link-schedule"!==s&&i})})]})}function DR(){let[e,t]=(0,h.useState)();return(0,jo.jsxs)(ms,{style:{position:"relative",marginLeft:5},children:[(0,jo.jsx)(ms,{onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:(0,jo.jsx)(mR,{style:{width:11,height:11,color:mo.n4}})}),e&&(0,jo.jsx)(Ss,{position:"bottom-left",style:{padding:10,color:mo.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 IR(e){let{selected:t,children:n,style:r,onSelect:o}=e;return(0,jo.jsx)(As,{bare:!0,style:[{fontSize:"inherit"},t&&{backgroundColor:mo.b9,":hover":{backgroundColor:mo.b9}},r],onClick:o,children:n})}function RR(e){return{...e,inputKey:""+Math.random()}}function NR(e){let{conditionsOp:t,conditions:n,editorStyle:r,isSchedule:o,onChangeConditions:i}=e;function a(e){let r=LR.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,jo.jsx)(As,{style:{alignSelf:"flex-start"},onClick:function(){a(-1)},children:"Add condition"}):(0,jo.jsx)(xs,{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,jo.jsx)(ms,{children:(0,jo.jsx)(TR,{editorStyle:r,ops:l,condition:e,isSchedule:o,onChange:(t,r)=>{!function(e,t,r){i(wR(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],RR(ik(null,t))):(t.op=e.op,RR(ik(e.value,t)))}if("op"===t){let t=r;return"oneOf"!==e.op&&"oneOf"===t?RR(ik(null!=e.value?[e.value]:[],{...e,op:r})):"oneOf"===e.op&&"oneOf"!==t?RR(ik(e.value.length>0?e.value[0]:null,{...e,op:r})):"isbetween"!==e.op&&"isbetween"===t?ik({num1:Vr(e.value),num2:Vr(e.value)},{...e,op:r}):"isbetween"===e.op&&"isbetween"!==t?ik(qr(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 LR=["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 FR(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 yr(hr("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=AR.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:mo.n10,borderRadius:4};return(0,jo.jsx)(Ks,{title:"Rule",padding:0,...n,style:[n.style,{flex:"inherit",maxWidth:"90%"}],children:()=>(0,jo.jsxs)(ms,{style:{maxWidth:"100%",width:900,height:"80vh",flexGrow:0,flexShrink:0,flexBasis:"auto",overflow:"hidden"},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",marginBottom:15,padding:"0 20px"},children:[(0,jo.jsx)(gs,{style:{color:mo.n4,marginRight:15},children:"Stage of rule:"}),(0,jo.jsxs)(xs,{direction:"row",align:"center",spacing:1,children:[(0,jo.jsx)(IR,{selected:"pre"===u,onSelect:()=>j("pre"),children:"Pre"}),(0,jo.jsx)(IR,{selected:null===u,onSelect:()=>j(null),children:"Default"}),(0,jo.jsx)(IR,{selected:"post"===u,onSelect:()=>j("post"),children:"Post"}),(0,jo.jsx)(DR,{})]})]}),(0,jo.jsx)(ms,{innerRef:m,style:{borderBottom:"1px solid "+mo.border,padding:20,overflow:"auto",maxHeight:"calc(100% - 300px)"},children:(0,jo.jsxs)(ms,{style:{flexShrink:0},children:[(0,jo.jsxs)(ms,{style:{marginBottom:30},children:[(0,jo.jsxs)(gs,{style:{color:mo.n4,marginBottom:15},children:["If",(0,jo.jsx)(kR,{"data-testid":"conditions-op",style:{display:"inline-flex"},fields:[["and","all"],["or","any"]],value:d,onChange:S}),"of these conditions match:"]}),(0,jo.jsx)(NR,{conditionsOp:d,conditions:i,editorStyle:C,isSchedule:v,onChangeConditions:e=>a(e)})]}),(0,jo.jsx)(gs,{style:{color:mo.n4,marginBottom:15},children:"Then apply these actions:"}),(0,jo.jsx)(ms,{style:{flex:1},children:0===l.length?(0,jo.jsx)(As,{style:{alignSelf:"flex-start"},onClick:x,children:"Add action"}):(0,jo.jsx)(xs,{spacing:2,"data-testid":"action-list",children:l.map(((e,t)=>(0,jo.jsx)(ms,{children:(0,jo.jsx)(MR,{ops:["set","link-schedule"],action:e,editorStyle:C,onChange:(t,n)=>{!function(e,t,n){s(wR(l,e,(()=>{let r={...e};return r[t]=n,"field"===t?(r.type=JS.get(r.field),r.value=null,RR(r)):"op"===t?(r.value=null,r.inputKey=""+Math.random(),RR(r)):r})))}(e,t,n)},onDelete:()=>function(e){s(l.filter((t=>t!==e)))}(e),onAdd:()=>w(t)})},t)))})})]})}),(0,jo.jsx)(Nx,{instance:b,children:(0,jo.jsxs)(ms,{style:{padding:"20px",flex:1},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",marginBottom:12},children:[(0,jo.jsx)(gs,{style:{color:mo.n4,marginBottom:0},children:"This rule applies to these transactions:"}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsxs)(As,{disabled:0===b.items.size,onClick:k,children:["Apply actions (",b.items.size,")"]})]}),(0,jo.jsx)(xR,{transactions:p,fields:SR(i,l),style:{border:"1px solid "+mo.border}}),(0,jo.jsxs)(xs,{direction:"row",justify:"flex-end",style:{marginTop:20},children:[(0,jo.jsx)(As,{onClick:()=>n.onClose(),children:"Cancel"}),(0,jo.jsx)(As,{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(jR(i,c.conditionErrors)),c.actionErrors&&s(jR(l,c.actionErrors))):(f&&(e.id=f),o&&o(e),n.onClose())}(),children:"Save"})]})]})})]})})}function BR(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,jo.jsx)(Ks,{...t,showHeader:!1,style:{width:600},children:()=>(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(gs,{style:{fontSize:25,fontWeight:700,color:mo.n2,margin:"20px 0"},children:o?"Unable to decrypt file":"This file is encrypted"}),o?(0,jo.jsxs)(Ws,{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,jo.jsx)(Ts,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}):(0,jo.jsxs)(Ws,{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,jo.jsx)(Ts,{asAnchor:!0,href:"https://actualbudget.github.io/docs/Getting-Started/sync#end-to-end-encryption",children:"Learn more"})]}),(0,jo.jsxs)("form",{onSubmit:e=>{e.preventDefault(),g()},children:[(0,jo.jsxs)(ms,{style:{marginTop:15,flexDirection:"column",alignItems:"center"},children:[(0,jo.jsx)(gs,{style:{fontWeight:600,marginBottom:5},children:"Password"})," ",u&&(0,jo.jsx)(ms,{style:{color:mo.r4,textAlign:"center",fontSize:13,marginBottom:3},children:u}),(0,jo.jsx)(Gs,{children:(0,jo.jsx)(Is,{type:p?"text":"password",style:{width:"50%"},onChange:e=>s(e.target.value)})}),(0,jo.jsx)(gs,{style:{marginTop:5},children:(0,jo.jsxs)("label",{style:{userSelect:"none"},children:[(0,jo.jsx)("input",{type:"checkbox",onClick:()=>y(!p)})," ","Show password"]})})]}),(0,jo.jsxs)($s,{style:{marginTop:20},children:[(0,jo.jsx)(As,{style:{marginRight:10},onClick:()=>t.onBack(),type:"button",children:"Back"}),(0,jo.jsx)(Ms,{loading:d,primary:!0,onClick:g,children:o?"Update key":"Create key"})]})]})]})})}let UR=[{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 zR(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 zf(lk(c))?c:null}function WR(e,t){if(!e)return null;try{return fh(e,t)}catch(Wa){}return null}function HR(e){let t=e.match(/\.([^.]*)$/);return t?t[1].toLowerCase():"ofx"}function KR(e){let{parseDateFormat:t,showParsed:n,dateFormat:r,date:o}=e,i=o&&WR(t?zR(o,t):o,r);return(0,jo.jsxs)(gs,{children:[(0,jo.jsxs)(gs,{children:[o||(0,jo.jsx)(gs,{style:{color:mo.n4,fontStyle:"italic"},children:"Empty"})," ","\u2192"," "]}),(0,jo.jsx)(gs,{style:{color:i?mo.g3:mo.r4},children:i||"Invalid"})]})}function $R(e,t){if(0===e.length||null==t.date)return"yyyy mm dd";let n=e[0][t.date],r=null==n?null:UR.find((e=>null!=zR(n,e.format)));return r?r.format:"mm dd yyyy"}function VR(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 qR(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 GR(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 YR(e,t,n,r){const o=parseFloat(r)||1;if(t){let t=GR(e.outflow,(e=>-Math.abs(e)))*o,n=t?0:GR(e.inflow,(e=>Math.abs(e)))*o;return{amount:t||n,outflow:t,inflow:n}}return{amount:GR(e.amount,(e=>n?-1*e:e))*o,outflow:null,inflow:null}}function QR(e){let{transaction:t,fieldMappings:n,showParsed:r,parseDateFormat:o,dateFormat:i,splitMode:a,flipAmount:l,multiplierAmount:s}=e,u=(0,h.useMemo)((()=>n?qR(t,n):t),[t,n]),{amount:c,outflow:d,inflow:f}=YR(u,a,l,s);return c=Hr(c),d=Hr(d),f=Hr(f),(0,jo.jsxs)(qw,{style:{backgroundColor:"white"},children:[(0,jo.jsx)($w,{width:200,borderColor:mo.border,children:r?(0,jo.jsx)(KR,{parseDateFormat:o,dateFormat:i,date:u.date}):WR(u.date,i)}),(0,jo.jsx)($w,{width:"flex",borderColor:mo.border,title:u.imported_payee||u.payee_name,children:u.payee_name}),(0,jo.jsx)($w,{width:"flex",borderColor:mo.border,title:u.notes,children:u.notes}),a?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)($w,{width:90,borderColor:mo.border,contentStyle:[{textAlign:"right"},vo.tnum],title:d,children:d}),(0,jo.jsx)($w,{width:90,borderColor:mo.border,contentStyle:[{textAlign:"right"},vo.tnum],title:f,children:f})]}):(0,jo.jsx)($w,{width:90,borderColor:mo.border,contentStyle:[{textAlign:"right"},vo.tnum],title:c,children:c})]})}function XR(e){let{title:t}=e;return(0,jo.jsx)(gs,{style:{fontSize:13,marginBottom:3,color:mo.n3},children:t})}function ZR(e){let{width:t,style:n,options:r,value:o,onChange:i}=e;return(0,jo.jsxs)(Ls,{value:o,style:n,onChange:e=>i(e.target.value),children:[(0,jo.jsx)("option",{value:"",children:"Choose field..."}),r.map((e=>(0,jo.jsx)("option",{value:e,children:e},e)))]})}function JR(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,jo.jsxs)(ms,{style:{width:120},children:[(0,jo.jsx)(Zs,{title:"Date format"}),(0,jo.jsx)(Ls,{value:r||"",onChange:e=>o(e.target.value),children:UR.map((e=>(0,jo.jsx)("option",{value:e.format,children:e.label.replace(/ /g,i)},e.format)))})]})}function eN(e){let{value:t,onChange:n}=e;return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,jo.jsx)(tu,{id:"add_multiplier",checked:t,onChange:n}),(0,jo.jsx)("label",{htmlFor:"add_multiplier",children:"Add Multiplier"})]})}function tN(e){let{value:t,disabled:n,onChange:r}=e;return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,jo.jsx)(tu,{id:"form_flip",checked:t,disabled:n,onChange:r}),(0,jo.jsx)("label",{htmlFor:"form_flip",style:{userSelect:"none",color:n?mo.n6:null},children:"Flip amount"})]})}function nN(e){let{value:t,onChange:n}=e;return(0,jo.jsxs)(ms,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,jo.jsx)(tu,{id:"form_split",checked:t,onChange:n}),(0,jo.jsx)("label",{htmlFor:"form_split",style:{userSelect:"none"},children:"Split amount into separate inflow/outflow columns"})]})}function rN(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,jo.jsxs)(ms,{children:[(0,jo.jsx)(Zs,{title:"CSV FIELDS"}),(0,jo.jsxs)(xs,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[(0,jo.jsxs)(ms,{style:{width:200},children:[(0,jo.jsx)(XR,{title:"Date"}),(0,jo.jsx)(ZR,{width:200,options:i,value:n.date||"",style:{marginRight:5},onChange:e=>r("date",e)})]}),(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(XR,{title:"Payee"}),(0,jo.jsx)(ZR,{width:"flex",options:i,value:n.payee||"",style:{marginRight:5},onChange:e=>r("payee",e)})]}),(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(XR,{title:"Notes"}),(0,jo.jsx)(ZR,{width:"flex",options:i,value:n.notes||"",style:{marginRight:5},onChange:e=>r("notes",e)})]}),o?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(ms,{style:{width:90},children:[(0,jo.jsx)(XR,{title:"Outflow"}),(0,jo.jsx)(ZR,{width:90,options:i,value:n.outflow||"",onChange:e=>r("outflow",e)})]}),(0,jo.jsxs)(ms,{style:{width:90},children:[(0,jo.jsx)(XR,{title:"Inflow"}),(0,jo.jsx)(ZR,{width:90,options:i,value:n.inflow||"",onChange:e=>r("inflow",e)})]})]}):(0,jo.jsxs)(ms,{style:{width:90},children:[(0,jo.jsx)(XR,{title:"Amount"}),(0,jo.jsx)(ZR,{width:90,options:i,value:n.amount||"",onChange:e=>r("amount",e)})]})]})]})}function oN(e){let{multiplierCB:t,value:n,onChange:r}=e;const o=t?"inherit":"none";return(0,jo.jsx)(Is,{type:"text",style:{display:o},value:n,placeholder:"Optional",onUpdate:r})}var iN=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}=e,[u,c]=(0,h.useState)(""),[d,f]=(0,h.useState)("parsing"),[p,y]=(0,h.useState)(null),[g,m]=(0,h.useState)(n.filename),[v,b]=(0,h.useState)([]),[x,w]=(0,h.useState)(null),[j,S]=(0,h.useState)(null),[k,C]=(0,h.useState)(!1),[_,O]=(0,h.useState)(!1),[E,T]=(0,h.useState)(!1),{accountId:P,onImported:A}=n,[M,D]=(0,h.useState)(o[`csv-delimiter-${P}`]||","),[I,R]=(0,h.useState)(null);async function N(e,t){f("parsing");let n=HR(e);m(e),w(n);let{errors:r,transactions:a}=await i(e,t);if(f(null),y(null),r.length>0)y({parsed:!0,message:r[0].message||"Internal error"});else{if("csv"!==n&&"qif"!==n||O(o[`flip-amount-${P}-${n}`]||!1),"csv"===n){let e=o[`csv-mappings-${P}`];e=e?JSON.parse(e):VR(a),S(e);let t=!(!e.outflow&&!e.inflow);C(t),R(o[`parse-date-${P}-${n}`]||$R(a,e))}else"qif"===n?R(o[`parse-date-${P}-${n}`]||$R(a,{date:"date"})):(S(null),R(null));b(a.reverse())}}(0,h.useEffect)((()=>{N(n.filename,"csv"===HR(n.filename)?{delimiter:M}:null)}),[i,n.filename]);let L=[{name:"Date",width:200},{name:"Payee",width:"flex"},{name:"Notes",width:"flex"}];return k?(L.push({name:"Outflow",width:90,style:{textAlign:"right"}}),L.push({name:"Inflow",width:90,style:{textAlign:"right"}})):L.push({name:"Amount",width:90,style:{textAlign:"right"}}),(0,jo.jsxs)(Ks,{title:"Import transactions"+(x?` (${x.toUpperCase()})`:""),...t,loading:"parsing"===d,style:{width:800},children:[p&&!p.parsed&&(0,jo.jsx)(ms,{style:{alignItems:"center",marginBottom:15},children:(0,jo.jsxs)(gs,{style:{marginRight:10,color:mo.r4},children:[(0,jo.jsx)("strong",{children:"Error:"})," ",p.message]})}),(!p||!p.parsed)&&(0,jo.jsxs)(ms,{style:{flex:"unset",height:300,border:"1px solid "+mo.border},children:[(0,jo.jsx)(oj,{headers:L}),(0,jo.jsx)(lj,{items:v,fields:["payee","amount"],style:{backgroundColor:mo.n11},getItemKey:e=>e,renderEmpty:()=>(0,jo.jsx)(ms,{style:{textAlign:"center",marginTop:25,color:mo.n4,fontStyle:"italic"},children:"No transactions found"}),renderItem:e=>{let{key:t,style:n,item:o,editing:i,focusedField:a}=e;return(0,jo.jsx)(ms,{style:n,children:(0,jo.jsx)(QR,{transaction:o,showParsed:"csv"===x||"qif"===x,parseDateFormat:I,dateFormat:r,fieldMappings:j,splitMode:k,flipAmount:_,multiplierAmount:u})},t)}})]}),p&&p.parsed&&(0,jo.jsxs)(ms,{style:{color:mo.r4,alignItems:"center",marginTop:10},children:[(0,jo.jsxs)(gs,{style:{maxWidth:450,marginBottom:15},children:[(0,jo.jsx)("strong",{children:"Error:"})," ",p.message]}),p.parsed&&(0,jo.jsx)(As,{onClick:()=>function(){const e=window.Actual.openFileDialog({filters:[{name:"Financial Files",extensions:["qif","ofx","qfx","csv"]}]});N(e[0],"csv"===HR(e[0])?{delimiter:M}:null)}(),children:"Select new file..."})]}),"csv"===x&&(0,jo.jsx)(ms,{style:{marginTop:25},children:(0,jo.jsx)(rN,{transactions:v,onChange:function(e,t){S({...j,[e]:""===t?null:t})},mappings:j,splitMode:k})}),("qif"===x||"csv"===x)&&(0,jo.jsx)(ms,{style:{marginTop:25},children:(0,jo.jsxs)(xs,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[(0,jo.jsx)(ms,{children:("qif"===x||"csv"===x)&&(0,jo.jsx)(JR,{transactions:v,fieldMappings:j,parseDateFormat:I,onChange:R})}),(0,jo.jsx)(ms,{children:"csv"===x&&(0,jo.jsxs)(ms,{style:{marginLeft:25},children:[(0,jo.jsx)(Zs,{title:"CSV DELIMITER"}),(0,jo.jsxs)(Ls,{value:M,onChange:e=>{D(e.target.value),N(g,{delimiter:e.target.value})},children:[(0,jo.jsx)("option",{value:",",children:","}),(0,jo.jsx)("option",{value:";",children:";"})]})]})}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsxs)(ms,{style:{marginRight:25},children:[(0,jo.jsx)(Zs,{title:"IMPORT OPTIONS"}),(0,jo.jsx)(ms,{style:{marginTop:5},children:(0,jo.jsx)(tN,{value:_,disabled:k,onChange:()=>{O(!_)}})}),"csv"===x&&(0,jo.jsx)(ms,{style:{marginTop:10},children:(0,jo.jsx)(nN,{value:k,onChange:function(){if(null==j)return;!0===_&&O(!_);let e=!k;C(e);let t=VR(v),n=e?{amount:null,outflow:t.amount,inflow:null}:{amount:t.amount,outflow:null,inflow:null};S({...j,...n})}})}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",marginTop:10},children:[(0,jo.jsx)(ms,{style:{marginRight:30},children:(0,jo.jsx)(eN,{value:E,onChange:()=>{T(!E),c("")}})}),(0,jo.jsx)(ms,{style:{width:75},children:(0,jo.jsx)(oN,{multiplierCB:E,value:u,onChange:function(e){const t=e;t&&!t.match(/^\d{1,}(\.\d{0,4})?$/)||c(t)}})})]})]})]})}),(0,jo.jsx)(ms,{style:{flexDirection:"row",marginTop:5},children:(0,jo.jsx)(ms,{style:{alignSelf:"flex-end",flexDirection:"row",alignItems:"center"},children:(0,jo.jsxs)(Ms,{primary:!0,disabled:0===v.length,loading:"importing"===d,onClick:async function(){f("importing");let e,n=[];for(let t of v){t=j?qR(t,j):t;let r="qfx"===x||"ofx"===x?t.date:zR(t.date,I);if(null==r){e=`Unable to parse date ${t.date||"(empty)"} with given date format`;break}let{amount:o}=YR(t,k,_,u);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:Vr(o)})}if(e)return f(null),void y({parsed:!1,message:e});if("ofx"!==x&&"qfx"!==x){s({[`parse-date-${P}-${x}`]:I})}"csv"===x&&(s({[`csv-mappings-${P}`]:JSON.stringify(j)}),s({[`csv-delimiter-${P}`]:M})),"csv"!==x&&"qif"!==x||s({[`flip-amount-${P}-${x}`]:_});let r=await a(P,n);r&&await l(),A&&A(r),t.onClose()},children:["Import ",v.length," transactions"]})})})]})}));class aN 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,jo.jsx)(ms,{style:{flex:1,maxHeight:200,overflow:"auto"},onMouseLeave:()=>this.onHover(null),children:e.map(((e,r)=>(0,jo.jsx)(qw,{collapsed:0!==r,focused:n===e.id,onMouseEnter:()=>this.onHover(e.id),onClick:()=>t(e.id),style:{cursor:"pointer"},children:(0,jo.jsx)(Vw,{width:"flex",value:e.date?e.date:"Revert to Latest",valueStyle:{paddingLeft:20}})},e.id)))})}}var lN=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,jo.jsx)(Ks,{title:"Load Backup",padding:0,...i,style:{flex:0},children:()=>(0,jo.jsxs)(ms,{style:{marginBottom:30},children:[(0,jo.jsx)(ms,{style:{margin:20,marginTop:0,marginBottom:15,lineHeight:1.5},children:a?(0,jo.jsxs)(Cs,{children:[(0,jo.jsxs)(Cs,{style:{marginBottom:10},children:[(0,jo.jsx)(gs,{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,jo.jsx)(As,{primary:!0,onClick:()=>o.loadBackup(t,a.id),children:"Revert to original version"})]}):(0,jo.jsxs)(ms,{style:{alignItems:"flex-start"},children:[(0,jo.jsxs)(Cs,{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,jo.jsx)(gs,{style:{fontWeight:600},children:"If you use a backup, you will have to setup all your devices to sync from the new budget."})]}),(0,jo.jsx)(As,{primary:!0,disabled:r,onClick:()=>o.makeBackup(),children:"Backup Now"})]})}),0===l.length?(0,jo.jsx)(Cs,{style:{color:mo.n6,marginLeft:20},children:"No backups available"}):(0,jo.jsx)(aN,{backups:l,onSelect:e=>o.loadBackup(t,e)})]})})};function sN(){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.4.2",REACT_APP_BACKEND_WORKER_HASH:"f69af9ddb3faa7a57f53",REACT_APP_RELEASE_TYPE:""}.REACT_APP_NETLIFY)||!1}function uN(e){let{modalProps:t,payeeId:n}=e,[r,o]=(0,h.useState)(!0),i=Yd();if(sN()&&"/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,jo.jsx)(Ks,{title:"Rules",padding:0,loading:r,...t,style:[t.style,{flex:1,maxWidth:"90%",maxHeight:"90%"}],children:()=>(0,jo.jsx)(Pk,{isModal:!0,payeeId:n,setLoading:o})})}function cN(e){let{icon:t,color:n,backgroundColor:r,style:o,children:i}=e;return(0,jo.jsxs)(ms,{style:[{color:n,fontSize:13,...vo.shadow,borderRadius:4,backgroundColor:r,padding:10,flexDirection:"row","& a, & a:active, & a:visited":{color:mo.b3}},o],children:[(0,jo.jsx)(ms,{style:{paddingLeft:2,paddingTop:".11em",alignSelf:"stretch",flexShrink:0,marginRight:5},children:(0,jo.jsx)(t,{width:13,style:{color:n,marginTop:2}})}),(0,jo.jsx)(gs,{style:{zIndex:1,lineHeight:1.5},children:i})]})}function dN(e){let{style:t,children:n}=e;return(0,jo.jsx)(cN,{icon:mR,color:mo.n4,backgroundColor:"transparent",style:[t,{boxShadow:"none",padding:5}],children:n})}function fN(e){let{style:t,children:n}=e;return(0,jo.jsx)(cN,{icon:bP,color:mo.y2,backgroundColor:mo.y10,style:t,children:n})}function pN(e){let{style:t,children:n}=e;return(0,jo.jsx)(cN,{icon:bP,color:mo.r2,backgroundColor:mo.r10,style:t,children:n})}let hN={color:mo.p5};function yN(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,jo.jsx)(Ks,{title:"Merge payee?",padding:0,showHeader:!1,...n,style:n.style,children:()=>(0,jo.jsx)(ms,{style:{padding:20,maxWidth:500},children:(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(Ws,{style:{marginBottom:10,fontWeight:500},children:1===f.length?(0,jo.jsxs)(jo.Fragment,{children:["The payee ",(0,jo.jsx)(gs,{style:hN,children:f[0].name})," ","is not used by transactions any more. Would like to merge it with ",(0,jo.jsx)(gs,{style:hN,children:p.name}),"?"]}):(0,jo.jsxs)(jo.Fragment,{children:["The following payees are not used by transactions any more. Would like to merge them with"," ",(0,jo.jsx)(gs,{style:hN,children:p.name}),"?",(0,jo.jsx)("ul",{ref:d,style:{margin:0,marginTop:10,maxHeight:140,overflow:"auto"},children:f.map((e=>(0,jo.jsx)("li",{children:(0,jo.jsx)(gs,{style:hN,children:e.name})},e.id)))})]})}),(0,jo.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,jo.jsxs)("label",{style:{fontSize:13,marginTop:10,color:mo.n4,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,jo.jsx)("input",{type:"checkbox",checked:u,onChange:e=>c(e.target.checked)}),(0,jo.jsxs)(gs,{style:{marginLeft:3},children:["Automatically rename"," ",1===f.length?"this payee":"these payees"," in the future"]})]}),(0,jo.jsxs)($s,{style:{marginTop:20},focusButton:!0,children:[(0,jo.jsx)(As,{primary:!0,style:{marginRight:10},onClick:y,type:"button",children:"Merge"}),!l&&(0,jo.jsx)(As,{style:{marginRight:10},onClick:g,type:"button",children:"Merge and edit rule"}),(0,jo.jsx)(As,{style:{marginRight:10},onClick:()=>n.onBack(),type:"button",children:"Do nothing"})]})]})})})}const gN=[{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 mN(e){return(0,jo.jsx)(pN,{style:{alignSelf:"center"},children:"timeout"===e?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function vN(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}=function(e){const[t,n]=(0,h.useState)([]),[r,o]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{!async function(){if(!e)return n([]),void o(!1);o(!0);const t=await qe("nordigen-get-banks",e);n(t),o(!1)}()}),[n,o,e]),{data:t,isLoading:r}}(d),{configured:b,isLoading:x}=function(){const[e,t]=(0,h.useState)(!1),[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}}();async function w(){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 j(){a("accounts"),await r(g.current),a(null)}return(0,jo.jsx)(Ks,{title:"Link Your Bank",...t,onClose:function(){o&&o(),t.onClose()},style:{flex:0},children:()=>(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(Ws,{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&&mN(p),i||x?(0,jo.jsxs)(ms,{style:{alignItems:"center",marginTop:15},children:[(0,jo.jsx)(Co,{color:mo.n1,style:{width:20,height:20}}),(0,jo.jsx)(ms,{style:{marginTop:10,color:mo.n4},children:x?"Checking Nordigen configuration..":"browser"===i?"Waiting on Nordigen...":"accounts"===i?"Loading accounts...":null})]}):l?(0,jo.jsx)(As,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,backgroundColor:mo.g4,borderColor:mo.g4},onClick:j,children:"Success! Click to continue \u2192"}):b?(0,jo.jsxs)(ms,{style:{gap:10},children:[(0,jo.jsxs)(eu,{children:[(0,jo.jsx)(Js,{title:"Choose your country:",htmlFor:"country-field"}),(0,jo.jsx)(_C,{strict:!0,highlightFirst:!0,disabled:x,suggestions:gN,onSelect:f,value:d,inputProps:{id:"country-field",placeholder:"(please select)"}})]}),d&&(v?"Loading banks...":(0,jo.jsxs)(eu,{children:[(0,jo.jsx)(Js,{title:"Choose your bank:",htmlFor:"bank-field"}),(0,jo.jsx)(_C,{focused:!0,strict:!0,highlightFirst:!0,suggestions:m,onSelect:c,value:u,inputProps:{id:"bank-field",placeholder:"(please select)"}})]})),(0,jo.jsxs)(fN,{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,jo.jsx)("a",{href:"https://nordigen.com/en/company/privacy-policy/",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})," ","and"," ",(0,jo.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,jo.jsx)(As,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600},onClick:w,disabled:!u||!d,children:"Link bank in browser \u2192"})]}):(0,jo.jsxs)(Ws,{style:{color:mo.r5},children:["Nordigen integration has not been configured so linking accounts is not available."," ",(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Accounts/connecting-your-bank/",target:"_blank",rel:"noopener noreferrer",children:"Learn more."})]})]})})}function bN(e){return(0,jo.jsx)(pN,{style:{alignSelf:"center"},children:"timeout"===e?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function xN(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,jo.jsx)(Ks,{title:"Link Your Bank",...t,onClose:function(){o&&o(),t.onClose()},style:{flex:0},children:()=>(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(Ws,{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&&bN(u),i?(0,jo.jsxs)(ms,{style:{alignItems:"center",marginTop:15},children:[(0,jo.jsx)(Co,{color:mo.n1,style:{width:20,height:20}}),(0,jo.jsx)(ms,{style:{marginTop:10,color:mo.n4},children:"browser"===i?"Waiting on browser...":"accounts"===i?"Loading accounts...":null})]}):l?(0,jo.jsx)(As,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10,backgroundColor:mo.g4,borderColor:mo.g4},onClick:p,children:"Success! Click to continue \u2192"}):(0,jo.jsx)(As,{primary:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:f,children:"Link bank in browser \u2192"}),(0,jo.jsx)("div",{style:{marginTop:i?30:35},children:(0,jo.jsx)(gs,{style:{color:mo.n5,fontWeight:600},children:"Why not link it in the app?"})}),(0,jo.jsx)(gs,{style:{marginTop:10,color:mo.n5,fontSize:13,"& a, & a:visited":{color:mo.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,jo.jsx)($s,{style:{marginTop:10},children:(0,jo.jsx)(As,{onClick:()=>t.onBack(),children:"Back"})})]})})}const wN={id:"new",name:"Create new account"};function jN(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!==wN.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,jo.jsx)(Ks,{title:"Link Accounts",...t,style:{width:800},children:()=>(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gs,{style:{marginBottom:10},children:"We found the following accounts. Select which ones you want to add:"}),(0,jo.jsxs)(ms,{style:{flex:"unset",height:300,border:"1px solid "+mo.border},children:[(0,jo.jsx)(oj,{headers:[{name:"Bank Account To Sync",width:200},{name:"Account in Actual",width:"flex"},{name:"Actions",width:"flex"}]}),(0,jo.jsx)(sj,{items:r,style:{backgroundColor:mo.n11},getItemKey:e=>e,renderItem:e=>{let{key:t,item:n}=e;return(0,jo.jsx)(ms,{children:(0,jo.jsx)(SN,{externalAccount:n,chosenAccount:a[n.account_id]===wN.id?wN:o.find((e=>a[n.account_id]===e.id)),unlinkedAccounts:u,onSetLinkedAccount:c})},t)}})]}),(0,jo.jsx)(ms,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:10},children:(0,jo.jsx)(As,{primary:!0,onClick:s,disabled:!Object.keys(a).length,children:"Link accounts"})})]})})}function SN(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)!==wN.id&&n,wN].filter(Boolean);return(0,jo.jsxs)(qw,{style:{backgroundColor:"white"},children:[(0,jo.jsx)($w,{width:200,children:t.name}),(0,jo.jsx)($w,{width:"flex",truncate:"account"!==i,onClick:()=>a("account"),children:"account"===i?(0,jo.jsx)(_C,{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,jo.jsx)($w,{width:"flex",children:n?(0,jo.jsx)(As,{onClick:()=>{o(t,null)},style:{float:"right"},children:"Remove bank-sync"}):(0,jo.jsx)(As,{primary:!0,onClick:()=>{a("account")},style:{float:"right"},children:"Setup bank-sync"})})]})}var kN=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=Vo("/"+f);return(0,jo.jsxs)(Ni,{location:y,children:[(0,jo.jsx)(Pi,{path:"/import-transactions",children:(0,jo.jsx)(iN,{modalProps:h,options:p})}),(0,jo.jsx)(Pi,{path:"/add-account",children:(0,jo.jsx)(pR,{modalProps:h,actions:u,syncServerStatus:d})}),(0,jo.jsx)(Pi,{path:"/add-local-account",children:(0,jo.jsx)(yR,{modalProps:h,actions:u,history:t})}),(0,jo.jsx)(Pi,{path:"/close-account",children:(0,jo.jsx)(sR,{modalProps:h,account:p.account,balance:p.balance,canDelete:p.canDelete,accounts:o.filter((e=>0===e.closed)),categoryGroups:i,actions:u})}),(0,jo.jsx)(Pi,{path:"/select-linked-accounts",children:(0,jo.jsx)(jN,{modalProps:h,externalAccounts:p.accounts,requisitionId:p.requisitionId,localAccounts:o.filter((e=>0===e.closed)),upgradingAccountId:p.upgradingAccountId,actions:u})}),(0,jo.jsx)(Pi,{path:"/configure-linked-accounts",children:(0,jo.jsx)(dR,{modalProps:h,institution:p.institution,publicToken:p.publicToken,accounts:p.accounts,upgradingId:p.upgradingId,actions:u})}),(0,jo.jsx)(Pi,{path:"/confirm-category-delete",render:()=>{const{category:e,group:t,onDelete:n}=p;return(0,jo.jsx)(fR,{modalProps:h,actions:u,category:a.find((t=>t.id===e)),group:i.find((e=>e.id===t)),categoryGroups:i,onDelete:n})}}),(0,jo.jsx)(Pi,{path:"/load-backup",render:()=>(0,jo.jsx)(KM,{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,jo.jsx)(lN,{budgetId:s,modalProps:h,actions:u,backups:t.backups})}})}),(0,jo.jsx)(Pi,{path:"/manage-rules",render:()=>(0,jo.jsx)(uN,{history:t,modalProps:h,payeeId:p.payeeId})}),(0,jo.jsx)(Pi,{path:"/edit-rule",render:()=>(0,jo.jsx)(FR,{history:t,modalProps:h,defaultRule:p.rule,onSave:p.onSave})}),(0,jo.jsx)(Pi,{path:"/merge-unused-payees",render:()=>(0,jo.jsx)(yN,{history:t,modalProps:h,payeeIds:p.payeeIds,targetPayeeId:p.targetPayeeId})}),(0,jo.jsx)(Pi,{path:"/plaid-external-msg",render:()=>(0,jo.jsx)(xN,{modalProps:h,actions:u,onMoveExternal:p.onMoveExternal,onClose:()=>{p.onClose&&p.onClose(),qe("poll-web-token-stop")},onSuccess:p.onSuccess})}),(0,jo.jsx)(Pi,{path:"/nordigen-external-msg",render:()=>(0,jo.jsx)(vN,{modalProps:h,actions:u,onMoveExternal:p.onMoveExternal,onClose:()=>{p.onClose&&p.onClose(),qe("nordigen-poll-web-token-stop")},onSuccess:p.onSuccess})}),(0,jo.jsx)(Pi,{path:"/create-encryption-key",render:()=>(0,jo.jsx)(hR,{modalProps:h,actions:u,options:p},f)}),(0,jo.jsx)(Pi,{path:"/fix-encryption-key",render:()=>(0,jo.jsx)(BR,{modalProps:h,actions:u,options:p},f)}),(0,jo.jsx)(Pi,{path:"/edit-field",render:()=>(0,jo.jsx)(gR,{modalProps:h,actions:u,name:p.name,onSubmit:p.onSubmit},f)}),(0,jo.jsx)(Pi,{path:"/budget-summary",children:(0,jo.jsx)(TD,{modalProps:h,month:p.month,actions:u,isGoalTemplatesEnabled:c},f)})]},f)}))}));function CN(){return window.close(),(0,jo.jsx)(Ks,{isCurrent:!0,showClose:!1,title:"Account sync",children:()=>(0,jo.jsxs)(ms,{style:{maxWidth:500},children:[(0,jo.jsx)(Ws,{children:"Please wait..."}),(0,jo.jsx)(Ws,{children:"The window should close automatically. If nothing happend you can close this window or tab."})]})})}function _N(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,jo.jsx)(xs,{spacing:2,children:e.split(/\n\n/).map(((e,o)=>{let i=e.split(/(\[[^\]]*\]\([^)]*\))/g);return(0,jo.jsx)(gs,{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,jo.jsx)("a",{href:"#",onClick:async o=>{o.preventDefault(),t[e]&&(n(!0),await t[e](),r())},children:a})}return(0,jo.jsx)(Ts,{asAnchor:!0,href:i[2],children:i[1]},o)}return(0,jo.jsx)(gs,{children:e},o)}))},o)}))})}(i,l,y,n)),[i,l]);return(0,jo.jsxs)(ms,{style:{marginTop:10,color:g?mo.g3:m?mo.r3:mo.y2},children:[(0,jo.jsxs)(xs,{align:"center",direction:"row",style:{padding:"14px 14px",fontSize:14,backgroundColor:g?mo.g11:m?mo.r11:mo.y10,borderTop:`3px solid ${g?mo.g5:m?mo.r5:mo.y4}`,...vo.shadowLarge,maxWidth:550,"& a":{color:"currentColor"}},children:[(0,jo.jsxs)(xs,{align:"flex-start",children:[o&&(0,jo.jsx)(ms,{style:{fontWeight:700,marginBottom:10},children:o}),(0,jo.jsx)(ms,{children:v}),a?a.split("\n\n").map(((e,t)=>(0,jo.jsx)(ms,{style:{whiteSpace:"pre-wrap",fontFamily:"monospace",fontSize:12,backgroundColor:"rgba(0, 0, 0, .05)",padding:10,borderRadius:4},children:e},t))):null,c&&(0,jo.jsx)(Ms,{bare:!0,loading:d,onClick:async()=>{f(!0),await c.action(),n(),f(!1)},style:{backgroundColor:"transparent",border:`1px solid ${g?mo.g5:m?mo.r4:mo.y3}`,color:"currentColor",fontSize:14,flexShrink:0,"&:hover, &:active":{backgroundColor:g?mo.g9:m?mo.r10:mo.y9}},children:c.title})]}),s&&(0,jo.jsx)(As,{bare:!0,style:{flexShrink:0,color:"currentColor"},onClick:n,children:(0,jo.jsx)(hs,{style:{width:9,height:9,color:"currentColor"}})})]}),p&&(0,jo.jsx)(ms,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(250, 250, 250, .75)",alignItems:"center",justifyContent:"center"},children:(0,jo.jsx)(Co,{color:"currentColor",style:{width:20,height:20,color:"currentColor"}})})]})}var ON=de((e=>({notifications:e.notifications.notifications})),(t=>Q(e,t)))((function(e){let{notifications:t,removeNotification:n,style:r}=e;return(0,jo.jsx)(ms,{style:[{position:"absolute",bottom:20,right:13,zIndex:1e4},r],children:t.map((e=>(0,jo.jsx)(_N,{notification:e,onRemove:()=>{e.onClose&&e.onClose(),n(e.id)}},e.id)))})}));var EN=e=>(0,jo.jsx)("svg",{...e,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",style:{color:"#242134",...e.style},children:(0,jo.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 TN=Xr((e=>Dr(e)));function PN(e,t,n){return 1===e?t:n}function AN(e){let{ruleCount:t,focused:n,onEdit:r,onClick:o}=e;return(0,jo.jsx)(Vw,{name:"rule-count",width:"auto",focused:n,style:{padding:"0 10px"},plain:!0,children:(0,jo.jsxs)(tj,{style:{borderRadius:4,padding:"3px 6px",backgroundColor:mo.g9,border:"1px solid "+mo.g9,color:mo.g1,fontSize:12},onEdit:r,onSelect:o,onFocus:r,children:[(0,jo.jsx)(gs,{style:{paddingRight:5},children:t>0?(0,jo.jsxs)(jo.Fragment,{children:[t," associated ",PN(t,"rule","rules")]}):(0,jo.jsx)(jo.Fragment,{children:"Create rule"})}),(0,jo.jsx)(LA,{style:{width:8,height:8,color:mo.g1}})]})})}let MN=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?mo.b8:mo.border,b=l||"select"===u;return(0,jo.jsxs)(qw,{borderColor:v,backgroundColor:i?mo.b9:b?mo.hover:"white",highlighted:a,style:[{alignItems:"stretch"},t,{backgroundColor:l?mo.hover:null},i&&{backgroundColor:mo.b9,zIndex:100}],"data-focus-key":n.id,onMouseEnter:()=>f&&f(n.id),children:[(0,jo.jsx)(nj,{exposed:null==n.transfer_acct&&(l||i||s),focused:"select"===u,selected:i,onSelect:()=>{m({type:"select",id:n.id})}}),(0,jo.jsx)(Xw,{value:(n.transfer_acct?"Transfer: ":"")+n.name,valueStyle:!i&&n.transfer_acct&&{color:mo.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,jo.jsx)(AN,{ruleCount:r,focused:"rule-count"===u,onEdit:()=>p(g,"rule-count"),onClick:()=>r>0?c(n.id):d(n.id)})]})}));const DN=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,jo.jsx)(ms,{style:[{flex:1}],onMouseLeave:()=>f(null),children:(0,jo.jsx)(sj,{ref:t,items:n,navigator:o,renderItem:e=>{let{item:t,editing:n,focusedField:o,onEdit:l}=e;return(0,jo.jsx)(MN,{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 IN(){let e=mo.border,t=Ix(),n=Rx();return(0,jo.jsx)(ms,{children:(0,jo.jsxs)(oj,{borderColor:e,style:{backgroundColor:"white",color:mo.n4,zIndex:200,userSelect:"none"},collapsed:!0,version:"v2",children:[(0,jo.jsx)(nj,{exposed:!0,focused:!1,selected:n.size>0,onSelect:()=>t({type:"select-all"})}),(0,jo.jsx)(Vw,{value:"Name",width:"flex"})]})})}function RN(e){let{text:t,style:n}=e;return(0,jo.jsx)(ms,{style:[{textAlign:"center",color:mo.n7,fontStyle:"italic",fontSize:13,marginTop:5},n],children:t})}function NN(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,jo.jsx)(Ss,{position:"bottom",width:250,style:{padding:0},onClose:i,children:(0,jo.jsx)(Us,{onMenuSelect:e=>{switch(i(),e){case"delete":r();break;case"merge":o()}},footer:(0,jo.jsx)(ms,{style:{padding:3,fontSize:11,fontStyle:"italic",color:mo.n7},children:[...n].slice(0,4).map((e=>t[e].name)).join(", ")+(n.size>4?", and more":"")}),items:[{icon:hs,name:"delete",text:"Delete",disabled:a},{icon:EN,iconSize:9,name:"merge",text:"Merge",disabled:a||n.size<2},Us.line]})})}const LN=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=TN(r);return(0,jo.jsxs)(ms,{style:{height:"100%"},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",padding:"0 10px 5px"},children:[(0,jo.jsx)(KM,{initialState:{menuOpen:!1},children:e=>{let{state:t,setState:n}=e;return(0,jo.jsxs)(ms,{children:[(0,jo.jsxs)(As,{bare:!0,style:{marginRight:10},disabled:E,onClick:()=>n({menuOpen:!0}),children:[E?"No payees selected":w.items.size+" "+PN(w.items.size,"payee","payees"),(0,jo.jsx)(ys,{width:8,height:8,style:{marginLeft:5}})]}),t.menuOpen&&(0,jo.jsx)(NN,{payeesById:P,selectedPayees:w.items,onClose:()=>n({menuOpen:!1}),onDelete:_,onMerge:O})]})}}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(Is,{placeholder:"Filter payees...",value:y,onChange:e=>{j(e.target.value),T.onEdit(null)},style:{width:350,borderColor:"transparent",backgroundColor:mo.n11,":focus":{backgroundColor:"white","::placeholder":{color:mo.n8}}}})]}),(0,jo.jsx)(Nx,{instance:w,fetchAllIds:C,children:(0,jo.jsxs)(ms,{style:{flex:1,border:"1px solid "+mo.border,borderRadius:4,overflow:"hidden"},children:[(0,jo.jsx)(IN,{}),0===x.length?(0,jo.jsx)(RN,{text:"No payees",style:{marginTop:15}}):(0,jo.jsx)(DN,{ref:m,payees:x,ruleCounts:o,categoryGroups:i,highlightedRows:f,navigator:T,onUpdate:k,onViewRules:u,onCreateRule:c})]})})]})}));var FN=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")||t.includes("payee_rules"))&&(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,jo.jsx)(LN,{ref:y,modalProps:t,payees:c,ruleCounts:f.value,categoryGroups:i,initialSelectedIds:n,lastUndoState:r,onBatchChange:e=>{qe("payees-batch-change",e),d(Pr(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 BN(){let e=Ui();return(0,jo.jsx)(LE,{title:"Payees",children:(0,jo.jsx)(FN,{initialSelectedIds:e.state&&e.state.selectedPayee?[e.state.selectedPayee]:null})})}function UN(e){Lf(1,arguments);var t=Uf(e);return t.setHours(0,0,0,0),t}var zN=864e5;function WN(e,t){Lf(2,arguments);var n=UN(e),r=UN(t),o=n.getTime()-bp(n),i=r.getTime()-bp(r);return Math.round((o-i)/zN)}var HN=function(e){let{amount:t}=e;return(0,jo.jsxs)(Cs,{style:[vo.smallText,{color:t<0?mo.r5:mo.g5}],children:[t>=0?"+":"",Wr(t)]})};function KN(e){return e.slice(0,7)}function $N(e){return e}async function VN(e,t){let n=await Promise.all(e.map((e=>yr(e).then((e=>{let{data:t}=e;return t})))));t(n)}function qN(e,t,n){const r={};return e.forEach((e=>{r[n?n(e[t]):e[t]]=e})),r}function GN(e,t,n){return async(r,o)=>{function i(r){let o=hr("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 VN([hr("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=qN(i,"date",r?KN:$N),u=qN(a,"date",r?KN:$N);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,jo.jsxs)("div",{children:[(0,jo.jsx)("div",{style:{marginBottom:10},children:(0,jo.jsx)("strong",{children:Hp(i,r?"MMMM yyyy":"MMMM d, yyyy")})}),(0,jo.jsxs)("div",{style:{lineHeight:1.5},children:[(0,jo.jsx)(zs,{left:"Income:",right:Wr(n)}),(0,jo.jsx)(zs,{left:"Expenses:",right:Wr(o)}),(0,jo.jsx)(zs,{left:"Change:",right:(0,jo.jsx)("strong",{children:Wr(n+o)})}),(0,jo.jsx)(zs,{left:"Balance:",right:Wr(c)})]})]});return e.income.push({x:i,y:qr(n)}),e.expenses.push({x:i,y:qr(o)}),e.balances.push({x:i,y:qr(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 YN=n(5322),QN=n.n(YN),XN=n(6608),ZN=n.n(XN),JN=n(1324),eL=n.n(JN),tL=n(3064),nL=n.n(tL),rL=n(4082),oL=n.n(rL);function iL(e){return function(e){if(Array.isArray(e))return aL(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 aL(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 aL(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 aL(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 lL(e){return Array.isArray(e)&&e.length>0}function sL(e){return Array.isArray(e)&&e.some((function(e){return"string"===typeof e}))}function uL(e){return Array.isArray(e)&&e.some((function(e){return e instanceof Date}))}function cL(e){return lL(e)&&e.every(Array.isArray)}function dL(e){return e.filter((function(e){return void 0!==e}))}function fL(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 uL(o)?new Date(Math.max.apply(Math,iL(o))):Math.max.apply(Math,iL(o))}function pL(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 uL(o)?new Date(Math.min.apply(Math,iL(o))):Math.min.apply(Math,iL(o))}var hL=n(8034),yL=n.n(hL),gL=n(4008),mL=n.n(gL);function vL(e,t){return(e.key||t).toString()}function bL(e){return e.reduce((function(e,t,n){return e[vL(t,n)]=t,e}),{})}function xL(e,t){var n=!1,r=yL()(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 jL(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&&bL(e),r=t&&bL(t);return{entering:n&&xL(r,n),exiting:r&&xL(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 SL(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=ZN()({},e,{onEnd:n}))&&e.onLoad&&!e.onLoad.duration)return{animate:e,data:t};var r=e.onLoad&&e.onLoad.after?e.onLoad.after:mL();return{animate:e,data:t=t.map((function(e,n){return ZN()({},e,r(e,n,t))}))}}(r,t,(function(){n({nodesShouldLoad:!1,nodesDoneLoad:!0})})):function(e,t,n,r){if((e=ZN()({},e,{onEnd:r}))&&e.onLoad&&!e.onLoad.duration)return{animate:e,data:n};var o=e.onLoad&&e.onLoad.before?e.onLoad.before:mL();return{animate:e,data:n=n.map((function(e,t){return ZN()({},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=ZN()({},e,i),r){e.onEnd=o;var a=e.onExit&&e.onExit.before?e.onExit.before:mL();n=n.map((function(e,t){var o=(e.key||t).toString();return r[o]?ZN()({},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=ZN()({},e,o),n){e.onEnd=r;var i=e.onEnter&&e.onEnter.after?e.onEnter.after:mL();t=t.map((function(e,r){var o=vL(e,r);return n[o]?ZN()({},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=ZN()({},e,{onEnd:o})).onEnter&&e.onEnter.before?e.onEnter.before:mL();n=n.map((function(e,t){var o=(e.key||t).toString();return r[o]?ZN()({},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=eL()({},e.animate,n.props.animate),g=n.props.polar&&n.type.defaultPolarTransitions||n.type.defaultTransitions;y.onExit=eL()({},y.onExit,g&&g.onExit),y.onEnter=eL()({},y.onEnter,g&&g.onEnter),y.onLoad=eL()({},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,ZN()({},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,ZN()({},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,ZN()({},y,C))}return!t&&y&&y.onExit?function(e,t){var n=e.onEnter&&e.onEnter.after?e.onEnter.after:mL();return{data:t.map((function(e,r){return ZN()({},e,n(e,r,t))}))}}(y,h):{animate:y,data:h}}}function kL(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 CL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kL(Object(n),!0).forEach((function(t){_L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OL(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 EL(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 EL(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 EL(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 TL={nodesShouldLoad:!1,nodesDoneLoad:!1,animating:!0},PL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:TL,t=OL(h.useState(e),2),n=t[0],r=t[1],o=h.useCallback((function(e){r((function(t){return CL(CL({},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=cL(e)?e[r]:e,eL()({childrenTransitions:e},n)}(),l=e.animate&&e.animate.parentState||a;if(!i){var s=SL(e,a,(function(e){return o(e)}));i=function(e){return s(e,r)}}return eL()({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=eL()({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)?oL()(e,t):t(e)},s=!e.polar&&oL()(i,(function(e){return l(e)||e.props.children&&l(e.props.children)})),u=jL(i,a),c=u.nodesWillExit,d=u.nodesWillEnter,f=u.childrenTransitions,p=u.nodesShouldEnter;o({nodesWillExit:c,nodesWillEnter:d,nodesShouldEnter:p,childrenTransitions:cL(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}},AL=n(5510),ML=n.n(AL),DL=n(3686),IL=n.n(DL),RL=n(6405),NL=n.n(RL);function LL(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 FL(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 eL()({},f,e)}function BL(e,t){var n=e.scale,r=e.polar,o=e.horizontal,i=FL(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 UL(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 zL(e){return"tooltip"===(e&&e.type&&e.type.role)}function WL(e,t){var n=e.theme,r=void 0===n?{}:n,o=e.labelComponent,i=r[t]&&r[t].style||{};if(!zL(o))return i;var a=r.tooltip&&r.tooltip.style||{},l=eL()({},a,i.labels);return eL()({},{labels:l},i)}function HL(e,t){var n="100%",r="100%";if(!e)return eL()({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:eL()({},a,l,{width:n,height:r}),labels:eL()({},i,s),data:eL()({},o,u)}}function KL(e,t){return NL()(e)?e(t):e}function $L(e,t){return t.disableInlineStyles?{}:e&&yL()(e).some((function(t){return NL()(e[t])}))?yL()(e).reduce((function(n,r){return n[r]=KL(e[r],t),n}),{}):e}function VL(e){return"number"===typeof e?e*(Math.PI/180):e}function qL(e){return"number"===typeof e?e/(Math.PI/180):e}function GL(e){var t=UL(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 YL(e){var t=e.width,n=e.height,r=UL(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 QL(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?[VL(e.startAngle||0),VL(e.endAngle||360)]:[e.innerRadius||0,GL(e)]}(e,t):function(e,t){var n="x"!==t,r=UL(e);return n?[e.height-r.bottom,r.top]:[r.left,e.width-r.right]}(e,t)}function XL(e){return NL()(e)?e:null===e||void 0===e?function(e){return e}:IL()(e)}function ZL(e,t,n){var r=LL(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 eL()(i,e,r,t)}function JL(e,t){return t?"x"===e?"y":"x":e}function eF(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=ZN()({},r.props,ML()(n,i)),p=r.type&&"stack"===r.type.role&&NL()(r.type.getChildren)?r.type.getChildren(f):h.Children.toArray(r.props.children).map((function(e){var t=ZN()({},e.props,ML()(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 tF(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 nF(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 nF(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 nF(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 rF(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 oF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var iF={startsWith:["data-","aria-"],exactMatch:[]},aF=function(e){return!(!function(e){var t=!1;return iF.startsWith.forEach((function(n){new RegExp("\\b(".concat(n,")(\\w|-)+"),"g").test(e)&&(t=!0)})),t}(e)&&!function(e){return iF.exactMatch.includes(e)}(e))},lF=function(e,t){return"function"===typeof e?e(t):e},sF=function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rF(Object(n),!0).forEach((function(t){oF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rF(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=tF(e,1)[0];return aF(t)})).map((function(t){var n=tF(t,2),r=n[0],o=n[1];return[r,lF(o,e)]})))},uF=function(e,t){return h.cloneElement(e,sF(t))},cF=n(4222),dF=n.n(cF),fF=n(3809),pF=n.n(fF),hF=n(3172),yF=n.n(hF),gF=n(4564),mF=n.n(gF),vF=n(3978),bF=n.n(vF),xF=n(8901),wF=n.n(xF),jF=n(2853),SF=n.n(jF),kF=n(6366),CF=n.n(kF),_F=n(8649),OF=n.n(_F),EF=n(9546),TF=n.n(EF),PF=n(2783),AF=n.n(PF),MF=n(3329),DF=n.n(MF),IF=n(3129),RF=n.n(IF),NF=n(4209),LF=n.n(NF),FF=n(5876),BF=n.n(FF),UF=n(4154),zF=n.n(UF),WF=n(6568),HF=n.n(WF),KF=n(9945),$F=n.n(KF);function VF(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function qF(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 GF extends Map{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JF;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(QF(this,e))}has(e){return super.has(QF(this,e))}set(e,t){return super.set(XF(this,e),t)}delete(e){return super.delete(ZF(this,e))}}class YF extends Set{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JF;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(QF(this,e))}add(e){return super.add(XF(this,e))}delete(e){return super.delete(ZF(this,e))}}function QF(e,t){let{_intern:n,_key:r}=e;const o=r(t);return n.has(o)?n.get(o):t}function XF(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 ZF(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 JF(e){return null!==e&&"object"===typeof e?e.valueOf():e}const eB=Symbol("implicit");function tB(){var e=new GF,t=[],n=[],r=eB;function o(o){let i=e.get(o);if(void 0===i){if(r!==eB)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 GF;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 tB(t,n).unknown(r)},VF.apply(o,arguments),o}function nB(){var e,t,n=tB().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 nB(r(),[i,a]).round(l).paddingInner(s).paddingOuter(u).align(c)},VF.apply(d(),arguments)}function rB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return rB(t())},e}function oB(){return rB(nB.apply(null,arguments).paddingInner(1))}var iB=Math.sqrt(50),aB=Math.sqrt(10),lB=Math.sqrt(2);function sB(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=uB(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 uB(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>=iB?10:i>=aB?5:i>=lB?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=iB?10:i>=aB?5:i>=lB?2:1)}function cB(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>=iB?o*=10:i>=aB?o*=5:i>=lB&&(o*=2),t<e?-o:o}function dB(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fB(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pB(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=dB,n=(t,n)=>dB(e(t),n),r=(t,n)=>e(t)-n):(t=e===dB||e===fB?e:hB,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 hB(){return 0}function yB(e){return null===e?NaN:+e}const gB=pB(dB),mB=gB.right;gB.left,pB(yB).center;var vB=mB;function bB(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xB(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function wB(){}var jB=.7,SB=1/jB,kB="\\s*([+-]?\\d+)\\s*",CB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",OB=/^#([0-9a-f]{3,8})$/,EB=new RegExp(`^rgb\\(${kB},${kB},${kB}\\)$`),TB=new RegExp(`^rgb\\(${_B},${_B},${_B}\\)$`),PB=new RegExp(`^rgba\\(${kB},${kB},${kB},${CB}\\)$`),AB=new RegExp(`^rgba\\(${_B},${_B},${_B},${CB}\\)$`),MB=new RegExp(`^hsl\\(${CB},${_B},${_B}\\)$`),DB=new RegExp(`^hsla\\(${CB},${_B},${_B},${CB}\\)$`),IB={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 RB(){return this.rgb().formatHex()}function NB(){return this.rgb().formatRgb()}function LB(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=OB.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?FB(t):3===n?new zB(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?BB(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?BB(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=EB.exec(e))?new zB(t[1],t[2],t[3],1):(t=TB.exec(e))?new zB(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=PB.exec(e))?BB(t[1],t[2],t[3],t[4]):(t=AB.exec(e))?BB(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=MB.exec(e))?qB(t[1],t[2]/100,t[3]/100,1):(t=DB.exec(e))?qB(t[1],t[2]/100,t[3]/100,t[4]):IB.hasOwnProperty(e)?FB(IB[e]):"transparent"===e?new zB(NaN,NaN,NaN,0):null}function FB(e){return new zB(e>>16&255,e>>8&255,255&e,1)}function BB(e,t,n,r){return r<=0&&(e=t=n=NaN),new zB(e,t,n,r)}function UB(e,t,n,r){return 1===arguments.length?function(e){return e instanceof wB||(e=LB(e)),e?new zB((e=e.rgb()).r,e.g,e.b,e.opacity):new zB}(e):new zB(e,t,n,null==r?1:r)}function zB(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function WB(){return`#${VB(this.r)}${VB(this.g)}${VB(this.b)}`}function HB(){const e=KB(this.opacity);return`${1===e?"rgb(":"rgba("}${$B(this.r)}, ${$B(this.g)}, ${$B(this.b)}${1===e?")":`, ${e})`}`}function KB(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $B(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function VB(e){return((e=$B(e))<16?"0":"")+e.toString(16)}function qB(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new YB(e,t,n,r)}function GB(e){if(e instanceof YB)return new YB(e.h,e.s,e.l,e.opacity);if(e instanceof wB||(e=LB(e)),!e)return new YB;if(e instanceof YB)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 YB(a,l,s,e.opacity)}function YB(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function QB(e){return(e=(e||0)%360)<0?e+360:e}function XB(e){return Math.max(0,Math.min(1,e||0))}function ZB(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 JB(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}bB(wB,LB,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RB,formatHex:RB,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return GB(this).formatHsl()},formatRgb:NB,toString:NB}),bB(zB,UB,xB(wB,{brighter(e){return e=null==e?SB:Math.pow(SB,e),new zB(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?jB:Math.pow(jB,e),new zB(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new zB($B(this.r),$B(this.g),$B(this.b),KB(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:WB,formatHex:WB,formatHex8:function(){return`#${VB(this.r)}${VB(this.g)}${VB(this.b)}${VB(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:HB,toString:HB})),bB(YB,(function(e,t,n,r){return 1===arguments.length?GB(e):new YB(e,t,n,null==r?1:r)}),xB(wB,{brighter(e){return e=null==e?SB:Math.pow(SB,e),new YB(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?jB:Math.pow(jB,e),new YB(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 zB(ZB(e>=240?e-240:e+120,o,r),ZB(e,o,r),ZB(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new YB(QB(this.h),XB(this.s),XB(this.l),KB(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=KB(this.opacity);return`${1===e?"hsl(":"hsla("}${QB(this.h)}, ${100*XB(this.s)}%, ${100*XB(this.l)}%${1===e?")":`, ${e})`}`}}));var eU=e=>()=>e;function tU(e,t){return function(n){return e+n*t}}function nU(e){return 1===(e=+e)?rU: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):eU(isNaN(t)?n:t)}}function rU(e,t){var n=t-e;return n?tU(e,n):eU(isNaN(e)?t:e)}var oU=function e(t){var n=nU(t);function r(e,t){var r=n((e=UB(e)).r,(t=UB(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=rU(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 iU(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=UB(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+""}}}iU((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 JB((n-r/t)*t,a,o,i,l)}})),iU((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 JB((n-r/t)*t,o,i,a,l)}}));function aU(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]=hU(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 lU(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function sU(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uU(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]=hU(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}var cU=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dU=new RegExp(cU.source,"g");function fU(e,t){var n,r,o,i=cU.lastIndex=dU.lastIndex=0,a=-1,l=[],s=[];for(e+="",t+="";(n=cU.exec(e))&&(r=dU.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:sU(n,r)})),i=dU.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 pU(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 hU(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?eU(t):("number"===o?sU:"string"===o?(n=LB(t))?(t=n,oU):fU:t instanceof LB?oU:t instanceof Date?lU:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?aU:"function"!==typeof t.valueOf&&"function"!==typeof t.toString||isNaN(t)?uU:sU:pU))(e,t)}function yU(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function gU(e){return+e}var mU=[0,1];function vU(e){return e}function bU(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function xU(e,t,n){var r=e[0],o=e[1],i=t[0],a=t[1];return o<r?(r=bU(o,r),i=n(a,i)):(r=bU(r,o),i=n(i,a)),function(e){return i(r(e))}}function wU(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]=bU(e[a],e[a+1]),i[a]=n(t[a],t[a+1]);return function(t){var n=vB(e,t,1,r)-1;return i[n](o[n](t))}}function jU(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function SU(){var e,t,n,r,o,i,a=mU,l=mU,s=hU,u=vU;function c(){var e=Math.min(a.length,l.length);return u!==vU&&(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?wU:xU,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),sU)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,gU),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=yU,c()},d.clamp=function(e){return arguments.length?(u=!!e||vU,c()):u!==vU},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 kU(){return SU()(vU,vU)}var CU,_U=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function OU(e){if(!(t=_U.exec(e)))throw new Error("invalid format: "+e);var t;return new EU({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 EU(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 TU(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 PU(e){return(e=TU(Math.abs(e)))?e[1]:NaN}function AU(e,t){var n=TU(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")}OU.prototype=EU.prototype,EU.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 MU={"%":(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)=>AU(100*e,t),r:AU,s:function(e,t){var n=TU(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(CU=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")+TU(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function DU(e){return e}var IU,RU,NU,LU=Array.prototype.map,FU=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function BU(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?DU:(t=LU.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?DU:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(LU.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=OU(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"):MU[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=MU[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?FU[8+CU/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=OU(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(PU(t)/3))),o=Math.pow(10,-r),i=FU[8+r/3];return function(e){return n(o*e)+i}}}}function UU(e,t,n,r){var o,i=cB(e,t,n);switch((r=OU(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(PU(t)/3)))-PU(Math.abs(e)))}(i,a))||(r.precision=o),NU(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,PU(t)-PU(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,-PU(Math.abs(e)))}(i))||(r.precision=o-2*("%"===r.type))}return RU(r)}function zU(e){var t=e.domain;return e.ticks=function(e){var n=t();return sB(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return UU(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=uB(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 WU(){var e=kU();return e.copy=function(){return jU(e,WU())},VF.apply(e,arguments),zU(e)}function HU(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,gU),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return HU(e).unknown(t)},e=arguments.length?Array.from(e,gU):[0,1],zU(n)}function KU(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 $U(e){return Math.log(e)}function VU(e){return Math.exp(e)}function qU(e){return-Math.log(-e)}function GU(e){return-Math.exp(-e)}function YU(e){return isFinite(e)?+("1e"+e):e<0?0:e}function QU(e){return(t,n)=>-e(-t,n)}function XU(e){const t=e($U,VU),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?YU:e===Math.E?Math.exp:t=>Math.pow(e,t)}(i),n()[0]<0?(r=QU(r),o=QU(o),e(qU,GU)):e($U,VU),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=sB(a,l,p))}else h=sB(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=OU(n)).precision||(n.trim=!0),n=RU(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(KU(n(),{floor:e=>o(Math.floor(r(e))),ceil:e=>o(Math.ceil(r(e)))})),t}function ZU(){const e=XU(SU()).domain([1,10]);return e.copy=()=>jU(e,ZU()).base(e.base()),VF.apply(e,arguments),e}function JU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ez(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function tz(e){var t=1,n=e(JU(t),ez(t));return n.constant=function(n){return arguments.length?e(JU(t=+n),ez(t)):t},zU(n)}function nz(){var e=tz(SU());return e.copy=function(){return jU(e,nz()).constant(e.constant())},VF.apply(e,arguments)}function rz(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oz(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function iz(e){return e<0?-e*e:e*e}function az(e){var t=e(vU,vU),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(vU,vU):.5===n?e(oz,iz):e(rz(n),rz(1/n)):n},zU(t)}function lz(){var e=az(SU());return e.copy=function(){return jU(e,lz()).exponent(e.exponent())},VF.apply(e,arguments),e}function sz(){return lz.apply(null,arguments).exponent(.5)}function uz(e){return Math.sign(e)*e*e}function cz(){var e,t=kU(),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(uz(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,gU)).map(uz)),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 cz(t.domain(),n).round(r).clamp(t.clamp()).unknown(e)},VF.apply(o,arguments),zU(o)}function dz(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 fz(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 pz(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dB;if(e===dB)return hz;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 hz(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function yz(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?hz:pz(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);yz(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(gz(e,n,t),o(e[r],i)>0&&gz(e,n,r);a<l;){for(gz(e,a,l),++a,--l;o(e[a],i)<0;)++a;for(;o(e[l],i)>0;)--l}0===o(e[n],i)?gz(e,n,l):(++l,gz(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function gz(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mz(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 fz(e);if(t>=1)return dz(e);var r,o=(r-1)*t,i=Math.floor(o),a=dz(yz(e,i).subarray(0,i+1));return a+(fz(e.subarray(i+1))-a)*(o-i)}}function vz(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yB;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 bz(){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]=vz(t,e/o);return i}function i(t){return null==t||isNaN(t=+t)?e:n[vB(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(dB),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 bz().domain(t).range(n).unknown(e)},VF.apply(i,arguments)}function xz(){var e,t=0,n=1,r=1,o=[.5],i=[0,1];function a(t){return null!=t&&t<=t?i[vB(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 xz().domain([t,n]).range(i).unknown(e)},VF.apply(zU(a),arguments)}function wz(){var e,t=[.5],n=[0,1],r=1;function o(o){return null!=o&&o<=o?n[vB(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 wz().domain(t).range(n).unknown(e)},VF.apply(o,arguments)}IU=BU({thousands:",",grouping:[3],currency:["$",""]}),RU=IU.format,NU=IU.formatPrefix;const jz=1e3,Sz=60*jz,kz=60*Sz,Cz=24*kz,_z=7*Cz,Oz=30*Cz,Ez=365*Cz,Tz=new Date,Pz=new Date;function Az(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=>Az((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)=>(Tz.setTime(+t),Pz.setTime(+r),e(Tz),e(Pz),Math.floor(n(Tz,Pz))),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 Mz=Az((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));Mz.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Az((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):Mz:null);Mz.range;const Dz=Az((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*jz)}),((e,t)=>(t-e)/jz),(e=>e.getUTCSeconds())),Iz=(Dz.range,Az((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*jz)}),((e,t)=>{e.setTime(+e+t*Sz)}),((e,t)=>(t-e)/Sz),(e=>e.getMinutes()))),Rz=(Iz.range,Az((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*Sz)}),((e,t)=>(t-e)/Sz),(e=>e.getUTCMinutes()))),Nz=(Rz.range,Az((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*jz-e.getMinutes()*Sz)}),((e,t)=>{e.setTime(+e+t*kz)}),((e,t)=>(t-e)/kz),(e=>e.getHours()))),Lz=(Nz.range,Az((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*kz)}),((e,t)=>(t-e)/kz),(e=>e.getUTCHours()))),Fz=(Lz.range,Az((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Sz)/Cz),(e=>e.getDate()-1))),Bz=(Fz.range,Az((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Cz),(e=>e.getUTCDate()-1))),Uz=(Bz.range,Az((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Cz),(e=>Math.floor(e/Cz))));Uz.range;function zz(e){return Az((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())*Sz)/_z))}const Wz=zz(0),Hz=zz(1),Kz=zz(2),$z=zz(3),Vz=zz(4),qz=zz(5),Gz=zz(6);Wz.range,Hz.range,Kz.range,$z.range,Vz.range,qz.range,Gz.range;function Yz(e){return Az((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)/_z))}const Qz=Yz(0),Xz=Yz(1),Zz=Yz(2),Jz=Yz(3),eW=Yz(4),tW=Yz(5),nW=Yz(6),rW=(Qz.range,Xz.range,Zz.range,Jz.range,eW.range,tW.range,nW.range,Az((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()))),oW=(rW.range,Az((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()))),iW=(oW.range,Az((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())));iW.every=e=>isFinite(e=Math.floor(e))&&e>0?Az((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;iW.range;const aW=Az((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()));aW.every=e=>isFinite(e=Math.floor(e))&&e>0?Az((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;aW.range;function lW(e,t,n,r,o,i){const a=[[Dz,1,jz],[Dz,5,5*jz],[Dz,15,15*jz],[Dz,30,30*jz],[i,1,Sz],[i,5,5*Sz],[i,15,15*Sz],[i,30,30*Sz],[o,1,kz],[o,3,3*kz],[o,6,6*kz],[o,12,12*kz],[r,1,Cz],[r,2,2*Cz],[n,1,_z],[t,1,Oz],[t,3,3*Oz],[e,1,Ez]];function l(t,n,r){const o=Math.abs(n-t)/r,i=pB((e=>{let[,,t]=e;return t})).right(a,o);if(i===a.length)return e.every(cB(t/Ez,n/Ez,r));if(0===i)return Mz.every(Math.max(cB(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[sW,uW]=lW(aW,oW,Qz,Uz,Lz,Rz),[cW,dW]=lW(iW,rW,Wz,Fz,Nz,Iz);function fW(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 pW(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 hW(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var yW,gW,mW,vW={"-":"",_:" ",0:"0"},bW=/^\s*\d+/,xW=/^%/,wW=/[\\^$*+?|[\]().{}]/g;function jW(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 SW(e){return e.replace(wW,"\\$&")}function kW(e){return new RegExp("^(?:"+e.map(SW).join("|")+")","i")}function CW(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function _W(e,t,n){var r=bW.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function OW(e,t,n){var r=bW.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function EW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function TW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function PW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function AW(e,t,n){var r=bW.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function MW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function DW(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 IW(e,t,n){var r=bW.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function RW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function NW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function LW(e,t,n){var r=bW.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function FW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function BW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function UW(e,t,n){var r=bW.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zW(e,t,n){var r=bW.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function WW(e,t,n){var r=bW.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function HW(e,t,n){var r=xW.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function KW(e,t,n){var r=bW.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function $W(e,t,n){var r=bW.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function VW(e,t){return jW(e.getDate(),t,2)}function qW(e,t){return jW(e.getHours(),t,2)}function GW(e,t){return jW(e.getHours()%12||12,t,2)}function YW(e,t){return jW(1+Fz.count(iW(e),e),t,3)}function QW(e,t){return jW(e.getMilliseconds(),t,3)}function XW(e,t){return QW(e,t)+"000"}function ZW(e,t){return jW(e.getMonth()+1,t,2)}function JW(e,t){return jW(e.getMinutes(),t,2)}function eH(e,t){return jW(e.getSeconds(),t,2)}function tH(e){var t=e.getDay();return 0===t?7:t}function nH(e,t){return jW(Wz.count(iW(e)-1,e),t,2)}function rH(e){var t=e.getDay();return t>=4||0===t?Vz(e):Vz.ceil(e)}function oH(e,t){return e=rH(e),jW(Vz.count(iW(e),e)+(4===iW(e).getDay()),t,2)}function iH(e){return e.getDay()}function aH(e,t){return jW(Hz.count(iW(e)-1,e),t,2)}function lH(e,t){return jW(e.getFullYear()%100,t,2)}function sH(e,t){return jW((e=rH(e)).getFullYear()%100,t,2)}function uH(e,t){return jW(e.getFullYear()%1e4,t,4)}function cH(e,t){var n=e.getDay();return jW((e=n>=4||0===n?Vz(e):Vz.ceil(e)).getFullYear()%1e4,t,4)}function dH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+jW(t/60|0,"0",2)+jW(t%60,"0",2)}function fH(e,t){return jW(e.getUTCDate(),t,2)}function pH(e,t){return jW(e.getUTCHours(),t,2)}function hH(e,t){return jW(e.getUTCHours()%12||12,t,2)}function yH(e,t){return jW(1+Bz.count(aW(e),e),t,3)}function gH(e,t){return jW(e.getUTCMilliseconds(),t,3)}function mH(e,t){return gH(e,t)+"000"}function vH(e,t){return jW(e.getUTCMonth()+1,t,2)}function bH(e,t){return jW(e.getUTCMinutes(),t,2)}function xH(e,t){return jW(e.getUTCSeconds(),t,2)}function wH(e){var t=e.getUTCDay();return 0===t?7:t}function jH(e,t){return jW(Qz.count(aW(e)-1,e),t,2)}function SH(e){var t=e.getUTCDay();return t>=4||0===t?eW(e):eW.ceil(e)}function kH(e,t){return e=SH(e),jW(eW.count(aW(e),e)+(4===aW(e).getUTCDay()),t,2)}function CH(e){return e.getUTCDay()}function _H(e,t){return jW(Xz.count(aW(e)-1,e),t,2)}function OH(e,t){return jW(e.getUTCFullYear()%100,t,2)}function EH(e,t){return jW((e=SH(e)).getUTCFullYear()%100,t,2)}function TH(e,t){return jW(e.getUTCFullYear()%1e4,t,4)}function PH(e,t){var n=e.getUTCDay();return jW((e=n>=4||0===n?eW(e):eW.ceil(e)).getUTCFullYear()%1e4,t,4)}function AH(){return"+0000"}function MH(){return"%"}function DH(e){return+e}function IH(e){return Math.floor(+e/1e3)}function RH(e){return new Date(e)}function NH(e){return e instanceof Date?+e:+new Date(+e)}function LH(e,t,n,r,o,i,a,l,s,u){var c=kU(),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,NH)):f().map(RH)},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(KU(n,e)):c},c.copy=function(){return jU(c,LH(e,t,n,r,o,i,a,l,s,u))},c}function FH(){return VF.apply(LH(cW,dW,iW,rW,Wz,Fz,Nz,Iz,Dz,gW).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function BH(){return VF.apply(LH(sW,uW,aW,oW,Qz,Bz,Lz,Rz,Dz,mW).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function UH(){var e,t,n,r,o,i=0,a=1,l=vU,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(hU),u.rangeRound=c(yU),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 zH(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function WH(){var e=zU(UH()(vU));return e.copy=function(){return zH(e,WH())},qF.apply(e,arguments)}function HH(){var e=XU(UH()).domain([1,10]);return e.copy=function(){return zH(e,HH()).base(e.base())},qF.apply(e,arguments)}function KH(){var e=tz(UH());return e.copy=function(){return zH(e,KH()).constant(e.constant())},qF.apply(e,arguments)}function $H(){var e=az(UH());return e.copy=function(){return zH(e,$H()).exponent(e.exponent())},qF.apply(e,arguments)}function VH(){return $H.apply(null,arguments).exponent(.5)}function qH(){var e=[],t=vU;function n(n){if(null!=n&&!isNaN(n=+n))return t((vB(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(dB),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)=>mz(e,r/t)))},n.copy=function(){return qH(t).domain(e)},qF.apply(n,arguments)}function GH(){var e,t,n,r,o,i,a,l=0,s=.5,u=1,c=1,d=vU,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=hU);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(hU),p.rangeRound=h(yU),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 YH(){var e=zU(GH()(vU));return e.copy=function(){return zH(e,YH())},qF.apply(e,arguments)}function QH(){var e=XU(GH()).domain([.1,1,10]);return e.copy=function(){return zH(e,QH()).base(e.base())},qF.apply(e,arguments)}function XH(){var e=tz(GH());return e.copy=function(){return zH(e,XH()).constant(e.constant())},qF.apply(e,arguments)}function ZH(){var e=az(GH());return e.copy=function(){return zH(e,ZH()).exponent(e.exponent())},qF.apply(e,arguments)}function JH(){return ZH.apply(null,arguments).exponent(.5)}!function(e){yW=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=kW(o),c=CW(o),d=kW(i),f=CW(i),p=kW(a),h=CW(a),y=kW(l),g=CW(l),m=kW(s),v=CW(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:VW,e:VW,f:XW,g:sH,G:cH,H:qW,I:GW,j:YW,L:QW,m:ZW,M:JW,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:DH,s:IH,S:eH,u:tH,U:nH,V:oH,w:iH,W:aH,x:null,X:null,y:lH,Y:uH,Z:dH,"%":MH},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:fH,e:fH,f:mH,g:EH,G:PH,H:pH,I:hH,j:yH,L:gH,m:vH,M:bH,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:DH,s:IH,S:xH,u:wH,U:jH,V:kH,w:CH,W:_H,x:null,X:null,y:OH,Y:TH,Z:AH,"%":MH},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:NW,e:NW,f:WW,g:MW,G:AW,H:FW,I:FW,j:LW,L:zW,m:RW,M:BW,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:IW,Q:KW,s:$W,S:UW,u:OW,U:EW,V:TW,w:_W,W:PW,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:MW,Y:AW,Z:DW,"%":HW};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=vW[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=hW(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=pW(hW(i.y,0,1))).getUTCDay(),r=o>4||0===o?Xz.ceil(r):Xz(r),r=Bz.offset(r,7*(i.V-1)),i.y=r.getUTCFullYear(),i.m=r.getUTCMonth(),i.d=r.getUTCDate()+(i.w+6)%7):(o=(r=fW(hW(i.y,0,1))).getDay(),r=o>4||0===o?Hz.ceil(r):Hz(r),r=Fz.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?pW(hW(i.y,0,1)).getUTCDay():fW(hW(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,pW(i)):fW(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 vW?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),gW=yW.format,yW.parse,mW=yW.utcFormat,yW.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 eK=["linear","time","log","sqrt"];function tK(e){return"function"===typeof e?NL()(e.copy)&&NL()(e.domain)&&NL()(e.range):"string"===typeof e&&CF()(eK,e)}function nK(e,t){return!!e.scale&&(!e.scale.x&&!e.scale.y||!!e.scale[t])}function rK(e,t){if(!e.data)return"linear";var n=XL(e[t]);return uL(e.data.map((function(e){var r=dF()(n(e))?n(e)[t]:n(e);return void 0!==r?r:e[t]})))?"time":"linear"}function oK(e){if(tK(e)){var t=function(e){return"scale".concat(function(e){return e&&e[0].toUpperCase()+e.slice(1)}(e))}(e);return i[t]()}return WU()}function iK(e,t){var n=aK(e,t);if(n)return"string"===typeof n?oK(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 uL(n)?"time":"linear"}(e,t)||rK(e,t);return oK(r)}function aK(e,t){if(nK(e,t)){var n=e.scale[t]||e.scale;return tK(n)?NL()(n)?n:oK(n):void 0}}function lK(e,t){return function(e,t){if(nK(e,t)){var n=e.scale[t]||e.scale;return"string"===typeof n?n:uK(n)}}(e,t)||rK(e,t)}var sK=[{name:"quantile",method:"quantiles"},{name:"log",method:"base"}];function uK(e){if("string"===typeof e)return e;var t=sK.filter((function(t){return void 0!==e[t.method]}))[0];return t?t.name:void 0}var cK="@@__IMMUTABLE_ITERABLE__@@",dK="@@__IMMUTABLE_RECORD__@@",fK="@@__IMMUTABLE_LIST__@@";function pK(e){return!(!e||!e[cK])}function hK(e){return pK(e)||function(e){return!(!e||!e[dK])}(e)}function yK(e,t){return pK(e)?e.reduce((function(e,n,r){return t&&t[r]&&(n=yK(n)),e[r]=n,e}),function(e){return!(!e||!e[fK])}(e)?[]:{}):e}function gK(e){return function(e){if(Array.isArray(e))return mK(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 mK(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 mK(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 mK(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 vK(e){return hK(e)?yK(e,{errorX:!0,errorY:!0}):e}function bK(e){return pK(e)?e.size:e.length}function xK(e,t){var n=(dF()(e.domain)?e.domain[t]:e.domain)||iK(e,t).domain(),r=e.samples||1,o=Math.max.apply(Math,gK(n)),i=Math.min.apply(Math,gK(n)),a=(o-i)/r,l=TF()(i,o,a);return $F()(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 OF()(e,t,r)}function jK(e,t){var n=1/Number.MAX_SAFE_INTEGER,r={x:lK(t,"x"),y:lK(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 ZN()({},e,{_x:t,_y:r,_y0:i})}(e)}))}function SK(e,t){var n=!!e.eventKey,r=function(e){return NL()(e)?e:null===e||void 0===e?function(){}:IL()(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?ZN()({eventKey:o},e):e}return e}))}function kK(e,t){var n=EK(e,t),r=TK(e,t),o=function(e,t){var n=Array.isArray(e.data)||pK(e.data);if(!n)return[];var r=void 0===e[t]?t:e[t],o=XL(r),i=e.data.reduce((function(e,t){return e.push(vK(t)),e}),[]),a=wK(i,e.sortKey,e.sortOrder);return a.reduce((function(e,t){return t=vK(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=bF()([].concat(gK(n),gK(r),gK(o)));return 0===i.length?null:i.reduce((function(e,t,n){return e[t]=n+1,e}),{})}function CK(e,t,n){if(!(Array.isArray(e)||pK(e))||bK(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]=XL(void 0!==t[r=n]?t[r]:r),e}),{}),a=HF()(n,r)&&"_x"===t.x&&"_y"===t.y&&"_y0"===t.y0;!1===a&&(o={x:-1!==n.indexOf("x")?kK(t,"x"):void 0,y:-1!==n.indexOf("y")?kK(t,"y"):void 0,y0:-1!==n.indexOf("y0")?kK(t,"y"):void 0});var l=a?e:e.reduce((function(e,t,r){var a={x:r,y:t=vK(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=ZN()({},l,t);return QN()(s)||e.push(s),e}),[]),s=jK(wK(l,t.sortKey,t.sortOrder),t);return SK(t,s)}function _K(e,t){return e.categories&&!Array.isArray(e.categories)?e.categories[t]:e.categories}function OK(e){return e.data?CK(e.data,e):CK(function(e){var t=xK(e,"x"),n=xK(e,"y"),r=t.map((function(e,t){return{x:e,y:n[t]}}));return r}(e),e)}function EK(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 TK(e,t){if(!e.categories)return[];var n=_K(e,t),r=n&&n.filter((function(e){return"string"===typeof e}));return r?dL(r):[]}function PK(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 CF()(["area","bar","boxplot","candlestick","errorbar","group","histogram","line","pie","scatter","stack","voronoi"],n)}function AK(e){return function(e){if(Array.isArray(e))return MK(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 MK(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 MK(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 MK(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 DK(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"min",r=function(e){return"max"===n?Math.max.apply(Math,AK(e)):Math.min.apply(Math,AK(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 IK(e,t,n){if(!t.domainPadding)return e;var r=HK(t,n),o=WK(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 dF()(e.domainPadding)?n(e.domainPadding[t]):n(e.domainPadding)}(t,n);if(!i.left&&!i.right)return e;var a=pL(e),l=fL(e),s=QL(t,JL(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=dF()(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?BK(new Date(x.min),new Date(x.max)):BK(x.min,x.max)}function RK(e,t){return e=NL()(e)?e:FK,t=NL()(t)?t:NK,function(n,r){var o=UK(n,r);if(o)return t(o,n,r);var i=_K(n,r),a=i?function(e,t,n){n=n||_K(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=HK(e,t),u=WK(e,t),c=sL(n)?TK(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:pL(f),h=void 0!==u?u:fL(f),y=BK(p,h);return r&&"x"===t&&360===Math.abs(i-l)?KK(y,f):y}(n,r,i):e(n,r);return a?t(a,n,r):void 0}}function NK(e,t,n){return function(e,t,n){return"log"!==lK(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)}(IK(e,t,n),t,n)}function LK(e,t){return RK()(e,t)}function FK(e,t,n){n=n||OK(e);var r=e.polar,o=e.startAngle,i=void 0===o?0:o,a=e.endAngle,l=void 0===a?360:a,s=HK(e,t),u=WK(e,t);if(n.length<1)return void 0!==s&&void 0!==u?BK(s,u):void 0;var c=BK(void 0!==s?s:DK(n,t,"min"),void 0!==u?u:DK(n,t,"max"));return r&&"x"===t&&360===Math.abs(i-l)?KK(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 BK(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 UK(e,t){var n=HK(e,t),r=WK(e,t);return dF()(e.domain)&&e.domain[t]?e.domain[t]:Array.isArray(e.domain)?e.domain:void 0!==n&&void 0!==r?BK(n,r):void 0}function zK(e,t){var n=UK(e,t);if(n)return n;var r=OK(e),o=r.reduce((function(e,t){return t._y0<e?t._y0:e}),1/0);return RK((function(){return FK(e,t,r)}),(function(n){return NK(function(n){if("x"===t)return n;var r=o!==1/0?o:0,i=WK(e,t),a=HK(e,t),l=void 0!==i?i:fL(n,r);return BK(void 0!==a?a:pL(n,r),l)}(n),e,t)}))(e,t)}function WK(e,t){return dF()(e.maxDomain)&&void 0!==e.maxDomain[t]?e.maxDomain[t]:"number"===typeof e.maxDomain||RF()(e.maxDomain)?e.maxDomain:void 0}function HK(e,t){return dF()(e.minDomain)&&void 0!==e.minDomain[t]?e.minDomain[t]:"number"===typeof e.minDomain||RF()(e.minDomain)?e.minDomain:void 0}function KK(e,t){var n=LF()(t.sort((function(e,t){return e-t}))),r=n[1]-n[0];return[e[0],e[1]+r]}function $K(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 CF()(["area","axis","bar","boxplot","candlestick","errorbar","group","histogram","line","pie","scatter","stack","voronoi"],n)}function VK(e){return function(e){if(Array.isArray(e))return qK(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 qK(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 qK(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 qK(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 GK(e){return e.dependentAxis?"y":"x"}function YK(e,t){t=t||mL();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 QK(e,t){return YK(e,(function(e){return e.type.getAxis(e.props)===t}))[0]}function XK(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 ZK(e){var t=function(e){var t=Math.min.apply(Math,VK(e)),n=Math.max.apply(Math,VK(e));return n<0?n:Math.max(0,t)};return{x:uL(e.x)?new Date(Math.min.apply(Math,VK(e.x))):t(e.x),y:uL(e.y)?new Date(Math.min.apply(Math,VK(e.y))):t(e.y)}}function JK(e,t){return uL(t)?"positive":e<=0&&Math.max.apply(Math,VK(t))<=0?"negative":"positive"}function e$(e){return{top:!1,bottom:!1,left:!0,right:!0}[e.orientation||(e.dependentAxis?"left":"bottom")]}function t$(e){return void 0!==e.tickValues&&sL(e.tickValues)}function n$(e){var t,n=GK(e),r=e.stringMap&&e.stringMap[n],o=Array.isArray(e.categories)?e.categories:e.categories&&e.categories[n],i=o&&(lL(t=o)&&t.every((function(e){return"string"===typeof e})))?o.map((function(e){return r[e]})):void 0,a=r&&pF()(r);return i&&0!==i.length?i:a}function r$(e){var t=e.tickValues,n=e.tickFormat,r=GK(e),o=e.stringMap&&e.stringMap[r],i=t;o&&(i=n$(e)),t&&sL(t)&&(i=o?t.map((function(e){return o[e]})):TF()(1,t.length+1));var a=i?bF()(i):function(){if(n&&Array.isArray(n))return sL(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>=pL(o)&&e<=fL(o)&&n.push({value:e,index:t}):n.push({value:e,index:t})})),n}(a):void 0}function o$(e,t){var n=e.tickFormat,r=GK(e),o=e.stringMap&&e.stringMap[r];if(!n){var i=function(e){var t=e.tickValues,n=GK(e),r=e.stringMap&&e.stringMap[n],o=t&&!uL(t)?function(e){return e}:void 0;if(!r)return t$(e)?function(e,n){return t[n]}:o;var i=r&&AF()(r),a=OF()(pF()(r),(function(e){return e})),l=a.map((function(e){return i[e]})),s=[""].concat(VK(l),[""]);return function(e){return s[e]}}(e),a=t.tickFormat&&NL()(t.tickFormat)?t.tickFormat():function(e){return e};return i||a}if(n&&Array.isArray(n)){var l=r$(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&&NL()(n)){return o?function(t,n,r){var i=AF()(o),a=r.map((function(e){return i[e]}));return e.tickFormat(i[t],n,a)}:n}return function(e){return e}}function i$(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 a$(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.tickCount,o=r$(e),i=o?o.map((function(e){return e.value})):void 0;if(i)return i$(i,r);if(t.ticks&&NL()(t.ticks)){var a=r||5,l=t.ticks(a),s=i$(Array.isArray(l)&&l.length?l:t.domain(),r);if(n){var u=CF()(s,0)?SF()(s,0):s;return u.length?u:s}return s}return t.domain()}function l$(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=r$(e),s=l?l.map((function(e){return e.value})):void 0;if(Array.isArray(s)){var u=HK(e,t),c=WK(e,t),d=t$(e),f=s.map((function(e){return Number(e)})),p=d?1:pL(f),h=d?s.length:fL(f),y=BK(void 0!==u?u:p,void 0!==c?c:h),g=n&&"x"===t&&360===Math.abs(o-a)?KK(y,f):y;return e$(e)&&!n&&g.reverse(),g}}function s$(e,t){var n=GK(e);if(!t||t===n)return RK(l$)(e,n)}function u$(e,t){if(e.axisValue){var n="x"===t?"y":"x",r=DF()(e.scale)&&NL()(e.scale[n])?e.scale[n]:void 0;if(r){var o="x"===t?"y":"x",i=DF()(e.stringMap)&&e.stringMap[o];return r(i&&"string"===typeof e.axisValue?i[e.axisValue]:e.axisValue)}}}function c$(e,t){if(!DF()(e.theme))return ZL(e,t,"axis");var n="axis";if(e.dependentAxis&&e.theme.dependentAxis?n="dependentAxis":!e.dependentAxis&&e.theme.independentAxis&&(n="independentAxis"),"axis"===n)return ZL(e,t,"axis");var r=eL()({},e.theme[n],e.theme.axis),o=ZN()({},e.theme,{axis:r});return ZL(ZN()({},e,{theme:o}),t,"axis")}var d$=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,d$(t)].join(" ")}),d$(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 f$=n(9693),p$=n.n(f$);function h$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y$(e){return function(e){if(Array.isArray(e))return g$(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 g$(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 g$(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 g$(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m$=/^onGlobal(.*)$/;function v$(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)?CF()(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?ZN()(e,t.eventHandlers):e}),{})},a=function(){var t;return Array.isArray(o.componentEvents)?Array.isArray(e.events)?(t=o.componentEvents).concat.apply(t,y$(e.events)):o.componentEvents:e.events}(),l=a&&NL()(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 ZN()({},u,l)}function b$(e,t,n,r){var o=this;if(QN()(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(!NL()(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(ZN()({},l,u),r),d=a[n]||{},f=function(e){return c?function(e){return"parent"===s?ZN()(e,h$({},t,ZN()(e[t],c))):ZN()(e,h$({},t,ZN()(e[t],h$({},s,c))))}(e):function(e){return e[t]&&e[t][s]&&delete e[t][s],e[t]&&!yL()(e[t]).length&&delete e[t],e}(e)};return void 0!==n&&null!==n?ZN()(a,h$({},n,f(d))):f(a)},c=function(t){var n=function(t){return"parent"===s?"parent":"all"===e.eventKey?r[t]?SF()(yL()(r[t]),"parent"):SF()(yL()(r),"parent"):void 0===e.eventKey&&"parent"===a?r[t]?yL()(r[t]):yL()(r):void 0!==e.eventKey?e.eventKey:a}(t);return Array.isArray(n)?n.reduce((function(e,n){return ZN()(e,u(n,t))}),{}):u(n,t)},d="all"===l?SF()(yL()(r),"parent"):l;return Array.isArray(d)?d.reduce((function(e,t){return ZN()(e,c(t))}),{}):c(d)},l=function(t,n,r,i){var l=e[i](t,n,r,o);if(!QN()(l)){var s=function(e){var t=function(e){return NL()(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 ZN()({},e,a(n,t))}),{}):a(e,t)}(l,r),s)}};return yL()(e).reduce((function(e,t){return e[t]=l,e}),{})}function x$(e,t,n){return e?yL()(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 j$(e,t,n,r){return t=t||{},n=n||{},yL()(t).reduce((function(o,i){var a=n[i]||{},l=t[i]||{};if("parent"===i){var s=S$(e,l,a,{eventKey:i,target:"parent"});o[i]=void 0!==s?ZN()({},a,s):a}else{var u=bF()(yL()(l).concat(yL()(a)));o[i]=u.reduce((function(t,n){var o={eventKey:i,target:n,childName:r},s=S$(e,l[n],a[n],o);return t[n]=void 0!==s?ZN()({},a[n],s):a[n],p$()(t,(function(e){return!QN()(e)}))}),{})}return p$()(o,(function(e){return!QN()(e)}))}),{})}function S$(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 CF()(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(!QN()(a)){var l=a.filter((function(e){return o(e,"eventKey")}));if(!QN()(l))return l.reduce((function(e,r){var o=(r&&NL()(r.mutation)?r.mutation:function(){})(ZN()({},t,n));return ZN()({},e,o)}),{})}}function k$(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=NL()(i)?i(o.props):i;return t=Array.isArray(a)?(r=t).concat.apply(r,y$(a)):t}),[]);return n&&n.length?n:void 0}function C$(e){var t=e.match(m$);return t&&t[1]&&t[1].toLowerCase()}var _$=function(e){return p$()(e,(function(e,t){return m$.test(t)}))},O$=function(e){return BF()(e,(function(e,t){return m$.test(t)}))},E$=function(e){return ZN()(e,{nativeEvent:e})};function T$(e){0}function P$(e){return function(e){if(Array.isArray(e))return A$(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 A$(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 A$(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 A$(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 M$(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 D$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M$(Object(n),!0).forEach((function(t){I$(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function I$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R$(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&&T$(),!a)return o;var l=n.bins||r[0].props.bins;if(!Array.isArray(l)){var s=t.reduce((function(e,t){var n=XL(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 D$(D$({},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=eF(o,(function(e,t,o){var i,a=ZN()({},e.props,n);return PK(e)?(i=e.type&&NL()(e.type.getData)?(e=o?h.cloneElement(e,o.props):e).type.getData(a):OK(a),r+=1,i.map((function(e,t){return ZN()({_stack:r,_group:t},e)}))):null}),e,[],(function(e,t){return e.concat(yF()(t,"_group"))})),l=i?"_group":"_stack";return pF()(mF()(a,l))}function N$(e,t,n){var r=e.datasets,o=QL(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 L$(e,t,n){n=n||h.Children.toArray(e.children);var r,o=UK(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||N$(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=HK(e,t),l=WK(e,t),s=(e.data||e.y)&&OK(e),u=s?FK(e,t,s):[],c=function(e,t,n){var r=n?n.slice(0):h.Children.toArray(e.children),o=e.data?OK(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?ZN()(d,{data:o}):d,p=eF(r,(function(e){var n=ZN()({},e.props,f);return $K(e)?e.type&&NL()(e.type.getDomain)?e.props&&e.type.getDomain(n,t):LK(n,t):null}),e);return[0===p.length?0:pL(p),0===p.length?1:fL(p)]}(e,t,n);r=BK(a||pL([].concat(P$(u),P$(c))),l||fL([].concat(P$(u),P$(c))))}return NK(r,ZN()({domainPadding:i},e),t)}function F$(e,t,n){if(e.data)return iK(e,t);var r=n?n.slice(0):h.Children.toArray(e.children),o=bF()(eF(r,(function(n){return lK(ZN()({},n.props,{horizontal:e.horizontal}),t)}),e));return o.length>1?oK("linear"):oK(o[0])}function B$(e){var t=k$(e,["groupComponent","containerComponent","labelComponent"]),n=e.events;return Array.isArray(t)&&(n=Array.isArray(e.events)?t.concat.apply(t,P$(e.events)):t),n||[]}function U$(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:N$(n)},c=eL()({},i.data,ZN()({},u,r.data,s)),d=eL()({},i.labels,r.labels);return{parent:r.parent,data:c,labels:d}}function z$(e,t,n){var r=dF()(e.categories)?e.categories[t]:e.categories,o=QK(n,t),i=o?EK(o.props,t):[],a=r||function(e,t){return eF(e.slice(0),(function(e){var n=e.props||{};if(!$K(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?dL(o):[]}))}(n,t);return bF()(wF()([].concat(P$(a),P$(i))))}function W$(e,t){var n=z$(e,"x",t=t||h.Children.toArray(e.children)),r=z$(e,"y",t),o=function(e){return eF(e.slice(0),(function(e){var t=e.props||{};return PK(e)?(e.type&&NL()(e.type.getData)?e.type.getData(t):OK(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:bF()(wF()([].concat(P$(n),P$(o.x)))),y:bF()(wF()([].concat(P$(r),P$(o.y))))}}function H$(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||W$(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 K$(e){var t=h.useRef();return h.useEffect((function(){t.current=e})),t.current}var $$=n(8522),V$=n.n($$),q$=n(1314),G$=n.n(q$),Y$=n(3139),Q$=n.n(Y$);var X$=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)})},Z$=function(){return null},J$=function(){},eV=function(e){return void 0===e?J$:null===e?Z$:e.constructor},tV=function(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).slice(8,-1)};function nV(e,t){return function(n,r,o){var i=n[r];return null!==i&&void 0!==i&&T$('"'.concat(r,'" property of "').concat(o,'" has been deprecated ').concat(t)),V$().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 rV(e){return X$((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 oV=X$((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})),iV=X$((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})),aV=X$((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})),lV=X$((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."))})),sV=X$((function(e,t,n){return tK(e[t])?null:new Error("`".concat(t,"` in `").concat(n,"` must be a d3 scale."))})),uV=X$((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=eV(r[0]),i=Q$()(r,(function(e){return o!==eV(e)}));if(i){var a=tV(r[0]),l=tV(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})),cV=(X$((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})),X$((function(e,t,n){return e[t]&&!G$()(e[t])?new Error("`".concat(t,"` in `").concat(n,"` must be a regular expression.")):null}))),dV={dataProps:{categories:V$().oneOfType([V$().arrayOf(V$().string),V$().shape({x:V$().arrayOf(V$().string),y:V$().arrayOf(V$().string)})]),data:V$().oneOfType([V$().array,V$().object]),dataComponent:V$().element,disableInlineStyles:V$().bool,labelComponent:V$().element,labels:V$().oneOfType([V$().func,V$().array]),samples:oV,sortKey:V$().oneOfType([V$().func,rV([iV,oV]),V$().string,V$().arrayOf(V$().string.isRequired)]),sortOrder:V$().oneOf(["ascending","descending"]),style:V$().shape({parent:V$().object,data:V$().object,labels:V$().object}),x:V$().oneOfType([V$().func,rV([iV,oV]),V$().string,V$().arrayOf(V$().string.isRequired)]),y:V$().oneOfType([V$().func,rV([iV,oV]),V$().string,V$().arrayOf(V$().string.isRequired)]),y0:V$().oneOfType([V$().func,rV([iV,oV]),V$().string,V$().arrayOf(V$().string.isRequired)])},baseProps:{animate:V$().oneOfType([V$().bool,V$().object]),containerComponent:V$().element,domain:V$().oneOfType([lV,V$().shape({x:lV,y:lV})]),maxDomain:V$().oneOfType([V$().number,V$().instanceOf(Date),V$().shape({x:V$().oneOfType([V$().number,V$().instanceOf(Date)]),y:V$().oneOfType([V$().number,V$().instanceOf(Date)])})]),minDomain:V$().oneOfType([V$().number,V$().instanceOf(Date),V$().shape({x:V$().oneOfType([V$().number,V$().instanceOf(Date)]),y:V$().oneOfType([V$().number,V$().instanceOf(Date)])})]),domainPadding:V$().oneOfType([V$().shape({x:V$().oneOfType([V$().number,V$().arrayOf(V$().number)]),y:V$().oneOfType([V$().number,V$().arrayOf(V$().number)])}),V$().number,V$().arrayOf(V$().number)]),eventKey:V$().oneOfType([V$().func,rV([iV,oV]),V$().string]),events:V$().arrayOf(V$().shape({target:V$().oneOf(["data","labels","parent"]),eventKey:V$().oneOfType([V$().array,rV([iV,oV]),V$().string]),eventHandlers:V$().object})),externalEventMutations:V$().arrayOf(V$().shape({callback:V$().func,childName:V$().oneOfType([V$().string,V$().array]),eventKey:V$().oneOfType([V$().array,rV([iV,oV]),V$().string]),mutation:V$().func,target:V$().oneOfType([V$().string,V$().array])})),groupComponent:V$().element,height:oV,name:V$().string,origin:V$().shape({x:V$().number,y:V$().number}),padding:V$().oneOfType([V$().number,V$().shape({top:V$().number,bottom:V$().number,left:V$().number,right:V$().number})]),polar:V$().bool,range:V$().oneOfType([lV,V$().shape({x:lV.isRequired,y:lV.isRequired})]),scale:V$().oneOfType([sV,V$().shape({x:sV.isRequired,y:sV.isRequired})]),sharedEvents:V$().shape({events:V$().array,getEventState:V$().func}),singleQuadrantDomainPadding:V$().oneOfType([V$().bool,V$().shape({x:V$().oneOfType([V$().bool]),y:V$().oneOfType([V$().bool])})]),standalone:V$().bool,theme:V$().object,width:oV},primitiveProps:{active:V$().bool,ariaLabel:V$().oneOfType([V$().string,V$().func]),className:V$().string,clipPath:V$().string,data:V$().oneOfType([V$().array,V$().object]),desc:V$().oneOfType([V$().string,V$().func]),disableInlineStyles:V$().bool,events:V$().object,id:V$().oneOfType([V$().number,V$().string,V$().func]),index:V$().oneOfType([V$().number,V$().string]),origin:V$().shape({x:V$().number,y:V$().number}),polar:V$().bool,role:V$().string,scale:V$().oneOfType([sV,V$().shape({x:sV,y:sV})]),shapeRendering:V$().string,style:V$().object,tabIndex:V$().oneOfType([V$().number,V$().func]),transform:V$().string}},fV=["desc"];function pV(){return pV=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},pV.apply(this,arguments)}function hV(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 yV=function(e){var t=e.desc,n=hV(e,fV);return t?h.createElement("rect",pV({vectorEffect:"non-scaling-stroke"},n),h.createElement("desc",null,t)):h.createElement("rect",pV({vectorEffect:"non-scaling-stroke"},n))},gV=["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 vV(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 bV=function(e){var t=e.desc,n=vV(e,gV);return t?h.createElement("circle",mV({vectorEffect:"non-scaling-stroke"},n),h.createElement("desc",null,t)):h.createElement("circle",mV({vectorEffect:"non-scaling-stroke"},n))};function xV(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 wV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xV(Object(n),!0).forEach((function(t){jV(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xV(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var SV=function(e){return e=function(e){var t=KL(e.id,e);return ZN()({},e,{id:t})}(e),e.polar?h.cloneElement(e.circleComponent,wV(wV({},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,wV(wV({},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}))};SV.propTypes=wV(wV({},dV.primitiveProps),{},{circleComponent:V$().element,height:V$().number,rectComponent:V$().element,rx:V$().number,ry:V$().number,width:V$().number,x:V$().number,y:V$().number}),SV.defaultProps={circleComponent:h.createElement(bV,null),rectComponent:h.createElement(yV,null),role:"presentation",shapeRendering:"auto"};var kV=n(5603),CV=n.n(kV);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 OV(e,t){return OV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OV(e,t)}function EV(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(Wa){return!1}}();return function(){var n,r=TV(e);if(t){var o=TV(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 TV(e){return TV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},TV(e)}var PV=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&&OV(e,t)}(i,e);var t,n,r,o=EV(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 yL()(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);PV.displayName="Portal",PV.propTypes={className:V$().string,height:oV,style:V$().object,viewBox:V$().string,width:oV};var AV=h.createContext({});AV.displayName="PortalContext";var MV,DV,IV=0,RV=0,NV=0,LV=1e3,FV=0,BV=0,UV=0,zV="object"===typeof performance&&performance.now?performance:Date,WV="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function HV(){return BV||(WV(KV),BV=zV.now()+UV)}function KV(){BV=0}function $V(){this._call=this._time=this._next=null}function VV(e,t,n){var r=new $V;return r.restart(e,t,n),r}function qV(){BV=(FV=zV.now())+UV,IV=RV=0;try{!function(){HV(),++IV;for(var e,t=MV;t;)(e=BV-t._time)>=0&&t._call.call(void 0,e),t=t._next;--IV}()}finally{IV=0,function(){var e,t,n=MV,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:MV=t);DV=e,YV(r)}(),BV=0}}function GV(){var e=zV.now(),t=e-FV;t>LV&&(UV-=t,FV=e)}function YV(e){IV||(RV&&(RV=clearTimeout(RV)),e-BV>24?(e<1/0&&(RV=setTimeout(qV,e-zV.now()-UV)),NV&&(NV=clearInterval(NV))):(NV||(FV=zV.now(),NV=setInterval(GV,LV)),IV=1,WV(qV)))}function QV(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)}}$V.prototype=VV.prototype={constructor:$V,restart:function(e,t,n){if("function"!==typeof e)throw new TypeError("callback is not a function");n=(null==n?HV():+n)+(null==t?0:+t),this._next||DV===this||(DV?DV._next=this:MV=this,DV=this),this._call=e,this._time=n,YV()},stop:function(){this._call&&(this._call=null,this._time=1/0,YV())}};var XV=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(HV()-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=VV(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:HV(),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&&QV(t.prototype,n),r&&QV(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),ZV=h.createContext({transitionTimer:new XV,animationTimer:new XV});ZV.displayName="TimerContext";var JV=ZV;function eq(){return eq=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},eq.apply(this,arguments)}function tq(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 nq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tq(Object(n),!0).forEach((function(t){rq(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tq(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}function oq(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 iq(e,t){return iq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iq(e,t)}function aq(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(Wa){return!1}}();return function(){var n,r=lq(e);if(t){var o=lq(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 lq(e){return lq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lq(e)}var sq=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&&iq(e,t)}(i,e);var t,n,r,o=aq(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 NL()(t.props.containerRef)&&t.props.containerRef(e),t.containerRef=e,e},t.handleWheel=function(e){return e.preventDefault()},t.containerId=DF()(e)&&void 0!==e.containerId?e.containerId:CV()("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 nq(nq(nq({},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=ZN()({pointerEvents:"none",touchAction:"none",position:"relative"},f),y=ZN()({zIndex:u,position:"absolute",top:0,left:0},f),g=ZN()({pointerEvents:"all"},f),m=ZN()({overflow:"visible"},f),v={width:l,height:s,viewBox:t.viewBox,preserveAspectRatio:t.preserveAspectRatio,style:m};return h.createElement(AV.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},h.createElement("div",eq({style:eL()({},n,p),className:a,ref:this.saveContainerRef},this.getOUIAProps(e)),h.createElement("svg",eq({},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,nq(nq({},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:LL(this.props.style,["height","width"]),d=sF(this.props),f=ZN()(nq({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&&oq(t.prototype,n),r&&oq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);sq.displayName="VictoryContainer",sq.role="container",sq.propTypes={"aria-describedby":V$().string,"aria-labelledby":V$().string,children:V$().oneOfType([V$().arrayOf(V$().node),V$().node]),className:V$().string,containerId:V$().oneOfType([V$().number,V$().string]),containerRef:V$().func,desc:V$().string,events:V$().object,height:oV,name:V$().string,origin:V$().shape({x:oV,y:oV}),ouiaId:V$().oneOfType([V$().number,V$().string]),ouiaSafe:V$().bool,ouiaType:V$().string,polar:V$().bool,portalComponent:V$().element,portalZIndex:iV,preserveAspectRatio:V$().string,responsive:V$().bool,role:V$().string,style:V$().object,tabIndex:V$().number,theme:V$().object,title:V$().string,width:oV},sq.defaultProps={className:"VictoryContainer",portalComponent:h.createElement(PV,null),portalZIndex:99,responsive:!0,role:"img"},sq.contextType=JV;var uq=["#252525","#525252","#737373","#969696","#bdbdbd","#d9d9d9","#f0f0f0"],cq="#252525",dq="#969696",fq={width:450,height:300,padding:50,colorScale:uq},pq={fontFamily:"'Gill Sans', 'Seravek', 'Trebuchet MS', sans-serif",fontSize:14,letterSpacing:"normal",padding:10,fill:cq,stroke:"transparent"},hq=ZN()({textAnchor:"middle"},pq),yq={area:ZN()({style:{data:{fill:cq},labels:pq}},fq),axis:ZN()({style:{axis:{fill:"transparent",stroke:cq,strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:ZN()({},hq,{padding:25}),grid:{fill:"none",stroke:"none",pointerEvents:"painted"},ticks:{fill:"transparent",size:1,stroke:"transparent"},tickLabels:pq}},fq),bar:ZN()({style:{data:{fill:cq,padding:8,strokeWidth:0},labels:pq}},fq),boxplot:ZN()({style:{max:{padding:8,stroke:cq,strokeWidth:1},maxLabels:ZN()({},pq,{padding:3}),median:{padding:8,stroke:cq,strokeWidth:1},medianLabels:ZN()({},pq,{padding:3}),min:{padding:8,stroke:cq,strokeWidth:1},minLabels:ZN()({},pq,{padding:3}),q1:{padding:8,fill:dq},q1Labels:ZN()({},pq,{padding:3}),q3:{padding:8,fill:dq},q3Labels:ZN()({},pq,{padding:3})},boxWidth:20},fq),candlestick:ZN()({style:{data:{stroke:cq,strokeWidth:1},labels:ZN()({},pq,{padding:5})},candleColors:{positive:"#ffffff",negative:cq}},fq),chart:fq,errorbar:ZN()({borderWidth:8,style:{data:{fill:"transparent",stroke:cq,strokeWidth:2},labels:pq}},fq),group:ZN()({colorScale:uq},fq),histogram:ZN()({style:{data:{fill:dq,stroke:cq,strokeWidth:2},labels:pq}},fq),legend:{colorScale:uq,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:pq,title:ZN()({},pq,{padding:5})}},line:ZN()({style:{data:{fill:"transparent",stroke:cq,strokeWidth:2},labels:pq}},fq),pie:{style:{data:{padding:10,stroke:"transparent",strokeWidth:1},labels:ZN()({},pq,{padding:20})},colorScale:uq,width:400,height:400,padding:50},scatter:ZN()({style:{data:{fill:cq,stroke:"transparent",strokeWidth:0},labels:pq}},fq),stack:ZN()({colorScale:uq},fq),tooltip:{style:ZN()({},pq,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:cq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:ZN()({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:ZN()({},pq,{padding:5,pointerEvents:"none"}),flyout:{stroke:cq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},fq)},gq=["#F4511E","#FFF59D","#DCE775","#8BC34A","#00796B","#006064"],mq="#ECEFF1",vq="#90A4AE",bq="#455A64",xq="#212121",wq={width:350,height:350,padding:50},jq={fontFamily:"'Helvetica Neue', 'Helvetica', sans-serif",fontSize:12,letterSpacing:"normal",padding:8,fill:bq,stroke:"transparent",strokeWidth:0},Sq=ZN()({textAnchor:"middle"},jq),kq="round",Cq="round",_q={grayscale:yq,material:{area:ZN()({style:{data:{fill:xq},labels:jq}},wq),axis:ZN()({style:{axis:{fill:"transparent",stroke:vq,strokeWidth:2,strokeLinecap:kq,strokeLinejoin:Cq},axisLabel:ZN()({},Sq,{padding:8,stroke:"transparent"}),grid:{fill:"none",stroke:mq,strokeDasharray:"10, 5",strokeLinecap:kq,strokeLinejoin:Cq,pointerEvents:"painted"},ticks:{fill:"transparent",size:5,stroke:vq,strokeWidth:1,strokeLinecap:kq,strokeLinejoin:Cq},tickLabels:ZN()({},jq,{fill:bq})}},wq),polarDependentAxis:ZN()({style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}}),bar:ZN()({style:{data:{fill:bq,padding:8,strokeWidth:0},labels:jq}},wq),boxplot:ZN()({style:{max:{padding:8,stroke:bq,strokeWidth:1},maxLabels:ZN()({},jq,{padding:3}),median:{padding:8,stroke:bq,strokeWidth:1},medianLabels:ZN()({},jq,{padding:3}),min:{padding:8,stroke:bq,strokeWidth:1},minLabels:ZN()({},jq,{padding:3}),q1:{padding:8,fill:bq},q1Labels:ZN()({},jq,{padding:3}),q3:{padding:8,fill:bq},q3Labels:ZN()({},jq,{padding:3})},boxWidth:20},wq),candlestick:ZN()({style:{data:{stroke:bq},labels:ZN()({},jq,{padding:5})},candleColors:{positive:"#ffffff",negative:bq}},wq),chart:wq,errorbar:ZN()({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:bq,strokeWidth:2},labels:jq}},wq),group:ZN()({colorScale:gq},wq),histogram:ZN()({style:{data:{fill:bq,stroke:xq,strokeWidth:2},labels:jq}},wq),legend:{colorScale:gq,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:jq,title:ZN()({},jq,{padding:5})}},line:ZN()({style:{data:{fill:"transparent",opacity:1,stroke:bq,strokeWidth:2},labels:jq}},wq),pie:ZN()({colorScale:gq,style:{data:{padding:8,stroke:mq,strokeWidth:1},labels:ZN()({},jq,{padding:20})}},wq),scatter:ZN()({style:{data:{fill:bq,opacity:1,stroke:"transparent",strokeWidth:0},labels:jq}},wq),stack:ZN()({colorScale:gq},wq),tooltip:{style:ZN()({},jq,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:xq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:ZN()({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:ZN()({},jq,{padding:5,pointerEvents:"none"}),flyout:{stroke:xq,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},wq)}},Oq=n(9010),Eq=n.n(Oq),Tq=n(4256),Pq=n.n(Tq),Aq=n(1513),Mq=n.n(Aq),Dq=n(1320),Iq=n.n(Dq),Rq=n(2211),Nq=n.n(Rq);function Lq(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)||Bq(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 Fq(e){return function(e){if(Array.isArray(e))return Uq(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Bq(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 Bq(e,t){if(e){if("string"===typeof e)return Uq(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)?Uq(e,t):void 0}}function Uq(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 zq(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 Wq(e,t){return Wq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Wq(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(Wa){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 Kq(e)}(this,n)}}function Kq(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $q(e){return $q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$q(e)}var Vq=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&&Wq(e,t)}(i,e);var t,n,r,o=Hq(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=b$.bind(Kq(t)),t.getEventState=w$.bind(Kq(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(!Iq()(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=yL()(this.globalEvents);t.forEach((function(t){return e.addGlobalListener(t)})),this.prevGlobalEventKeys=t}},{key:"componentDidUpdate",value:function(){var e=this,t=yL()(this.globalEvents);Eq()(this.prevGlobalEventKeys,t).forEach((function(t){return e.removeGlobalListener(t)})),Eq()(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(E$(n))};this.boundGlobalEvents[e]=n,window.addEventListener(C$(e),n)}},{key:"removeGlobalListener",value:function(e){window.removeEventListener(C$(e),this.boundGlobalEvents[e])}},{key:"getAllEvents",value:function(e){var t=k$(e,["container","groupComponent"]);return Array.isArray(t)?Array.isArray(e.events)?t.concat.apply(t,Fq(e.events)):t:e.events}},{key:"applyExternalMutations",value:function(e,t){if(!QN()(t)){var n=e.externalEventMutations.reduce((function(e,t){return e=NL()(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 QN()(e.externalEventMutations)?void 0:function(e,t,n,r){return t=t||{},n=n||{},r.reduce((function(r,o){var i=n[o],a=j$(e,t[o],n[o],o);return r[o]=a||i,p$()(r,(function(e){return!QN()(e)}))}),{})}(e.externalEventMutations,t,this.state,yL()(t))}},{key:"cacheSharedEvents",value:function(e,t,n){this.sharedEventsCache[e]=[t,n]}},{key:"getCachedSharedEvents",value:function(e,t){var n=Lq(this.sharedEventsCache[e]||[],2),r=n[0],o=n[1];if(r&&Iq()(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 ZN()({},r,{parent:o})}},{key:"getBasePropsFromChildren",value:function(e){var t=eF(e,(function(e,t){if(e.type&&NL()(e.type.getBaseProps)){var n=e.props&&e.type.getBaseProps(e.props);return n?[[t,n]]:null}return null}));return Pq()(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&&NL()(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,Nq()(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,ZN()({key:"events-".concat(f),sharedEvents:g,eventKey:o,name:f},l.props)))}return e.concat(l)}),[])},a=yL()(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=v$.bind(this),d=a&&c({sharedEvents:a},"parent"),f=eL()({},this.getEventState("parent","parent"),u,t.parent,{children:o}),p=eL()({},x$(d,"parent",f),u.events);this.globalEvents=_$(p);var y=O$(p);return"container"===s?h.cloneElement(l,ZN()({},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&&zq(t.prototype,n),r&&zq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);Vq.displayName="VictorySharedEvents",Vq.role="shared-event-wrapper",Vq.propTypes={children:Mq().oneOfType([Mq().arrayOf(Mq().node),Mq().node]),container:Mq().node,eventKey:Mq().oneOfType([Mq().array,Mq().func,rV([iV,oV]),Mq().string]),events:Mq().arrayOf(Mq().shape({childName:Mq().oneOfType([Mq().string,Mq().array]),eventHandlers:Mq().object,eventKey:Mq().oneOfType([Mq().array,Mq().func,rV([iV,oV]),Mq().string]),target:Mq().string})),externalEventMutations:Mq().arrayOf(Mq().shape({callback:Mq().func,childName:Mq().oneOfType([Mq().string,Mq().array]),eventKey:Mq().oneOfType([Mq().array,rV([iV,oV]),Mq().string]),mutation:Mq().func,target:Mq().oneOfType([Mq().string,Mq().array])})),groupComponent:Mq().node},Vq.defaultProps={groupComponent:h.createElement("g",null)},Vq.contextType=JV;var qq=n(5769),Gq=n.n(qq);function Yq(e){return function(e){if(Array.isArray(e))return Qq(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 Qq(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 Qq(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 Qq(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 Xq={"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}},Zq={mm:3.8,sm:38,pt:1.33,pc:16,in:96,px:1},Jq={em:1,ex:.5},eG=1.05,tG=1.15,nG={lineHeight:1,letterSpacing:"0px",fontSize:0,angle:0,fontFamily:""},rG=function(e){return Array.isArray(e)?e:e.toString().split(/\r\n|\r|\n/g)},oG=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)},iG=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?Zq.hasOwnProperty(r)?o*Zq[r]:Jq.hasOwnProperty(r)?(t?o*t:o*nG.fontSize)*Jq[r]:o:o||0},aG=function(e,t){var n=Array.isArray(e)?e[t]:e,r=eL()({},n,nG);return ZN()({},r,{fontFamily:r.fontFamily,letterSpacing:"number"===typeof r.letterSpacing?r.letterSpacing:iG(String(r.letterSpacing),r.fontSize),fontSize:"number"===typeof r.fontSize?r.fontSize:iG(String(r.fontSize))})},lG=function(e,t){if(void 0===e||""===e||null===e)return 0;var n=rG(e).map((function(e,n){var r=e.toString().length,o=aG(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 Xq[e]}))||"Helvetica";return Xq[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,Yq(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:rG(e).reduce((function(e,n,r){var o=aG(t,r),i=n.toString().match(/[(A-Z)(0-9)]/)?o.fontSize*tG:o.fontSize;return e+o.lineHeight*i}),0)}(e,t),o=lG(e,t);return{width:n?oG(o,r,n):o,height:(n?oG(r,o,n):r)*eG}},uG=function(e,t){return sG(e,t)},cG=["desc"];function dG(){return dG=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},dG.apply(this,arguments)}function fG(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 pG=function(e){var t=e.desc,n=fG(e,cG);return t?h.createElement("line",dG({vectorEffect:"non-scaling-stroke"},n),h.createElement("desc",null,t)):h.createElement("line",dG({vectorEffect:"non-scaling-stroke"},n))};function hG(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 yG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hG(Object(n),!0).forEach((function(t){gG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gG(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=KL(e.ariaLabel,e),n=KL(e.desc,e),r=KL(e.id,e),o=$L(ZN()({stroke:"black"},e.style),e),i=KL(e.tabIndex,e);return ZN()({},e,{ariaLabel:t,desc:n,id:r,style:o,tabIndex:i})}(e),h.cloneElement(e.lineComponent,yG(yG({},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 vG(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 bG(e,t){return bG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bG(e,t)}function xG(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(Wa){return!1}}();return function(){var n,r=wG(e);if(t){var o=wG(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 wG(e){return wG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wG(e)}mG.propTypes=yG(yG({},dV.primitiveProps),{},{datum:V$().any,lineComponent:V$().element,x1:V$().number,x2:V$().number,y1:V$().number,y2:V$().number}),mG.defaultProps={lineComponent:h.createElement(pG,null),role:"presentation",shapeRendering:"auto"};var 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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bG(e,t)}(i,e);var t,n,r,o=xG(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&&(T$(),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=eL()(r,n,LL(this.props,["children","groupComponent"])),i=e&&h.cloneElement(e,o);return this.renderPortal(i)}}])&&vG(t.prototype,n),r&&vG(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);jG.displayName="VictoryPortal",jG.role="portal",jG.propTypes={children:V$().node,groupComponent:V$().element},jG.defaultProps={groupComponent:h.createElement("g",null)},jG.contextType=AV;var SG=["children","title","desc"];function kG(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 CG=function(e){var t=e.children,n=e.title,r=e.desc,o=kG(e,SG);return h.createElement("text",o,n&&h.createElement("title",null,n),r&&h.createElement("desc",null,r),t)};CG.propTypes={children:V$().node,desc:V$().string,title:V$().string};var _G=function(e){return h.createElement("tspan",e)};function OG(e,t){if(e.polar)return{};var n=function(e,t){t=t||{};var n=e.horizontal,r=KL((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 EG(e,t){var n=e.polar,r=BL(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=IG(e,t),o=KL((n.labels||{}).padding,e)||0,i=VL(r);return{x:o*Math.cos(i),y:-o*Math.sin(i)}}(e,t);return{x:o+a.x,y:i+a.y}}function TG(e){var t=e.labelComponent,n=e.labelPlacement,r=e.polar?"perpendicular":"vertical";return n||(t.props&&t.props.labelPlacement||r)}function PG(e,t,n){return void 0!==(t=t||{}).label?t.label:Array.isArray(e.labels)?e.labels[n]:e.labels}function AG(e,t){var n=TG(e);return"perpendicular"===n||"vertical"===n&&(90===t||270===t)?"middle":t<=90||t>270?"start":"end"}function MG(e,t){var n=TG(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 DG(e,t){var n=e.labelPlacement,r=e.datum;if(!n||"vertical"===n)return 0;var o=void 0!==t?t%360:IG(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 IG(e,t){var n=FL(t).x;return qL(e.scale.x(n))%360}function RG(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=IG(e,f),h=a?AG(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?MG(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=PG(e,f,t),v=TG(e),b=EG(e,f),x=b.x,w=b.y,j=OG(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(!zL(c))return S;var k=u&&u.tooltip||{};return eL()({},S,LL(k,["style"]))}function NG(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 LG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NG(Object(n),!0).forEach((function(t){FG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function FG(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BG(e){return function(e){if(Array.isArray(e))return UG(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 UG(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 UG(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 UG(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 zG={fill:"#252525",fontSize:14,fontFamily:"'Gill Sans', 'Gill Sans MT', 'Ser\xadavek', 'Trebuchet MS', sans-serif",stroke:"transparent"},WG=function(e,t){return e.datum?BL(e,e.datum)[t]:0},HG=function(e){var t=e&&e.fontSize;if("number"===typeof t)return t;if(void 0===t||null===t)return zG.fontSize;if("string"===typeof t){var n=Number(t.replace("px",""));return isNaN(n)?(T$(),zG.fontSize):n}return zG.fontSize},KG=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Array.isArray(e)?e[t]||e[0]:e},$G=function(e){var t=e.backgroundStyle,n=e.backgroundPadding;return Array.isArray(t)&&!QN()(t)||Array.isArray(n)&&!QN()(n)},VG=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)}},qG=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)}},GG=function(e,t){return $G(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=KG(t,o-1),l=e.textSize,c=e.fontSize*e.lineHeight,d=Math.ceil(c),f=KG(a,o),p=KG(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=VG(e,t.labelSize.width),d=c.slice(0,n+1).reduce((function(e,t){return e+t.dy}),u),f=KG(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?qG(e,p)-f.top:d,m={key:"tspan-background-".concat(n),height:p,style:KG(i,n),width:t.widthWithPadding,transform:o,x:y-f.left,y:g};return h.cloneElement(l,eL()({},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,BG(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,BG(c.map((function(e){return e.width})))),p=VG(e,f),y=qG(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,eL()({},i.props,g))}(e,t)},YG=function(e,t,n){var r=t.inline,o=KG(e,n);return n&&!r?function(e,t,n){var r=KG(e,t),o=KG(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 $G(n)?u+r.backgroundPadding.top+o.backgroundPadding.bottom:u}(e,n,t):r?0===n?o.backgroundPadding.top:void 0:o.backgroundPadding.top},QG=function(e){var t=function(e,t){if(void 0!==e&&null!==e){if(Array.isArray(e))return e.map((function(e){return KL(e,t)}));var n=KL(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=$L(e,t);return{fontSize:HG(n)}}var r=function(e){var n=$L(e=e?eL()({},e,zG):zG,t);return ZN()({},n,{fontSize:HG(n)})};return Array.isArray(e)&&!QN()(e)?e.map((function(e){return r(e)})):r(e)}(e.style,ZN()({},e,{text:t})),r=function(e,t){if(e)return Array.isArray(e)&&!QN()(e)?e.map((function(e){return $L(e,t)})):$L(e,t)}(e.backgroundStyle,ZN()({},e,{text:t,style:n})),o=function(e){return e.backgroundPadding&&Array.isArray(e.backgroundPadding)?e.backgroundPadding.map((function(t){return UL({padding:KL(t,e)})})):UL({padding:KL(e.backgroundPadding,e)})}(ZN()({},e,{text:t,style:n,backgroundStyle:r})),i=KL(e.id,e);return ZN()({},e,{backgroundStyle:r,backgroundPadding:o,style:n,text:t,id:i})},XG=function(e){var t=KL(e.ariaLabel,e),n=KG(e.style),r=function(e){var t=KL(e.lineHeight,e);return Array.isArray(t)&&QN()(t)?[1]:t}(e),o=e.direction?KL(e.direction,e):"inherit",i=e.textAnchor?KL(e.textAnchor,e):n.textAnchor||"start",a=e.verticalAnchor?KL(e.verticalAnchor,e):n.verticalAnchor||"middle",l=e.dx?KL(e.dx,e):0,s=function(e,t,n){var r=e.dy?KL(e.dy,e):0,o=e.inline?1:e.text.length,i=KL(e.capHeight,e),a=t?KL(t,e):"middle",l=BG(Array(o).keys()).map((function(t){return KG(e.style,t).fontSize})),s=BG(Array(o).keys()).map((function(e){return KG(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=BG(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:WG(e,"x"),c=void 0!==e.y?e.y:WG(e,"y"),d=function(e,t,n){var r=e.polar,o=KG(e.style),i=r?DG(e):0,a=void 0===o.angle?KL(e.angle,e):o.angle,l=void 0===a?i:a,s=e.transform||o.transform,u=s&&KL(s,e);return u||l?d$(u,l&&{rotate:[l,t,n]}):void 0}(e,u,c);return ZN()({},e,{ariaLabel:t,lineHeight:r,direction:o,textAnchor:i,verticalAnchor:a,dx:l,dy:s,originalDy:e.dy,transform:d,x:u,y:c})},ZG=function(e){if(null===(e=QG(e)).text||void 0===e.text)return null;var t=XG(e),n=t.text,r=t.style,o=t.capHeight,i=t.backgroundPadding,a=t.lineHeight,l=n.map((function(e,t){var n=KG(r,t),l=iG("".concat(o,"em"),n.fontSize),s=KG(a,t);return{style:n,fontSize:n.fontSize||zG.fontSize,capHeight:l,text:e,textSize:uG(e,n),lineHeight:s,backgroundPadding:KG(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=sF(e),j=LG(LG({"aria-label":n,key:"text"},a),{},{direction:l,dx:c,x:p,y:y+d,transform:f,className:o,title:i,desc:KL(g,e),tabIndex:KL(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:YG(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=[GG(t,l),s],c=h.cloneElement(e.groupComponent,{},u);return e.renderInPortal?h.createElement(jG,null,c):c}return e.renderInPortal?h.createElement(jG,null,s):s};ZG.displayName="VictoryLabel",ZG.role="label",ZG.defaultStyles=zG,ZG.propTypes={active:V$().bool,angle:V$().oneOfType([V$().string,V$().number,V$().func]),ariaLabel:V$().oneOfType([V$().string,V$().func]),backgroundComponent:V$().element,backgroundPadding:V$().oneOfType([V$().number,V$().object,V$().array]),backgroundStyle:V$().oneOfType([V$().object,V$().array]),capHeight:V$().oneOfType([V$().string,oV,V$().func]),className:V$().string,data:V$().array,datum:V$().any,desc:V$().oneOfType([V$().string,V$().func]),direction:V$().oneOf(["rtl","ltr","inherit"]),dx:V$().oneOfType([V$().number,V$().string,V$().func]),dy:V$().oneOfType([V$().number,V$().string,V$().func]),events:V$().object,groupComponent:V$().element,id:V$().oneOfType([V$().number,V$().string,V$().func]),index:V$().oneOfType([V$().number,V$().string]),inline:V$().bool,labelPlacement:V$().oneOf(["parallel","perpendicular","vertical"]),lineHeight:V$().oneOfType([V$().string,oV,V$().func,V$().array]),origin:V$().shape({x:oV.isRequired,y:oV.isRequired}),polar:V$().bool,renderInPortal:V$().bool,scale:V$().shape({x:sV,y:sV}),style:V$().oneOfType([V$().object,V$().array]),tabIndex:V$().oneOfType([V$().number,V$().func]),text:V$().oneOfType([V$().string,V$().number,V$().func,V$().array]),textAnchor:V$().oneOfType([V$().oneOf(["start","middle","end","inherit"]),V$().func]),textComponent:V$().element,title:V$().string,transform:V$().oneOfType([V$().string,V$().object,V$().func]),tspanComponent:V$().element,verticalAnchor:V$().oneOfType([V$().oneOf(["start","middle","end"]),V$().func]),x:V$().oneOfType([V$().number,V$().string]),y:V$().oneOfType([V$().number,V$().string])},ZG.defaultProps={backgroundComponent:h.createElement(yV,null),groupComponent:h.createElement("g",null),direction:"inherit",textComponent:h.createElement(CG,null),tspanComponent:h.createElement(_G,null),capHeight:.71,lineHeight:1};var JG=n(2185),eY=n.n(JG);const tY=e=>+e;function nY(e){return e*e}function rY(e){return e*(2-e)}function oY(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function iY(e){return e*e*e}function aY(e){return--e*e*e+1}function lY(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),uY=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),dY=Math.PI,fY=dY/2;function pY(e){return 1===+e?1:1-Math.cos(e*fY)}function hY(e){return Math.sin(e*fY)}function yY(e){return(1-Math.cos(dY*e))/2}function gY(e){return 1.0009775171065494*(Math.pow(2,-10*e)-.0009765625)}function mY(e){return gY(1-+e)}function vY(e){return 1-gY(e)}function bY(e){return((e*=2)<=1?gY(1-e):2-gY(e-1))/2}function xY(e){return 1-Math.sqrt(1-e*e)}function wY(e){return Math.sqrt(1- --e*e)}function jY(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var SY=4/11,kY=6/11,CY=8/11,_Y=3/4,OY=9/11,EY=10/11,TY=15/16,PY=21/22,AY=63/64,MY=1/SY/SY;function DY(e){return 1-IY(1-e)}function IY(e){return(e=+e)<SY?MY*e*e:e<CY?MY*(e-=kY)*e+_Y:e<EY?MY*(e-=OY)*e+TY:MY*(e-=PY)*e+AY}function RY(e){return((e*=2)<=1?1-IY(1-e):IY(e-1)+1)/2}var NY=1.70158,LY=function e(t){function n(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,n.overshoot=e,n}(NY),FY=function e(t){function n(e){return--e*e*((e+1)*t+e)+1}return t=+t,n.overshoot=e,n}(NY),BY=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}(NY),UY=2*Math.PI,zY=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=UY);function o(e){return t*gY(- --e)*Math.sin((r-e)/n)}return o.amplitude=function(t){return e(t,n*UY)},o.period=function(n){return e(t,n)},o}(1,.3),WY=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=UY);function o(e){return 1-t*gY(e=+e)*Math.sin((e+r)/n)}return o.amplitude=function(t){return e(t,n*UY)},o.period=function(n){return e(t,n)},o}(1,.3),HY=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=UY);function o(e){return((e=2*e-1)<0?t*gY(-e)*Math.sin((r-e)/n):2-t*gY(e)*Math.sin((r+e)/n))/2}return o.amplitude=function(t){return e(t,n*UY)},o.period=function(n){return e(t,n)},o}(1,.3),KY=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)||dF()(e)}return!1},$Y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return function(r){return r<n?e:t}},VY=function(e,t){return function(n){return n>=1?t:function(){return hU("function"===typeof e?e.apply(this,arguments):e,"function"===typeof t?t.apply(this,arguments):t)(n)}}},qY=function(e,t){var n,r,o,i=function(e){return Array.isArray(e)?OF()(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&&KY(r)&&KY(o)?"function"===typeof r||"function"===typeof o?VY(r,o):"object"===typeof r&&dF()(r)||"object"===typeof o&&dF()(o)?qY(r,o):hU(r,o):$Y(r,o)):l[n]=t[n];return function(e){for(n in a)l[n]=a[n](e);return l}},GY=function(e,t){return e!==t&&KY(e)&&KY(t)?"function"===typeof e||"function"===typeof t?VY(e,t):dF()(e)||dF()(t)?qY(e,t):"string"===typeof e||"string"===typeof t?function(e,t){var n=function(e){return"string"===typeof e?e.replace(/,/g,""):e};return hU(n(e),n(t))}(e,t):hU(e,t):$Y(e,t)};function YY(e){return function(e){if(Array.isArray(e))return QY(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 QY(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 QY(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 QY(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 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?Object.setPrototypeOf.bind():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(Wa){return!1}}();return function(){var n,r=eQ(e);if(t){var o=eQ(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 eQ(e){return eQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eQ(e)}var tQ=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&&ZY(e,t)}(i,e);var t,n,r,o=JY(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(!Iq()(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,YY(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=GY(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&&XY(t.prototype,n),r&&XY(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function nQ(){return nQ=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},nQ.apply(this,arguments)}function rQ(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 oQ(e,t){return oQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oQ(e,t)}function iQ(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(Wa){return!1}}();return function(){var n,r=aQ(e);if(t){var o=aQ(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 aQ(e){return aQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},aQ(e)}tQ.displayName="VictoryAnimation",tQ.propTypes={children:V$().func,data:V$().oneOfType([V$().object,V$().array]),delay:V$().number,duration:V$().number,easing:V$().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:V$().func},tQ.defaultProps={data:{},delay:0,duration:1e3,easing:"quadInOut"},tQ.contextType=JV;var lQ=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&&oQ(e,t)}(i,e);var t,n,r,o=iQ(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 Iq()(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=jL(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&&NL()(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]:[pL(a),fL(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=QL(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:SL(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=eL()({domain:a,clipWidth:l},i,o.props),u=(n.animationWhitelist||[]).concat(["clipWidth"]),c=u.length?ML()(s,u):s;return h.createElement(tQ,nQ({},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,eL()({animate:null,animating:!0,groupComponent:n},e,s))}return h.cloneElement(o,eL()({animate:null,animating:!0},e,s))}))}}],n&&rQ(t.prototype,n),r&&rQ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function sQ(e){return function(e){if(Array.isArray(e))return uQ(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 uQ(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 uQ(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 uQ(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 dQ(e,t){return dQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dQ(e,t)}function fQ(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(Wa){return!1}}();return function(){var n,r=hQ(e);if(t){var o=hQ(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 pQ(e)}(this,n)}}function pQ(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hQ(e){return hQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hQ(e)}lQ.displayName="VictoryTransition",lQ.propTypes={animate:V$().oneOfType([V$().bool,V$().object]),animationWhitelist:V$().array,children:V$().node},lQ.contextType=JV;var yQ=function(e){return!eY()(e._x)&&!eY()(e._y)},gQ=[{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&&dQ(e,t)}(l,n);var r,o,i,a=fQ(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(pQ(t)),t.getScopedEvents=b$.bind(pQ(t)),t.getEvents=function(e,n,r){return v$.call(pQ(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=!Iq()(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 Iq()(this.calculatedState,o)?!Iq()(this.props,e)&&(this.cacheValues(this.getCalculatedValues(e)),!0):(this.cacheValues(this.getCalculatedValues(e)),!0)}},{key:"componentDidMount",value:function(){var e=this,t=yL()(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=yL()(this.globalEvents);Eq()(this.prevGlobalEventKeys,r).forEach((function(e){return t.removeGlobalListener(e)})),Eq()(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(E$(n))};this.boundGlobalEvents[e]=n,window.addEventListener(C$(e),n)}},{key:"removeGlobalListener",value:function(e){window.removeEventListener(C$(e),this.boundGlobalEvents[e])}},{key:"getStateChanges",value:function(e){var n=this;if(!this.hasEvents)return{};var r=function(e,t){var r=eL()({},n.getEventState(e,t),n.getSharedEventState(e,t));return QN()(r)?void 0:r},o=(t.components||gQ).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(!QN()(t)){var n=e.externalEventMutations.reduce((function(e,t){return e=NL()(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=k$(t,e.expectedComponents),o=n&&NL()(n.getEventState)?n.getEventState:function(){},i=this.getBaseProps(t,o),a=yL()(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 QN()(n)||t?void 0:j$(n,this.baseProps,this.state)}},{key:"cacheValues",value:function(e){var t=this;yL()(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=eL()({},o,r),a=i.parentControlledProps,l=a?ML()(i,a):{},s=eL()({},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=eL()({index:r,key:a},this.getEventState(i,n),this.getSharedEventState(i,n),t.props,l,{id:a}),c=eL()({},x$(s,i,u),u.events);return ZN()({},u,{events:c})}return eL()({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=_$(n.events),n.events=O$(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(lQ,{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=SF()(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]:yQ,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 vQ(e){return function(e){if(Array.isArray(e))return bQ(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 bQ(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 bQ(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 bQ(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 xQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wQ={top:-1,left:-1,right:1,bottom:1},jQ=function(e){return null!==e&&void 0!==e},SQ=function(e,t){var n=e.style||{};t=t||{};return{parent:eL()(n.parent,t.parent,{height:"100%",width:"100%"}),axis:eL()({},n.axis,t.axis),axisLabel:eL()({},n.axisLabel,t.axisLabel),grid:eL()({},n.grid,t.grid),ticks:eL()({},n.ticks,t.ticks),tickLabels:eL()({},n.tickLabels,t.tickLabels)}},kQ=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}},CQ=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}},_Q=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}},OQ=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]},EQ=function(e,t,n){var r=t.orientation,o=u$(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]},TQ=function(e,t,n){var r=e.tickStyle,o=e.labelStyle,i=r.size||0,a=i+(r.padding||0)+(o.padding||0),l=wQ[t];return{x:n?l*a:0,x2:n?l*i:0,y:n?0:l*a,y2:n?0:l*i}},PQ=function(e,t,n){return{x:n?t.x:e+t.x,y:n?e+t.y:t.y}},AQ=function(e,t){var n=t.orientation,r=t.padding,o=t.isVertical,i=-wQ[n];return{x:o?i*(e.width-(r.left+r.right)):0,y:o?0:i*(e.height-(r.top+r.bottom))}},MQ=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}},DQ=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:jQ(e.offsetX)?e.offsetX:x,y:jQ(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:jQ(e.offsetX)?e.offsetX:b,y:jQ(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:xQ({},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 $L(n.ticks,ZN()({},p,{tick:o,index:r})).size||0})),x=v+2*Math.max.apply(Math,vQ(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:EQ(e,t,n),gridOffset:MQ(t,n),gridEdge:AQ(e,t)}},IQ=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]=eL()({},i[t],r[t]),e}),{}):i||r}(e),n=SQ(e,t),r=UL(e),o=function(e,t){var n=t.axisLabel||{};if(void 0!==n.padding&&null!==n.padding)return n.padding;var r=e$(e),o=n.fontSize||14;return e.label?o*(r?2.3:1.6):0}(e,n),i=t$(e)?e.tickValues:void 0,a=GK(e),l=s$(e),s=function(e){var t=GK(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=iK(e,t),o=e.domain&&e.domain[t]||s$(e)||r.domain();return r.range(QL(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=a$(e,s,p),y=o$(e,s),g={x:QL(e,"x"),y:QL(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?iK(e,"x").domain(e.domain.x).range(e.horizontal?g.y:g.x):d,y:e.domain&&e.domain.y?iK(e,"y").domain(e.domain.y).range(e.horizontal?g.x:g.y):f},b=m.x&&m.y?ZK(m):void 0,x=b?{x:JK(b.x,m.x),y:JK(b.y,m.y)}:void 0,w=x?{x:OQ("x",x.y,e.horizontal),y:OQ("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=e$(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}},RQ=function(e,t){e=c$(e,t);var n=IQ(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=DQ(e,n),S=j.globalTransform,k=j.gridOffset,C=j.gridEdge,_={scale:xQ({},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=wQ[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:ZN()({style:o.parent,ticks:s,standalone:m,theme:v,width:y,height:g,padding:x,domain:d},_)},P={dimension:p,range:xQ({},p,QL(e,p)),scale:e.scale&&e.scale[p]?xQ({},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:$L(e.ticks,t),labelStyle:$L(e.tickLabels,t),gridStyle:$L(e.grid,t)}}(o,ZN()({},_,{tick:y,tickValue:t,index:n,text:g})),v={position:TQ(m,i,a),transform:PQ(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:ZN()({dimension:r},_,O),axisLabel:ZN()({},_,E),ticks:ZN()({},_,kQ(v,m.tickStyle,t)),tickLabels:ZN()({},_,CQ(v,m.labelStyle,c,t,g)),grid:ZN()({},_,P,_Q(b,m.gridStyle,t))},e}),T)};function NQ(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 LQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NQ(Object(n),!0).forEach((function(t){FQ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NQ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function FQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BQ(e){return function(e){if(Array.isArray(e))return UQ(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 UQ(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 UQ(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 UQ(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 zQ(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 WQ(e,t){return WQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WQ(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(Wa){return!1}}();return function(){var n,r=KQ(e);if(t){var o=KQ(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 KQ(e){return KQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KQ(e)}var $Q={width:450,height:300,padding:50},VQ=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&&WQ(e,t)}(i,e);var t,n,r,o=HQ(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||!QN()(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=e$(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?ZN()({},{top:0,right:0,bottom:0,left:0},e):{top:e,right:e,bottom:e,left:e}}(t.style.padding),o=uG(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=qQ.animationWhitelist,t=c$(this.props,$Q),n=sF(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(BQ(o)),a=h.cloneElement(t.containerComponent,n);return t.standalone?this.renderContainer(a,i):h.cloneElement(t.groupComponent,n,i)}}],n&&zQ(t.prototype,n),r&&zQ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);VQ.animationWhitelist=["style","domain","range","tickCount","tickValues","offsetX","offsetY","padding","width","height"],VQ.displayName="VictoryAxis",VQ.role="axis",VQ.defaultTransitions={onExit:{duration:500},onEnter:{duration:500}},VQ.propTypes=LQ(LQ({},dV.baseProps),{},{axisComponent:Gq().element,axisLabelComponent:Gq().element,axisValue:Gq().oneOfType([Gq().number,Gq().string,Gq().object]),categories:Gq().oneOfType([Gq().arrayOf(Gq().string),Gq().shape({x:Gq().arrayOf(Gq().string),y:Gq().arrayOf(Gq().string)})]),crossAxis:Gq().bool,dependentAxis:Gq().bool,events:Gq().arrayOf(Gq().shape({target:Gq().oneOf(["axis","axisLabel","grid","ticks","tickLabels"]),eventKey:Gq().oneOfType([Gq().array,rV([iV,oV]),Gq().string]),eventHandlers:Gq().object})),fixLabelOverlap:Gq().bool,gridComponent:Gq().element,groupComponent:Gq().element,invertAxis:Gq().bool,label:Gq().any,offsetX:Gq().number,offsetY:Gq().number,orientation:Gq().oneOf(["top","bottom","left","right"]),origin:Gq().shape({x:Gq().number,y:Gq().number}),stringMap:Gq().object,style:Gq().shape({parent:Gq().object,axis:Gq().object,axisLabel:Gq().object,grid:Gq().object,ticks:Gq().object,tickLabels:Gq().object}),tickComponent:Gq().element,tickCount:rV([iV,aV]),tickFormat:Gq().oneOfType([Gq().func,uV]),tickLabelComponent:Gq().element,tickValues:uV}),VQ.defaultProps={axisComponent:h.createElement(mG,null),axisLabelComponent:h.createElement(ZG,null),tickLabelComponent:h.createElement(ZG,null),tickComponent:h.createElement(mG,null),gridComponent:h.createElement(mG,null),standalone:!0,theme:_q.grayscale,containerComponent:h.createElement(sq,null),groupComponent:h.createElement("g",{role:"presentation"}),fixLabelOverlap:!1},VQ.getDomain=s$,VQ.getAxis=GK,VQ.getStyles=function(e){return SQ(e)},VQ.getBaseProps=function(e){return RQ(e,$Q)},VQ.expectedComponents=["axisComponent","axisLabelComponent","groupComponent","containerComponent","tickComponent","tickLabelComponent","gridComponent"];var qQ=mQ(VQ,{components:[{name:"axis",index:0},{name:"axisLabel",index:0},{name:"grid"},{name:"parent",index:"parent"},{name:"ticks"},{name:"tickLabels"}]}),GQ=n(811),YQ=n.n(GQ),QQ=["desc"];function XQ(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 ZQ=function(e){var t=e.desc,n=XQ(e,QQ);return t?h.createElement("path",n,h.createElement("desc",null,t)):h.createElement("path",n)};function JQ(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 eX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JQ(Object(n),!0).forEach((function(t){tX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JQ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nX=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(VL(o)),u=n-r*Math.sin(VL(o)),c=t+r*Math.cos(VL(l)),d=n-r*Math.sin(VL(l)),f=t+r*Math.cos(VL(i)),p=n-r*Math.sin(VL(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)},rX=function(e){return e=function(e){var t=KL(e.ariaLabel,e),n=KL(e.desc,e),r=KL(e.id,e),o=$L(ZN()({stroke:"black",fill:"none"},e.style),e),i=KL(e.tabIndex,e);return ZN()({},e,{ariaLabel:t,desc:n,id:r,style:o,tabIndex:i})}(e),h.cloneElement(e.pathComponent,eX(eX({},e.events),{},{"aria-label":e.ariaLabel,d:nX(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}))};rX.propTypes=eX(eX({},dV.primitiveProps),{},{closedPath:V$().bool,cx:V$().number,cy:V$().number,datum:V$().any,endAngle:V$().number,pathComponent:V$().element,r:V$().number,startAngle:V$().number}),rX.defaultProps={pathComponent:h.createElement(ZQ,null),role:"presentation",shapeRendering:"auto"};var oX=function(e,t,n){return"x"===n?e*Math.cos(t):-e*Math.sin(t)},iX=function(e){var t=e.dependentAxis?"radial":"angular",n="angular"===t?"radial":"angular";return e.horizontal?n:t},aX=function(e,t){return{tickStyle:$L(e.ticks,t),labelStyle:$L(e.tickLabels,t),gridStyle:$L(e.grid,t)}},lX=function(e){var t=UL(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},sX=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"===iX(e))return[VL(e.startAngle),VL(e.endAngle)];var n=lX(e);return[e.innerRadius||0,n]},uX=function(e){var t=GK(e),n=iK(e,t),r=s$(e,t)||n.domain(),o=sX(e,t);return n.range(o),n.domain(r),n},cX=function(e,t){if(e.disableInlineStyles)return{};var n=e.style||{};t=t||{};return{parent:eL()({height:"auto",width:"100%"},n.parent,t.parent),axis:eL()({},n.axis,t.axis),axisLabel:eL()({},n.axisLabel,t.axisLabel),grid:eL()({},n.grid,t.grid),ticks:eL()({},n.ticks,t.ticks),tickLabels:eL()({},n.tickLabels,t.tickLabels)}},dX=function(e){var t=e.axisAngle,n=e.startAngle,r=e.dependentAxis,o=u$(e,GK(e));return void 0!==o&&r?qL(o):void 0===t?n:t},fX=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=aX(l,{tick:p,tickValue:n,index:r,ticks:u,stringTicks:s,radius:i,scale:a,axisType:o,text:f}).tickStyle,y="radial"===o?dX(e):void 0,g=h.padding||h.size||0,m=VL(90-y),v="angular"===o?a(n):VL(-1*y),b="angular"===o?i:a(n);return"angular"===o?{index:r,datum:p,style:h,x1:oX(b,v,"x")+d.x,y1:oX(b,v,"y")+d.y,x2:oX(b+g,v,"x")+d.x,y2:oX(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}},pX=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=aX(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?dX(e):void 0,b="angular"===o?qL(s(n)):v+0,x=void 0===h.angle?DG(ZN()({},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||AG(ZN()({},e,{labelPlacement:g}),b),text:f,x:w*Math.cos(VL(b))+d.x,y:-w*Math.sin(VL(b))+d.y}},hX=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=aX(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:oX(i,b,"x")+d.x,y1:oX(i,b,"y")+d.y,x2:oX(g,b,"x")+d.x,y2:oX(g,b,"y")+d.y}:{style:v,index:r,datum:m,cx:d.x,cy:d.y,r:l(n),startAngle:p,endAngle:h}},yX=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]=eL()({},l[t],o[t]),e}),{}):l||o}(e=ZN()({polar:!0},e)),n=cX(e,t),r=UL(e),o=GK(e),i=iX(e),a=t$(e)?e.tickValues:void 0,l=s$(e,o),s=sX(e,o),u=uX(e),c=a$(e,u),d="angular"===i?function(e,t){return yF()(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:o$(e,u),domain:l,range:s,radius:lX(e),origin:YL(e)}},gX=function(e,t){e=c$(e,t);var n=yX(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?VL(dX(e)):void 0;return"radial"===r?{style:n.axis,x1:oX(u,c,"x")+i.x,x2:oX(o,c,"x")+i.x,y1:oX(u,c,"y")+i.y,y2:oX(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?dX(e):void 0,c=void 0===s.angle?DG(ZN()({},e,{labelPlacement:l}),u):s.angle,d=r+(s.padding||0);return{style:s,angle:c,textAnchor:s.textAnchor||AG(ZN()({},e,{labelPlacement:l}),u),verticalAnchor:s.verticalAnchor||MG(ZN()({},e,{labelPlacement:l}),u),text:e.label,x:oX(d,VL(u),"x")+i.x,y:oX(d,VL(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:fX(e,n,r,o),tickLabels:pX(e,n,r,o),grid:hX(e,n,r,o)},t}),y)};function mX(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 vX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mX(Object(n),!0).forEach((function(t){bX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xX(e){return function(e){if(Array.isArray(e))return wX(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 wX(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 wX(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 wX(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 jX(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 SX(e,t){return SX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SX(e,t)}function kX(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(Wa){return!1}}();return function(){var n,r=CX(e);if(t){var o=CX(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 CX(e){return CX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},CX(e)}var _X={width:450,height:300,padding:50},OX=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&&SX(e,t)}(i,e);var t,n,r,o=kX(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||!QN()(o)},a="radial"===(e.dependentAxis?"radial":"angular")?e.circularGridComponent:e.gridComponent,l=this.dataKeys.map((function(e,r){var a=ZN()({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=ZN()({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=ZN()({key:"".concat(o,"-tick-").concat(e)},t.getComponentProps(r,"tickLabels",n));return h.cloneElement(r,i)})),c=[this.renderAxisLine(e),this.renderLabel(e)].concat(xX(l),xX(s),xX(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=c$(this.props,_X);if(this.shouldAnimate())return this.animateComponent(t,e);var n=this.renderAxis(t);return t.standalone?this.renderContainer(t.containerComponent,n):n}}],n&&jX(t.prototype,n),r&&jX(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);OX.animationWhitelist=["style","domain","range","tickCount","tickValues","padding","width","height"],OX.displayName="VictoryAxis",OX.role="axis",OX.defaultTransitions={onExit:{duration:500},onEnter:{duration:500}},OX.propTypes=vX(vX({},dV.baseProps),{},{axisAngle:YQ().number,axisComponent:YQ().element,axisLabelComponent:YQ().element,axisValue:YQ().oneOfType([YQ().number,YQ().string,YQ().object]),categories:YQ().oneOfType([YQ().arrayOf(YQ().string),YQ().shape({x:YQ().arrayOf(YQ().string),y:YQ().arrayOf(YQ().string)})]),circularAxisComponent:YQ().element,circularGridComponent:YQ().element,containerComponent:YQ().element,dependentAxis:YQ().bool,disableInlineStyles:YQ().bool,endAngle:YQ().number,events:YQ().arrayOf(YQ().shape({target:YQ().oneOf(["axis","axisLabel","grid","ticks","tickLabels"]),eventKey:YQ().oneOfType([YQ().array,rV([iV,oV]),YQ().string]),eventHandlers:YQ().object})),gridComponent:YQ().element,innerRadius:oV,labelPlacement:YQ().oneOf(["parallel","perpendicular","vertical"]),startAngle:YQ().number,stringMap:YQ().object,style:YQ().shape({parent:YQ().object,axis:YQ().object,axisLabel:YQ().object,grid:YQ().object,ticks:YQ().object,tickLabels:YQ().object}),tickComponent:YQ().element,tickCount:rV([iV,aV]),tickFormat:YQ().oneOfType([YQ().func,uV]),tickLabelComponent:YQ().element,tickValues:uV}),OX.defaultProps={axisComponent:h.createElement(mG,null),axisLabelComponent:h.createElement(ZG,null),circularAxisComponent:h.createElement(rX,null),circularGridComponent:h.createElement(rX,null),containerComponent:h.createElement(sq,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(ZG,null)},OX.getDomain=s$,OX.getAxis=GK,OX.getScale=uX,OX.getStyles=function(e){return cX(e,_X.style)},OX.getBaseProps=function(e){return gX(e,_X)},OX.expectedComponents=["axisComponent","circularAxisComponent","groupComponent","containerComponent","tickComponent","tickLabelComponent","gridComponent","circularGridComponent"];var EX=mQ(OX,{components:[{name:"axis",index:0},{name:"axisLabel",index:0},{name:"grid"},{name:"parent",index:"parent"},{name:"ticks"},{name:"tickLabels"}]});function TX(e){return function(e){if(Array.isArray(e))return PX(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 PX(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 PX(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 PX(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 AX={width:450,height:300,padding:50};function MX(e,t){var n=function(e){var t=e.style&&e.style.parent;return{parent:eL()({},t,{height:"100%",width:"100%",userSelect:"none"})}}(e),r=e=ZL(e,AX,"chart"),o=r.horizontal,i=r.polar,a=W$(e,t),l=H$(e,t,a),s=NX(e,t,a),u={x:RX(ZN()({},e,{categories:l}),"x",t),y:RX(ZN()({},e,{categories:l}),"y",t)},c={x:QL(e,"x"),y:QL(e,"y")},d={x:aK(e,"x")||F$(e,"x"),y:aK(e,"y")||F$(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?YL(e):ZK(u),padding:UL(e)}}function DX(e,t,n){t=t||IX(e);var r=(n=n||MX(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:eL()({},t.props.style,{parent:r}),y=function(e,t,n){var r=YK([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=eL()({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 IX=function(e,t){var n=h.Children.toArray(e.children),r=TX(n);if(0===n.length)r.push(t.independent,t.dependent);else{var o={dependent:XK(n,"dependent"),independent:XK(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},RX=function(e,t,n){var r=L$(e,t,n=n||h.Children.toArray(e.children)),o=QK(n,t);return o&&o.props&&o.props.invertAxis?r.concat().reverse():r},NX=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 LX(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 FX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LX(Object(n),!0).forEach((function(t){BX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function BX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var UX={width:450,height:300,padding:50},zX=function(e){var t=PL(),n=t.getAnimationProps,r=t.setAnimationState,o=(0,t.getProps)(e),i=ZL(o,UX,"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 IX(i,b)}),[i,b]),w=h.useMemo((function(){return MX(i,x)}),[i,x]),j=w.domain,S=w.scale,k=w.style,C=w.origin,_=w.horizontal,O=h.useMemo((function(){var e=DX(o,x,w).map((function(e,t){var r=ZN()({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,eL()({},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=eL()({},s.props,E,sF(e));return h.cloneElement(s,t)}return c}),[c,u,s,E,e]),P=h.useMemo((function(){return B$(o)}),[o]),A=K$(e);return h.useEffect((function(){return function(){e.animate&&r(A,e)}}),[r,A,e]),QN()(P)?h.cloneElement(T,T.props,O):h.createElement(Vq,{container:T,eventKey:l,events:P,externalEventMutations:d},O)};zX.propTypes=FX(FX({},dV.baseProps),{},{backgroundComponent:nL().element,children:nL().oneOfType([nL().arrayOf(nL().node),nL().node]),defaultAxes:nL().shape({independent:nL().element,dependent:nL().element}),defaultPolarAxes:nL().shape({independent:nL().element,dependent:nL().element}),endAngle:nL().number,innerRadius:oV,prependDefaultAxes:nL().bool,startAngle:nL().number}),zX.defaultProps={backgroundComponent:h.createElement(SV,null),containerComponent:h.createElement(sq,null),defaultAxes:{independent:h.createElement(qQ,null),dependent:h.createElement(qQ,{dependentAxis:!0})},defaultPolarAxes:{independent:h.createElement(EX,null),dependent:h.createElement(EX,{dependentAxis:!0})},groupComponent:h.createElement("g",null),standalone:!0,theme:_q.grayscale};var WX=h.memo(zX,Iq());WX.displayName="VictoryChart",WX.expectedComponents=["groupComponent","containerComponent"];var HX=n(1543),KX=n.n(HX),$X=n(5545),VX=n.n($X);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 GX(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){YX(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 YX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var QX=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=dF()(a)&&a.x,d=dF()(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=dF()(a)&&a.x,d=dF()(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)},XX=function(e){e=function(e){var t=KL(e.id,e),n=$L(e.style,e);return ZN()({},e,{id:t,style:n})}(e);var t=sF(e);return h.cloneElement(e.pathComponent,GX(GX(GX({},e.events),t),{},{style:e.style,d:QX(e),className:e.className,shapeRendering:e.shapeRendering,role:e.role,transform:e.transform,clipPath:e.clipPath}))};XX.propTypes=GX(GX({},dV.primitiveProps),{},{center:VX().shape({x:VX().number,y:VX().number}),cornerRadius:VX().number,datum:VX().object,dx:VX().number,dy:VX().number,height:VX().number,orientation:VX().oneOf(["top","bottom","left","right"]),pathComponent:VX().element,pointerLength:VX().number,pointerWidth:VX().number,width:VX().number,x:VX().number,y:VX().number}),XX.defaultProps={pathComponent:h.createElement(ZQ,null),role:"presentation",shapeRendering:"auto"};var ZX=XX;function JX(e){return function(e){if(Array.isArray(e))return eZ(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 eZ(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 eZ(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 eZ(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 tZ(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 rZ(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(Wa){return!1}}();return function(){var n,r=oZ(e);if(t){var o=oZ(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 oZ(e){return oZ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oZ(e)}var iZ={cornerRadius:5,pointerLength:10,pointerWidth:10},aZ=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=rZ(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?CV()("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=IG(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 eL()({},e,n)})):eL()({},e.style,n),o=t&&t.tooltip&&t.tooltip.flyoutStyle?t.tooltip.flyoutStyle:{},i=e.flyoutStyle?eL()({},e.flyoutStyle,o):o,a=Array.isArray(r)?r.map((function(t){return $L(t,e)})):$L(r,e);return{style:a,flyoutStyle:$L(i,ZN()({},e,{style:a}))}}},{key:"getEvaluatedProps",value:function(e){var t=e.cornerRadius,n=e.centerOffset,r=e.dx,o=e.dy,i=KL(e.active,e),a=KL(e.text,ZN()({},e,{active:i})),l=this.getStyles(ZN()({},e,{active:i,text:a})),s=l.style,u=l.flyoutStyle,c=KL(e.orientation,ZN()({},e,{active:i,text:a,style:s,flyoutStyle:u}))||this.getDefaultOrientation(e),d=UL({padding:KL(e.flyoutPadding,ZN()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c}))||this.getLabelPadding(s)}),f=KL(e.pointerWidth,ZN()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c})),p=KL(e.pointerLength,ZN()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c})),h=uG(a,s),y=this.getDimensions(ZN()({},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=ZN()({},e,{active:i,text:a,style:s,flyoutStyle:u,orientation:c,flyoutHeight:g,flyoutWidth:m,flyoutPadding:d,pointerWidth:f,pointerLength:p}),b=dF()(n)&&void 0!==n.x?KL(n.x,v):0,x=dF()(n)&&void 0!==n.y?KL(n.y,v):0;return ZN()({},v,{centerOffset:{x:b,y:x},dx:void 0!==r?KL(r,v):0,dy:void 0!==o?KL(o,v):0,cornerRadius:KL(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:uG(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=IG(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=dF()(e.center)&&void 0!==e.center.x?e.center.x:h.x,g=dF()(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,JX(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=KL(e.cornerRadius,e);return{flyoutHeight:i?KL(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?KL(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 eL()({},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 OF()(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=KL(e.pointerOrientation,e);return eL()({},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=KL(e.active,e),n=e.renderInPortal;if(!t)return n?h.createElement(jG,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(jG,null,u):u}},{key:"render",value:function(){var e=ZL(this.props,iZ,"tooltip");return this.renderTooltip(e)}}],n&&tZ(t.prototype,n),r&&tZ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);aZ.displayName="VictoryTooltip",aZ.role="tooltip",aZ.propTypes={activateData:VX().bool,active:VX().oneOfType([VX().bool,VX().func]),activePoints:VX().array,angle:VX().number,center:VX().shape({x:oV,y:oV}),centerOffset:VX().shape({x:VX().oneOfType([VX().number,VX().func]),y:VX().oneOfType([VX().number,VX().func])}),constrainToVisibleArea:VX().bool,cornerRadius:VX().oneOfType([oV,VX().func]),data:VX().array,datum:VX().object,dx:VX().oneOfType([VX().number,VX().func]),dy:VX().oneOfType([VX().number,VX().func]),events:VX().object,flyoutComponent:VX().element,flyoutHeight:VX().oneOfType([oV,VX().func]),flyoutPadding:VX().oneOfType([VX().func,VX().number,VX().shape({top:VX().number,bottom:VX().number,left:VX().number,right:VX().number})]),flyoutStyle:VX().object,flyoutWidth:VX().oneOfType([oV,VX().func]),groupComponent:VX().element,height:VX().number,horizontal:VX().bool,id:VX().oneOfType([VX().number,VX().string]),index:VX().oneOfType([VX().number,VX().string]),labelComponent:VX().element,orientation:VX().oneOfType([VX().oneOf(["top","bottom","left","right"]),VX().func]),pointerLength:VX().oneOfType([oV,VX().func]),pointerOrientation:VX().oneOfType([VX().oneOf(["top","bottom","left","right"]),VX().func]),pointerWidth:VX().oneOfType([oV,VX().func]),polar:VX().bool,renderInPortal:VX().bool,scale:VX().shape({x:sV,y:sV}),style:VX().oneOfType([VX().object,VX().array]),text:VX().oneOfType([VX().string,VX().number,VX().func,VX().array]),theme:VX().object,width:VX().number,x:VX().number,y:VX().number},aZ.defaultProps={active:!1,renderInPortal:!0,labelComponent:h.createElement(ZG,null),flyoutComponent:h.createElement(ZX,null),groupComponent:h.createElement("g",null)},aZ.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 lZ=n(8133),sZ=n.n(lZ),uZ=n(3806),cZ=n.n(uZ);function dZ(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 fZ(e){return!(!e||void 0===e.identifier)}function pZ(e){if(!fZ(e.nativeEvent)){var t=function(e){return"svg"===e.nodeName?e:e.parentNode?t(e.parentNode):e};return t(e.target)}}var hZ=n(6813);function yZ(e){return function(e){if(Array.isArray(e))return gZ(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 gZ(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 gZ(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 gZ(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 mZ={withinBounds:function(e,t){var n=e.width,r=e.height,o=e.polar,i=e.origin,a=e.scale,l=UL(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,yZ(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:pL(e.domain.x),y:pL(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=FL(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 ZN()({_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=OK(e);return Array.isArray(t)&&t.length>0?t:void 0};return eF(n,(function(t,n){var i=(t.props||{}).name||n,a=e.voronoiBlacklist||[],l=a.filter(sZ()),s=a.filter(G$()).some((function(e){return e.test(i)}));if(!PK(t)||CF()(l,i)||s)return null;var u=(t.type&&NL()(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=BL(e,t);return[n.x,n.y]})),o=hZ.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 QN()(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 QN()(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){NL()(e.onActivated)&&e.onActivated(t,e)},onDeactivated:function(e,t){NL()(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,yZ(i))},onMouseMove:function(e,t){var n=this,r=t.activePoints||[],o=t.parentSVG||pZ(e),i=function(e,t){if(fZ(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||pZ(n));return{x:dZ(n.clientX,r,"x"),y:dZ(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,yZ(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&&Iq()(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,yZ(h).concat(yZ(p)))}},vZ={onMouseLeave:mZ.onMouseLeave.bind(mZ),onMouseMove:cZ()(mZ.onMouseMove.bind(mZ),32,{leading:!0,trailing:!1})},bZ=["childName","eventKey","style","continuous"];function xZ(e){return function(e){if(Array.isArray(e))return wZ(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 wZ(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 wZ(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 wZ(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 jZ(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 SZ(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 kZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SZ(Object(n),!0).forEach((function(t){CZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function CZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Z(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 OZ(e,t){return OZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OZ(e,t)}function EZ(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(Wa){return!1}}();return function(){var n,r=TZ(e);if(t){var o=TZ(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 TZ(e){return TZ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},TZ(e)}var PZ=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&&OZ(e,t)}(i,e);var t,n,r,o=EZ(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 ML()(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=BL(e,this.getPoint(n[0])),l=o?r:void 0;if(!i||n.length<2)return kZ(kZ({},a),{},{center:eL()({},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:eL()({},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=eL()({},a,{datum:t,active:!0}),u=NL()(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=$L(eL()({},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=eL()({},s,{datum:t,active:!0}),o=NL()(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,jZ(c,bZ)),h=e.name===d?d:"".concat(e.name,"-").concat(d),y=eL()({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 eL()({},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(xZ(h.Children.toArray(e.children)),[this.getTooltip(e)])}}],n&&_Z(t.prototype,n),r&&_Z(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(e),t.displayName="VictoryVoronoiContainer",t.propTypes=kZ(kZ({},sq.propTypes),{},{activateData:KX().bool,activateLabels:KX().bool,disable:KX().bool,labelComponent:KX().element,labels:KX().func,mouseFollowTooltips:KX().bool,onActivated:KX().func,onDeactivated:KX().func,radius:KX().number,voronoiBlacklist:KX().arrayOf(KX().oneOfType([KX().string,cV])),voronoiDimension:KX().oneOf(["x","y"]),voronoiPadding:KX().oneOfType([KX().number,KX().shape({top:KX().number,bottom:KX().number,left:KX().number,right:KX().number})])}),t.defaultProps=kZ(kZ({},sq.defaultProps),{},{activateData:!0,activateLabels:!0,labelComponent:h.createElement(aZ,null),voronoiPadding:5}),t.defaultEvents=function(e){return[{target:"parent",eventHandlers:{onMouseLeave:function(t,n){return e.disable?{}:vZ.onMouseLeave(t,n)},onTouchCancel:function(t,n){return e.disable?{}:vZ.onMouseLeave(t,n)},onMouseMove:function(t,n){return e.disable?{}:vZ.onMouseMove(t,n)},onTouchMove:function(t,n){return e.disable?{}:vZ.onMouseMove(t,n)}}},{target:"data",eventHandlers:e.disable?{}:{onMouseOver:function(){return null},onMouseOut:function(){return null},onMouseMove:function(){return null}}}]},t}(sq),AZ=n(5143),MZ=n.n(AZ);function DZ(e){return function(e){if(Array.isArray(e))return NZ(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||RZ(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 IZ(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)||RZ(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 RZ(e,t){if(e){if("string"===typeof e)return NZ(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)?NZ(e,t):void 0}}function NZ(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 LZ(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 FZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LZ(Object(n),!0).forEach((function(t){BZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function BZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var UZ={width:450,height:300,padding:50,offset:0};function zZ(e,t){var n="group",r=function(e,t,n){return HL(t,e&&e[n]&&e[n].style?e[n].style:{})}((e=ZL(e,UZ,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||H$(e,t,null),d=e.datasets||R$(e,null),f={x:L$(ZN()({},e,{categories:c}),"x",t),y:L$(ZN()({},e,{categories:c}),"y",t)},p=e.range||{x:QL(e,"x"),y:QL(e,"y")},h={x:aK(e,"x")||F$(e,"x"),y:aK(e,"y")||F$(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:YL(e),padding:UL(e)}}var WZ=function(e){var t=e.children,n=h.Children.toArray(t).map((function(e){return FZ(FZ({},e),{},{props:LL(e.props,["sharedEvents"])})}));return e.children=n,e};function HZ(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=JL(t,e.horizontal),o=n.domain[t],i=n.range[r];return(Math.max.apply(Math,DZ(o))-Math.min.apply(Math,DZ(o)))/(Math.max.apply(Math,DZ(i))-Math.min.apply(Math,DZ(i)))*e.offset}(e,"x",t);return(n-o)*i}function KZ(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,DZ(n.y));return e.offset/(2*Math.PI*o)*r}(e,t);return(n-o)*i}function $Z(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 VZ(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?OK(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 ZN()({},e,{_x1:t})}))}function qZ(e,t,n){e=ZL(e,UZ,"stack"),t=t||h.Children.toArray(e.children);var r=(n=n||zZ(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?KZ(e,n,o,u):HZ(e,n,o,u),d="voronoi"===u||"tooltip"===u||"label"===u?t.props.style:U$(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,ZN()({labels:f,style:d,key:"".concat(p,"-key-").concat(o),name:p,data:VZ(e,r[o],c),colorScale:$Z(e,t),labelComponent:i||t.props.labelComponent,xOffset:c},l))}))}function GZ(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 YZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GZ(Object(n),!0).forEach((function(t){QZ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GZ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function QZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var XZ={width:450,height:300,padding:50,offset:0},ZZ=function(e){var t=null===eJ||void 0===eJ?void 0:eJ.role,n=PL(),r=n.getAnimationProps,o=n.setAnimationState,i=(0,n.getProps)(e),a=ZL(i,XZ,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=WZ(e),n=IZ(h.useState(t),2),r=n[0],o=n[1];return h.useEffect((function(){Iq()(t,r)||o(t)}),[r,o,t]),h.useMemo((function(){return zZ(r,r.children)}),[r])}(a),w=x.domain,j=x.scale,S=x.style,k=x.origin,C=h.useMemo((function(){return qZ(i,b,x).map((function(e,t){var n=ZN()({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 sF(e)}),[e]),E=h.useMemo((function(){if(u){var e=eL()({},s.props,_,O);return h.cloneElement(s,e)}return h.cloneElement(c,O)}),[c,u,s,_,O]),T=h.useMemo((function(){return B$(i)}),[i]),P=K$(e);return h.useEffect((function(){return function(){e.animate&&o(P,i)}}),[o,P,e,i]),QN()(T)?h.cloneElement(E,E.props,C):h.createElement(Vq,{container:E,eventKey:l,events:T,externalEventMutations:d},C)};ZZ.propTypes=YZ(YZ(YZ({},dV.baseProps),dV.dataProps),{},{children:MZ().oneOfType([MZ().arrayOf(MZ().node),MZ().node]),horizontal:MZ().bool,offset:MZ().number}),ZZ.defaultProps={containerComponent:h.createElement(sq,null),groupComponent:h.createElement("g",null),samples:50,sortOrder:"ascending",standalone:!0,theme:_q.grayscale};var JZ={role:"group",expectedComponents:["groupComponent","containerComponent","labelComponent"],getChildren:qZ},eJ=Object.assign(h.memo(ZZ,Iq()),JZ);eJ.displayName="VictoryGroup";var tJ=n(7667),nJ=n.n(tJ),rJ=function(e){var t=e.polar,n=WL(e,"bar"),r=e.disableInlineStyles?{}:HL(e.style,n),o=e.range||{x:QL(e,"x"),y:QL(e,"y")},i={x:zK(e,"x"),y:zK(e,"y")},a={x:iK(e,"x").domain(i.x).range(e.horizontal?o.y:o.x),y:iK(e,"y").domain(i.y).range(e.horizontal?o.x:o.y)},l=t?e.origin||YL(e):void 0,s=OK(e);return s=function(e,t,n){var r=function(e){return void 0!==e},o=pL(t.x),i=fL(t.x),a=pL(t.y),l=fL(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),ZN()({},e,BF()({_x:t,_y:o,_y0:i,_y1:s},zF()))):e}))}(s,i,0),{style:r,data:s,scale:a,domain:i,origin:l}},oJ=function(e,t){var n=ZL(e,t,"bar"),r=e=ZN()({},n,rJ(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=eY()(n.eventKey)?r:n.eventKey,h=function(e,t){var n=function(n){var r="log"===uK(e.scale[n])?1/Number.MAX_SAFE_INTEGER:0,o=pL(e.domain[n]),i=fL(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 BL(e,ZN()({},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=PG(e,n,r);return(void 0!==E&&null!==E||j&&(c||m))&&(t[u].labels=RG(e,r)),t}),_)},iJ=function(e,t){var n={topLeft:0,topRight:0,bottomLeft:0,bottomRight:0};return e?dF()(e)?function(e,t){var n={topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},r=function(r,o){eY()(e[r])?eY()(e[o])||(n[r]=KL(e[o],t)):n[r]=KL(e[r],t)};return r("topLeft","top"),r("topRight","top"),r("bottomLeft","bottom"),r("bottomRight","bottom"),n}(e,t):(n.topLeft=KL(e,t),n.topRight=KL(e,t),n):n};function aJ(e){return function(){return e}}const lJ=Math.abs,sJ=Math.atan2,uJ=Math.cos,cJ=Math.max,dJ=Math.min,fJ=Math.sin,pJ=Math.sqrt,hJ=1e-12,yJ=Math.PI,gJ=yJ/2,mJ=2*yJ;function vJ(e){return e>=1?gJ:e<=-1?-gJ:Math.asin(e)}const bJ=Math.PI,xJ=2*bJ,wJ=1e-6,jJ=xJ-wJ;function SJ(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class kJ{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?SJ:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return SJ;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>wJ)if(Math.abs(c*l-s*u)>wJ&&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((bJ-Math.acos((h+d-y)/(2*g*m)))/2),b=v/m,x=v/g;Math.abs(b-1)>wJ&&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)>wJ||Math.abs(this._y1-u)>wJ)&&this._append`L${s},${u}`,n&&(d<0&&(d=d%xJ+xJ),d>jJ?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>wJ&&this._append`A${n},${n},0,${+(d>=bJ)},${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 CJ(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 kJ(t)}function _J(e){return e.innerRadius}function OJ(e){return e.outerRadius}function EJ(e){return e.startAngle}function TJ(e){return e.endAngle}function PJ(e){return e&&e.padAngle}function AJ(e,t,n,r,o,i,a){var l=e-n,s=t-r,u=(a?i:-i)/pJ(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)*pJ(cJ(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 MJ(){var e=_J,t=OJ,n=aJ(0),r=null,o=EJ,i=TJ,a=PJ,l=null,s=CJ(u);function u(){var u,c,d,f=+e.apply(this,arguments),p=+t.apply(this,arguments),h=o.apply(this,arguments)-gJ,y=i.apply(this,arguments)-gJ,g=lJ(y-h),m=y>h;if(l||(l=u=s()),p<f&&(c=p,p=f,f=c),p>hJ)if(g>mJ-hJ)l.moveTo(p*uJ(h),p*fJ(h)),l.arc(0,0,p,h,y,!m),f>hJ&&(l.moveTo(f*uJ(y),f*fJ(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=_>hJ&&(r?+r.apply(this,arguments):pJ(f*f+p*p)),E=dJ(lJ(p-f)/2,+n.apply(this,arguments)),T=E,P=E;if(O>hJ){var A=vJ(O/f*fJ(_)),M=vJ(O/p*fJ(_));(k-=2*A)>hJ?(j+=A*=m?1:-1,S-=A):(k=0,j=S=(h+y)/2),(C-=2*M)>hJ?(x+=M*=m?1:-1,w-=M):(C=0,x=w=(h+y)/2)}var D=p*uJ(x),I=p*fJ(x),R=f*uJ(S),N=f*fJ(S);if(E>hJ){var L,F=p*uJ(w),B=p*fJ(w),U=f*uJ(j),z=f*fJ(j);if(g<yJ)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<hJ))return[e+(f=(c*(t-i)-d*(e-o))/f)*s,t+f*u]}(D,I,U,z,F,B,R,N)){var W=D-L[0],H=I-L[1],K=F-L[0],$=B-L[1],V=1/fJ(((d=(W*K+H*$)/(pJ(W*W+H*H)*pJ(K*K+$*$)))>1?0:d<-1?yJ:Math.acos(d))/2),q=pJ(L[0]*L[0]+L[1]*L[1]);T=dJ(E,(f-q)/(V-1)),P=dJ(E,(p-q)/(V+1))}else T=P=0}C>hJ?P>hJ?(v=AJ(U,z,D,I,p,P,m),b=AJ(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,sJ(v.y01,v.x01),sJ(b.y01,b.x01),!m):(l.arc(v.cx,v.cy,P,sJ(v.y01,v.x01),sJ(v.y11,v.x11),!m),l.arc(0,0,p,sJ(v.cy+v.y11,v.cx+v.x11),sJ(b.cy+b.y11,b.cx+b.x11),!m),l.arc(b.cx,b.cy,P,sJ(b.y11,b.x11),sJ(b.y01,b.x01),!m))):(l.moveTo(D,I),l.arc(0,0,p,x,w,!m)):l.moveTo(D,I),f>hJ&&k>hJ?T>hJ?(v=AJ(R,N,F,B,f,-T,m),b=AJ(D,I,U,z,f,-T,m),l.lineTo(v.cx+v.x01,v.cy+v.y01),T<E?l.arc(v.cx,v.cy,T,sJ(v.y01,v.x01),sJ(b.y01,b.x01),!m):(l.arc(v.cx,v.cy,T,sJ(v.y01,v.x01),sJ(v.y11,v.x11),!m),l.arc(0,0,f,sJ(v.cy+v.y11,v.cx+v.x11),sJ(b.cy+b.y11,b.cx+b.x11),m),l.arc(b.cx,b.cy,T,sJ(b.y11,b.x11),sJ(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-yJ/2;return[uJ(r)*n,fJ(r)*n]},u.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:aJ(+t),u):e},u.outerRadius=function(e){return arguments.length?(t="function"===typeof e?e:aJ(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n="function"===typeof e?e:aJ(+e),u):n},u.padRadius=function(e){return arguments.length?(r=null==e?null:"function"===typeof e?e:aJ(+e),u):r},u.startAngle=function(e){return arguments.length?(o="function"===typeof e?e:aJ(+e),u):o},u.endAngle=function(e){return arguments.length?(i="function"===typeof e?e:aJ(+e),u):i},u.padAngle=function(e){return arguments.length?(a="function"===typeof e?e:aJ(+e),u):a},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}kJ.prototype;var DJ=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 DJ(this.x+e.x,this.y+e.y)},subtract:function(e){return DJ(this.x-e.x,this.y-e.y)},scalarMult:function(e){return DJ(this.x*e,this.y*e)},scalarDivide:function(e){if(0===e)throw new Error("Division by 0 error");return DJ(this.x/e,this.y/e)},equals:function(e){return this.x===e.x&&this.y===e.y}}},IJ=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=[DJ(p-l*(f-c)/i,h+l*(d-u)/i),DJ(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 RJ(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?RJ(Object(n),!0).forEach((function(t){LJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function LJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FJ(e){return function(e){if(Array.isArray(e))return BJ(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 BJ(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 BJ(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 BJ(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 UJ=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}},zJ=function(e,t){var n=e.data,r=e.scale,o=void 0===n[t]._x1?"_x":"_x1";return r.x(n[t][o])},WJ=function(e){return-1*e+Math.PI/2},HJ=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")},KJ=function(e,t,n){var r=UJ(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=DJ(u+s*n["top".concat(e)],a+t*n["top".concat(e)]),y=IJ(h,n["top".concat(e)]),g=DJ(u+s*n["bottom".concat(e)],i-t*n["bottom".concat(e)]),m=IJ(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 HJ(a,n,i)},$J=function(e,t,n){var r=UJ(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=DJ(i+n["".concat(e,"Left")],u-s*n["".concat(e,"Left")]),y=IJ(h,n["".concat(e,"Left")]),g=DJ(a-n["".concat(e,"Right")],u-s*n["".concat(e,"Right")]),m=IJ(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(FJ(s),[u[3],u[2]])}(r,o,i);return HJ(a,i,"0 0 1")},VJ=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,FJ(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=zJ(e,t),a=Math.abs(r.x.range()[1]-r.x.range()[0]),l=0===t?zJ(e,n.length-1)-2*Math.PI:zJ(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=zJ(e,t),a=Math.abs(r.x.range()[1]-r.x.range()[0]),l=r.x.range()[1]===2*Math.PI?zJ(e,0)+2*Math.PI:r.x.range()[1],s=t===n.length-1?zJ(e,0)+2*Math.PI:zJ(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 MJ().innerRadius(u).outerRadius(c).startAngle(WJ(n)).endAngle(WJ(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(FJ(u.slice(0,b)),FJ(p.slice(m))),o=[].concat(FJ(d.slice(0,b)),FJ(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(FJ(p.slice(0,g+2)),FJ(c.slice(v))),o=[].concat(FJ(h.slice(0,g+2)),FJ(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(FJ(g),FJ(m)).reduce((function(e,t){return e+="".concat(t.command," ").concat(t.coords.join())}),"");return"".concat(v," z")},qJ=function(e,t,n){return e.getPath?function(e,t){return(0,e.getPath)(NJ(NJ({},e),UJ(e,t)))}(e,t):e.horizontal?$J(e,t,n):KJ(e,t,n)};function GJ(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 YJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GJ(Object(n),!0).forEach((function(t){QJ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GJ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function QJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var XJ=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 $L(ZN()(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 KL(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,ZN()({},e,{style:t})),r=iJ(e.cornerRadius,ZN()({},e,{style:t,barWidth:n})),o=KL(e.ariaLabel,e),i=KL(e.desc,e),a=KL(e.id,e),l=KL(e.tabIndex,e);return ZN()({},e,{ariaLabel:o,style:t,barWidth:n,cornerRadius:r,desc:i,id:a,tabIndex:l})},ZJ=function(e){var t=e=XJ(e),n=t.polar,r=t.origin,o=t.style,i=t.barWidth,a=t.cornerRadius,l=n?function(e,t){return VJ(e,t)}(e,a):qJ(e,i,a),s=n&&r?"translate(".concat(r.x,", ").concat(r.y,")"):void 0;return h.cloneElement(e.pathComponent,YJ(YJ({},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}))};ZJ.propTypes=YJ(YJ({},dV.primitiveProps),{},{alignment:nJ().oneOf(["start","middle","end"]),barRatio:nJ().number,barWidth:nJ().oneOfType([nJ().number,nJ().func]),cornerRadius:nJ().oneOfType([nJ().number,nJ().func,nJ().shape({top:nJ().oneOfType([nJ().number,nJ().func]),topLeft:nJ().oneOfType([nJ().number,nJ().func]),topRight:nJ().oneOfType([nJ().number,nJ().func]),bottom:nJ().oneOfType([nJ().number,nJ().func]),bottomLeft:nJ().oneOfType([nJ().number,nJ().func]),bottomRight:nJ().oneOfType([nJ().number,nJ().func])})]),datum:nJ().object,getPath:nJ().func,horizontal:nJ().bool,pathComponent:nJ().element,width:nJ().number,x:nJ().number,y:nJ().number,y0:nJ().number}),ZJ.defaultProps={defaultBarWidth:8,pathComponent:h.createElement(ZQ,null),role:"presentation",shapeRendering:"auto"};var JJ=ZJ;function e0(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 t0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e0(Object(n),!0).forEach((function(t){n0(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e0(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r0(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 o0(e,t){return o0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o0(e,t)}function i0(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(Wa){return!1}}();return function(){var n,r=a0(e);if(t){var o=a0(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 a0(e){return a0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a0(e)}var l0={width:450,height:300,padding:50},s0=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&&o0(e,t)}(i,e);var t,n,r,o=i0(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=ZL(this.props,l0,t);if(this.shouldAnimate())return this.animateComponent(n,e);var r=this.renderData(n),o=n.standalone?this.renderContainer(n.containerComponent,r):r;return uF(o,n)}}],n&&r0(t.prototype,n),r&&r0(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);s0.animationWhitelist=["data","domain","height","padding","style","width"],s0.displayName="VictoryBar",s0.role="bar",s0.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}}}},s0.propTypes=t0(t0(t0({},dV.baseProps),dV.dataProps),{},{alignment:nJ().oneOf(["start","middle","end"]),barRatio:nJ().number,barWidth:nJ().oneOfType([nJ().number,nJ().func]),cornerRadius:nJ().oneOfType([nJ().number,nJ().func,nJ().shape({top:nJ().oneOfType([nJ().number,nJ().func]),topLeft:nJ().oneOfType([nJ().number,nJ().func]),topRight:nJ().oneOfType([nJ().number,nJ().func]),bottom:nJ().oneOfType([nJ().number,nJ().func]),bottomLeft:nJ().oneOfType([nJ().number,nJ().func]),bottomRight:nJ().oneOfType([nJ().number,nJ().func])})]),getPath:nJ().func,horizontal:nJ().bool}),s0.defaultProps={containerComponent:h.createElement(sq,null),data:[{x:1,y:1},{x:2,y:2},{x:3,y:3},{x:4,y:4}],dataComponent:h.createElement(JJ,null),groupComponent:h.createElement("g",{role:"presentation"}),labelComponent:h.createElement(ZG,null),samples:50,sortOrder:"ascending",standalone:!0,theme:_q.grayscale},s0.getDomain=zK,s0.getData=OK,s0.getBaseProps=function(e){return oJ(e,l0)},s0.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];var u0=mQ(s0),c0=n(840),d0=n.n(c0),f0=function(e,t){var n=ZL(e,t,"line");e=ZN()({},n,function(e){var t=OK(e);t.length<2&&(t=[]);var n={x:QL(e,"x"),y:QL(e,"y")},r={x:LK(e,"x"),y:LK(e,"y")},o={x:iK(e,"x").domain(r.x).range(e.horizontal?n.y:n.x),y:iK(e,"y").domain(r.y).range(e.horizontal?n.x:n.y)},i=e.polar?e.origin||YL(e):void 0,a=WL(e,"line");return{domain:r,data:t,scale:o,style:HL(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=PG(e,n,r);(void 0!==o&&null!==o||x&&(a||y))&&(t[eY()(n.eventKey)?r:n.eventKey]={labels:RG(e,r)});return t}),S)},p0=Array.prototype.slice;function h0(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}function y0(e){this._context=e}function g0(e){return new y0(e)}function m0(e){return e[0]}function v0(e){return e[1]}function b0(e,t){var n=aJ(!0),r=null,o=g0,i=null,a=CJ(l);function l(l){var s,u,c,d=(l=h0(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?m0:aJ(e),t="function"===typeof t?t:void 0===t?v0:aJ(t),l.x=function(t){return arguments.length?(e="function"===typeof t?t:aJ(+t),l):e},l.y=function(e){return arguments.length?(t="function"===typeof e?e:aJ(+e),l):t},l.defined=function(e){return arguments.length?(n="function"===typeof e?e:aJ(!!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 x0(e,t,n){var r=null,o=aJ(!0),i=null,a=g0,l=null,s=CJ(u);function u(u){var c,d,f,p,h,y=(u=h0(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 b0().defined(o).curve(a).context(i)}return e="function"===typeof e?e:void 0===e?m0:aJ(+e),t="function"===typeof t?t:aJ(void 0===t?0:+t),n="function"===typeof n?n:void 0===n?v0:aJ(+n),u.x=function(t){return arguments.length?(e="function"===typeof t?t:aJ(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:aJ(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"===typeof e?e:aJ(+e),u):r},u.y=function(e){return arguments.length?(t="function"===typeof e?e:aJ(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"===typeof e?e:aJ(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:aJ(+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:aJ(!!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 w0(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function j0(e){return e}function S0(){var e=j0,t=w0,n=null,r=aJ(0),o=aJ(mJ),i=aJ(0);function a(a){var l,s,u,c,d,f=(a=h0(a)).length,p=0,h=new Array(f),y=new Array(f),g=+r.apply(this,arguments),m=Math.min(mJ,Math.max(-mJ,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:aJ(+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:aJ(+e),a):r},a.endAngle=function(e){return arguments.length?(o="function"===typeof e?e:aJ(+e),a):o},a.padAngle=function(e){return arguments.length?(i="function"===typeof e?e:aJ(+e),a):i},a}y0.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 k0=_0(g0);function C0(e){this._curve=e}function _0(e){function t(t){return new C0(e(t))}return t._curve=e,t}function O0(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(_0(e)):t()._curve},e}function E0(){return O0(b0().curve(k0))}function T0(){var e=x0().curve(k0),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 O0(n())},delete e.lineX0,e.lineEndAngle=function(){return O0(r())},delete e.lineX1,e.lineInnerRadius=function(){return O0(o())},delete e.lineY0,e.lineOuterRadius=function(){return O0(i())},delete e.lineY1,e.curve=function(e){return arguments.length?t(_0(e)):t()._curve},e}function P0(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}C0.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 A0{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 M0{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=P0(this._x0,this._y0),r=P0(this._x0,this._y0=(this._y0+t)/2),o=P0(e,this._y0),i=P0(e,t);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...o,...i)}this._x0=e,this._y0=t}}function D0(e){return new A0(e,!0)}function I0(e){return new A0(e,!1)}function R0(e){return new M0(e)}function N0(e){return e.source}function L0(e){return e.target}function F0(e){let t=N0,n=L0,r=m0,o=v0,i=null,a=null,l=CJ(s);function s(){let s;const u=p0.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:aJ(+e),s):r},s.y=function(e){return arguments.length?(o="function"===typeof e?e:aJ(+e),s):o},s.context=function(t){return arguments.length?(null==t?i=a=null:a=e(i=t),s):i},s}function B0(){return F0(D0)}function U0(){return F0(I0)}function z0(){const e=F0(R0);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const W0=pJ(3);var H0={draw(e,t){const n=.59436*pJ(t+dJ(t/28,.75)),r=n/2,o=r*W0;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-o,-r),e.lineTo(o,r),e.moveTo(-o,r),e.lineTo(o,-r)}},K0={draw(e,t){const n=pJ(t/yJ);e.moveTo(n,0),e.arc(0,0,n,0,mJ)}},$0={draw(e,t){const n=pJ(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 V0=pJ(1/3),q0=2*V0;var G0={draw(e,t){const n=pJ(t/q0),r=n*V0;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Y0={draw(e,t){const n=.62625*pJ(t);e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},Q0={draw(e,t){const n=.87559*pJ(t-dJ(t/7,2));e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},X0={draw(e,t){const n=pJ(t),r=-n/2;e.rect(r,r,n,n)}},Z0={draw(e,t){const n=.4431*pJ(t);e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};const J0=fJ(yJ/10)/fJ(7*yJ/10),e1=fJ(mJ/10)*J0,t1=-uJ(mJ/10)*J0;var n1={draw(e,t){const n=pJ(.8908130915292852*t),r=e1*n,o=t1*n;e.moveTo(0,-n),e.lineTo(r,o);for(let i=1;i<5;++i){const t=mJ*i/5,a=uJ(t),l=fJ(t);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*o,l*r+a*o)}e.closePath()}};const r1=pJ(3);var o1={draw(e,t){const n=-pJ(t/(3*r1));e.moveTo(0,2*n),e.lineTo(-r1*n,-n),e.lineTo(r1*n,-n),e.closePath()}};const i1=pJ(3);var a1={draw(e,t){const n=.6824*pJ(t),r=n/2,o=n*i1/2;e.moveTo(0,-n),e.lineTo(o,r),e.lineTo(-o,r),e.closePath()}};const l1=-.5,s1=pJ(3)/2,u1=1/pJ(12),c1=3*(u1/2+1);var d1={draw(e,t){const n=pJ(t/c1),r=n/2,o=n*u1,i=r,a=n*u1+n,l=-i,s=a;e.moveTo(r,o),e.lineTo(i,a),e.lineTo(l,s),e.lineTo(l1*r-s1*o,s1*r+l1*o),e.lineTo(l1*i-s1*a,s1*i+l1*a),e.lineTo(l1*l-s1*s,s1*l+l1*s),e.lineTo(l1*r+s1*o,l1*o-s1*r),e.lineTo(l1*i+s1*a,l1*a-s1*i),e.lineTo(l1*l+s1*s,l1*s-s1*l),e.closePath()}},f1={draw(e,t){const n=.6189*pJ(t-dJ(t/6,1.7));e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};const p1=[K0,$0,G0,X0,n1,o1,d1],h1=[K0,Q0,f1,a1,H0,Z0,Y0];function y1(e,t){let n=null,r=CJ(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:aJ(e||K0),t="function"===typeof t?t:aJ(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"===typeof t?t:aJ(t),o):e},o.size=function(e){return arguments.length?(t="function"===typeof e?e:aJ(+e),o):t},o.context=function(e){return arguments.length?(n=null==e?null:e,o):n},o}function g1(){}function m1(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 v1(e){this._context=e}function b1(e){return new v1(e)}function x1(e){this._context=e}function w1(e){return new x1(e)}function j1(e){this._context=e}function S1(e){return new j1(e)}function k1(e,t){this._basis=new v1(e),this._beta=t}v1.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:m1(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:m1(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},x1.prototype={areaStart:g1,areaEnd:g1,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:m1(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},j1.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:m1(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},k1.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 C1=function e(t){function n(e){return 1===t?new v1(e):new k1(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function _1(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 O1(e,t){this._context=e,this._k=(1-t)/6}O1.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:_1(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:_1(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 E1=function e(t){function n(e){return new O1(e,t)}return n.tension=function(t){return e(+t)},n}(0);function T1(e,t){this._context=e,this._k=(1-t)/6}T1.prototype={areaStart:g1,areaEnd:g1,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:_1(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 P1=function e(t){function n(e){return new T1(e,t)}return n.tension=function(t){return e(+t)},n}(0);function A1(e,t){this._context=e,this._k=(1-t)/6}A1.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:_1(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 M1=function e(t){function n(e){return new A1(e,t)}return n.tension=function(t){return e(+t)},n}(0);function D1(e,t,n){var r=e._x1,o=e._y1,i=e._x2,a=e._y2;if(e._l01_a>hJ){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>hJ){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 I1(e,t){this._context=e,this._alpha=t}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._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:D1(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 R1=function e(t){function n(e){return t?new I1(e,t):new O1(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function N1(e,t){this._context=e,this._alpha=t}N1.prototype={areaStart:g1,areaEnd:g1,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:D1(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 L1=function e(t){function n(e){return t?new N1(e,t):new T1(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function F1(e,t){this._context=e,this._alpha=t}F1.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:D1(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 B1=function e(t){function n(e){return t?new F1(e,t):new A1(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function U1(e){this._context=e}function z1(e){return new U1(e)}function W1(e){return e<0?-1:1}function H1(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(W1(i)+W1(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(l))||0}function K1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $1(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 V1(e){this._context=e}function q1(e){this._context=new G1(e)}function G1(e){this._context=e}function Y1(e){return new V1(e)}function Q1(e){return new q1(e)}function X1(e){this._context=e}function Z1(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 J1(e){return new X1(e)}function e5(e,t){this._context=e,this._t=t}function t5(e){return new e5(e,.5)}function n5(e){return new e5(e,0)}function r5(e){return new e5(e,1)}function o5(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 i5(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function a5(e,t){return e[t]}function l5(e){const t=[];return t.key=e,t}function s5(){var e=aJ([]),t=i5,n=o5,r=a5;function o(o){var i,a,l=Array.from(e.apply(this,arguments),l5),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=h0(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:aJ(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"===typeof e?e:aJ(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?i5:"function"===typeof e?e:aJ(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?o5:e,o):n},o}function u5(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}o5(e,t)}}function c5(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 d5(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}o5(e,t)}}function f5(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,o5(e,t)}}function p5(e){var t=e.map(h5);return i5(e).sort((function(e,n){return t[e]-t[n]}))}function h5(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 y5(e){var t=e.map(g5);return i5(e).sort((function(e,n){return t[e]-t[n]}))}function g5(e){for(var t,n=0,r=-1,o=e.length;++r<o;)(t=+e[r][1])&&(n+=t);return n}function m5(e){return y5(e).reverse()}function v5(e){var t,n,r=e.length,o=e.map(g5),i=p5(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 b5(e){return i5(e).reverse()}U1.prototype={areaStart:g1,areaEnd:g1,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))}},V1.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:$1(this,this._t0,K1(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,$1(this,K1(this,n=H1(this,e,t)),n);break;default:$1(this,this._t0,n=H1(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(q1.prototype=Object.create(V1.prototype)).point=function(e,t){V1.prototype.point.call(this,t,e)},G1.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)}},X1.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=Z1(e),o=Z1(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)}},e5.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 x5=function(e){var t=void 0!==e._y1?e._y1:e._y;return null!==t&&void 0!==t&&null!==e._y0},w5=function(e){return function(t){return e.x(void 0!==t._x1?t._x1:t._x)}},j5=function(e){return function(t){return e.y(void 0!==t._y1?t._y1:t._y)}},S5=function(e){return"curve".concat(function(e){return e&&e[0].toUpperCase()+e.slice(1)}(e))},k5=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)?S5(t):function(e){return"".concat(S5(e),"Closed")}(t);return l[o]}return g0},C5=function(e){var t=e.polar,n=e.scale,r=e.horizontal;return t?E0().defined(x5).curve(k5(e)).angle(function(e){return function(t){return-1*e.x(void 0!==t._x1?t._x1:t._x)+Math.PI/2}}(n)).radius(j5(n)):b0().defined(x5).curve(k5(e)).x(r?j5(n):w5(n)).y(r?w5(n):j5(n))};function _5(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 O5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_5(Object(n),!0).forEach((function(t){E5(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T5=function(e){e=function(e){var t=KL(e.ariaLabel,e),n=KL(e.id,e),r=$L(ZN()({fill:"none",stroke:"black"},e.style),e),o=KL(e.tabIndex,e);return ZN()({},e,{ariaLabel:t,id:n,style:r,tabIndex:o})}(e);var t=sF(e),n=e,r=n.polar,o=n.origin,i=C5(e),a=r&&o?"translate(".concat(o.x,", ").concat(o.y,")"):void 0,l=i(e.data);return h.cloneElement(e.pathComponent,O5(O5(O5({},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}))};T5.propTypes=O5(O5({},dV.primitiveProps),{},{interpolation:d0().oneOfType([d0().string,d0().func]),openCurve:d0().bool,origin:d0().shape({x:d0().number.isRequired,y:d0().number.isRequired}),pathComponent:d0().element,polar:d0().bool}),T5.defaultProps={pathComponent:h.createElement(ZQ,null),role:"presentation",shapeRendering:"auto"};var P5=function(e){return h.createElement("defs",null,h.createElement("clipPath",{id:e.clipId},e.children))};function A5(e){return function(e){if(Array.isArray(e))return M5(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 M5(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 M5(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 M5(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 D5(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 I5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D5(Object(n),!0).forEach((function(t){R5(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N5(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 L5(e,t){return L5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L5(e,t)}function F5(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(Wa){return!1}}();return function(){var n,r=B5(e);if(t){var o=B5(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 B5(e){return B5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},B5(e)}P5.propTypes={children:V$().oneOfType([V$().arrayOf(V$().node),V$().node]),clipId:V$().oneOfType([V$().number,V$().string])};var U5=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&&L5(e,t)}(i,e);var t,n,r,o=F5(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=DF()(e)&&void 0!==e.clipId?e.clipId:CV()("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=UL({padding:e.clipPadding}),f=e.radius||GL(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=sF(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=ZN()({className:l,style:r,transform:i,key:"clipped-group-".concat(t),clipPath:"url(#".concat(t,")")},o);return h.cloneElement(s,I5(I5({},d),{},{tabIndex:u},n),[c].concat(A5(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,ZN()({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=UL({padding:e.clipPadding}),v=m.top,b=m.bottom,x=m.left,w=m.right;if(r){var j=e.radius||GL(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,ZN()({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=QL(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=QL(e,t);return r?Math.min.apply(Math,A5(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=eL()({},this.props,{clipHeight:e,clipWidth:t,translateX:n,translateY:r});return this.renderClippedGroup(o,this.clipId)}}],n&&N5(t.prototype,n),r&&N5(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);function z5(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 W5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z5(Object(n),!0).forEach((function(t){H5(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function H5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K5(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 $5(e,t){return $5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$5(e,t)}function V5(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(Wa){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)}U5.displayName="VictoryClipContainer",U5.role="container",U5.propTypes={"aria-label":V$().string,children:V$().oneOfType([V$().arrayOf(V$().node),V$().node]),circleComponent:V$().element,className:V$().string,clipHeight:oV,clipId:V$().oneOfType([V$().number,V$().string]),clipPadding:V$().shape({top:V$().number,bottom:V$().number,left:V$().number,right:V$().number}),clipPathComponent:V$().element,clipWidth:oV,events:V$().object,groupComponent:V$().element,origin:V$().shape({x:oV,y:oV}),polar:V$().bool,radius:oV,style:V$().object,tabIndex:V$().number,transform:V$().string,translateX:V$().number,translateY:V$().number},U5.defaultProps={circleComponent:h.createElement(bV,null),rectComponent:h.createElement(yV,null),clipPathComponent:h.createElement(P5,null),groupComponent:h.createElement("g",null)};var G5={width:450,height:300,padding:50,interpolation:"linear"},Y5=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&&$5(e,t)}(i,e);var t,n,r,o=V5(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=ZL(this.props,G5,t);if(this.shouldAnimate())return this.animateComponent(n,e);var r=this.renderContinuousData(n),o=n.standalone?this.renderContainer(n.containerComponent,r):r;return uF(o,n)}}],n&&K5(t.prototype,n),r&&K5(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);Y5.animationWhitelist=["data","domain","height","padding","samples","style","width"],Y5.displayName="VictoryLine",Y5.role="line",Y5.defaultTransitions={onLoad:{duration:2e3},onExit:{duration:500},onEnter:{duration:500}},Y5.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}}}},Y5.continuous=!0,Y5.propTypes=W5(W5(W5({},dV.baseProps),dV.dataProps),{},{interpolation:d0().oneOfType([d0().oneOf(["basis","bundle","cardinal","catmullRom","linear","monotoneX","monotoneY","natural","step","stepAfter","stepBefore"]),d0().func]),label:nV(d0().string,"Use `labels` instead for individual data labels")}),Y5.defaultProps={containerComponent:h.createElement(sq,null),dataComponent:h.createElement(T5,null),labelComponent:h.createElement(ZG,{renderInPortal:!0}),groupComponent:h.createElement(U5,null),samples:50,sortKey:"x",sortOrder:"ascending",standalone:!0,theme:_q.grayscale},Y5.getDomain=LK,Y5.getData=OK,Y5.getBaseProps=function(e){return f0(e,G5)},Y5.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];var Q5=mQ(Y5,{components:[{name:"parent",index:"parent"},{name:"data",index:"all"},{name:"labels"}]});const X5={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:mo.n1,stroke:"transparent"},Z5={axis:{fill:"transparent",stroke:"none"},grid:{fill:"none",stroke:"none",pointerEvents:"none"},ticks:{fill:"transparent",size:1,stroke:"none"},axisLabel:X5,tickLabels:X5};var J5={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:mo.r7,blue:mo.b6},area:{style:{labels:X5,data:{stroke:mo.b6,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}}},axis:{style:Z5},dependentAxis:{style:{...Z5,grid:{...Z5.grid,stroke:"rgba(0,0,0,.2)",strokeDasharray:"1,1"},tickLabels:{...X5,padding:5}}},independentAxis:{style:{...Z5,axis:{...Z5.axis,stroke:"rgba(0,0,0,.2)"},tickLabels:{...X5,padding:10}}},bar:{style:{labels:X5,data:{fill:mo.b6,stroke:"none"}}},line:{style:{labels:X5,data:{fill:"none",stroke:mo.b6,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}}},voronoi:{style:{labels:X5}},chart:{padding:{top:20,left:65,right:20,bottom:50}}};function e2(e){let{style:t,children:n}=e;const r=(0,h.useRef)(null);return(0,jo.jsxs)(ms,{style:[{height:300,position:"relative",flexShrink:0},t],children:[(0,jo.jsx)("div",{ref:r}),(0,jo.jsx)(Iw,{children:e=>{let{width:t,height:o}=e;return(0,jo.jsx)("div",{style:{width:t,height:o},children:n(t,o,r.current)})}})]})}class t2 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,jo.jsx)("div",{...(0,so.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":mo.n1,color:u?"inherit":"white",padding:10},!u&&(0,so.bb)({position:"absolute",display:"inline-block",borderTop:"7px solid transparent",borderBottom:"7px solid transparent",["right"===s?"borderRight":"borderLeft"]:"7px solid "+mo.n1,["right"===s?"left":"right"]:-6,top:"calc(50% - 7px)",content:'" "'}),d),children:o.premadeLabel}),i)):null}}t2.defaultEvents=aZ.defaultEvents;var n2=t2;var r2=function(e){let{style:t,start:n,end:r,graphData:o,isConcise:i,compact:a}=e;return(0,jo.jsx)(e2,{children:(e,t,n)=>o&&(0,jo.jsxs)(WX,{scale:{x:"time",y:"linear"},theme:J5,domainPadding:10,width:e,height:t,containerComponent:(0,jo.jsx)(PZ,{voronoiDimension:"x"}),children:[(0,jo.jsxs)(eJ,{children:[(0,jo.jsx)(u0,{data:o.expenses,style:{data:{fill:J5.colors.red}}}),(0,jo.jsx)(u0,{data:o.income})]}),(0,jo.jsx)(Q5,{data:o.balances,labelComponent:(0,jo.jsx)(n2,{portalHost:n}),labels:e=>e.premadeLabel,style:{data:{stroke:mo.n5}}}),(0,jo.jsx)(qQ,{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,jo.jsx)(qQ,{dependentAxis:!0,crossAxis:!1})]})})};function o2(e,t,n){const r=Zp();return n>r&&(n=r),t<e&&(t=e),[t,n]}function i2(e){const t=Zp();return[nh(t,e),t]}var a2=function(e){let{title:t,start:n,end:r,show1Month:o,allMonths:i,onChangeDates:a}=e;return(0,jo.jsxs)(ms,{style:{padding:20,paddingTop:0,flexShrink:0},children:[(0,jo.jsxs)(Ps,{to:"/reports",bare:!0,style:{marginBottom:"15",alignSelf:"flex-start"},children:[(0,jo.jsx)(mP,{width:10,height:10,style:{marginRight:5}})," Back"]}),(0,jo.jsx)(ms,{style:vo.veryLargeText,children:t}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",marginTop:15},children:[(0,jo.jsxs)("div",{children:[(0,jo.jsx)(Ls,{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)),o2(r,t,n)}(i,e.target.value,r)),value:n,children:i.map((e=>(0,jo.jsx)("option",{value:e.name,children:e.pretty},e.name)))})," ","to"," ",(0,jo.jsx)(Ls,{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)),o2(r,t,n)}(i,n,e.target.value)),value:r,children:i.map((e=>(0,jo.jsx)("option",{value:e.name,children:e.pretty},e.name)))})]}),o&&(0,jo.jsx)(As,{bare:!0,style:{marginLeft:15},onClick:()=>a(...i2(1)),children:"1 month"}),(0,jo.jsx)(As,{bare:!0,style:{marginLeft:15},onClick:()=>a(...i2(2)),children:"3 months"}),(0,jo.jsx)(As,{bare:!0,style:{marginLeft:15},onClick:()=>a(...i2(5)),children:"6 months"}),(0,jo.jsx)(As,{bare:!0,style:{marginLeft:15},onClick:()=>a(...i2(12)),children:"1 Year"}),(0,jo.jsx)(As,{bare:!0,style:{marginLeft:15},onClick:()=>a(...function(e){return[e[e.length-1].name,Zp()]}(i)),children:"All Time"})]})]})};var l2=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 s2=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)((()=>WN(lk(o),lk(n))>93)),s=(0,h.useMemo)((()=>GN(n,o,a)),[n,o,a]),u=l2("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,jo.jsxs)(ms,{style:[vo.page,{minWidth:650,overflow:"hidden"}],children:[(0,jo.jsx)(a2,{title:"Cash Flow",allMonths:e,start:ch(n),end:ch(o),show1Month:!0,onChangeDates:function(e,t){const n=WN(lk(t),lk(e))>93;let o=t+"-31";o>Jp()&&(o=Jp()),r(e+"-01"),i(o),l(n)}}),(0,jo.jsxs)(ms,{style:{backgroundColor:"white",paddingLeft:30,paddingRight:30,overflow:"auto"},children:[(0,jo.jsxs)(ms,{style:{paddingTop:20,paddingRight:20,flexShrink:0,alignItems:"flex-end",color:mo.n3},children:[(0,jo.jsx)(zs,{style:{marginBottom:5,minWidth:160},left:(0,jo.jsx)(Cs,{children:"Income:"}),right:(0,jo.jsx)(gs,{style:{fontWeight:600},children:Wr(f)})}),(0,jo.jsx)(zs,{style:{marginBottom:5,minWidth:160},left:(0,jo.jsx)(Cs,{children:"Expenses:"}),right:(0,jo.jsx)(gs,{style:{fontWeight:600},children:Wr(d)})}),(0,jo.jsx)(gs,{style:{fontWeight:600},children:(0,jo.jsx)(HN,{amount:f+d})})]}),(0,jo.jsx)(r2,{start:n,end:o,graphData:c,isConcise:a}),(0,jo.jsxs)(ms,{style:{marginTop:30},children:[(0,jo.jsx)(Ws,{children:(0,jo.jsx)("strong",{children:"How is cash flow calculated?"})}),(0,jo.jsx)(Ws,{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 u2(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([yr(hr("transactions").filter({account:n.id,date:{$lt:e+"-01"}}).calculate({$sum:"$amount"})).then((e=>{let{data:t}=e;return t})),yr(hr("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:qN(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-Vr(c.y):0,p=(0,jo.jsxs)("div",{children:[(0,jo.jsx)("div",{style:{marginBottom:10},children:(0,jo.jsx)("strong",{children:Hp(d,"MMMM yyyy")})}),(0,jo.jsxs)("div",{style:{lineHeight:1.5},children:[(0,jo.jsx)(zs,{left:"Assets:",right:Wr(s)}),(0,jo.jsx)(zs,{left:"Debt:",right:`-${Wr(r)}`}),(0,jo.jsx)(zs,{left:"Net worth:",right:(0,jo.jsx)("strong",{children:Wr(u)})}),(0,jo.jsx)(zs,{left:"Change:",right:Wr(f)})]})]});return 0===e.length&&(a=u),l=u,e.push({x:d,y:qr(u),premadeLabel:p}),e}),[]);return{graphData:{data:s,hasNegative:i,start:t,end:n},netWorth:l,totalChange:l-a}}(i,e,t))}}var c2=n(311),d2=n.n(c2),f2=function(e){var t=e.polar,n=WL(e,"area"),r=HL(e.style,n),o={x:QL(e,"x"),y:QL(e,"y")},i={x:zK(e,"x"),y:zK(e,"y")},a={x:iK(e,"x").domain(i.x).range(e.horizontal?o.y:o.x),y:iK(e,"y").domain(i.y).range(e.horizontal?o.x:o.y)},l=t?e.origin||YL(e):void 0,s=function(e,t){var n=OK(e);n.length<2&&(n=[]);var r=function(e){var n="log"===uK(t[e])?1/Number.MAX_SAFE_INTEGER:0,r=t[e].domain(),o=pL(r),i=fL(r),a=n;return o<0&&i<=0?a=i:o>=0&&i>0&&(a=o),uL(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 ZN()({},e,{_y0:n,_y1:t,_x0:i,_x1:o})}))}(e,a);return{style:r,data:s,scale:a,domain:i,origin:l}};function p2(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 h2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p2(Object(n),!0).forEach((function(t){y2(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p2(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g2=function(e){var t=void 0!==e._y1?e._y1:e._y;return null!==t&&void 0!==t&&null!==e._y0},m2=function(e){return function(t){return e.x(void 0!==t._x1?t._x1:t._x)}},v2=function(e){return function(t){return e.y(void 0!==t._y1?t._y1:t._y)}},b2=function(e){return function(t){return e.y(t._y0)}},x2=function(e){var t=e.polar,n=e.scale,r=k5(e);return t?T0().defined(g2).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(v2(n)).innerRadius(b2(n)):function(e){var t=e.horizontal,n=e.scale,r=k5(e);return t?x0().defined(g2).curve(r).x0(b2(n)).x1(v2(n)).y(m2(n)):x0().defined(g2).curve(r).x(m2(n)).y1(v2(n)).y0(b2(n))}(e)},w2=function(e){e=function(e){var t=KL(e.ariaLabel,e),n=KL(e.desc,e),r=KL(e.id,e),o=$L(ZN()({fill:"black"},e.style),e),i=KL(e.tabIndex,e);return ZN()({},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=sF(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=x2(e),S=w&&C5(e),k=y.stroke?"none":y.fill,C=h2(h2({"aria-label":n,className:i,role:r,shapeRendering:o,transform:x},c),{},{clipPath:f,tabIndex:m}),_=h.cloneElement(u,ZN()({key:"".concat(p,"-area"),style:ZN()({},y,{stroke:k}),d:j(s),desc:g,tabIndex:m},C,v)),O=w?h.cloneElement(u,ZN()({key:"".concat(p,"-area-stroke"),style:ZN()({},y,{fill:"none"}),d:S(s)},C)):null;return w?h.cloneElement(d,v,[_,O]):_};function j2(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 S2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j2(Object(n),!0).forEach((function(t){k2(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C2(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 _2(e,t){return _2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_2(e,t)}function O2(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(Wa){return!1}}();return function(){var n,r=E2(e);if(t){var o=E2(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 E2(e){return E2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E2(e)}w2.propTypes=h2(h2({},dV.primitiveProps),{},{groupComponent:d2().element,interpolation:d2().oneOfType([d2().string,d2().func]),pathComponent:d2().element}),w2.defaultProps={groupComponent:h.createElement("g",null),pathComponent:h.createElement(ZQ,null),role:"presentation",shapeRendering:"auto"};var T2={width:450,height:300,padding:50,interpolation:"linear"},P2=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&&_2(e,t)}(i,e);var t,n,r,o=O2(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=ZL(this.props,T2,t);if(this.shouldAnimate())return this.animateComponent(n,e);var r=this.renderContinuousData(n),o=n.standalone?this.renderContainer(n.containerComponent,r):r;return uF(o,n)}}],n&&C2(t.prototype,n),r&&C2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(h.Component);P2.animationWhitelist=["data","domain","height","padding","style","width"],P2.propTypes=S2(S2(S2({},dV.baseProps),dV.dataProps),{},{interpolation:d2().oneOfType([d2().oneOf(["basis","cardinal","catmullRom","linear","monotoneX","monotoneY","natural","step","stepAfter","stepBefore"]),d2().func]),label:nV(d2().string,"Use `labels` instead for individual data labels")}),P2.defaultProps={containerComponent:h.createElement(sq,null),dataComponent:h.createElement(w2,null),groupComponent:h.createElement(U5,null),labelComponent:h.createElement(ZG,{renderInPortal:!0}),samples:50,sortKey:"x",sortOrder:"ascending",standalone:!0,theme:_q.grayscale},P2.displayName="VictoryArea",P2.role="area",P2.continuous=!0,P2.defaultTransitions={onLoad:{duration:2e3},onExit:{duration:500},onEnter:{duration:500}},P2.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}}}},P2.getDomain=zK,P2.getData=OK,P2.getBaseProps=function(e){return function(e,t){var n=ZL(e,t,"area"),r=e=ZN()({},n,f2(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=PG(e,n,r);return(void 0!==o&&null!==o||x&&(a||y))&&(t[eY()(n.eventKey)?r:n.eventKey]={labels:RG(e,r)}),t}),S)}(e,T2)},P2.expectedComponents=["dataComponent","labelComponent","groupComponent","containerComponent"];var A2=mQ(P2,{components:[{name:"parent",index:"parent"},{name:"data",index:"all"},{name:"labels"}]});function M2(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,jo.jsx)("svg",{children:(0,jo.jsxs)("defs",{children:[(0,jo.jsx)("clipPath",{id:"positive",children:(0,jo.jsx)("rect",{x:s,y:a.y[1],width:u-s,height:l-a.y[1]+1,fill:"#ffffff"})}),(0,jo.jsx)("clipPath",{id:"negative",children:(0,jo.jsx)("rect",{x:s,y:l+1,width:u-s,height:Math.max(a.y[0]-l-1,0),fill:"#ffffff"})}),(0,jo.jsxs)("linearGradient",{id:"positive-gradient",gradientUnits:"userSpaceOnUse",x1:0,y1:a.y[1],x2:0,y2:l,children:[(0,jo.jsx)("stop",{offset:"0%",stopColor:J5.colors.blueFadeStart}),(0,jo.jsx)("stop",{offset:"100%",stopColor:J5.colors.blueFadeEnd})]}),(0,jo.jsxs)("linearGradient",{id:"negative-gradient",gradientUnits:"userSpaceOnUse",x1:0,y1:l,x2:0,y2:a.y[0],children:[(0,jo.jsx)("stop",{offset:"0%",stopColor:J5.colors.redFadeEnd}),(0,jo.jsx)("stop",{offset:"100%",stopColor:J5.colors.redFadeStart})]})]})})}var D2=function(e){let{style:t,start:n,end:r,graphData:o,compact:i}=e;const a=i?eJ:WX;return(0,jo.jsx)(e2,{style:[t,i&&{height:"auto"}],children:(e,t,n)=>o&&(0,jo.jsxs)(a,{scale:{x:"time",y:"linear"},theme:J5,domainPadding:{x:0,y:10},width:e,height:t,containerComponent:(0,jo.jsx)(PZ,{voronoiDimension:"x"}),padding:i&&{top:0,bottom:0,left:0,right:0},children:[(0,jo.jsx)(M2,{start:o.start,end:o.end,data:o.data}),h.createElement(1===o.data.length?u0:A2,{data:o.data,labelComponent:(0,jo.jsx)(n2,{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,jo.jsx)(A2,{data:o.data,style:{data:{clipPath:"url(#negative)",fill:"url(#negative-gradient)",stroke:J5.colors.red,strokeLinejoin:"round"}}}),(0,jo.jsx)(A2,{data:o.data,style:{data:{fill:"none",stroke:"none"}}}),!i&&(0,jo.jsx)(qQ,{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,jo.jsx)(qQ,{dependentAxis:!0,crossAxis:!o.hasNegative})]})})};var I2=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)((()=>u2(o,a,t)),[o,a,t]),u=l2("net_worth",s);return(0,h.useEffect)((()=>{!async function(){const e=await qe("get-earliest-transaction"),t=Zp();let n=e?Qp(lk(KN(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,jo.jsxs)(ms,{style:[vo.page,{minWidth:650,overflow:"hidden"}],children:[(0,jo.jsx)(a2,{title:"Net Worth",allMonths:n,start:o,end:a,onChangeDates:function(e,t){i(e),l(t)}}),(0,jo.jsxs)(ms,{style:{backgroundColor:"white",padding:"30px",overflow:"auto"},children:[(0,jo.jsxs)(ms,{style:{textAlign:"right",paddingRight:20,flexShrink:0},children:[(0,jo.jsx)(ms,{style:[vo.largeText,{fontWeight:400,marginBottom:5}],children:Wr(u.netWorth)}),(0,jo.jsx)(HN,{amount:u.totalChange})]}),(0,jo.jsx)(D2,{start:o,end:a,graphData:u.graphData}),(0,jo.jsxs)(ms,{style:{marginTop:30},children:[(0,jo.jsx)(Ws,{children:(0,jo.jsx)("strong",{children:"How is net worth calculated?"})}),(0,jo.jsx)(Ws,{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 R2=function(e){let t,{start:n,end:r}=e;return n=lk(n),r=lk(r),t=n.getYear()!==r.getYear()?(0,jo.jsxs)("div",{children:[Hp(n,"MMM yyyy")," - ",Hp(r,"MMM yyyy")]}):n.getMonth()!==r.getMonth()?(0,jo.jsxs)("div",{children:[Hp(n,"MMM")," - ",Hp(r,"MMM yyyy")]}):Hp(r,"MMMM yyyy"),(0,jo.jsx)(Cs,{style:{color:mo.n6},children:t})};function N2(e){let{flex:t,to:n,style:r,children:o}=e;const i={flex:t,margin:15},a=(0,jo.jsx)(ms,{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,jo.jsx)(Es,{to:n,exact:!0,style:[{textDecoration:"none",flex:t},i],children:a}):a}function L2(e){let{accounts:t}=e;const n=Zp(),r=nh(n,5),o=(0,h.useMemo)((()=>u2(r,n,t)),[r,n,t]),i=l2("net_worth",o);return i?(0,jo.jsx)(N2,{flex:2,to:"/reports/net-worth",children:(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",padding:20},children:[(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(Cs,{style:[vo.mediumText,{fontWeight:500,marginBottom:5}],role:"heading",children:"Net Worth"}),(0,jo.jsx)(R2,{start:r,end:n})]}),(0,jo.jsxs)(ms,{style:{textAlign:"right"},children:[(0,jo.jsx)(Cs,{style:[vo.mediumText,{fontWeight:500,marginBottom:5}],children:Wr(i.netWorth)}),(0,jo.jsx)(HN,{amount:i.totalChange,style:{color:mo.n6,fontWeight:300}})]})]}),(0,jo.jsx)(D2,{start:r,end:n,graphData:i.graphData,compact:!0,style:{height:"auto",flex:1}})]})}):null}function F2(){const e=Jp(),t=Zp()+"-01",n=(0,h.useMemo)((()=>function(e,t){return async(n,r)=>{function o(){return hr("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 VN([o().filter({amount:{$gt:0}}),o().filter({amount:{$lt:0}})],(e=>{r({graphData:{income:e[0],expense:e[1]}})}))}}(t,e)),[t,e]),r=l2("cash_flow_simple",n);if(!r)return null;const{graphData:o}=r,i=-(o.expense||0),a=o.income||0;return(0,jo.jsx)(N2,{flex:1,to:"/reports/cash-flow",children:(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",padding:20},children:[(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsx)(Cs,{style:[vo.mediumText,{fontWeight:500,marginBottom:5}],role:"heading",children:"Cash Flow"}),(0,jo.jsx)(R2,{start:t,end:e})]}),(0,jo.jsx)(ms,{style:{textAlign:"right"},children:(0,jo.jsx)(HN,{amount:a-i,style:{color:mo.n6,fontWeight:300}})})]}),(0,jo.jsx)(e2,{style:{height:"auto",flex:1},children:(e,t,n)=>(0,jo.jsxs)(eJ,{colorScale:[J5.colors.blue,J5.colors.red],width:100,height:t,theme:J5,domain:{x:[0,100],y:[0,Math.max(a,i,100)]},containerComponent:(0,jo.jsx)(PZ,{voronoiDimension:"x"}),labelComponent:(0,jo.jsx)(n2,{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,jo.jsx)(u0,{barWidth:13,data:[{x:30,y:Math.max(a,5),premadeLabel:(0,jo.jsxs)("div",{style:{textAlign:"right"},children:[(0,jo.jsx)("div",{children:"Income"}),(0,jo.jsx)("div",{children:Wr(a)})]}),labelPosition:"left"}],labels:e=>e.premadeLabel}),(0,jo.jsx)(u0,{barWidth:13,data:[{x:60,y:Math.max(i,5),premadeLabel:(0,jo.jsxs)("div",{children:[(0,jo.jsx)("div",{children:"Expenses"}),(0,jo.jsx)("div",{children:Wr(i)})]}),labelPosition:"right",fill:J5.colors.red}],labels:e=>e.premadeLabel})]})})]})})}var B2=de((e=>({accounts:e.queries.accounts})),(t=>Q(e,t)))((function(e){let{accounts:t}=e;return(0,jo.jsxs)(ms,{style:[vo.page,{paddingLeft:40,paddingRight:40,minWidth:700}],children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",flex:"0 0 auto"},children:[(0,jo.jsx)(L2,{accounts:t}),(0,jo.jsx)(F2,{})]}),(0,jo.jsx)(ms,{style:{flex:"0 0 auto",flexDirection:"row"},children:(0,jo.jsxs)(N2,{style:[{color:"#a0a0a0",justifyContent:"center",alignItems:"center",width:200},vo.mediumText],children:["More reports",(0,jo.jsx)("br",{})," coming soon!"]})})]})}));function U2(){return(0,jo.jsxs)(ms,{style:{flex:1},"data-testid":"reports-page",children:[(0,jo.jsx)(Pi,{path:"/reports",exact:!0,component:B2}),(0,jo.jsx)(Pi,{path:"/reports/net-worth",exact:!0,component:I2}),(0,jo.jsx)(Pi,{path:"/reports/cash-flow",exact:!0,component:s2})]})}var z2=e=>(0,jo.jsx)("svg",{...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",style:{color:"#242134",...e.style},children:(0,jo.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 W2=43;function H2(e){let{schedule:t,status:n,onAction:r}=e,[o,i]=(0,h.useState)(!1);return(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(As,{bare:!0,onClick:e=>{e.stopPropagation(),i(!0)},children:(0,jo.jsx)(qx,{width:15,height:15,style:{color:"inherit",transform:"rotateZ(90deg)"}})}),o&&(0,jo.jsx)(Ss,{position:"bottom-right",width:150,style:{padding:0},onClose:()=>i(!1),children:(0,jo.jsx)(Us,{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 K2(e){let{amount:t,op:n}=e,r=Sh(t),o=Wr(Math.abs(r||0)),i="isapprox"===n||"isbetween"===n;return(0,jo.jsxs)(Vw,{width:100,plain:!0,style:{textAlign:"right",flexDirection:"row",alignItems:"center",padding:"0 5px"},name:"amount",children:[i&&(0,jo.jsx)(ms,{style:{textAlign:"left",color:mo.n7,lineHeight:"1em",marginRight:10},title:(i?"Approximately ":"")+o,children:"~"}),(0,jo.jsx)(gs,{style:{flex:1,color:r>0?mo.g5:null,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:(i?"Approximately ":"")+o,children:r>0?`+${o}`:`${o}`})]})}function $2(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?"+":"")+Wr(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,jo.jsxs)(ms,{style:[{flex:1},u],children:[(0,jo.jsxs)(oj,{height:W2,inset:15,version:"v2",children:[(0,jo.jsx)($w,{width:"flex",children:"Name"}),(0,jo.jsx)($w,{width:"flex",children:"Payee"}),(0,jo.jsx)($w,{width:"flex",children:"Account"}),(0,jo.jsx)($w,{width:110,children:"Next date"}),(0,jo.jsx)($w,{width:120,children:"Status"}),(0,jo.jsx)($w,{width:100,style:{textAlign:"right"},children:"Amount"}),!o&&(0,jo.jsx)($w,{width:80,style:{textAlign:"center"},children:"Recurring"}),!o&&(0,jo.jsx)($w,{width:40})]}),(0,jo.jsx)(sj,{rowHeight:W2,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,jo.jsx)(qw,{height:W2,inset:15,backgroundColor:"transparent",style:{cursor:"pointer",backgroundColor:"white",":hover":{backgroundColor:mo.hover}},onClick:()=>f(!0),children:(0,jo.jsx)($w,{width:"flex",style:{fontStyle:"italic",textAlign:"center",color:mo.n6},children:"Show completed schedules"})}):function(e){let{item:t}=e;return(0,jo.jsxs)(qw,{height:W2,inset:15,backgroundColor:"transparent",onClick:()=>l(t.id),style:{cursor:"pointer",backgroundColor:"white",":hover":{backgroundColor:mo.hover}},children:[(0,jo.jsx)($w,{width:"flex",name:"name",children:(0,jo.jsx)(gs,{style:null==t.name?{color:mo.n8}:null,title:t.name?t.name:"",children:t.name?t.name:"None"})}),(0,jo.jsx)($w,{width:"flex",name:"payee",children:(0,jo.jsx)(vR,{type:"payees",id:t._payee})}),(0,jo.jsx)($w,{width:"flex",name:"account",children:(0,jo.jsx)(vR,{type:"accounts",id:t._account})}),(0,jo.jsx)($w,{width:110,name:"date",children:t.next_date?fh(t.next_date,c):null}),(0,jo.jsx)($w,{width:120,name:"status",style:{alignItems:"flex-start"},children:(0,jo.jsx)(N_,{status:n.get(t.id)})}),(0,jo.jsx)(K2,{amount:t._amount,op:t._amountOp}),!o&&(0,jo.jsx)($w,{width:80,style:{textAlign:"center"},children:t._date&&t._date.frequency&&(0,jo.jsx)(z2,{style:{width:13,height:13}})}),!o&&(0,jo.jsx)($w,{width:40,name:"actions",children:(0,jo.jsx)(H2,{schedule:t,status:n.get(t.id),onAction:s})})]})}({item:t})},renderEmpty:r?"No matching schedules":"No schedules",allowPopupsEscape:m.length<6})]})}function V2(){let e=Bi(),[t,n]=(0,h.useState)(""),r=Ch();if(null==r)return null;let{schedules:o,statuses:i}=r;return(0,jo.jsxs)(LE,{title:"Schedules",children:[(0,jo.jsx)(ms,{style:{alignItems:"flex-end"},children:(0,jo.jsx)(Ns,{placeholder:"Filter schedules\u2026",value:t,onChange:n})}),(0,jo.jsx)(ms,{style:{marginTop:20,flexBasis:(W2-1)*(Math.max(o.length,1)+1),overflow:"hidden"},children:(0,jo.jsx)($2,{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,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"space-between",margin:"20px 0",flexShrink:0},children:[(0,jo.jsx)(As,{onClick:function(){e.push("/schedule/discover",{locationPtr:e.location})},children:"Find schedules"}),(0,jo.jsx)(As,{primary:!0,onClick:function(){e.push("/schedule/edit",{locationPtr:e.location})},children:"Add new schedule"})]})]})}let q2=43;function G2(e){let{schedules:t,loading:n}=e,r=RE(),o=Rx(),i=Ix();return(0,jo.jsxs)(ms,{style:{flex:1},children:[(0,jo.jsxs)(oj,{height:q2,inset:15,version:"v2",children:[(0,jo.jsx)(nj,{exposed:!0,focused:!1,selected:o.size>0,onSelect:()=>i({type:"select-all"})}),(0,jo.jsx)($w,{width:"flex",children:"Payee"}),(0,jo.jsx)($w,{width:"flex",children:"Account"}),(0,jo.jsx)($w,{width:"auto",style:{flex:1.5},children:"When"}),(0,jo.jsx)($w,{width:100,style:{textAlign:"right"},children:"Amount"})]}),(0,jo.jsx)(sj,{rowHeight:q2,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,jo.jsxs)(qw,{height:q2,inset:15,backgroundColor:"transparent",onClick:()=>{i({type:"select",id:t.id})},borderColor:n?mo.b8:mo.border,style:{cursor:"pointer",backgroundColor:n?mo.selected:"white",":hover":{backgroundColor:n?mo.selected:mo.hover}},children:[(0,jo.jsx)(nj,{exposed:!0,focused:!1,selected:n,onSelect:()=>{i({type:"select",id:t.id})}}),(0,jo.jsx)($w,{width:"flex",children:(0,jo.jsx)(vR,{type:"payees",id:t.payee})}),(0,jo.jsx)($w,{width:"flex",children:(0,jo.jsx)(vR,{type:"accounts",id:t.account})}),(0,jo.jsx)($w,{width:"auto",title:a,style:{flex:1.5},children:a}),(0,jo.jsx)(K2,{amount:t.amount,op:r})]})},renderEmpty:"No schedules found"})]})}function Y2(){let e=RE(),t=Bi(),[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,jo.jsxs)(LE,{title:"Found schedules",modalSize:{width:850,height:650},children:[(0,jo.jsx)(Ws,{children:"We found some possible schedules in your current transactions. Select the ones you want to create."}),(0,jo.jsx)(Ws,{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,jo.jsx)(Ws,{children:"You can always do this later from \u201cMore Tools\u201d \u2192 \u201cFind Schedules.\u201d"}),(0,jo.jsx)(Nx,{instance:a,children:(0,jo.jsx)(G2,{loading:null==n,schedules:n})}),(0,jo.jsx)(xs,{direction:"row",align:"center",justify:"flex-end",style:{paddingTop:20,paddingBottom:"modal"===e.type?0:20},children:(0,jo.jsx)(Ms,{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 yr(hr("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 Q2(e,t){let n={...e};return t&&Object.keys(t).forEach((r=>{r in e&&(n[r]=t[r])})),n}function X2(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 Z2(){let{id:e,initialFields:t}=zi(),n=null==e,r=bf({idKey:!0}),o=Bi(),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:Q2({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 yr(hr("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 gr(hr("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}=X2(l.schedule,l.fields);if(s({type:"set-transactions",transactions:[]}),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=gr(hr("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,jo.jsxs)(LE,{title:p?`Schedule: ${p.name}`:"Schedule",modalSize:"medium",children:[(0,jo.jsx)(xs,{direction:"row",style:{marginTop:10},children:(0,jo.jsxs)(eu,{style:{flex:1},children:[(0,jo.jsx)(Js,{title:"Schedule Name",htmlFor:"name-field"}),(0,jo.jsx)(a_,{field:"string",type:"string",value:l.fields.name,multi:!1,onChange:e=>{s({type:"set-field",field:"name",value:e})}})]})}),(0,jo.jsxs)(xs,{direction:"row",style:{marginTop:20},children:[(0,jo.jsxs)(eu,{style:{flex:1},children:[(0,jo.jsx)(Js,{title:"Payee",htmlFor:"payee-field"}),(0,jo.jsx)(LC,{value:l.fields.payee,inputProps:{id:"payee-field",placeholder:"(none)"},onSelect:e=>s({type:"set-field",field:"payee",value:e}),isCreatable:!0})]}),(0,jo.jsxs)(eu,{style:{flex:1},children:[(0,jo.jsx)(Js,{title:"Account",htmlFor:"account-field"}),(0,jo.jsx)(EC,{includeClosedAccounts:!1,value:l.fields.account,inputProps:{id:"account-field",placeholder:"(none)"},onSelect:e=>s({type:"set-field",field:"account",value:e})})]}),(0,jo.jsxs)(eu,{style:{flex:1},children:[(0,jo.jsxs)(xs,{direction:"row",align:"center",style:{marginBottom:3},children:[(0,jo.jsx)(Js,{title:"Amount",htmlFor:"amount-field",style:{margin:0,flex:1}}),(0,jo.jsx)(CR,{ops:["is","isapprox","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:mo.n5,fontSize:12},onChange:(e,t)=>s({type:"set-field",field:"amountOp",value:t})})]}),"isbetween"===l.fields.amountOp?(0,jo.jsx)(fD,{defaultValue:l.fields.amount,onChange:e=>s({type:"set-field",field:"amount",value:e})}):(0,jo.jsx)(dD,{id:"amount-field",defaultValue:l.fields.amount,onChange:e=>s({type:"set-field",field:"amount",value:e})})]})]}),(0,jo.jsx)(ms,{style:{marginTop:20},children:(0,jo.jsx)(Js,{title:"Date"})}),(0,jo.jsxs)(xs,{direction:"row",align:"flex-start",children:[(0,jo.jsxs)(ms,{style:{flex:1},children:[y?(0,jo.jsx)(i_,{value:l.fields.date,onChange:e=>s({type:"set-field",field:"date",value:e})}):(0,jo.jsx)(HC,{value:l.fields.date,onSelect:e=>s({type:"set-field",field:"date",value:e}),dateFormat:a}),l.upcomingDates&&(0,jo.jsxs)(ms,{style:{fontSize:13,marginTop:20},children:[(0,jo.jsx)(gs,{style:{color:mo.n4,fontWeight:600},children:"Upcoming dates"}),(0,jo.jsx)(xs,{direction:"column",spacing:1,style:{marginTop:10,color:mo.n4},children:l.upcomingDates.map((e=>(0,jo.jsx)(ms,{children:fh(e,`${a} EEEE`)},e)))})]})]}),(0,jo.jsxs)(ms,{style:{marginTop:5,flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[(0,jo.jsx)(tu,{id:"form_repeats",checked:y,onChange:e=>{s({type:"set-repeats",repeats:e.target.checked})}}),(0,jo.jsx)("label",{htmlFor:"form_repeats",style:{userSelect:"none"},children:"Repeats"})]}),(0,jo.jsxs)(ms,{style:{alignItems:"flex-end",flex:1},children:[(0,jo.jsxs)(ms,{style:{marginTop:5,flexDirection:"row",alignItems:"center",userSelect:"none",justifyContent:"flex-end"},children:[(0,jo.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,jo.jsx)("label",{htmlFor:"form_posts_transaction",style:{userSelect:"none"},children:"Automatically add transaction"})]}),(0,jo.jsx)(gs,{style:{width:350,textAlign:"right",color:mo.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,jo.jsxs)(xs,{direction:"row",align:"center",style:{marginTop:30},children:[l.isCustom&&(0,jo.jsx)(gs,{style:{color:mo.b5,fontSize:13,textAlign:"right",width:350},children:"This schedule has custom conditions and actions"}),(0,jo.jsx)(As,{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,jo.jsx)(ms,{style:{marginTop:30,flex:1},children:(0,jo.jsxs)(Nx,{instance:c,children:[n?(0,jo.jsxs)(ms,{style:{flexDirection:"row",padding:"5px 0"},children:[(0,jo.jsx)(gs,{style:{color:mo.n4},children:"These transactions match this schedule:"}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(gs,{style:{color:mo.n6},children:"Select transactions to link on save"})]}):(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(As,{bare:!0,style:{color:"linked"===l.transactionsMode?mo.b4:mo.n7,marginRight:10,fontSize:14},onClick:()=>f("linked"),children:"Linked transactions"})," ",(0,jo.jsx)(As,{bare:!0,style:{color:"matched"===l.transactionsMode?mo.b4:mo.n7,fontSize:14},onClick:()=>f("matched"),children:"Find matching transactions"}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.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,jo.jsx)(xR,{renderEmpty:"matched"===l.transactionsMode&&(()=>(0,jo.jsx)(ms,{style:{padding:20,color:mo.n4,textAlign:"center"},children:l.error?(0,jo.jsxs)(gs,{style:{color:mo.r4},children:["Could not search: ",l.error]}):"No transactions found"})),transactions:l.transactions,fields:["date","payee","amount"],style:{border:"1px solid "+mo.border,borderRadius:4,overflow:"hidden",marginTop:5}})]})}),(0,jo.jsxs)(xs,{direction:"row",justify:"flex-end",align:"center",style:{marginTop:20},children:[l.error&&(0,jo.jsx)(gs,{style:{color:mo.r4},children:l.error}),(0,jo.jsx)(As,{style:{marginRight:10},onClick:()=>o.goBack(),children:"Cancel"}),(0,jo.jsx)(As,{primary:!0,onClick:async function(){if(s({type:"form-error",error:null}),l.fields.name){let{data:e}=await yr(hr("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}=X2(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 J2(){let e=Ui(),t=Bi(),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,jo.jsxs)(LE,{title:"Link Schedule",modalSize:"medium",children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",marginBottom:20,alignItems:"center"},children:[(0,jo.jsx)(gs,{children:"Choose a schedule to link these transactions to:"}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(Ns,{isInModal:!0,width:300,placeholder:"Filter schedules\u2026",value:r,onChange:o})]}),(0,jo.jsx)($2,{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 e3(){let e=Ui(),t=Bi(),n=e.state&&e.state.payees||[],r=n.length>1;return(0,jo.jsxs)(LE,{title:"Post transactions?",modalSize:"small",children:[(0,jo.jsxs)(Ws,{children:[n.length>0?(0,jo.jsxs)(gs,{children:["The ",r?"payees ":"payee ",n.map(((e,t)=>(0,jo.jsxs)(gs,{children:[(0,jo.jsx)(gs,{style:{color:mo.p4},children:(0,jo.jsx)(vR,{id:e,type:"payees"},e)}),t===n.length-1?" ":t===n.length-2?", and ":", "]})))]}):(0,jo.jsxs)(gs,{children:["There ",r?"are payees ":"is a payee "," that "]}),(0,jo.jsxs)(gs,{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,jo.jsx)(Ws,{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,jo.jsx)(Ws,{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,jo.jsxs)(xs,{direction:"row",justify:"flex-end",style:{marginTop:20},spacing:2,children:[(0,jo.jsx)(As,{onClick:function(){t.goBack()},children:"Decide later"}),(0,jo.jsx)(As,{primary:!0,onClick:async function(){await qe("schedule/force-run-service"),t.goBack()},children:"Post transactions"})]})]})}function t3(){let[e,t]=(0,h.useState)("");return(0,h.useEffect)((()=>{(async()=>{t(await Df())})()}),[]),e}var n3=t3;function r3(e){let{primaryAction:t,style:n,children:r}=e;return(0,jo.jsxs)(ms,{...(0,so.iv)([{backgroundColor:mo.n9,alignSelf:"flex-start",alignItems:"flex-start",padding:15,borderRadius:4,border:"1px solid "+mo.n8,width:"100%"},n]),children:[(0,jo.jsx)(ms,{style:{marginBottom:t?10:0,maxWidth:500,lineHeight:1.5,gap:10},children:r}),t||null]})}function o3(e){let{children:t}=e,n=Ui(),[r,o]=(0,h.useState)("#advanced"===n.hash);return r?(0,jo.jsxs)(ms,{id:"advanced",style:[{gap:20,alignItems:"flex-start",marginBottom:25,width:"100%"},(0,so.BC)(`(min-width: ${go.breakpoint_medium})`,{width:"auto"})],innerRef:e=>{e&&"#advanced"===n.hash&&e.scrollIntoView(!0)},children:[(0,jo.jsx)(ms,{style:{fontSize:20,fontWeight:500,flexShrink:0},children:"Advanced Settings"}),t]}):(0,jo.jsx)(Os,{id:"advanced",onClick:()=>o(!0),style:{flexShrink:0,alignSelf:"flex-start",color:mo.p4,marginBottom:25},children:"Show advanced settings"})}function i3(e){let{prefs:t,pushModal:n}=e;const r=Bx(),o=!(window.crypto&&crypto.subtle);return t.encryptKeyId?(0,jo.jsx)(r3,{primaryAction:(0,jo.jsx)(As,{onClick:function(){n("create-encryption-key",{recreate:!0})},children:"Generate new key"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.jsx)(gs,{style:{color:mo.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,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/sync/#encryption",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})}):o?(0,jo.jsx)(r3,{primaryAction:(0,jo.jsx)(As,{disabled:!0,children:"Enable encryption\u2026"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.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,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Installing/HTTPS",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})}):r?(0,jo.jsx)(r3,{primaryAction:(0,jo.jsx)(As,{onClick:()=>n("create-encryption-key"),children:"Enable encryption\u2026"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.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,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/sync/#encryption",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})}):(0,jo.jsx)(r3,{primaryAction:(0,jo.jsx)(As,{disabled:!0,children:"Enable encryption\u2026"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.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,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/sync/#encryption",target:"_blank",rel:"noopener noreferrer",children:"Learn more\u2026"})]})})}function a3(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,jo.jsx)(r3,{primaryAction:r?(0,jo.jsxs)(ms,{style:{gap:"1em"},children:[(0,jo.jsxs)("label",{style:{display:"flex",color:a?mo.n5:"inherit"},children:[(0,jo.jsx)(tu,{id:"report-budget-flag",checked:i.reportBudget,onChange:()=>{n({"flags.reportBudget":!i.reportBudget})},disabled:a})," ",(0,jo.jsxs)(ms,{children:["Budget mode toggle",a&&(0,jo.jsx)(gs,{style:{color:mo.r3,fontWeight:500},children:"Switch to a rollover budget before turning off this feature"})]})]}),(0,jo.jsxs)("label",{style:{display:"flex"},children:[(0,jo.jsx)(tu,{id:"sync-account-flag",checked:i.syncAccount,onChange:()=>{n({"flags.syncAccount":!i.syncAccount})}})," ",(0,jo.jsx)(ms,{children:"Account syncing via Nordigen"})]}),(0,jo.jsxs)("label",{style:{display:"flex"},children:[(0,jo.jsx)(tu,{id:"goal-templates-flag",checked:i.goalTemplatesEnabled,onChange:()=>{n({"flags.goalTemplatesEnabled":!i.goalTemplatesEnabled})}})," ",(0,jo.jsx)(ms,{children:"Goal templates"})]})]}):(0,jo.jsx)(Os,{onClick:()=>o(!0),style:{flexShrink:0,alignSelf:"flex-start",color:mo.p4},children:"I understand the risks, show experimental features"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.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 l3(e){let{prefs:t}=e;return(0,jo.jsxs)(r3,{primaryAction:(0,jo.jsx)(As,{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,jo.jsxs)(gs,{children:[(0,jo.jsx)("strong",{children:"Export"})," your data as a zip file containing"," ",(0,jo.jsx)("code",{children:"db.sqlite"})," and ",(0,jo.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,jo.jsx)(gs,{children:"Even though encryption is enabled, the exported zip file will not have any encryption."}):null]})}function s3(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,jo.jsx)(Ws,{style:{color:mo.g3,marginBottom:0,marginLeft:"1em",textAlign:"right",whiteSpace:"pre-wrap"},children:o})}function u3(){let[e,t]=(0,h.useState)(!1),[n,r]=(0,h.useState)(null);return(0,jo.jsxs)(r3,{primaryAction:(0,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"space-between",maxWidth:500,width:"100%",alignItems:"center"},children:[(0,jo.jsx)(Ms,{loading:e,onClick:async function(){t(!0);let e=await qe("tools/fix-split-transactions");r(e),t(!1)},children:"Repair split transactions"}),n&&s3(n)]}),children:[(0,jo.jsxs)(gs,{children:[(0,jo.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,jo.jsxs)("ul",{style:{margin:0,paddingLeft:"1.5em"},children:[(0,jo.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,jo.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 c3=[{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 d3(e){let{title:t,children:n}=e;return(0,jo.jsxs)(ms,{style:{alignItems:"flex-start",gap:"0.5em",flexGrow:1,[`@media (max-width: ${go.breakpoint_xs})`]:{width:"100%"}},children:[(0,jo.jsx)(gs,{style:{fontWeight:500},children:t}),(0,jo.jsx)(ms,{style:{alignItems:"flex-start",gap:"1em"},children:n})]})}function f3(e){let{prefs:t,savePrefs:n}=e;let r=t.dateFormat||"MM/dd/yyyy",o=t.numberFormat||"comma-dot";return(0,jo.jsx)(r3,{primaryAction:(0,jo.jsxs)(ms,{style:{flexDirection:"row",gap:"1em",width:"100%",[`@media (max-width: ${go.breakpoint_xs})`]:{flexDirection:"column"}},children:[(0,jo.jsxs)(d3,{title:"Numbers",children:[(0,jo.jsx)(As,{bounce:!1,style:{padding:0},children:(0,jo.jsx)(Fs,{value:o,onChange:function(e){n({numberFormat:e})},options:Rr.map((e=>[e.value,t.hideFraction?e.labelNoFraction:e.label])),style:{padding:"5px 10px",fontSize:15}},t.hideFraction)}),(0,jo.jsxs)(gs,{style:{display:"flex"},children:[(0,jo.jsx)(tu,{id:"settings-textDecimal",checked:t.hideFraction,onChange:function(e){let t=e.target.checked;n({hideFraction:t})}}),(0,jo.jsx)("label",{htmlFor:"settings-textDecimal",children:"Hide decimal places"})]})]}),(0,jo.jsx)(d3,{title:"Dates",children:(0,jo.jsx)(As,{bounce:!1,style:{padding:0},children:(0,jo.jsx)(Fs,{value:r,onChange:function(e){n({dateFormat:e})},options:c3.map((e=>[e.value,e.label])),style:{padding:"5px 10px",fontSize:15}})})})]}),children:(0,jo.jsxs)(gs,{children:[(0,jo.jsx)("strong",{children:"Formatting"})," does not affect how budget data is stored, and can be changed at any time."]})})}function p3(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,jo.jsxs)(r3,{primaryAction:(0,jo.jsxs)(ms,{style:{flexDirection:"row"},children:[(0,jo.jsx)(As,{onClick:async function(){let e=await window.Actual.openFileDialog({properties:["openDirectory"]});e&&(n({documentDir:e[0]}),o(!0))},children:"Change location"}),r&&(0,jo.jsx)(dN,{children:"A restart is required for this change to take effect"})]}),children:[(0,jo.jsxs)(gs,{children:[(0,jo.jsx)("strong",{children:"Actual\u2019s files"})," are stored in a folder on your computer. Currently, that\u2019s:"]}),(0,jo.jsx)(gs,{innerRef:i,style:{backgroundColor:mo.n10,padding:"7px 10px",borderRadius:4,overflow:"auto",whiteSpace:"nowrap","::-webkit-scrollbar":{display:"none"}},children:t.documentDir})]})}function h3(){let[e,t]=(0,h.useState)(!1);return(0,jo.jsx)(r3,{primaryAction:(0,jo.jsx)(Ms,{loading:e,onClick:async function(){t(!0),await qe("reset-budget-cache"),t(!1)},children:"Reset budget cache"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.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 y3(e){let{resetSync:t}=e,[n,r]=(0,h.useState)(!1);return(0,jo.jsx)(r3,{primaryAction:(0,jo.jsx)(Ms,{loading:n,onClick:async function(){r(!0),await t(),r(!1)},children:"Reset sync"}),children:(0,jo.jsxs)(gs,{children:[(0,jo.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 g3(){const e=Ux(),t=n3(),n=function(){let[e,t]=(0,h.useState)(!1);const n=t3();return(0,h.useEffect)((()=>{(async()=>{t(await If(n))})()}),[n]),e}();return(0,jo.jsxs)(r3,{children:[(0,jo.jsxs)(gs,{children:[(0,jo.jsx)("strong",{children:"Actual"})," is a super fast privacy-focused app for managing your finances."]}),(0,jo.jsxs)(ms,{style:[{flexDirection:"column",gap:10},(0,so.BC)(`(min-width: ${go.breakpoint_medium})`,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"50% 50%",columnGap:"2em",gridAutoFlow:"column"})],children:[(0,jo.jsxs)(gs,{children:["Client version: v",window.Actual.ACTUAL_VERSION]}),(0,jo.jsxs)(gs,{children:["Server version: ",e]}),n?(0,jo.jsxs)("a",{style:{color:mo.p4},href:"https://actualbudget.github.io/docs/Release-Notes",children:["New version available: ",t]}):(0,jo.jsx)(gs,{style:{color:mo.g2,fontWeight:600},children:"You\u2019re up to date!"}),(0,jo.jsx)(gs,{children:(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Release-Notes",children:"Release Notes"})})]})]})}function m3(e){let{children:t}=e;return(0,jo.jsx)(gs,{style:{fontWeight:500},children:t})}function v3(e){let{prefs:t}=e;return(0,jo.jsxs)(r3,{children:[(0,jo.jsxs)(gs,{children:[(0,jo.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,jo.jsxs)(gs,{children:[(0,jo.jsx)(m3,{children:"Budget ID:"})," ",t.id]}),(0,jo.jsxs)(gs,{style:{color:mo.n5},children:[(0,jo.jsx)(m3,{children:"Sync ID:"})," ",t.groupId||"(none)"]})]})}var b3=xO(mo.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,jo.jsx)(ms,{style:{marginInline:i.floatingSidebar&&!Ef()?"auto":0},children:(0,jo.jsx)(LE,{title:"Settings",titleStyle:Ef()?{backgroundColor:mo.n11,color:mo.n1}:void 0,children:(0,jo.jsxs)(ms,{style:{flexShrink:0,gap:30},children:[Ef()&&(0,jo.jsxs)(ms,{style:{gap:10,flexDirection:"row",alignItems:"flex-end"},children:[(0,jo.jsxs)(eu,{children:[(0,jo.jsx)(Js,{title:"Budget Name"}),(0,jo.jsx)(Is,{value:o.budgetName,disabled:!0,style:{color:"#999"}})]}),(0,jo.jsx)(As,{onClick:s,children:"Close Budget"})]}),(0,jo.jsx)(g3,{}),!yo&&(0,jo.jsx)(p3,{globalPrefs:i,saveGlobalPrefs:r}),(0,jo.jsx)(f3,{prefs:o,savePrefs:n}),(0,jo.jsx)(i3,{prefs:o,pushModal:a}),(0,jo.jsx)(l3,{prefs:o}),(0,jo.jsxs)(o3,{children:[(0,jo.jsx)(v3,{prefs:o}),(0,jo.jsx)(h3,{}),(0,jo.jsx)(y3,{resetSync:l}),(0,jo.jsx)(u3,{}),(0,jo.jsx)(a3,{prefs:o,savePrefs:n})]})]})})})})));function x3(e){let{path:t,component:n}=e;return(0,jo.jsx)(Pi,{path:t,children:e=>(0,jo.jsx)(ms,{style:{flex:1,display:e.match?"flex":"none"},children:(0,jo.jsx)(n,{...e})})})}function w3(e){let{isMobile:t,location:n}=e;return(0,jo.jsx)(Ni,{location:n,children:(0,jo.jsxs)(Pi,{path:"/",children:[(0,jo.jsx)(Pi,{path:"/",exact:!0,render:()=>(0,jo.jsx)(Ci,{to:"/budget"})}),(0,jo.jsx)(x3,{path:"/reports",component:U2}),(0,jo.jsx)(x3,{path:"/budget",component:t?_D:uD}),(0,jo.jsx)(Pi,{path:"/schedules",exact:!0,component:V2}),(0,jo.jsx)(Pi,{path:"/schedule/edit",exact:!0,component:Z2}),(0,jo.jsx)(Pi,{path:"/schedule/edit/:id",component:Z2}),(0,jo.jsx)(Pi,{path:"/schedule/link",component:J2}),(0,jo.jsx)(Pi,{path:"/schedule/discover",component:Y2}),(0,jo.jsx)(Pi,{path:"/schedule/posts-offline-notification",component:e3}),(0,jo.jsx)(Pi,{path:"/payees",exact:!0,component:BN}),(0,jo.jsx)(Pi,{path:"/rules",exact:!0,component:ED}),(0,jo.jsx)(Pi,{path:"/settings",component:b3}),(0,jo.jsx)(Pi,{path:"/nordigen/link",exact:!0,component:CN}),(0,jo.jsx)(Pi,{path:"/accounts/:id",exact:!0,children:e=>{const n=t?EE:bO;return e.match&&(0,jo.jsx)(n,{...e},e.match.params.id)}}),(0,jo.jsx)(Pi,{path:"/accounts",exact:!0,component:t?WE:bO})]})})}function j3(e){let{isMobile:t}=e,n=Ui(),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,jo.jsxs)(ow,{location:o[o.length-1],children:[(0,jo.jsx)(w3,{location:i,isMobile:t}),a.map(((e,n)=>(0,jo.jsx)(IE,{type:"modal",current:n===a.length-1,children:(0,jo.jsx)(w3,{location:e,isMobile:t})},e.key)))]})}function S3(e){let{icon:t,name:n,path:r}=e;return(0,jo.jsxs)(Qi,{to:r,style:{alignItems:"center",color:"#8E8E8F",display:"flex",flexDirection:"column",textDecoration:"none"},activeStyle:{color:mo.p5},children:[(0,jo.jsx)(t,{width:22,height:22,style:{color:"inherit",marginBottom:"5px"}}),n]})}function k3(){return(0,jo.jsxs)("div",{style:{backgroundColor:"white",borderTop:`1px solid ${mo.n10}`,bottom:0,...vo.shadow,display:"flex",height:"80px",justifyContent:"space-around",paddingTop:10,width:"100%"},children:[(0,jo.jsx)(S3,{name:"Budget",path:"/budget",icon:Of,isActive:!1}),(0,jo.jsx)(S3,{name:"Accounts",path:"/accounts",icon:_f,isActive:!1}),(0,jo.jsx)(S3,{name:"Settings",path:"/settings",icon:Cf,isActive:!1})]})}class C3 extends h.Component{constructor(e){super(e),this.state={isMobile:Ef()},this.history=Jo();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")})),cs.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"===ho&&(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"!==ho&&{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,jo.jsx)(bi,{history:this.history,children:(0,jo.jsx)(df,{children:(0,jo.jsxs)(ms,{style:{height:"100%",backgroundColor:mo.n10},children:[(0,jo.jsx)(OD,{}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",flex:1},children:[!this.state.isMobile&&(0,jo.jsx)(EA,{}),(0,jo.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",width:"100%"},children:[!this.state.isMobile&&(0,jo.jsx)(RA,{style:{WebkitAppRegion:"drag",position:"absolute",top:0,left:0,right:0,zIndex:1e3}}),(0,jo.jsxs)("div",{style:{flex:1,display:"flex",overflow:"auto",position:"relative"},children:[(0,jo.jsx)(ON,{}),(0,jo.jsx)(sP,{}),(0,jo.jsx)(j3,{isMobile:this.state.isMobile}),(0,jo.jsx)(kN,{history:this.history})]}),this.state.isMobile&&(0,jo.jsxs)(Ni,{children:[(0,jo.jsx)(Pi,{path:"/budget",component:k3}),(0,jo.jsx)(Pi,{path:"/accounts",component:k3}),(0,jo.jsx)(Pi,{path:"/settings",component:k3})]})]})]})]})})})}}var _3=de(null,e)((function(e){let t=(0,h.useMemo)((()=>(0,jo.jsx)(C3,{...e})),[e]);return(0,jo.jsx)(kf,{children:(0,jo.jsx)(AA,{children:(0,jo.jsx)(_A,{children:(0,jo.jsx)(SP,{children:(0,jo.jsx)(mf,{children:(0,jo.jsx)(pf,{children:(0,jo.jsx)(Tc,{backend:ld,children:t})})})})})})})}));var O3=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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 E3=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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 T3=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 P3=e=>(0,jo.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:[(0,jo.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,jo.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 A3=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 M3=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"#242134",...e.style},children:(0,jo.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 D3(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 I3(e){let{onDelete:t,onClose:n}=e;return(0,jo.jsx)(Us,{onMenuSelect:function(e){if(n(),"delete"===e)t()},items:[{name:"delete",text:"Delete"}]})}function R3(e){let{state:t,onDelete:n}=e,[r,o]=(0,h.useState)(!1);return(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(As,{bare:!0,onClick:e=>{e.stopPropagation(),o(!0)},children:(0,jo.jsx)(qx,{style:{width:16,height:16}})}),r&&(0,jo.jsx)(Ss,{position:"bottom-right",style:{padding:0},onClose:()=>o(!1),children:(0,jo.jsx)(I3,{state:t,onDelete:n,onClose:()=>o(!1)})})]})}function N3(e){let t,n,r,{file:o}=e;switch(o.state){case"unknown":t=P3,n="Network unavailable",r=mo.n7;break;case"remote":t=E3,n="Available for download";break;case"local":case"broken":t=T3,n="Local";break;default:t=O3,n="Syncing"}return(0,jo.jsxs)(ms,{style:{color:r,alignItems:"center",flexDirection:"row",marginTop:8},children:[(0,jo.jsx)(t,{color:r,style:{width:18,height:18,color:"currentColor"}}),(0,jo.jsx)(gs,{style:{marginLeft:5},children:n})]})}function L3(e){let{file:t,onSelect:n,onDelete:r}=e,o=(0,h.useRef)(!1);return(0,jo.jsxs)(ms,{onClick:()=>async function(e){o.current||(o.current=!0,await n(e),o.current=!1)}(t),title:D3(t),style:[{flexDirection:"row",justifyContent:"space-between",alignItems:"center",...vo.shadow,margin:10,padding:"12px 15px",backgroundColor:"white",borderRadius:6,flexShrink:0,cursor:"pointer",":hover":{backgroundColor:mo.hover}}],children:[(0,jo.jsxs)(ms,{style:{alignItems:"flex-start"},children:[(0,jo.jsx)(gs,{style:[{fontSize:16,fontWeight:700}],children:t.name}),(0,jo.jsx)(N3,{file:t})]}),(0,jo.jsxs)(ms,{style:{flex:"0 0 auto",flexDirection:"row",alignItems:"center"},children:[t.encryptKeyId&&(0,jo.jsx)(A3,{style:{width:13,height:13,marginRight:8,color:t.hasKey?mo.b5:mo.n8}}),(0,jo.jsx)(R3,{state:t.state,onDelete:()=>r(t)})]})]})}function F3(e){let{files:t,onSelect:n,onDelete:r}=e;return(0,jo.jsx)(ms,{style:{flexGrow:1,[`@media (min-width: ${go.breakpoint_narrow})`]:{flexGrow:0,maxHeight:310},overflow:"auto","& *":{userSelect:"none"}},children:t.map((e=>(0,jo.jsx)(L3,{file:e,onSelect:n,onDelete:r},e.id||e.cloudFileId)))})}function B3(e){let{onRefresh:t}=e,[n,r]=(0,h.useState)(!1);let o=n?Co:M3;return(0,jo.jsx)(As,{bare:!0,style:{padding:10,marginRight:5},onClick:async function(){r(!0),await t(),r(!1)},children:(0,jo.jsx)(o,{color:mo.n1,style:{width:18,height:18,color:mo.n1}})})}var U3=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,jo.jsxs)(ms,{style:{flex:1,justifyContent:"center",minWidth:go.breakpoint_narrow,[`@media (max-width: ${go.breakpoint_narrow})`]:{width:"100vw",minWidth:"100vw",marginInline:-20,marginTop:20}},children:[(0,jo.jsxs)(ms,{children:[(0,jo.jsx)(gs,{style:[vo.veryLargeText,{margin:20}],children:"Files"}),(0,jo.jsx)(ms,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",marginRight:5},children:(0,jo.jsx)(B3,{onRefresh:()=>{r(),o()}})})]}),(0,jo.jsx)(F3,{files:n,actions:e,onSelect:e=>{"remote"===e.state?s(e.cloudFileId):a(e.id)},onDelete:e=>i("delete-budget",{file:e})}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"flex-end",padding:25,paddingLeft:5},children:[(0,jo.jsx)(As,{bare:!0,style:{marginLeft:10,color:mo.n4},onClick:e=>{e.preventDefault(),i("import")},children:"Import file"}),(0,jo.jsx)(As,{primary:!0,onClick:d,style:{marginLeft:15},children:"Create new file"}),sN()&&(0,jo.jsx)(As,{primary:!0,onClick:()=>d({testMode:!0}),style:{marginLeft:15},children:"Create test file"})]})]})}));function z3(){let[e,t]=(0,h.useState)(!1),n=Bi(),r=Ui(),o=zx();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 W3(e){let{text:t}=e;return(0,jo.jsx)("h1",{style:{fontSize:40,fontWeight:700,color:mo.p3,marginBottom:20},children:t})}const H3=h.forwardRef(((e,t)=>(0,jo.jsx)(Is,{...e,style:[{padding:10,fontSize:15,border:"none",...vo.shadow,":focus":{border:"none",...vo.shadow}},e.style]})));function K3(){!function(e){(0,h.useEffect)((()=>{wO(e)}),[e,wO])}(mo.p5);let e=ge(),t=Bi(),[n,r]=(0,h.useState)(""),o=Bx(),i=zx();(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(cr()),t.push("/")}return(0,jo.jsxs)(ms,{style:{maxWidth:500,marginTop:-30},children:[(0,jo.jsx)(W3,{text:"Where\u2019s the server?"}),(0,jo.jsx)(gs,{style:{fontSize:16,color:mo.n2,lineHeight:1.5},children:o?(0,jo.jsx)(jo.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,jo.jsx)(jo.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,jo.jsx)(gs,{style:{marginTop:20,color:mo.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,jo.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(dr()),t.push("/"));else{let{error:o}=await i("https://"+n);o?(r("https://"+n),u(o)):(await e(dr()),t.push("/")),l(!1)}}()},children:[(0,jo.jsx)(H3,{autoFocus:!0,placeholder:"https://example.com",value:n,onChange:e=>r(e.target.value),style:{flex:1,marginRight:10}}),(0,jo.jsx)(Ms,{primary:!0,loading:a,style:{fontSize:15},children:"OK"}),o&&(0,jo.jsx)(As,{bare:!0,type:"button",style:{fontSize:15,marginLeft:10},onClick:()=>t.goBack(),children:"Cancel"})]}),(0,jo.jsx)(ms,{style:{flexDirection:"row",flexFlow:"row wrap",justifyContent:"center",marginTop:15},children:o?(0,jo.jsx)(As,{bare:!0,style:{color:mo.n4},onClick:c,children:"Stop using a server"}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(As,{bare:!0,style:{color:mo.n4,margin:5,marginRight:15},onClick:function(){r(window.location.origin)},children:["Use ",window.location.origin.replace(/https?:\/\//,"")]}),(0,jo.jsx)(As,{bare:!0,style:{color:mo.n4,margin:5},onClick:c,children:"Don\u2019t use a server"}),sN()&&(0,jo.jsx)(As,{primary:!0,style:{marginLeft:15},onClick:async function(){await i(null),await e(Zn({testMode:!0})),window.__history.push("/")},children:"Create test file"})]})})]})}function $3(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,jo.jsx)(Ks,{...t,title:"Delete "+r.name,padding:0,showOverlay:!1,onClose:t.onBack,children:()=>(0,jo.jsxs)(ms,{style:{padding:15,paddingTop:0,paddingBottom:25,width:500,lineHeight:"1.5em"},children:[s&&(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(gs,{children:["This is a ",(0,jo.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,jo.jsx)(Ms,{primary:!0,loading:"cloud"===o,style:{backgroundColor:mo.r4,alignSelf:"center",border:0,marginTop:10,padding:"10px 30px",fontSize:14},onClick:a,children:"Delete file from all devices"})]}),r.id&&(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(gs,{style:[s&&{marginTop:20}],children:s?(0,jo.jsx)(gs,{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,jo.jsxs)(gs,{children:["broken"===r.state?(0,jo.jsxs)(gs,{children:["This is a ",(0,jo.jsx)("strong",{children:"hosted file"})," but it was created by another user. You can only delete the local copy."]}):(0,jo.jsxs)(gs,{children:["This a ",(0,jo.jsx)("strong",{children:"local file"})," which is not stored on a server."]})," ","Deleting it will remove it and all of its backups permanently."]})}),(0,jo.jsx)(Ms,{primary:!s,loading:"local"===o,style:[{alignSelf:"center",marginTop:10,padding:"10px 30px",fontSize:14},s?{color:mo.r4,borderColor:mo.r4}:{border:0,backgroundColor:mo.r4}],onClick:l,children:"Delete file locally"})]})]})})}function V3(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 q3=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 "+mo.border,borderRadius:6,marginBottom:10,display:"block"};return(0,jo.jsx)(Ks,{...t,title:"Import From",style:{width:400},children:()=>(0,jo.jsxs)(ms,{style:[vo.smallText,{lineHeight:1.5}],children:[r&&(0,jo.jsx)(Cs,{style:{color:mo.r4,marginBottom:15},children:V3(r)}),(0,jo.jsx)(gs,{style:{marginBottom:15},children:"Select an app to import from, and we\u2019ll guide you through the process."}),(0,jo.jsxs)(As,{style:i,onClick:()=>o("ynab4"),children:[(0,jo.jsx)("span",{style:{fontWeight:700},children:"YNAB4"}),(0,jo.jsx)(ms,{style:{color:mo.n5},children:"The old unsupported desktop app"})]}),(0,jo.jsxs)(As,{style:i,onClick:()=>o("ynab5"),children:[(0,jo.jsx)("span",{style:{fontWeight:700},children:"nYNAB"}),(0,jo.jsx)(ms,{style:{color:mo.n5},children:(0,jo.jsx)("div",{children:"The newer web app"})})]}),(0,jo.jsxs)(As,{style:i,onClick:()=>o("actual"),children:[(0,jo.jsx)("span",{style:{fontWeight:700},children:"Actual"}),(0,jo.jsx)(ms,{style:{color:mo.n5},children:(0,jo.jsx)("div",{children:"Import a file exported from Actual"})})]})]})})};function G3(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 Y3=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(Jn(e[0],"actual"))}catch(t){i(t.message)}finally{l(!1)}}}return(0,jo.jsx)(Ks,{...t,title:"Import from Actual export",style:{width:400},children:()=>(0,jo.jsxs)(ms,{style:[vo.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,jo.jsx)(Cs,{style:{color:mo.r4,marginBottom:15},children:G3(o)}),(0,jo.jsxs)(ms,{style:{"& > div":{lineHeight:"1.7em"}},children:[(0,jo.jsxs)(Ws,{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,jo.jsx)("code",{children:"db.sqlite"})," and ",(0,jo.jsx)("code",{children:"metadata.json"})," files."]}),(0,jo.jsx)(Ws,{children:"Select one of these compressed files and import it here."}),(0,jo.jsx)(ms,{style:{alignSelf:"center"},children:(0,jo.jsx)(Ms,{loading:a,primary:!0,onClick:s,children:"Select file..."})})]})]})})};function Q3(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 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:"ynab",extensions:["zip"]}]});if(e){l(!0),i(!1);try{await r(Jn(e[0],"ynab4"))}catch(t){i(t.message)}finally{l(!1)}}}return(0,jo.jsx)(Ks,{...t,title:"Import from YNAB4",style:{width:400},children:()=>(0,jo.jsxs)(ms,{style:[vo.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,jo.jsx)(Cs,{style:{color:mo.r4,marginBottom:15},children:Q3(o)}),(0,jo.jsxs)(ms,{style:{alignItems:"center"},children:[(0,jo.jsxs)(Ws,{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,jo.jsx)("code",{children:".ynab4"})," suffix."]}),(0,jo.jsxs)(Ws,{children:["When you\u2019ve located your data,"," ",(0,jo.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,jo.jsx)(ms,{children:(0,jo.jsx)(Ms,{loading:a,primary:!0,onClick:s,children:"Select zip file..."})})]})]})})};function Z3(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 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:["json"]}]});if(e){l(!0),i(!1);try{await r(Jn(e[0],"ynab5"))}catch(t){i(t.message)}finally{l(!1)}}}return(0,jo.jsx)(Ks,{...t,title:"Import from nYNAB",style:{width:400},children:()=>(0,jo.jsxs)(ms,{style:[vo.smallText,{lineHeight:1.5,marginTop:20}],children:[o&&(0,jo.jsx)(Cs,{style:{color:mo.r4,marginBottom:15},children:Z3(o)}),(0,jo.jsxs)(ms,{style:{alignItems:"center","& > div":{lineHeight:"1.7em"}},children:[(0,jo.jsxs)(Ws,{children:[(0,jo.jsx)(Ts,{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,jo.jsx)(Ws,{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,jo.jsx)(ms,{children:(0,jo.jsx)(Ms,{loading:a,primary:!0,onClick:s,children:"Select file..."})})]})]})})};var e6=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,jo.jsx)($3,{modalProps:s,actions:l,file:a.file},i);case"import":return(0,jo.jsx)(q3,{modalProps:s,actions:l,availableImports:o},i);case"import-ynab4":return(0,jo.jsx)(X3,{modalProps:s,actions:l},i);case"import-ynab5":return(0,jo.jsx)(J3,{modalProps:s,actions:l},i);case"import-actual":return(0,jo.jsx)(Y3,{modalProps:s,actions:l},i);case"load-backup":return(0,jo.jsx)(KM,{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,jo.jsx)(lN,{budgetId:a.budgetId,modalProps:{...s,onClose:l.popModal},backupDisabled:!0,actions:l,backups:t.backups})}},i);case"create-encryption-key":return(0,jo.jsx)(hR,{modalProps:s,actions:l,options:a},i);case"fix-encryption-key":return(0,jo.jsx)(BR,{modalProps:s,actions:l,options:a},i);default:throw new Error("Unknown modal: "+i)}}));return(0,jo.jsx)(ms,{style:{flex:1,padding:50},children:s})}));function t6(){const e=Bx();return(0,jo.jsxs)(ms,{style:{position:"absolute",bottom:0,left:0,right:0,justifyContent:"center",flexDirection:"row",marginBottom:15,zIndex:5e3},children:[(0,jo.jsx)(gs,{children:e?(0,jo.jsxs)(jo.Fragment,{children:["Using server: ",(0,jo.jsx)("strong",{children:e})]}):(0,jo.jsx)("strong",{children:"No server configured"})}),(0,jo.jsx)(Es,{bare:!0,to:"/config-server",style:{marginLeft:15},children:"Change"})]})}function n6(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,jo.jsxs)("form",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",marginTop:30},onSubmit:f,children:[(0,jo.jsx)(H3,{autoFocus:!0,placeholder:"Password",type:s?"text":"password",value:o,onChange:e=>i(e.target.value),onEnter:f}),(0,jo.jsx)(H3,{placeholder:"Confirm password",type:s?"text":"password",value:a,onChange:e=>l(e.target.value),style:{marginTop:10},onEnter:f}),(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center",fontSize:15,marginTop:20},children:[(0,jo.jsxs)("label",{style:{userSelect:"none"},children:[(0,jo.jsx)("input",{type:"checkbox",onChange:function(e){u(e.target.checked)}})," Show password"]}),(0,jo.jsx)(ms,{style:{flex:1}}),t,(0,jo.jsx)(Ms,{primary:!0,loading:c,children:"OK"})]})]})}function r6(){let e=ge(),[t,n]=(0,h.useState)(null),{checked:r}=z3();return r?(0,jo.jsxs)(ms,{style:{maxWidth:450,marginTop:-30},children:[(0,jo.jsx)(W3,{text:"Welcome to Actual!"}),(0,jo.jsx)(Ws,{style:{fontSize:16,color:mo.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,jo.jsxs)(Ws,{isLast:!0,style:{fontSize:16,color:mo.n2},children:["Consider opening"," ",(0,jo.jsx)("a",{href:"https://actualbudget.github.io/docs/Getting-Started/using-actual/",target:"_blank",rel:"noopener noreferrer",style:{color:mo.b4},children:"our tour"})," ","in a new tab for some guidance on what to do when you\u2019ve set your password."]}),t&&(0,jo.jsx)(gs,{style:{marginTop:20,color:mo.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,jo.jsx)(n6,{buttons:(0,jo.jsx)(As,{bare:!0,style:{fontSize:15,color:mo.b4,marginRight:15},onClick:async function(){await e(Zn({demoMode:!0}))},children:"Try Demo"}),onSetPassword:async function(t){n(null);let{error:r}=await qe("subscribe-bootstrap",{password:t});r?n(r):e(cr())},onError:n})]}):null}function o6(){let e=Bi(),[t,n]=(0,h.useState)(null),[r,o]=(0,h.useState)(null);return(0,jo.jsxs)(ms,{style:{maxWidth:500,marginTop:-30},children:[(0,jo.jsx)(W3,{text:"Change server password"}),(0,jo.jsx)(gs,{style:{fontSize:16,color:mo.n2,lineHeight:1.4},children:"This will change the password for this server instance. All existing sessions will stay logged in."}),t&&(0,jo.jsx)(gs,{style:{marginTop:20,color:mo.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,jo.jsx)(gs,{style:{marginTop:20,color:mo.g4,borderRadius:4,fontSize:15},children:r}),(0,jo.jsx)(n6,{buttons:(0,jo.jsx)(As,{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 i6(){let e=Bi(),t=Ui(),{error:n}=t.state||{};return(0,jo.jsxs)(ms,{style:{alignItems:"center"},children:[(0,jo.jsx)(gs,{style:{fontSize:16,color:mo.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,jo.jsx)(As,{onClick:function(){e.push("/")},style:{marginTop:20},children:"Try again"})]});var r}function a6(){let e=ge(),[t,n]=(0,h.useState)(""),[r,o]=(0,h.useState)(!1),[i,a]=(0,h.useState)(null),{checked:l}=z3();return l?(0,jo.jsxs)(ms,{style:{maxWidth:450,marginTop:-30},children:[(0,jo.jsx)(W3,{text:"Sign in to this Actual instance"}),(0,jo.jsx)(gs,{style:{fontSize:16,color:mo.n2,lineHeight:1.4},children:"If you lost your password, you likely still have access to your server to manually reset it."}),i&&(0,jo.jsx)(gs,{style:{marginTop:20,color:mo.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,jo.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(cr())},children:[(0,jo.jsx)(H3,{autoFocus:!0,placeholder:"Password",type:"password",onChange:e=>n(e.target.value),style:{flex:1,marginRight:10}}),(0,jo.jsx)(Ms,{primary:!0,loading:r,style:{fontSize:15},children:"Sign in"})]}),(0,jo.jsx)(ms,{style:{flexDirection:"row",justifyContent:"center",marginTop:15},children:(0,jo.jsx)(As,{bare:!0,style:{fontSize:15,color:mo.b4,marginLeft:10},onClick:async function(){await e(Zn({demoMode:!0}))},children:"Try Demo \u2192"})})]}):null}var l6=de(null,e)((function(e){let{createBudget:t,pushModal:n}=e;return(0,jo.jsxs)(ms,{style:{gap:10,maxWidth:500,fontSize:15,maxHeight:"100vh",marginBlock:20},children:[(0,jo.jsx)(gs,{style:vo.veryLargeText,children:"Let\u2019s get started!"}),(0,jo.jsxs)(ms,{style:{overflowY:"auto"},children:[(0,jo.jsxs)(Ws,{children:["Actual is a personal finance tool that focuses on beautiful design and a slick user experience."," ",(0,jo.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,jo.jsxs)(Ws,{style:{"& a, & a:visited":{color:mo.p5}},children:["Currently, Actual implements budgeting based on a"," ",(0,jo.jsx)(Ts,{asAnchor:!0,style:{color:mo.p5},href:"https://actualbudget.github.io/docs/Budgeting/howitworks",children:"monthly envelope system"}),". Consider taking our"," ",(0,jo.jsx)(Ts,{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,jo.jsx)(Ws,{style:{color:mo.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,jo.jsxs)(ms,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",flexShrink:0},children:[(0,jo.jsx)(As,{onClick:()=>n("import"),children:"Import my budget"}),(0,jo.jsx)(As,{primary:!0,onClick:t,children:"Start fresh"})]})]})}));function s6(){const e=Ux();return(0,jo.jsx)(gs,{style:{color:mo.n7,":hover":{color:mo.n2},margin:15,marginLeft:17,[`@media (min-width: ${go.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 u6=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)(Jo);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,jo.jsxs)(bi,{history:s,children:[(0,jo.jsxs)(ms,{style:{height:"100%"},children:[(0,jo.jsx)(ms,{style:{position:"absolute",top:0,left:0,right:0,height:40,WebkitAppRegion:"drag"}}),(0,jo.jsx)(ms,{style:{position:"absolute",bottom:40,right:15},children:(0,jo.jsx)(ON,{style:{position:"relative",left:"initial",right:"initial"}})}),o&&(0,jo.jsx)(ms,{style:{alignItems:"center",bottom:0,justifyContent:"center",left:0,padding:20,position:"absolute",right:0,top:0},children:r&&n?(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsxs)(Ni,{children:[(0,jo.jsx)(Pi,{exact:!0,path:"/config-server",component:K3}),(0,jo.jsx)(Pi,{exact:!0,path:"/change-password",component:o6}),n&&n.length>0?(0,jo.jsx)(Pi,{exact:!0,path:"/",component:U3}):(0,jo.jsx)(Pi,{exact:!0,path:"/",component:l6}),(0,jo.jsx)(Pi,{path:"/",render:()=>(0,jo.jsx)(Ci,{to:"/"})})]}),(0,jo.jsx)(ms,{style:{position:"absolute",top:0,right:0,padding:"6px 10px",zIndex:4e3},children:(0,jo.jsxs)(Ni,{children:[(0,jo.jsx)(Pi,{exact:!0,path:"/config-server",component:null}),(0,jo.jsx)(Pi,{exact:!0,path:"/",render:()=>(0,jo.jsx)(TA,{style:{padding:"4px 7px"}})})]})})]}):(0,jo.jsxs)(Ni,{children:[(0,jo.jsx)(Pi,{exact:!0,path:"/login",component:a6}),(0,jo.jsx)(Pi,{exact:!0,path:"/error",component:i6}),(0,jo.jsx)(Pi,{exact:!0,path:"/config-server",component:K3}),(0,jo.jsx)(Pi,{exact:!0,path:"/bootstrap",component:r6}),(0,jo.jsx)(Pi,{path:"/",render:()=>(0,jo.jsx)(Ci,{to:"/bootstrap"})})]})}),(0,jo.jsxs)(Ni,{children:[(0,jo.jsx)(Pi,{exact:!0,path:"/config-server",component:null}),(0,jo.jsx)(Pi,{path:"/",component:t6})]}),(0,jo.jsx)(s6,{})]}),(0,jo.jsx)(e6,{history:s})]}):null}));let c6={border:0,fontSize:15,padding:"10px 13px"};function d6(){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,jo.jsxs)(ms,{style:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:mo.n1,color:"white",padding:10,margin:10,borderRadius:6,zIndex:1e4,fontSize:15,...vo.shadowLarge},children:[(0,jo.jsxs)(gs,{style:{lineHeight:"1.5em"},children:[(0,jo.jsx)("strong",{children:"Actual features are limited on small screens."}),(0,jo.jsx)("br",{}),(0,jo.jsx)("span",{children:"While we work to improve this experience, you may find the full Actual feature set on devices with larger screens."})]}),(0,jo.jsxs)(ms,{style:{gap:16,marginTop:20,justifyContent:"center"},children:[(0,jo.jsx)(As,{style:c6,onClick:function(){if(n(!1),r)i(Rn({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,jo.jsxs)(ms,{style:{alignItems:"center",flexDirection:"row",justifyContent:"flex-end"},children:[(0,jo.jsx)(tu,{id:"dont_remind_me",checked:r,onChange:()=>{o(!r)}}),(0,jo.jsx)("label",{htmlFor:"dont_remind_me",style:{userSelect:"none"},children:"Don\u2019t remind me again"})]})]})]}):null}var f6=e=>(0,jo.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"#242134",...e.style},children:(0,jo.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 p6=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,jo.jsxs)(ms,{style:{position:"absolute",bottom:0,right:0,margin:"15px 17px",backgroundColor:mo.p6,color:"white",padding:"7px 10px",borderRadius:4,zIndex:1e4,maxWidth:450},children:[(0,jo.jsxs)(ms,{style:{flexDirection:"row",alignItems:"center"},children:[(0,jo.jsx)(ms,{style:{marginRight:10,fontWeight:700},children:(0,jo.jsxs)(gs,{children:["App updated to ",t.version]})}),(0,jo.jsx)(ms,{style:{flex:1}}),(0,jo.jsx)(ms,{style:{marginTop:-1},children:(0,jo.jsxs)(gs,{children:[(0,jo.jsx)(Os,{onClick:r,style:{color:"white",textDecoration:"underline"},children:"Restart"})," ","(",(0,jo.jsx)(Os,{style:{color:"white",textDecoration:"underline"},onClick:()=>window.Actual.openURLInBrowser("https://actualbudget.github.io/docs/Release-Notes/"),children:"notes"}),")",(0,jo.jsx)(As,{bare:!0,style:{display:"inline",padding:"1px 7px 2px 7px"},onClick:()=>function(e){e({updateInfo:null,showUpdateNotification:!1})}(o),children:(0,jo.jsx)(f6,{width:9,style:{color:"white"}})})]})})]}),e&&(0,jo.jsx)(ms,{style:{marginTop:10,fontWeight:500},children:e})]})}return null}));class h6 extends h.Component{constructor(){super(...arguments),this.state={fatalError:null,initializing:!0,hiddenScrollbars:wo()}}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(Wa){if("app-init-failure"===Wa.type)return void this.setState({initializing:!1,fatalError:Wa});throw Wa}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([uo(),this.init()]),this.setState({initializing:!1});let e=()=>{this.state.hiddenScrollbars!==wo()&&this.setState({hiddenScrollbars:wo()})};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,jo.jsxs)("div",{...(0,so.iv)([{height:"100%",backgroundColor:"#E8ECF0",overflow:"hidden"},vo.lightScrollbar]),children:[n?(0,jo.jsxs)(h.Fragment,{children:[(0,jo.jsx)(Xs,{}),(0,jo.jsx)(ru,{error:n,buttonText:"Restart app"})]}):r?(0,jo.jsx)(Xs,{initializing:r,loadingText:t}):e?(0,jo.jsx)(_3,{}):(0,jo.jsxs)(jo.Fragment,{children:[(0,jo.jsx)(Xs,{initializing:r,loadingText:t}),(0,jo.jsx)(u6,{isLoading:null!=t})]}),(0,jo.jsx)(p6,{}),(0,jo.jsx)(d6,{})]},o?"hidden-scrollbars":"scrollbars")}}var y6=de((e=>({budgetId:e.prefs.local&&e.prefs.local.id,cloudFileId:e.prefs.local&&e.prefs.local.cloudFileId,loadingText:e.app.loadingText})),e)(h6);n(1803);const g6=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(Wa){i=Wa}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}}(lo);const m6=G((function(e,t){return t.type===gt&&(e={budgets:e.budgets,user:e.user,prefs:{local:null,global:e.prefs.global},app:{...wr,updateInfo:e.updateInfo,showUpdateNotification:e.showUpdateNotification,managerHasInitialized:e.app.managerHasInitialized,loadingText:e.app.loadingText}}),g6(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)),v6=Q(e,m6.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})}))}(v6,m6),window.__actionsForMenu=v6,window.$send=qe,window.$query=yr,window.$q=hr;const b6=document.getElementById("root");(0,je.s)(b6).render((0,jo.jsx)(w,{store:m6,children:(0,jo.jsx)(Kx,{children:(0,jo.jsx)(y6,{})})}))}()}();
|
|
3
|
-
//# sourceMappingURL=main.9c657c78.js.map
|